浏览代码

Merge remote-tracking branch 'origin/shaoyf/dev' into shaoyf/master

hujing 5 年之前
父节点
当前提交
3bde3610ed
共有 20 个文件被更改,包括 1079 次插入2 次删除
  1. 125 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH03047.java
  2. 50 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH03048.java
  3. 45 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH03049.java
  4. 95 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH03050.java
  5. 111 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH03051.java
  6. 47 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH03053.java
  7. 47 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH03055.java
  8. 47 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH03056.java
  9. 55 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH03057.java
  10. 47 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH03058.java
  11. 51 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP03045.java
  12. 85 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP03046.java
  13. 186 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/threelevelward/THR03044.java
  14. 27 1
      kernel/src/main/java/com/lantone/qc/kernel/structure/ai/process/EntityProcessPacs.java
  15. 2 0
      public/src/main/java/com/lantone/qc/pub/model/InputInfo.java
  16. 15 0
      public/src/main/java/com/lantone/qc/pub/model/doc/LisDoc.java
  17. 2 0
      public/src/main/java/com/lantone/qc/pub/model/entity/Pacs.java
  18. 0 1
      trans/src/main/java/com/lantone/qc/trans/shaoyf/ShaoyfBeHospitalizedDocTrans.java
  19. 5 0
      trans/src/main/java/com/lantone/qc/trans/shaoyf/ShaoyfDocTrans.java
  20. 37 0
      trans/src/main/java/com/lantone/qc/trans/shaoyf/ShaoyfLisDocTrans.java

+ 125 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH03047.java

@@ -0,0 +1,125 @@
+package com.lantone.qc.kernel.catalogue.behospitalized;
+
+import com.lantone.qc.kernel.catalogue.QCCatalogue;
+import com.lantone.qc.pub.model.InputInfo;
+import com.lantone.qc.pub.model.OutputInfo;
+import com.lantone.qc.pub.model.entity.Diag;
+import com.lantone.qc.pub.model.label.DiagLabel;
+import com.lantone.qc.pub.util.StringUtil;
+import org.springframework.stereotype.Component;
+
+import java.util.ArrayList;
+import java.util.Comparator;
+import java.util.List;
+import java.util.Map;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+import java.util.stream.Collectors;
+
+/**
+ * @ClassName : BEH03047
+ * @Description : 初步诊断诊断依据不充分(暂只做高血压)
+ * @Author : 胡敬
+ * @Date: 2020-07-27 14:54
+ */
+@Component
+public class BEH03047 extends QCCatalogue {
+
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        status.set("0");
+        if (inputInfo.getBeHospitalizedDoc() == null) {
+            return;
+        }
+        DiagLabel initialDiagLabel = inputInfo.getBeHospitalizedDoc().getInitialDiagLabel();
+        if (initialDiagLabel == null || StringUtil.isBlank(initialDiagLabel.getText())) {
+            return;
+        }
+
+        List<Diag> initDiags = initialDiagLabel.getDiags();
+        List<String> initDiagFilter = initDiags
+                .stream()
+                .map(Diag::getHospitalDiagName)
+                .filter(x -> StringUtil.isNotBlank(x) && x.contains("高血压"))
+                .collect(Collectors.toList());
+
+        if (initDiagFilter.size() > 0) {
+            String regex = "\\d+/\\d+mmHg";
+            List<Integer> highBlood = new ArrayList<>();
+            List<Integer> lowBlood = new ArrayList<>();
+
+            Map<String, String> beStructMap = inputInfo.getBeHospitalizedDoc().getStructureMap();
+            //现病史取血压值
+            String presentText = beStructMap.get("现病史");
+            String bloodPressure = regularValue(presentText, regex);
+            saveBloodValue(highBlood, lowBlood, bloodPressure);
+
+            //生命体征取血压
+            String bloodValue = beStructMap.get("血压");
+            saveBloodValue(highBlood, lowBlood, bloodValue);
+
+            //专科检查
+            String special = beStructMap.get("专科检查");
+            bloodPressure = regularValue(special, regex);
+            saveBloodValue(highBlood, lowBlood, bloodPressure);
+
+            highBlood.sort(Comparator.reverseOrder());
+            lowBlood.sort(Comparator.reverseOrder());
+
+            Integer high = highBlood.get(0);//收缩压
+            Integer low = lowBlood.get(0);//舒张压
+
+            String diag = initDiagFilter.get(0);//高血压病2级
+            if (diag.contains("1")) {
+                if ((high > 160 || high < 140) && (low > 100 || low < 90)) {
+                    status.set("-1");
+                    info.set(diag + ":" + "血压未达到1级标准");
+                }
+            } else if (diag.contains("2")) {
+                if ((high > 180 || high < 160) && (low > 110 || low < 100)) {
+                    status.set("-1");
+                    info.set(diag + ":" + "血压未达到2级标准");
+                }
+            } else if (diag.contains("3")) {
+                if (high < 180 && low < 110) {
+                    status.set("-1");
+                    info.set(diag + ":" + "血压未达到3级标准");
+                }
+            }
+
+        }
+
+    }
+
+    /**
+     * 从血压值中取收缩压和舒张压(170/97mmHg)
+     *
+     * @param highBlood
+     * @param lowBlood
+     * @param bloodPressure
+     */
+    private void saveBloodValue(List<Integer> highBlood, List<Integer> lowBlood, String bloodPressure) {
+        if (StringUtil.isNotBlank(bloodPressure)) {
+            if (bloodPressure.contains("mmHg")) {
+                bloodPressure = bloodPressure.substring(0, bloodPressure.lastIndexOf("mmHg"));
+            }
+            String[] bloodValue = bloodPressure.split("/");
+            if (bloodValue.length == 2) {
+                highBlood.add(Integer.parseInt(bloodValue[0]));
+                lowBlood.add(Integer.parseInt(bloodValue[1]));
+            }
+        }
+    }
+
+    private String regularValue(String input, String regex) {
+        String value = "";
+        if (StringUtil.isNotBlank(input)) {
+            Pattern p = Pattern.compile(regex);
+            Matcher m = p.matcher(input);
+            if (m.find()) {
+                value = m.group(0);
+            }
+        }
+        return value;
+    }
+
+}

+ 50 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH03048.java

@@ -0,0 +1,50 @@
+package com.lantone.qc.kernel.catalogue.behospitalized;
+
+import com.google.common.collect.Lists;
+import com.lantone.qc.kernel.catalogue.QCCatalogue;
+import com.lantone.qc.pub.model.InputInfo;
+import com.lantone.qc.pub.model.OutputInfo;
+import com.lantone.qc.pub.model.doc.BeHospitalizedDoc;
+import com.lantone.qc.pub.util.StringUtil;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @ClassName : BEH03048
+ * @Description : 入院记录体格检查与专科检查不一致
+ * @Author : 胡敬
+ * @Date: 2020-07-28 09:52
+ */
+@Component
+public class BEH03048 extends QCCatalogue {
+    private List<String> vitals = Lists.newArrayList("Murphy征", "麦氏点压痛");
+
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        status.set("0");
+        if (inputInfo.getBeHospitalizedDoc() == null) {
+            return;
+        }
+
+        BeHospitalizedDoc beHospitalizedDoc = inputInfo.getBeHospitalizedDoc();
+        Map<String, String> beHospitalStructureMap = beHospitalizedDoc.getStructureMap();
+        String vitalLabelSpecial = beHospitalStructureMap.get("专科体格检查");
+        if (StringUtil.isBlank(vitalLabelSpecial)) {
+            return;
+        }
+        vitalLabelSpecial = vitalLabelSpecial.replace("墨菲氏征", "Murphy征");
+
+        for (String vital : vitals) {
+            String v = beHospitalStructureMap.get(vital);
+            if (StringUtil.isNotBlank(v)) {
+                v = vital + v;
+                if (vitalLabelSpecial.contains(vital) && !vitalLabelSpecial.contains(v)) {
+                    status.set("-1");
+                    return;
+                }
+            }
+
+        }
+    }
+}

+ 45 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH03049.java

@@ -0,0 +1,45 @@
+package com.lantone.qc.kernel.catalogue.behospitalized;
+
+import com.lantone.qc.kernel.catalogue.QCCatalogue;
+import com.lantone.qc.pub.model.InputInfo;
+import com.lantone.qc.pub.model.OutputInfo;
+import com.lantone.qc.pub.util.StringUtil;
+import org.springframework.stereotype.Component;
+
+import java.util.Map;
+
+/**
+ * @ClassName : BEH03049
+ * @Description : 入院记录中脉搏与心率不一致
+ * @Author : 楼辉荣
+ * @Date: 2020-03-06 17:28
+ */
+@Component
+public class BEH03049 extends QCCatalogue {
+
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        status.set("0");
+        if (inputInfo.getBeHospitalizedDoc() == null || inputInfo.getBeHospitalizedDoc().getStructureMap() == null) {
+            return;
+        }
+        Map<String, String> structureMap = inputInfo.getBeHospitalizedDoc().getStructureMap();
+        String initialDiag = structureMap.get("初步诊断");
+        if (StringUtil.isBlank(initialDiag)) {
+            return;
+        }
+        String souval = structureMap.get("脉搏");
+        String tarval = structureMap.get("心率");
+        if (StringUtil.isNotBlank(souval)
+                && StringUtil.isNotBlank(tarval)
+                && initialDiag.indexOf("房颤") == -1
+                && initialDiag.indexOf("纤颤") == -1
+                && initialDiag.indexOf("房扑") == -1) {
+            souval = souval.replaceAll("[^0-9]*", "");
+            tarval = tarval.replaceAll("[^0-9]*", "");
+            if (StringUtil.isNotBlank(souval) && StringUtil.isNotBlank(tarval) && !souval.equals(tarval)) {
+                status.set("-1");
+            }
+        }
+    }
+
+}

+ 95 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH03050.java

@@ -0,0 +1,95 @@
+package com.lantone.qc.kernel.catalogue.behospitalized;
+
+import com.google.common.collect.Lists;
+import com.lantone.qc.kernel.catalogue.QCCatalogue;
+import com.lantone.qc.pub.model.InputInfo;
+import com.lantone.qc.pub.model.OutputInfo;
+import com.lantone.qc.pub.model.doc.BeHospitalizedDoc;
+import com.lantone.qc.pub.model.label.ChiefLabel;
+import com.lantone.qc.pub.model.label.PresentLabel;
+import com.lantone.qc.pub.util.StringUtil;
+import org.springframework.stereotype.Component;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * @ClassName : BEH03050
+ * @Description : 主诉与现病史发病部位不一致
+ * @Author : 胡敬
+ * @Date: 2020-07-28 09:52
+ */
+@Component
+public class BEH03050 extends QCCatalogue {
+    private List<String> positions = Lists.newArrayList("左上", "左下", "右上", "右下", "上", "下", "左", "右");
+    private List<String> containList = Arrays.asList("检查", "术后", "药物", "发现", "误服", "确诊", "经", "异常", "诊断"
+            , "示", "超", "伤", "术", "复查", "体检", "血透", "血液透析");
+
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        status.set("0");
+        if (inputInfo.getBeHospitalizedDoc() == null) {
+            return;
+        }
+
+        BeHospitalizedDoc beHospitalizedDoc = inputInfo.getBeHospitalizedDoc();
+        ChiefLabel chiefLabel = beHospitalizedDoc.getChiefLabel();
+        PresentLabel presentLabel = beHospitalizedDoc.getPresentLabel();
+        if (chiefLabel == null || presentLabel == null) {
+            return;
+        }
+
+        List<String> chiefPosition = new ArrayList<>();
+        List<String> presentPosition = new ArrayList<>();
+
+
+        String chiefText = chiefLabel.getText();
+        String presentText = presentLabel.getText();
+        if (StringUtil.isBlank(chiefText) || StringUtil.isBlank(presentText)) {
+            return;
+        }
+        //主诉如果包括相关词,不报错
+        for (String word : containList) {
+            if (chiefText.contains(word)) {
+                return;
+            }
+        }
+
+        //取主诉的方位词
+        for (String position : positions) {
+            if (chiefText.contains(position)) {
+                chiefPosition.add(position);
+                chiefText = chiefText.replace(position, "");
+            }
+        }
+
+        //取现病史的方位词,只取现病史前20个字
+        if (presentText.length() > 20) {
+            presentText = presentText.substring(0, 20);
+        }
+        for (String position : positions) {
+            if (presentText.contains(position)) {
+                presentPosition.add(position);
+                presentText = presentText.replace(position, "");
+            }
+        }
+
+        if (chiefPosition.size() == 0 || presentPosition.size() == 0) {
+            return;
+        }
+
+        int matchNum = 0;
+        for (String chiefP : chiefPosition) {
+            for (String presentP : presentPosition) {
+                if (chiefP.equals(presentP)) {
+                    matchNum++;
+                    break;
+                }
+            }
+        }
+
+        if (matchNum == 0) {
+            status.set("-1");
+        }
+    }
+}

+ 111 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH03051.java

@@ -0,0 +1,111 @@
+package com.lantone.qc.kernel.catalogue.behospitalized;
+
+import com.google.common.collect.ImmutableMap;
+import com.lantone.qc.kernel.catalogue.QCCatalogue;
+import com.lantone.qc.pub.model.InputInfo;
+import com.lantone.qc.pub.model.OutputInfo;
+import com.lantone.qc.pub.model.doc.BeHospitalizedDoc;
+import com.lantone.qc.pub.model.entity.Diag;
+import com.lantone.qc.pub.model.label.DiagLabel;
+import com.lantone.qc.pub.model.label.VitalLabelSpecial;
+import com.lantone.qc.pub.util.StringUtil;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.stream.Collectors;
+
+/**
+ * @ClassName : BEH03051
+ * @Description : 与诊断相关的主要体征未描述
+ * @Author : 胡敬
+ * @Date: 2020-07-28 09:52
+ */
+@Component
+public class BEH03051 extends QCCatalogue {
+    /**
+     * 暂时先整理出以下诊断的体征
+     * 用|分隔。
+     * |前面的是且的关系,每个都要有
+     * |后面的是或的关系,有一个就可以
+     */
+
+    Map<String, String> diagVital = ImmutableMap.<String, String>builder()
+            .put("急性阑尾炎", "右下腹:专科查体无右下腹描述/反跳痛:专科查体无反跳痛描述|麦氏点:专科查体无麦氏点描述/麦氏点压痛/阑尾点")
+            .put("冠状动脉粥样硬化性心脏病", "心率:专科查体无心率描述/律:专科查体无心律描述|瓣膜:专科查体无各瓣膜区听诊描述/杂音/二尖瓣/三尖瓣/主动脉瓣")
+            .put("高血压病", "血压:专科查体无血压值描述")
+            .put("高血压病1级", "血压:专科查体无血压值描述")
+            .put("高血压病2级", "血压:专科查体无血压值描述")
+            .put("高血压病3级", "血压:专科查体无血压值描述")
+            .put("心房颤动", "心率:专科查体无心率描述/律:专科查体无心律描述|脉搏:专科查体无脉搏描述/心音:专科查体无心音描述")
+            .build();
+
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        status.set("0");
+        if (inputInfo.getBeHospitalizedDoc() == null) {
+            return;
+        }
+
+        BeHospitalizedDoc beHospitalizedDoc = inputInfo.getBeHospitalizedDoc();
+        DiagLabel initialDiagLabel = beHospitalizedDoc.getInitialDiagLabel();
+        VitalLabelSpecial vitalLabelSpecial = beHospitalizedDoc.getVitalLabelSpecial();
+        if (initialDiagLabel == null || vitalLabelSpecial == null) {
+            return;
+        }
+
+        String vitalSpecialText = vitalLabelSpecial.getText();
+        if (StringUtil.isBlank(vitalSpecialText)) {
+            return;
+        }
+
+        List<Diag> initDiags = initialDiagLabel.getDiags();
+        List<String> initDiagStrs = initDiags
+                .stream()
+                .map(Diag::getHospitalDiagName)
+                .filter(Objects::nonNull)
+                .collect(Collectors.toList());
+
+        if (initDiagStrs.size() == 0) {
+            return;
+        }
+        for (String initDiagStr : initDiagStrs) {
+            if (diagVital.containsKey(initDiagStr)) {
+                String vitals = diagVital.get(initDiagStr);
+                String[] vitalArr = vitals.split("\\|");
+                String vitalAnd = vitalArr[0];//体征且的关系,每个必须有
+                for (String vitalInfo : vitalAnd.split("/")) {
+                    String[] vitalInfoArr = vitalInfo.split(":");
+                    String vital = "";
+                    if (!vitalSpecialText.contains(vitalInfoArr[0])) {
+                        status.set("-1");
+                        if (vitalInfoArr.length > 1) {
+                            vital = ":" + vitalInfoArr[1];
+                        }
+                        info.set(initDiagStr + vital);
+                        return;
+                    }
+                }
+                if (vitalArr.length == 2) {
+                    String vitalOr = vitalArr[1];//体征或的关系,有一个就行
+                    int existNum = 0;
+                    String vital = "";
+                    for (String vitalInfo : vitalOr.split("/")) {
+                        String[] vitalInfoArr = vitalInfo.split(":");
+                        if (vitalSpecialText.contains(vitalInfoArr[0])) {
+                            existNum++;
+                        }
+                        if (vitalInfoArr.length > 1) {
+                            vital = ":" + vitalInfoArr[1];
+                        }
+                    }
+                    if (existNum == 0) {
+                        status.set("-1");
+                        info.set(initDiagStr + vital);
+                        return;
+                    }
+                }
+            }
+        }
+    }
+}

+ 47 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH03053.java

@@ -0,0 +1,47 @@
+package com.lantone.qc.kernel.catalogue.behospitalized;
+
+import com.lantone.qc.kernel.catalogue.QCCatalogue;
+import com.lantone.qc.pub.model.InputInfo;
+import com.lantone.qc.pub.model.OutputInfo;
+import com.lantone.qc.pub.util.StringUtil;
+import org.springframework.stereotype.Component;
+
+import java.util.Map;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+/**
+ * @ClassName : BEH03053
+ * @Description : 入院记录体格检查体温与专科检查体温不一致
+ * @Author : 楼辉荣
+ * @Date: 2020-03-06 17:28
+ */
+@Component
+public class BEH03053 extends QCCatalogue {
+
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        status.set("0");
+        if (inputInfo.getBeHospitalizedDoc() == null || inputInfo.getBeHospitalizedDoc().getStructureMap() == null) {
+            return;
+        }
+        Map<String, String> structureMap = inputInfo.getBeHospitalizedDoc().getStructureMap();
+        String souval = structureMap.get("体温");
+        String tarval = null;
+        String vitalLabelSpecial = structureMap.get("专科体格检查");
+        if (StringUtil.isNotBlank(vitalLabelSpecial)) {
+            Pattern pattern = Pattern.compile("(体温)[^,;。,;体温|脉搏|呼吸|血压|疼痛]+");
+            Matcher matcher = pattern.matcher(vitalLabelSpecial);
+            if (matcher.find()) {
+                pattern = Pattern.compile("[0-9]+[./]*[0-9]*");
+                matcher = pattern.matcher(matcher.group());
+                if (matcher.find()) {
+                    tarval = matcher.group();
+                }
+            }
+        }
+        if (StringUtil.isNotBlank(souval) && StringUtil.isNotBlank(tarval) && !souval.equals(tarval)) {
+            status.set("-1");
+        }
+    }
+
+}

+ 47 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH03055.java

@@ -0,0 +1,47 @@
+package com.lantone.qc.kernel.catalogue.behospitalized;
+
+import com.lantone.qc.kernel.catalogue.QCCatalogue;
+import com.lantone.qc.pub.model.InputInfo;
+import com.lantone.qc.pub.model.OutputInfo;
+import com.lantone.qc.pub.util.StringUtil;
+import org.springframework.stereotype.Component;
+
+import java.util.Map;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+/**
+ * @ClassName : BEH03055
+ * @Description : 入院记录体格检查脉搏与专科检查脉搏不一致
+ * @Author : 楼辉荣
+ * @Date: 2020-03-06 17:28
+ */
+@Component
+public class BEH03055 extends QCCatalogue {
+
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        status.set("0");
+        if (inputInfo.getBeHospitalizedDoc() == null || inputInfo.getBeHospitalizedDoc().getStructureMap() == null) {
+            return;
+        }
+        Map<String, String> structureMap = inputInfo.getBeHospitalizedDoc().getStructureMap();
+        String souval = structureMap.get("脉搏");
+        String tarval = null;
+        String vitalLabelSpecial = structureMap.get("专科体格检查");
+        if (StringUtil.isNotBlank(vitalLabelSpecial)) {
+            Pattern pattern = Pattern.compile("(脉搏)[^,;。,;体温|脉搏|呼吸|血压|疼痛]+");
+            Matcher matcher = pattern.matcher(vitalLabelSpecial);
+            if (matcher.find()) {
+                pattern = Pattern.compile("[0-9]+[./]*[0-9]*");
+                matcher = pattern.matcher(matcher.group());
+                if (matcher.find()) {
+                    tarval = matcher.group();
+                }
+            }
+        }
+        if (StringUtil.isNotBlank(souval) && StringUtil.isNotBlank(tarval) && !souval.equals(tarval)) {
+            status.set("-1");
+        }
+    }
+
+}

+ 47 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH03056.java

@@ -0,0 +1,47 @@
+package com.lantone.qc.kernel.catalogue.behospitalized;
+
+import com.lantone.qc.kernel.catalogue.QCCatalogue;
+import com.lantone.qc.pub.model.InputInfo;
+import com.lantone.qc.pub.model.OutputInfo;
+import com.lantone.qc.pub.util.StringUtil;
+import org.springframework.stereotype.Component;
+
+import java.util.Map;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+/**
+ * @ClassName : BEH03056
+ * @Description : 入院记录体格检查呼吸与专科检查呼吸不一致
+ * @Author : 楼辉荣
+ * @Date: 2020-03-06 17:28
+ */
+@Component
+public class BEH03056 extends QCCatalogue {
+
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        status.set("0");
+        if (inputInfo.getBeHospitalizedDoc() == null || inputInfo.getBeHospitalizedDoc().getStructureMap() == null) {
+            return;
+        }
+        Map<String, String> structureMap = inputInfo.getBeHospitalizedDoc().getStructureMap();
+        String souval = structureMap.get("呼吸");
+        String tarval = null;
+        String vitalLabelSpecial = structureMap.get("专科体格检查");
+        if (StringUtil.isNotBlank(vitalLabelSpecial)) {
+            Pattern pattern = Pattern.compile("(呼吸)[^,;。,;体温|脉搏|呼吸|血压|疼痛]+");
+            Matcher matcher = pattern.matcher(vitalLabelSpecial);
+            if (matcher.find()) {
+                pattern = Pattern.compile("[0-9]+[./]*[0-9]*");
+                matcher = pattern.matcher(matcher.group());
+                if (matcher.find()) {
+                    tarval = matcher.group();
+                }
+            }
+        }
+        if (StringUtil.isNotBlank(souval) && StringUtil.isNotBlank(tarval) && !souval.equals(tarval)) {
+            status.set("-1");
+        }
+    }
+
+}

+ 55 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH03057.java

@@ -0,0 +1,55 @@
+package com.lantone.qc.kernel.catalogue.behospitalized;
+
+import com.lantone.qc.kernel.catalogue.QCCatalogue;
+import com.lantone.qc.pub.model.InputInfo;
+import com.lantone.qc.pub.model.OutputInfo;
+import com.lantone.qc.pub.util.StringUtil;
+import org.springframework.stereotype.Component;
+
+import java.util.Map;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+/**
+ * @ClassName : BEH03057
+ * @Description : 入院记录体格检查血压与专科检查血压不一致
+ * @Author : 楼辉荣
+ * @Date: 2020-03-06 17:28
+ */
+@Component
+public class BEH03057 extends QCCatalogue {
+
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        status.set("0");
+        if (inputInfo.getBeHospitalizedDoc() == null || inputInfo.getBeHospitalizedDoc().getStructureMap() == null) {
+            return;
+        }
+        Map<String, String> structureMap = inputInfo.getBeHospitalizedDoc().getStructureMap();
+        String souval = structureMap.get("血压");
+        if (StringUtil.isBlank(souval)) {
+            return;
+        }
+        Pattern pattern = Pattern.compile("[0-9]+[./]*[0-9]*");
+        Matcher matcher = pattern.matcher(souval);
+        if (matcher.find()) {
+            souval = matcher.group();
+        }
+        String tarval = null;
+        String vitalLabelSpecial = structureMap.get("专科体格检查");
+        if (StringUtil.isNotBlank(vitalLabelSpecial)) {
+            pattern = Pattern.compile("(血压)[^,;。,;体温|脉搏|呼吸|血压|疼痛]+");
+            matcher = pattern.matcher(vitalLabelSpecial);
+            if (matcher.find()) {
+                pattern = Pattern.compile("[0-9]+[./]*[0-9]*");
+                matcher = pattern.matcher(matcher.group());
+                if (matcher.find()) {
+                    tarval = matcher.group();
+                }
+            }
+        }
+        if (StringUtil.isNotBlank(souval) && StringUtil.isNotBlank(tarval) && !souval.equals(tarval)) {
+            status.set("-1");
+        }
+    }
+
+}

+ 47 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH03058.java

@@ -0,0 +1,47 @@
+package com.lantone.qc.kernel.catalogue.behospitalized;
+
+import com.lantone.qc.kernel.catalogue.QCCatalogue;
+import com.lantone.qc.pub.model.InputInfo;
+import com.lantone.qc.pub.model.OutputInfo;
+import com.lantone.qc.pub.util.StringUtil;
+import org.springframework.stereotype.Component;
+
+import java.util.Map;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+/**
+ * @ClassName : BEH03058
+ * @Description : 入院记录体格检查疼痛评分与专科检查疼痛评分不一致
+ * @Author : 楼辉荣
+ * @Date: 2020-03-06 17:28
+ */
+@Component
+public class BEH03058 extends QCCatalogue {
+
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        status.set("0");
+        if (inputInfo.getBeHospitalizedDoc() == null || inputInfo.getBeHospitalizedDoc().getStructureMap() == null) {
+            return;
+        }
+        Map<String, String> structureMap = inputInfo.getBeHospitalizedDoc().getStructureMap();
+        String souval = structureMap.get("疼痛评分");
+        String tarval = null;
+        String vitalLabelSpecial = structureMap.get("专科体格检查");
+        if (StringUtil.isNotBlank(vitalLabelSpecial)) {
+            Pattern pattern = Pattern.compile("(疼痛)[^,;。,;体温|脉搏|呼吸|血压|疼痛]+");
+            Matcher matcher = pattern.matcher(vitalLabelSpecial);
+            if (matcher.find()) {
+                pattern = Pattern.compile("[0-9]+[./]*[0-9]*");
+                matcher = pattern.matcher(matcher.group());
+                if (matcher.find()) {
+                    tarval = matcher.group();
+                }
+            }
+        }
+        if (StringUtil.isNotBlank(souval) && StringUtil.isNotBlank(tarval) && !souval.equals(tarval)) {
+            status.set("-1");
+        }
+    }
+
+}

+ 51 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP03045.java

@@ -0,0 +1,51 @@
+package com.lantone.qc.kernel.catalogue.firstpagerecord;
+
+import com.lantone.qc.kernel.catalogue.QCCatalogue;
+import com.lantone.qc.pub.model.InputInfo;
+import com.lantone.qc.pub.model.OutputInfo;
+import com.lantone.qc.pub.model.doc.DoctorAdviceDoc;
+import com.lantone.qc.pub.util.StringUtil;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+/**
+ * @ClassName : FIRP03045
+ * @Description : 呼吸机辅助治疗未记录
+ * 医嘱里找呼吸机
+ * 手术和操作里面找
+ * @Author : 楼辉荣
+ * @Date: 2020-03-06 17:28
+ */
+@Component
+public class FIRP03045 extends QCCatalogue {
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        status.set("0");
+        if (inputInfo.getFirstPageRecordDoc() != null && inputInfo.getFirstPageRecordDoc().getStructureExtMap() != null
+                && inputInfo.getDoctorAdviceDocs().size() > 0) {
+            List<DoctorAdviceDoc> doctorAdviceDocs = inputInfo.getDoctorAdviceDocs();
+            List<String> docAdviceElement = doctorAdviceDocs
+                    .stream()
+                    .map(x -> x.getStructureMap().get("医嘱项目名称"))
+                    .filter(x -> x != null && x.contains("呼吸机"))
+                    .collect(Collectors.toList());
+
+            Map<String, Object> extMap = inputInfo.getFirstPageRecordDoc().getStructureExtMap();
+            List<Map<String, String>> operationList = (List<Map<String, String>>) extMap.get("手术信息");
+            if (operationList != null && operationList.size() > 0) {
+                List<String> firstPageElement = operationList
+                        .stream()
+                        .map(x -> x.get("手术名称"))
+                        .filter(x -> StringUtil.isNotBlank(x) && x.contains("呼吸机"))
+                        .collect(Collectors.toList());
+
+                if (docAdviceElement.size() > 0 && firstPageElement.size() == 0) {
+                    status.set("-1");
+                }
+            }
+
+        }
+    }
+}

+ 85 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP03046.java

@@ -0,0 +1,85 @@
+package com.lantone.qc.kernel.catalogue.firstpagerecord;
+
+import com.google.common.collect.Lists;
+import com.lantone.qc.kernel.catalogue.QCCatalogue;
+import com.lantone.qc.pub.Content;
+import com.lantone.qc.pub.model.InputInfo;
+import com.lantone.qc.pub.model.OutputInfo;
+import com.lantone.qc.pub.util.ListUtil;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @ClassName : FIRP03046
+ * @Description : 主要诊断与主要手术/操作不匹配
+ * @Author : 楼辉荣
+ * @Date: 2020-03-06 17:28
+ */
+@Component
+public class FIRP03046 extends QCCatalogue {
+
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        status.set("0");
+        if (inputInfo.getFirstPageRecordDoc() == null || inputInfo.getFirstPageRecordDoc().getStructureExtMap() == null) {
+            return;
+        }
+        Map<String, Object> structureExtMap = inputInfo.getFirstPageRecordDoc().getStructureExtMap();
+        List<Map<String, String>> diags = (List) structureExtMap.get(Content.dischargeDiag);
+        List<Map<String, String>> opers = (List) structureExtMap.get(Content.operative_information);
+        if (ListUtil.isEmpty(diags) || ListUtil.isEmpty(opers)) {
+            return;
+        }
+        String diagName = diags.get(0).get("诊断名称");
+        String operName = opers.get(0).get("手术名称");
+        diagOperList.forEach(i -> {
+            String[] diagOperArry = i.split("=");
+            if (diagOperArry[0].indexOf(diagName) > -1 && diagOperArry[1].indexOf(operName) > -1) {
+                status.set("-1");
+                return;
+            }
+        });
+    }
+
+    private List<String> diagOperList = Lists.newArrayList(
+            "冠状动脉粥样硬化性心脏病;痛风;缺血性心肌病;PCI术后;ICD植入术后;心功能II级;心律失常;心房颤动;高血压病3级 很高危组=体内埋藏式自动除颤起搏器植入;经皮血管成型术",
+            "感染性休克(好转);低钾血症;急性梗阻性化脓性胆管炎;高血压病;经皮穿刺胆汁引流术;胆囊癌;肝转移;胰腺转移;低钙血症=鼻内镜鼻腔鼻窦手术;前鼻孔填塞术;手术名称 : 非血管介入: 腹腔置管引流术;手术名称 : 非血管介入: 经皮穿刺胆汁引流术;(住院)超声科B超引导下腹腔积液置管引流",
+            "发热;高血压;胆道感染?;胆囊切除术后;肝内胆管结石伴感染?;肝右叶占位;腺癌;肝硬化;右下肢静脉曲张=手术名称 : 非血管介入: 经皮肝穿刺活检术,非血管介入: 各个部位脓肿、囊肿穿刺引流术",
+            "胆囊占位性病变;胆囊肿瘤?;胆囊结石伴慢性胆囊炎;高血压;脑梗史;左侧髋关节术后=经皮冠脉造影术;腹腔镜胆囊癌根治术(肝IVb、V段部分切除;肝门淋巴结清扫);手术名称 : 非血管介入: 经皮穿刺胆汁引流术",
+            "肝癌;左眼翼状胬肉;经皮肝动脉化疗栓塞术;高血压;慢性乙型病毒性肝炎;糖尿病;双眼原发性急性闭角型青光眼;右肾囊肿;左眼大发作期;右眼间歇期;双眼白内障=心电监护下左眼白内障超声乳化囊外摘除联合人工晶体植入/房角粘连分离/胬肉切除术/自体结膜移植术;右眼超声乳化白内障摘除联合人工晶体植入术/房角粘连分离;经皮肝动脉化疗栓塞术",
+            "低钠血症;开颅鞍区肿瘤切除术后;2型糖尿病=神经导航下复发颅咽管瘤囊腔Ommaya泵置入",
+            "甲状腺结节;高血压病=右侧甲状腺癌根治(右侧甲状腺叶切除;峡部切除;右侧气食管沟清扫);右侧甲状旁腺移植;术中冰冻",
+            "急性胆管炎;左肝切除术后;胆囊切除术后;肾结石伴肾积水;左输尿管镜探查+左侧D-J管留置术后=左输尿管镜探查;左侧D-J管留置术",
+            "冠状动脉粥样硬化性心脏病;PCI术后;双侧颈动脉狭窄;高血压病3级 高危=主动脉、颈动脉造影术;经皮血管成型术",
+            "肝功能异常;右肾上腺髓脂肪瘤;遗传代谢性肝病?;脂肪肝;贫血待查:溶血性贫血?;胆囊结石;肾囊肿;肝囊肿=骨髓穿刺;B超引导下肝脏穿刺活检术",
+            "休克;皮肤软组织感染;分布性;急性肾损伤;梗阻性?;多发伤;脊髓损伤;胸椎5/6骨折脱位伴截瘫;脓毒症;胸椎后路T5/6骨折复位、椎管减压、植骨融合、椎弓根钉棒系统内固定术后;肺部感染;胸椎椎体及附件多发骨折;肺栓塞;C6-7椎板及棘突=胸椎后路T5/6骨折复位、椎管减压、植骨融合、椎弓根钉棒系统内固定术;更换气管插管术;-",
+            "慢性便秘;继发性巨结肠;不全性肠梗阻;肝囊肿=腹腔镜辅助下全结肠切除;回肠直肠吻合术",
+            "膀胱肿瘤;高血压病;冠状动脉粥样硬化性心脏病;PCI术后=冠状动脉药物涂层支架置入术",
+            "子宫多发肌瘤;盆腔子宫内膜异位症III期;左卵巢子宫内膜异位囊肿;双侧输卵管系膜囊肿;宫内节育器(已取出)=取环;腹腔镜下盆腔粘连松解;子宫肌瘤剔除;左卵巢子宫内膜异位囊肿剥除;左卵巢成形;双侧输卵管系膜囊肿剥除;通液术",
+            "腰椎管狭窄;尿道狭窄=尿道狭窄扩张;留置导尿;经后路腰4,5椎间盘切除;椎管扩大减压;椎体间骨移植;内固定;神经电生理监护术",
+            "病态窦房结综合征;两侧大脑中动脉粥样硬化;窦性停博;右侧大脑中动脉M1段轻度狭窄;房性早搏;椎间盘突出;双腔永久性起搏器植入术后;肺结节;复视;海绵窦脑膜动静脉瘘;海绵窦脑膜动静脉瘘栓塞术=脑血管造影;海绵窦脑膜动静脉瘘栓塞术;双腔永久起搏器置入术;腰椎穿刺",
+            "颈部皮肤肿物:纤维腺瘤?增生结节?;右乳保乳根治术后=头皮肿物切除术;左侧胸壁异物取出术",
+            "妊娠期糖尿病;宫颈机能不全(宫颈环扎线拆除术后);孕1产1孕37周+6天LOA剖宫产活婴;左侧输卵管系膜囊肿=子宫下段剖宫产术;左输卵管系膜囊肿切除;宫颈环扎线拆除术",
+            "宫颈管息肉;宫颈粘连;宫腔粘连;子宫内膜囊肿;子宫肌瘤;眩晕症=宫颈粘连分离;宫腔镜下宫颈管息肉电切术",
+            "盆腔炎性疾病后遗症:左侧输卵管积水;继发不孕;子宫小肌瘤=腹腔镜左侧输卵管切除术;盆腔粘连松解;宫腔镜检查;插管通液",
+            "颈椎间盘突出;腰椎间盘突出;肠息肉摘除术后=后路腰4/5经右侧椎间孔减压、椎体间融合、钉棒系统内固定术",
+            "左半侧颜面萎缩=腹部吸脂;左侧颞部自体脂肪移植术",
+            "妊娠期高血压;孕1产1孕39+周LSA剖宫产活婴;甲状腺功能减退;子宫肌瘤=急诊子宫下段剖宫产;子宫肌瘤剔除术",
+            "左侧股骨远端骨折术后;左膝关节僵硬=左膝关节松解;内固定拆除术",
+            "轻度认知障碍;动脉粥样硬化(双下肢多发细小斑块);高血压病 2级 中危;垂体结节(Rathke囊肿?);颈椎间盘突出;输卵管结扎术后;肺结节;子宫肌瘤;宫颈多发囊肿;结节性甲状腺肿=腰椎穿刺术",
+            "风湿性瓣膜性联合性心脏病;病态窦房结综合征;二尖瓣及主动脉瓣置换术后;起搏器植入术后;心房颤动;高脂血症;再次射频消融术后;肾功能不全;心功能II级;冠状动脉粥样硬化性心脏病;陈旧性心肌梗死=经皮心房颤动射频消融术",
+            "惊恐障碍;睡眠呼吸暂停低通气综合征,中度低氧血症(改善);高血压病;高血脂症;花斑癣;冠状动脉粥样硬化;慢性浅表性胃炎=无痛肠镜",
+            "取卵术后;卵巢过度刺激综合征=(住院)超声科B超引导下腹腔积液置管引流;胸腔积液彩超",
+            "后循环脑血管缺血;直肠息肉;慢性非萎缩性胃炎;反流性食管炎;高脂血症;胆囊结石;乳腺增生=无痛肠镜申请单(和爽)(西甲硅油)|经肠镜结直肠息肉摘除术",
+            "左侧卵巢囊肿蒂扭转;双侧卵巢畸胎瘤=腹腔镜下双侧附件切除;盆腔粘连松解",
+            "左侧股骨转子间骨折;左髋关节滑膜炎;高血压病=左髋关节滑膜切除;粗隆骨折切复内固定术",
+            "病态窦房结综合征;双腔起搏器植入术后;颈动脉粥样硬化;轻度睡眠呼吸暂停合并轻度低氧血症;肺结节;肺气肿;胃部分切除术后=用两根导管的冠状动脉造影术;双腔永久起搏器置入术",
+            "肋软骨痛;高血压;结肠息肉摘除术后;动脉粥样硬化;高脂血症=无痛肠镜申请单(和爽)(西甲硅油)|经肠镜结直肠息肉摘除术",
+            "心律失常;室性期前收缩;射频消融术后;2型糖尿病;肺结节;胆囊多发息肉=用两根导管的冠状动脉造影术;经皮室性早搏射频消融术",
+            "心律失常;频发室早;射频消融术后;冠状动脉粥样硬化;高血压2级 高危组;肺结节病;腰椎间盘突出=用两根导管的冠状动脉造影术;经皮室性早搏射频消融术",
+            "病态窦房结综合征;高血压3级,很高危组;阵发性心房颤动;高脂血症;射频消融术后;腔隙性脑梗死;双腔起搏器植入术后;前列腺增生;冠状动脉粥样硬化性心脏病;肝囊肿;PCI术后;肺结节;动脉粥样硬化=用两根导管的冠状动脉造影术;经皮心房颤动射频消融术",
+            "心律失常;病态窦房结综合征;双腔起搏器置入术后;心房颤动;射频消融术后;高血压2级 高危组=用两根导管的冠状动脉造影术;双腔永久起搏器置入术"
+    );
+
+}

+ 186 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/threelevelward/THR03044.java

@@ -0,0 +1,186 @@
+package com.lantone.qc.kernel.catalogue.threelevelward;
+
+import com.google.common.collect.ImmutableMap;
+import com.lantone.qc.kernel.catalogue.QCCatalogue;
+import com.lantone.qc.pub.model.InputInfo;
+import com.lantone.qc.pub.model.OutputInfo;
+import com.lantone.qc.pub.model.doc.DoctorAdviceDoc;
+import com.lantone.qc.pub.model.doc.LisDoc;
+import com.lantone.qc.pub.util.StringUtil;
+import org.springframework.stereotype.Component;
+
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+import java.util.stream.Collectors;
+
+/**
+ * @ClassName : THR03044
+ * @Description : 抗生素使用指征不明确
+ * @Author : kwz
+ * @Date: 2020-07-23 14:16
+ */
+@Component
+public class THR03044 extends QCCatalogue {
+    public static Map<String, String> lisData = ImmutableMap.<String, String>builder()
+            .put("超敏C反应蛋白", ">10")
+            .put("降钙素CT(免疫)", ">0.25")
+            .put("尿=白细胞", ">13.2")
+            .put("白细胞计数[电阻抗法]", "<0.4")
+            .put("中性粒细胞绝对值", ">12")
+            .put("中性粒细胞百分率", ">70%")
+            .put("血培养报阳时间", "")
+            //            .put("尿培养加菌落计数", "细菌生长")
+            .put("一般细菌涂片检查", "细菌生长")
+            //            .put("内毒素鲎定性试验", "阳性")
+            //            .put("常规药敏定性试验", "阳性")
+            //            .put("细菌抗体测定", "阳性")
+            .put("碱性磷酸酶[速率法]", ">80")
+            .put("血沉", ">25")
+            //            .put("肥达氏反应", "大于等于1:160")
+            //            .put("外斐氏反应", "大于等于:160")
+            .put("粪=白细胞", ">2")
+            //            .put("前列腺液白细胞", "大于1个/高位视野")
+            .put("胸水常规=白细胞", ">500")
+            .put("G+球菌:痰夜", "少,中等,多,偶见")
+            .put("G-球菌:痰夜", "少,中等,多,偶见")
+            .put("G+杆菌:痰夜", "少,中等,多,偶见")
+            .put("G-杆菌:痰夜", "少,中等,多,偶见")
+            .build();
+
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        status.set("0");
+        List<DoctorAdviceDoc> doctorAdviceDocs = inputInfo.getDoctorAdviceDocs();
+        List<LisDoc> lisDocs = inputInfo.getLisDocs();
+
+        if (doctorAdviceDocs.size() == 0 || lisDocs.size() == 0) {
+            return;
+        }
+
+        Set<String> antibiotics = doctorAdviceDocs
+                .stream()
+                .map(x -> x.getStructureMap().get("药品类型"))
+                .filter(x -> StringUtil.isNotBlank(x) && x.contains("抗生素"))
+                .collect(Collectors.toSet());
+
+        if (antibiotics.size() == 0) {
+            return;
+        }
+
+        Set<String> lises = new HashSet<>();
+        Map<String, String> lisReportMap = new HashMap<>();
+
+        for (LisDoc lisDoc : lisDocs) {
+            Map<String, String> lisDocStructureMap = lisDoc.getStructureMap();
+            String lisName = lisDocStructureMap.get("报告名称").trim();
+            String result = lisDocStructureMap.get("检验结果");
+            lisReportMap.put(lisName, result);
+            if (lisName.contains("=")) {
+                lises.add(lisName.split("=")[1]);
+            } else {
+                lises.add(lisName);
+            }
+        }
+        //如果这个病例的化验项目不在lisData,不报
+        Set<String> dataLises = lisData.keySet();
+        Set<String> collect = new HashSet<>();
+        for (String dataLis : dataLises) {
+            if (dataLis.contains("=")) {
+                collect.add(dataLis.split("=")[1]);
+            } else {
+                collect.add(dataLis);
+            }
+        }
+        collect.retainAll(lises);
+        if (collect.size() == 0) {
+            return;
+        }
+
+        String[] lisNameMapSub = null;
+        String[] lisNameSub = null;
+        String lisMapKey = null, lisMapValue = null, lisKey = null, lisValue = null;
+        for (Map.Entry<String, String> lisDataMap : lisData.entrySet()) {
+            String lisName = lisDataMap.getKey();
+            String lisResult = lisDataMap.getValue();
+            if (lisName.contains("=")) {
+                lisNameMapSub = lisName.split("=");
+            }
+            if (lisNameMapSub != null) {
+                lisMapKey = lisNameMapSub[0]; //静态map(lisData)的key根据=分隔,得到的key,如尿=白细胞,lisMapKey=尿
+                lisMapValue = lisNameMapSub[1];//静态map(lisData)的key根据=分隔,得到的value,如尿=白细胞,lisMapValue=白细胞
+            } else {
+                lisMapValue = lisName;//若静态map(lisData)的key没有=,直接用key作为分隔后的value,如超敏C反应蛋白,lisMapValue=超敏C反应蛋白
+            }
+            for (Map.Entry<String, String> lis : lisReportMap.entrySet()) {
+                String lisname = lis.getKey();
+                String result = lis.getValue();
+                lisNameSub = lisname.split("=");
+                lisKey = lisNameSub[0];//库中化验表map的key根据=分隔,得到的key,如尿=白细胞,lisMapKey=尿
+                lisValue = lisNameSub[1];
+                if (StringUtil.isBlank(lisMapKey) && lisMapValue.equals(lisValue)) {
+                    if (compare(result, lisResult)) {
+                        status.set("-1");
+                        return;
+                    }
+                }
+                if (StringUtil.isNotBlank(lisMapKey) && lisMapKey.contains(lisKey) && lisMapValue.equals(lisValue)) {
+                    if (compare(result, lisResult)) {
+                        status.set("-1");
+                        return;
+                    }
+                }
+            }
+        }
+
+    }
+
+    /**
+     * 比对化验表数据与lisData中数据大小,若符合则返回true
+     *
+     * @param result
+     * @param value
+     * @return
+     */
+    private boolean compare(String result, String value) {
+        boolean flag = false;
+        String s = num_method(value);
+        if (num_contain(result) && num_contain(s)) {
+            if (Float.parseFloat(result) > Float.parseFloat(s) && value.contains(">")) {
+                flag = true;
+            }
+            if (Float.parseFloat(result) < Float.parseFloat(s) && value.contains("<")) {
+                flag = true;
+            }
+        } else {
+            if (result.equals(s)) {
+                flag = true;
+            }
+        }
+        return flag;
+    }
+
+    public String num_method(String content) {
+        //        String compile = "(\\d+\\.\\d+)|(\\d+)";
+        String group = "";
+        String compile = "([1-9]\\d*\\.?\\d*)|(0\\.\\d*[1-9])";
+        Pattern p = Pattern.compile(compile);
+        Matcher matcher = p.matcher(content);
+        if (matcher.find()) {
+            group = matcher.group(0);
+        }
+        return group;
+    }
+
+    public Boolean num_contain(String content) {
+        //        String compile = "(\\d+\\.\\d+)|(\\d+)";
+        String compile = "(\\d+)";
+        Pattern p = Pattern.compile(compile);
+        Matcher matcher = p.matcher(content);
+        boolean b = matcher.find();
+        return b;
+    }
+}

+ 27 - 1
kernel/src/main/java/com/lantone/qc/kernel/structure/ai/process/EntityProcessPacs.java

@@ -3,16 +3,22 @@ package com.lantone.qc.kernel.structure.ai.process;
 import com.alibaba.fastjson.JSONObject;
 import com.lantone.qc.kernel.structure.ai.model.EntityEnum;
 import com.lantone.qc.kernel.structure.ai.model.Lemma;
+import com.lantone.qc.kernel.util.DiagEnhancer;
 import com.lantone.qc.pub.model.entity.BodyPart;
+import com.lantone.qc.pub.model.entity.Diag;
 import com.lantone.qc.pub.model.entity.OuterCourtyard;
 import com.lantone.qc.pub.model.entity.PD;
 import com.lantone.qc.pub.model.entity.Pacs;
 import com.lantone.qc.pub.model.entity.PacsValue;
+import com.lantone.qc.pub.model.entity.Possible;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import java.util.ArrayList;
 import java.util.List;
 
 public class EntityProcessPacs extends EntityProcess {
+    private Logger logger = LoggerFactory.getLogger(EntityProcessPacs.class);
 
     public List<Pacs> extractEntity(JSONObject aiOut) {
         //辅检情况
@@ -34,12 +40,32 @@ public class EntityProcessPacs extends EntityProcess {
             }
             pacses.add(pacs);
         }
+        //辅检提取疾病
+        List<Diag> diags = new ArrayList<>();
+        try {
+            //读取疾病信息
+            List<Lemma> diagLemmas = createEntityTree(aiOut, EntityEnum.DIEASE.toString());
+            for (Lemma lemma : diagLemmas) {
+                Diag diag = DiagEnhancer.create(lemma.getText());
+                if (lemma.isHaveChildren()) {
+                    diag.setNegative(findNegative(lemma));//阴性
+                    diag.setPossible(findT(lemma, new Possible(), EntityEnum.POSSIBLE.toString()));//可能的
+                    diag.setPd(findT(lemma, new PD(), EntityEnum.TIME.toString()));//时间
+                }
+                diags.add(diag);
+            }
+        } catch (Exception e) {
+            logger.error(e.getMessage(), e);
+        }
+        Pacs pacs = new Pacs();
+        pacs.setDiags(diags);
+        pacses.add(pacs);
         //辅检时间(不是辅检具体项目时间)
         List<Lemma> pdLemmas = createEntityTree(aiOut, EntityEnum.TIME.toString());
         for (Lemma lemma : pdLemmas) {
             PD pd = new PD();
             pd.setName(lemma.getText());
-            Pacs pacs = new Pacs();
+            pacs = new Pacs();
             pacs.setPd(pd);
             pacses.add(pacs);
         }

+ 2 - 0
public/src/main/java/com/lantone/qc/pub/model/InputInfo.java

@@ -57,6 +57,8 @@ public class InputInfo {
     private List<DifficultCaseDiscussDoc> difficultCaseDiscussDocs = new ArrayList<>();
     //医嘱信息
     private List<DoctorAdviceDoc> doctorAdviceDocs = new ArrayList<>();
+    //化验信息
+    private List<LisDoc> lisDocs = new ArrayList<>();
     //值班交接制度
     private List<DutyShiftSystemDoc> dutyShiftSystemDocs = new ArrayList<>();
     //首次病程录

+ 15 - 0
public/src/main/java/com/lantone/qc/pub/model/doc/LisDoc.java

@@ -0,0 +1,15 @@
+package com.lantone.qc.pub.model.doc;
+
+import com.lantone.qc.pub.model.doc.ModelDoc;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description: 化验文档
+ * @author: rengb
+ * @time: 2020/3/20 15:47
+ */
+@Getter
+@Setter
+public class LisDoc extends ModelDoc {
+}

+ 2 - 0
public/src/main/java/com/lantone/qc/pub/model/entity/Pacs.java

@@ -3,6 +3,7 @@ package com.lantone.qc.pub.model.entity;
 import lombok.Getter;
 import lombok.Setter;
 
+import java.util.ArrayList;
 import java.util.List;
 
 /**
@@ -19,4 +20,5 @@ public class Pacs extends General{
     private PacsValue pacsValues;
     private BodyPart bodyPart;
     private OuterCourtyard outerCourtyard; //外院
+    private List<Diag> diags = new ArrayList<>();//疾病
 }

+ 0 - 1
trans/src/main/java/com/lantone/qc/trans/shaoyf/ShaoyfBeHospitalizedDocTrans.java

@@ -66,7 +66,6 @@ public class ShaoyfBeHospitalizedDocTrans extends ModelDocTrans {
             "职业=职业",
             "出生地址=出生地",
             "出生、生长史=出生生长史",
-            "婚姻状况=婚姻",
             "地址=联系地址",
             "现住址=联系地址",
             "工作场所=工作单位",

+ 5 - 0
trans/src/main/java/com/lantone/qc/trans/shaoyf/ShaoyfDocTrans.java

@@ -156,6 +156,11 @@ public class ShaoyfDocTrans extends DocTrans {
                 case "住院病历信息":
                     ShaoyfMedicalRecordInfoDocTrans medicalRecordInfoDocTrans = new ShaoyfMedicalRecordInfoDocTrans();
                     inputInfo.setMedicalRecordInfoDoc(medicalRecordInfoDocTrans.extract(i));
+                    break;
+                case "化验":
+                    ShaoyfLisDocTrans shaoyfLisDocTrans = new ShaoyfLisDocTrans();
+                    inputInfo.setLisDocs(shaoyfLisDocTrans.extract(i));
+                    break;
                 default:
                     break;
             }

+ 37 - 0
trans/src/main/java/com/lantone/qc/trans/shaoyf/ShaoyfLisDocTrans.java

@@ -0,0 +1,37 @@
+package com.lantone.qc.trans.shaoyf;
+
+import com.google.common.collect.Lists;
+import com.lantone.qc.pub.model.doc.DoctorAdviceDoc;
+import com.lantone.qc.pub.model.doc.LisDoc;
+import com.lantone.qc.pub.model.vo.MedrecVo;
+import com.lantone.qc.pub.util.FastJsonUtils;
+import com.lantone.qc.trans.ModelDocTrans;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @Description: 化验信息文档生成
+ * @author: rengb
+ * @time: 2020/3/19 19:41
+ */
+public class ShaoyfLisDocTrans extends ModelDocTrans {
+
+    @Override
+    public List<LisDoc> extract(MedrecVo medrecVo) {
+        List<LisDoc> retList = Lists.newArrayList();
+        List<String> contents = (List) medrecVo.getContent().get("content");
+        contents.forEach(content -> {
+            retList.add(getDoctorAdviceDoc((Map) FastJsonUtils.getJsonToMap(content)));
+        });
+        return retList;
+    }
+
+    private LisDoc getDoctorAdviceDoc(Map<String, String> content) {
+        LisDoc doctorAdviceDoc = new LisDoc();
+        doctorAdviceDoc.setStructureMap(content);
+        doctorAdviceDoc.setPageData((Map) content);
+        return doctorAdviceDoc;
+    }
+
+}