Browse Source

Merge branch 'hb/beilun' into his/yiwufubao

# Conflicts:
#	dbanaly/src/main/resources/application-local.yml
#	kernel/src/main/java/com/lantone/qc/kernel/catalogue/beilun/behospitalized/BEH0024.java
#	kernel/src/main/java/com/lantone/qc/kernel/catalogue/beilun/behospitalized/BEH0032.java
#	kernel/src/main/java/com/lantone/qc/kernel/catalogue/beilun/crisisvaluereport/CRI0382.java
#	kernel/src/main/java/com/lantone/qc/kernel/catalogue/beilun/operationdiscussion/OPE0369.java
#	kernel/src/main/java/com/lantone/qc/kernel/catalogue/beilun/preoperativediscussion/PRE0328.java
#	kernel/src/main/java/com/lantone/qc/kernel/catalogue/beilun/threelevelward/THR0134.java
#	kernel/src/main/java/com/lantone/qc/kernel/catalogue/beilun/threelevelward/THR0139.java
#	kernel/src/main/java/com/lantone/qc/kernel/catalogue/beilun/threelevelward/THR03090.java
#	kernel/src/main/java/com/lantone/qc/kernel/catalogue/ninghaiyiyi/behospitalized/BEH0024.java
#	kernel/src/main/java/com/lantone/qc/kernel/catalogue/ninghaiyiyi/behospitalized/BEH0025.java
#	kernel/src/main/java/com/lantone/qc/kernel/catalogue/ninghaiyiyi/behospitalized/BEH0026.java
#	kernel/src/main/java/com/lantone/qc/kernel/catalogue/ninghaiyiyi/behospitalized/BEH0028.java
#	kernel/src/main/java/com/lantone/qc/kernel/catalogue/ninghaiyiyi/behospitalized/BEH0029.java
#	kernel/src/main/java/com/lantone/qc/kernel/catalogue/ninghaiyiyi/behospitalized/BEH0030.java
#	kernel/src/main/java/com/lantone/qc/kernel/catalogue/ninghaiyiyi/behospitalized/BEH0031.java
#	kernel/src/main/java/com/lantone/qc/kernel/catalogue/ninghaiyiyi/behospitalized/BEH0042.java
#	kernel/src/main/java/com/lantone/qc/kernel/catalogue/ninghaiyiyi/behospitalized/BEH0043.java
#	kernel/src/main/java/com/lantone/qc/kernel/catalogue/ninghaiyiyi/behospitalized/BEH0047.java
#	kernel/src/main/java/com/lantone/qc/kernel/catalogue/ninghaiyiyi/behospitalized/BEH0053.java
#	kernel/src/main/java/com/lantone/qc/kernel/catalogue/ninghaiyiyi/behospitalized/BEH0058.java
#	kernel/src/main/java/com/lantone/qc/kernel/catalogue/ninghaiyiyi/behospitalized/BEH0375.java
#	kernel/src/main/java/com/lantone/qc/kernel/catalogue/ninghaiyiyi/behospitalized/BEH0376.java
#	kernel/src/main/java/com/lantone/qc/kernel/catalogue/ninghaiyiyi/behospitalized/BEH0397.java
#	kernel/src/main/java/com/lantone/qc/kernel/catalogue/ninghaiyiyi/behospitalized/BEH0439.java
#	kernel/src/main/java/com/lantone/qc/kernel/catalogue/ninghaiyiyi/behospitalized/BEH0454.java
#	kernel/src/main/java/com/lantone/qc/kernel/catalogue/ninghaiyiyi/firstcourserecord/FIRC0095.java
#	kernel/src/main/java/com/lantone/qc/kernel/catalogue/ninghaiyiyi/firstpagerecord/FIRP02972.java
#	kernel/src/main/java/com/lantone/qc/kernel/catalogue/ninghaiyiyi/operationdiscussion/OPE02891.java
#	kernel/src/main/java/com/lantone/qc/kernel/catalogue/ninghaiyiyi/operationdiscussion/OPE02892.java
#	kernel/src/main/java/com/lantone/qc/kernel/catalogue/ninghaiyiyi/operationdiscussion/OPE02897.java
#	kernel/src/main/java/com/lantone/qc/kernel/catalogue/ninghaiyiyi/operationdiscussion/OPE02898.java
#	kernel/src/main/java/com/lantone/qc/kernel/catalogue/ninghaiyiyi/operationdiscussion/OPE02930.java
#	kernel/src/main/java/com/lantone/qc/kernel/catalogue/ninghaiyiyi/operationdiscussion/OPE0369.java
#	kernel/src/main/java/com/lantone/qc/kernel/catalogue/ninghaiyiyi/operationdiscussion/OPE0628.java
#	kernel/src/main/java/com/lantone/qc/kernel/catalogue/ninghaiyiyi/operationdiscussion/OPE0630.java
#	kernel/src/main/java/com/lantone/qc/kernel/catalogue/ninghaiyiyi/preoperativediscussion/PRE0328.java
#	kernel/src/main/java/com/lantone/qc/kernel/catalogue/ninghaiyiyi/threelevelward/THR0125.java
#	kernel/src/main/java/com/lantone/qc/kernel/catalogue/ninghaiyiyi/threelevelward/THR0126.java
#	kernel/src/main/java/com/lantone/qc/kernel/catalogue/ninghaiyiyi/threelevelward/THR0144.java
#	kernel/src/main/java/com/lantone/qc/kernel/catalogue/ninghaiyiyi/threelevelward/THR02900.java
#	kernel/src/main/java/com/lantone/qc/kernel/catalogue/ninghaiyiyi/threelevelward/THR03090.java
#	kernel/src/main/java/com/lantone/qc/kernel/catalogue/ninghaiyiyi/threelevelward/THR0601.java
#	kernel/src/main/java/com/lantone/qc/kernel/catalogue/yiwu/behospitalized/BEH0407.java
#	kernel/src/main/java/com/lantone/qc/kernel/catalogue/yiwu/threelevelward/THR0127.java
#	trans/src/main/java/com/lantone/qc/trans/beilun/BeilunDocTrans.java
#	trans/src/main/java/com/lantone/qc/trans/ninghaiyiyi/util/NingHaiYiYiBeHospitalizedHtmlAnalysis.java
#	trans/src/main/java/com/lantone/qc/trans/ninghaiyiyi/util/NingHaiYiYiFirstCourseRecordHtmlAnalysis.java
#	trans/src/main/java/com/lantone/qc/trans/ninghaiyiyi/util/NingHaiYiYiLeaveHospitalHtmlAnalysis.java
#	trans/src/main/java/com/lantone/qc/trans/ninghaiyiyi/util/NingHaiYiYiOperationRecordHtmlAnalysis.java
liuqq 3 years ago
parent
commit
b5d39a8673
100 changed files with 5492 additions and 20 deletions
  1. 1 1
      dbanaly/src/main/java/com/lantone/qc/dbanaly/facade/comsis/ModuleHelper.java
  2. 152 0
      dbanaly/src/main/java/com/lantone/qc/dbanaly/facade/shengzhouzz/ShengzhouyyXmlUtil.java
  3. 67 0
      dbanaly/src/main/java/com/lantone/qc/dbanaly/facade/wenfuyi/WenfuyiXmlUtil.java
  4. 5 1
      dbanaly/src/main/java/com/lantone/qc/dbanaly/util/ModuleMappingUtil.java
  5. 2 2
      dbanaly/src/main/resources/application-dev.yml
  6. 4 4
      dbanaly/src/main/resources/application-test.yml
  7. 1 1
      kernel/pom.xml
  8. 1 5
      kernel/src/main/java/com/lantone/qc/kernel/KernelApplication.java
  9. 10 4
      kernel/src/main/java/com/lantone/qc/kernel/analysis/QCAnalysis.java
  10. 7 2
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/QCCatalogue.java
  11. 36 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/anesthesiarelated/ANES0672.java
  12. 36 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/anesthesiarelated/ANES0673.java
  13. 36 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/anesthesiarelated/ANES0674.java
  14. 36 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/anesthesiarelated/ANES0675.java
  15. 36 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/anesthesiarelated/ANES0676.java
  16. 36 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/anesthesiarelated/ANES0677.java
  17. 36 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/anesthesiarelated/ANES0678.java
  18. 36 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/anesthesiarelated/ANES0679.java
  19. 131 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0001.java
  20. 125 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0002.java
  21. 35 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0003.java
  22. 41 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0004.java
  23. 70 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0005.java
  24. 122 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0006.java
  25. 66 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0007.java
  26. 43 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0008.java
  27. 67 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0009.java
  28. 73 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0010.java
  29. 242 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0011.java
  30. 79 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0012.java
  31. 82 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0013.java
  32. 127 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0014.java
  33. 45 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0015.java
  34. 38 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0016.java
  35. 64 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0017.java
  36. 81 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0018.java
  37. 42 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0019.java
  38. 38 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0020.java
  39. 43 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0021.java
  40. 44 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0022.java
  41. 47 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0023.java
  42. 56 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0024.java
  43. 70 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0025.java
  44. 61 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0026.java
  45. 52 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0027.java
  46. 54 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0028.java
  47. 72 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0029.java
  48. 56 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0030.java
  49. 69 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0031.java
  50. 72 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0032.java
  51. 23 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0033.java
  52. 71 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0034.java
  53. 79 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0035.java
  54. 50 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0036.java
  55. 60 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0037.java
  56. 55 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0038.java
  57. 61 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0039.java
  58. 59 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0040.java
  59. 42 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0041.java
  60. 68 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0042.java
  61. 70 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0043.java
  62. 56 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0044.java
  63. 50 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0045.java
  64. 51 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0046.java
  65. 53 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0047.java
  66. 50 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0048.java
  67. 41 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0049.java
  68. 55 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0050.java
  69. 51 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0051.java
  70. 40 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0052.java
  71. 65 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0053.java
  72. 54 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0054.java
  73. 23 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0055.java
  74. 70 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0056.java
  75. 23 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0057.java
  76. 110 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0058.java
  77. 65 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0059.java
  78. 53 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0060.java
  79. 57 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0061.java
  80. 57 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0062.java
  81. 68 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0063.java
  82. 72 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0064.java
  83. 60 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0065.java
  84. 57 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0066.java
  85. 71 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0067.java
  86. 54 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0068.java
  87. 44 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0069.java
  88. 70 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0070.java
  89. 38 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0071.java
  90. 59 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0072.java
  91. 70 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0073.java
  92. 60 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0074.java
  93. 43 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0075.java
  94. 41 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0076.java
  95. 29 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0079.java
  96. 38 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0081.java
  97. 49 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0082.java
  98. 32 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH02813.java
  99. 30 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH02855.java
  100. 0 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH02860.java

+ 1 - 1
dbanaly/src/main/java/com/lantone/qc/dbanaly/facade/comsis/ModuleHelper.java

@@ -53,7 +53,7 @@ public class ModuleHelper {
     public boolean loadModuleInfo() {
         try {
             List<String> xmlDataTypeHospitalIds = Lists.newArrayList("1", "2", "3");
-            List<String> htmlDataTypeHospitalIds = Lists.newArrayList("4", "5");
+            List<String> htmlDataTypeHospitalIds = Lists.newArrayList("4", "5", "10", "13");
             for (String hospitalId : hospitalIds.split(",")) {
                 loadStandardModule(hospitalId);
                 if (xmlDataTypeHospitalIds.contains(hospitalId)) {

+ 152 - 0
dbanaly/src/main/java/com/lantone/qc/dbanaly/facade/shengzhouzz/ShengzhouyyXmlUtil.java

@@ -0,0 +1,152 @@
+package com.lantone.qc.dbanaly.facade.shengzhouzz;
+
+import com.google.common.collect.Lists;
+import com.google.common.collect.Maps;
+import com.lantone.qc.pub.util.FileUtil;
+import com.lantone.qc.pub.util.StringUtil;
+import lombok.extern.slf4j.Slf4j;
+import org.dom4j.Document;
+import org.dom4j.DocumentHelper;
+import org.dom4j.Element;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @Description: xml解析工具
+ * @author: rengb
+ * @time: 2020/3/28 14:23
+ */
+@Slf4j
+public class ShengzhouyyXmlUtil {
+
+    public static Map<String, String> xmlToMap(String xml) {
+        Map<String, String> map = Maps.newHashMap();
+        try {
+            Document doc = DocumentHelper.parseText(xml);
+            Element root = (Element) doc.selectSingleNode("//XTextDocument/XElements/Element[@xsi:type='XTextBody']/XElements");
+            findElement(root, "XInputField").forEach(i -> {
+                xInputField(map, i, null);
+            });
+            findElement(root, "XTextTable").forEach(tableElement -> {
+                String tablePreTxt = getElementPreVal(tableElement);
+                findElement(tableElement.element("XElements"), "XTextTableRow").forEach(rowElement -> {
+                    findElement(rowElement.element("XElements"), "XTextTableCell").forEach(cellElement -> {
+                        findElement(cellElement.element("XElements"), "XInputField").forEach(xInputFieldElement -> {
+                            xInputField(map, xInputFieldElement, tablePreTxt);
+                        });
+                    });
+                });
+            });
+            Element bodyTextElement = (Element) doc.selectSingleNode("//XTextDocument/BodyText");
+            String bodyText = bodyTextElement.getText();
+            map.put("原始文本", bodyText);
+        } catch (Exception e) {
+            e.printStackTrace();
+            map.clear();
+        }
+//        map.keySet().forEach(key -> {
+//            System.out.println(key + "----" + map.get(key));
+//        });
+        return map;
+    }
+
+    public static List<Element> findElement(Element element, String attual) {
+        List<Element> ret = Lists.newArrayList();
+        ((List<Element>) (element.elements())).forEach(i -> {
+            if (StringUtil.isNotBlank(i.attributeValue("type")) && i.attributeValue("type").equals(attual)) {
+                ret.add(i);
+            }
+        });
+        return ret;
+    }
+
+    public static void xInputField(Map<String, String> map, Element xInputFieldElement, String tablePreTxt) {
+        String value = getXInputFieldValue(xInputFieldElement);
+        if (value == null) {
+            return;
+        }
+        String key = getXInputFieldKey(xInputFieldElement, tablePreTxt);
+        if (StringUtil.isNotBlank(key)) {
+            if (map.containsKey(key)) {
+                value = map.get(key) + " " + value;
+            }
+            map.put(key, value);
+        }
+    }
+
+    //获取 XInputField 的键
+    private static String getXInputFieldKey(Element xInputFieldElement, String tablePreTxt) {
+        String key = null;
+        String[] elementNames = {"Name","BackgroundText", "ToolTip" };
+        for (String elementName : elementNames) {
+            key = xInputFieldElement.elementTextTrim(elementName);
+            if (StringUtil.isNotBlank(key)) {
+                break;
+            }
+        }
+        if (StringUtil.isBlank(key)) {
+            key = getElementPreVal(xInputFieldElement);
+        }
+        if (StringUtil.isBlank(key)) {
+            key = tablePreTxt;
+        }
+        if (StringUtil.isBlank(key)) {
+            key = "病历内容";
+        }
+        return keyHandle(key);
+    }
+
+    //获取 XInputField 的值
+    private static String getXInputFieldValue(Element xInputFieldElement) {
+        String value = null;
+        Element innerValueElement = xInputFieldElement.element("InnerValue");
+        if (innerValueElement != null) {
+            value = innerValueElement.getTextTrim();
+        }
+        if (StringUtil.isBlank(value)) {
+            Element xElementsElement = xInputFieldElement.element("XElements");
+            if (xElementsElement != null) {
+                List<Element> elements = findElement(xElementsElement, "XString");
+                if (elements.size() > 0) {
+                    value = "";
+                    for (Element element : elements) {
+                        Element text = element.element("Text");
+                        if (text != null) {
+                            value += text.getTextTrim();
+                        }
+                    }
+                }
+            }
+        }
+        return value;
+    }
+
+    //获取前面文本信息作为key
+    private static String getElementPreVal(Element xInputFieldElement) {
+        String ret = "";
+        List<Element> sonElements = xInputFieldElement.getParent().elements();
+        int index = sonElements.indexOf(xInputFieldElement);
+        for (int i = index - 1; i >= 0; i--) {
+            Element sonElement = sonElements.get(i);
+            if (sonElement.attributeValue("type").equals("XTextTable") || sonElement.attributeValue("type").equals("XInputField")) {
+                break;
+            }
+            if (sonElement.attributeValue("type").equals("XString")) {
+                ret = sonElement.elementTextTrim("Text") + ret;
+            }
+        }
+        return ret;
+    }
+
+    //针对key的一些特殊处理
+    private static String keyHandle(String key) {
+        key = StringUtil.removeBlank(key).replaceAll("[::]", "");
+        return key;
+    }
+
+    public static void main(String[] args) {
+        xmlToMap(FileUtil.fileRead("C:\\Users\\Administrator\\Desktop\\义务\\jiexi\\n5.xml"));
+    }
+
+}

+ 67 - 0
dbanaly/src/main/java/com/lantone/qc/dbanaly/facade/wenfuyi/WenfuyiXmlUtil.java

@@ -0,0 +1,67 @@
+package com.lantone.qc.dbanaly.facade.wenfuyi;
+
+import com.google.common.collect.Lists;
+import com.google.common.collect.Maps;
+import com.lantone.qc.pub.util.StringUtil;
+import lombok.extern.slf4j.Slf4j;
+import org.dom4j.Document;
+import org.dom4j.DocumentException;
+import org.dom4j.DocumentHelper;
+import org.dom4j.Element;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @Description: xml解析工具
+ * @author: rengb
+ * @time: 2020/3/28 14:23
+ */
+@Slf4j
+public class WenfuyiXmlUtil {
+
+    public static Map<String, String> xmlToMap(String xml) {
+        Map<String, String> map = Maps.newHashMap();
+        try {
+            Document doc = DocumentHelper.parseText(xml);
+            Element root = (Element) doc.selectSingleNode("//m_wsjl_xml/list");
+            findElement(root).forEach(i -> {
+                map.put(i.element("mc").getTextTrim(), i.element("nr").getTextTrim());
+            });
+        } catch (DocumentException e) {
+            e.printStackTrace();
+        }
+        return map;
+    }
+
+    public static Map<String, String> behospitalInfoXmlToMap(String xml) {
+
+        Map<String, String> map = Maps.newHashMap();
+
+        try {
+            xml = xml.replace("<?xml version=\"1.0\" encoding=\"UTF-8\"?>", "|<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
+            String[] a = xml.split("\\|");
+            for (String s : a) {
+                if (StringUtil.isNotBlank(s)) {
+                    Document doc = DocumentHelper.parseText(s);
+                    Element root = (Element) doc.selectSingleNode("//m_wsjl_xml/list");
+                    findElement(root).forEach(i -> {
+                        map.put(i.element("mc").getTextTrim(), i.element("nr").getTextTrim());
+                    });
+                }
+            }
+
+        } catch (DocumentException e) {
+            e.printStackTrace();
+        }
+        return map;
+    }
+
+    public static List<Element> findElement(Element element) {
+        List<Element> ret = Lists.newArrayList();
+        ((List<Element>) (element.elements())).forEach(i -> {
+            ret.add(i);
+        });
+        return ret;
+    }
+}

+ 5 - 1
dbanaly/src/main/java/com/lantone/qc/dbanaly/util/ModuleMappingUtil.java

@@ -61,7 +61,11 @@ public class ModuleMappingUtil {
         if (behospitalInfo != null) {
             String behDeptId = behospitalInfo.getBehDeptId();
             if (StringUtil.isNotBlank(behDeptId)) {
-                return getHtmlDataTypeModuleId(modeId + "-" + behDeptId);
+                String ret = getHtmlDataTypeModuleId(modeId + "-" + behDeptId + "-" + behospitalInfo.getSex());
+                if (StringUtil.isBlank(ret)) {
+                    return getHtmlDataTypeModuleId(modeId + "-" + behDeptId);
+                }
+                return ret;
             }
         }
         return null;

+ 2 - 2
dbanaly/src/main/resources/application-dev.yml

@@ -5,9 +5,9 @@ spring:
     druid:
       lantone:
         driver-class-name: com.mysql.jdbc.Driver
-        url: jdbc:mysql://192.168.2.121:3306/qc?useUnicode=true&characterEncoding=utf8&useSSL=false
+        url: jdbc:mysql://192.168.2.125:3307/qc?useUnicode=true&characterEncoding=utf8&useSSL=false
         username: root
-        password: QuGDHNG35r
+        password: LangT0ng@lt
         initial-size: 8
         min-idle: 1
         max-active: 20

+ 4 - 4
dbanaly/src/main/resources/application-test.yml

@@ -5,7 +5,7 @@ spring:
     druid:
       lantone:
         driver-class-name: com.mysql.jdbc.Driver
-        url: jdbc:mysql://192.168.2.241:3306/qc?useUnicode=true&characterEncoding=utf8&useSSL=false
+        url: jdbc:mysql://192.168.2.236:3306/stu?useUnicode=true&characterEncoding=utf8&useSSL=false
         username: root
         password: lantone
         initial-size: 8
@@ -26,9 +26,9 @@ spring:
         use-global-data-source-stat: true
   redis:
     database:
-      cache: 10 # cache索引
-      token: 10 # Token索引
-    host: 192.168.2.241  #Redis服务器地址
+      cache: 6 # cache索引
+      token: 6 # Token索引
+    host: 192.168.2.236  #Redis服务器地址
     port: 6379 # Redis服务器连接端口(本地环境端口6378,其他环境端口是6379)
     password: lantone # Redis服务器连接密码(默认为空)
     lettuce:

+ 1 - 1
kernel/pom.xml

@@ -169,7 +169,7 @@
                 </includes>
             </resource>
         </resources>
-        <finalName>qc-beilun-web</finalName>
+        <finalName>qc-web</finalName>
     </build>
 
 </project>

+ 1 - 5
kernel/src/main/java/com/lantone/qc/kernel/KernelApplication.java

@@ -20,11 +20,7 @@ import org.springframework.context.annotation.ComponentScan;
         "com.lantone.qc.kernel.structure",
         "com.lantone.qc.kernel.client",
         "com.lantone.qc.kernel.analysis",
-        "com.lantone.qc.kernel.catalogue.beilun",
-        "com.lantone.qc.kernel.catalogue.yiwu",
-        "com.lantone.qc.kernel.catalogue.xiamen",
-        "com.lantone.qc.kernel.catalogue.ywzxyy",
-        "com.lantone.qc.kernel.catalogue.ninghaiyiyi"
+        "com.lantone.qc.kernel.catalogue"
 })
 public class KernelApplication {
     public static void main(String[] args) {

+ 10 - 4
kernel/src/main/java/com/lantone/qc/kernel/analysis/QCAnalysis.java

@@ -36,7 +36,7 @@ public class QCAnalysis {
     SimilarityServiceClient similarityServiceClient;
 
     public OutputInfo anlysis(QueryVo queryVo) throws AIException, CatalogueException, Exception {
-        log.error("json:"+ FastJsonUtils.getBeanToJson(queryVo));
+        log.error("json:" + FastJsonUtils.getBeanToJson(queryVo));
         specialStorageUtil.getHospitalIdThreadLocal().set(queryVo.getHospitalId());
         specialStorageUtil.getBehospitalInfoThreadLocal().set(queryVo.getBehospitalInfo());
         OutputInfo outputInfo = new OutputInfo();
@@ -55,10 +55,16 @@ public class QCAnalysis {
         }
         long t3 = System.currentTimeMillis();
         for (Map.Entry<String, Map<String, String>> entry : inputInfo.getInputCatalogueMap().entrySet()) {
-            if (CatalogueUtil.qcCatalogueMap.get(queryVo.getCid() + "." + entry.getKey()) == null) {
-                continue;
+//            if (CatalogueUtil.qcCatalogueMap.get(queryVo.getCid() + "." + entry.getKey()) == null) {
+//                continue;
+//            }
+//            CatalogueUtil.qcCatalogueMap.get(queryVo.getCid() + "." + entry.getKey()).execute(inputInfo, outputInfo);
+            if (CatalogueUtil.qcCatalogueMap.get(queryVo.getCid() + "." + entry.getKey()) != null) {
+                CatalogueUtil.qcCatalogueMap.get(queryVo.getCid() + "." + entry.getKey()).execute(inputInfo, outputInfo);
+            } else if (CatalogueUtil.qcCatalogueMap.get(entry.getKey()) != null) {
+                CatalogueUtil.qcCatalogueMap.get(entry.getKey()).execute(inputInfo, outputInfo);
             }
-            CatalogueUtil.qcCatalogueMap.get(queryVo.getCid() + "." + entry.getKey()).execute(inputInfo, outputInfo);
+
         }
         //        inputInfo.getInputCatalogueMap().entrySet().parallelStream().forEach(entry -> {
         //            if (CatalogueUtil.qcCatalogueMap.get(entry.getKey()) != null) {

+ 7 - 2
kernel/src/main/java/com/lantone/qc/kernel/catalogue/QCCatalogue.java

@@ -97,8 +97,13 @@ public class QCCatalogue {
     private String className = this.getClass().getSimpleName();
 
     public QCCatalogue() {
-        String keyName = this.getClass().getName().substring(32);
-        keyName = keyName.substring(0, keyName.indexOf(".") + 1) + className;
+        String keyName = className;
+        String pathName = this.getClass().getName().substring(32);
+        String hospital = pathName.substring(0, pathName.indexOf(".") + 1);
+        if ("hospital.".equals(hospital)) {
+            String replace = pathName.replace(hospital, "");
+            keyName = replace.substring(0, replace.indexOf(".") + 1) + className;
+        }
         CatalogueUtil.qcCatalogueMap.put(keyName, this);
     }
 

+ 36 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/anesthesiarelated/ANES0672.java

@@ -0,0 +1,36 @@
+package com.lantone.qc.kernel.catalogue.anesthesiarelated;
+
+import com.lantone.qc.kernel.catalogue.QCCatalogue;
+import com.lantone.qc.kernel.util.CatalogueUtil;
+import com.lantone.qc.pub.model.InputInfo;
+import com.lantone.qc.pub.model.OutputInfo;
+import com.lantone.qc.pub.model.doc.AnesthesiaRelatedDoc;
+import com.lantone.qc.pub.util.ListUtil;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @ClassName : ANES0672
+ * @Description : 麻醉记录无术前诊断
+ * @Author : 胡敬
+ * @Date: 2020-03-30 10:01
+ */
+@Component
+public class ANES0672 extends QCCatalogue {
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        status.set("0");
+        List<AnesthesiaRelatedDoc> anesthesiaRelatedDocs = inputInfo.getAnesthesiaRelatedDocs();
+        if (ListUtil.isEmpty(anesthesiaRelatedDocs)) {
+            return;
+        }
+        for (AnesthesiaRelatedDoc anesthesiaRelatedDoc : anesthesiaRelatedDocs) {
+            Map<String, String> anesthesiaRelatedStructureMap = anesthesiaRelatedDoc.getStructureMap();
+            if (CatalogueUtil.isEmpty(anesthesiaRelatedStructureMap.get("术前诊断"))) {
+                status.set("-1");
+                return;
+            }
+        }
+    }
+}

+ 36 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/anesthesiarelated/ANES0673.java

@@ -0,0 +1,36 @@
+package com.lantone.qc.kernel.catalogue.anesthesiarelated;
+
+import com.lantone.qc.kernel.catalogue.QCCatalogue;
+import com.lantone.qc.kernel.util.CatalogueUtil;
+import com.lantone.qc.pub.model.InputInfo;
+import com.lantone.qc.pub.model.OutputInfo;
+import com.lantone.qc.pub.model.doc.AnesthesiaRelatedDoc;
+import com.lantone.qc.pub.util.ListUtil;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @ClassName : ANES0673
+ * @Description : 麻醉记录无拟施手术
+ * @Author : 胡敬
+ * @Date: 2020-03-30 11:01
+ */
+@Component
+public class ANES0673 extends QCCatalogue {
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        status.set("0");
+        List<AnesthesiaRelatedDoc> anesthesiaRelatedDocs = inputInfo.getAnesthesiaRelatedDocs();
+        if (ListUtil.isEmpty(anesthesiaRelatedDocs)) {
+            return;
+        }
+        for (AnesthesiaRelatedDoc anesthesiaRelatedDoc : anesthesiaRelatedDocs) {
+            Map<String, String> anesthesiaRelatedStructureMap = anesthesiaRelatedDoc.getStructureMap();
+            if (CatalogueUtil.isEmpty(anesthesiaRelatedStructureMap.get("拟施手术"))) {
+                status.set("-1");
+                return;
+            }
+        }
+    }
+}

+ 36 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/anesthesiarelated/ANES0674.java

@@ -0,0 +1,36 @@
+package com.lantone.qc.kernel.catalogue.anesthesiarelated;
+
+import com.lantone.qc.kernel.catalogue.QCCatalogue;
+import com.lantone.qc.kernel.util.CatalogueUtil;
+import com.lantone.qc.pub.model.InputInfo;
+import com.lantone.qc.pub.model.OutputInfo;
+import com.lantone.qc.pub.model.doc.AnesthesiaRelatedDoc;
+import com.lantone.qc.pub.util.ListUtil;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @ClassName : ANES0674
+ * @Description : 麻醉记录无手术后诊断
+ * @Author : 胡敬
+ * @Date: 2020-03-30 11:05
+ */
+@Component
+public class ANES0674 extends QCCatalogue {
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        status.set("0");
+        List<AnesthesiaRelatedDoc> anesthesiaRelatedDocs = inputInfo.getAnesthesiaRelatedDocs();
+        if (ListUtil.isEmpty(anesthesiaRelatedDocs)) {
+            return;
+        }
+        for (AnesthesiaRelatedDoc anesthesiaRelatedDoc : anesthesiaRelatedDocs) {
+            Map<String, String> anesthesiaRelatedStructureMap = anesthesiaRelatedDoc.getStructureMap();
+            if (CatalogueUtil.isEmpty(anesthesiaRelatedStructureMap.get("手术后诊断"))) {
+                status.set("-1");
+                return;
+            }
+        }
+    }
+}

+ 36 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/anesthesiarelated/ANES0675.java

@@ -0,0 +1,36 @@
+package com.lantone.qc.kernel.catalogue.anesthesiarelated;
+
+import com.lantone.qc.kernel.catalogue.QCCatalogue;
+import com.lantone.qc.kernel.util.CatalogueUtil;
+import com.lantone.qc.pub.model.InputInfo;
+import com.lantone.qc.pub.model.OutputInfo;
+import com.lantone.qc.pub.model.doc.AnesthesiaRelatedDoc;
+import com.lantone.qc.pub.util.ListUtil;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @ClassName : ANES0675
+ * @Description : 麻醉记录无手术名称
+ * @Author : 胡敬
+ * @Date: 2020-03-30 11:05
+ */
+@Component
+public class ANES0675 extends QCCatalogue {
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        status.set("0");
+        List<AnesthesiaRelatedDoc> anesthesiaRelatedDocs = inputInfo.getAnesthesiaRelatedDocs();
+        if (ListUtil.isEmpty(anesthesiaRelatedDocs)) {
+            return;
+        }
+        for (AnesthesiaRelatedDoc anesthesiaRelatedDoc : anesthesiaRelatedDocs) {
+            Map<String, String> anesthesiaRelatedStructureMap = anesthesiaRelatedDoc.getStructureMap();
+            if (CatalogueUtil.isEmpty(anesthesiaRelatedStructureMap.get("手术名称"))) {
+                status.set("-1");
+                return;
+            }
+        }
+    }
+}

+ 36 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/anesthesiarelated/ANES0676.java

@@ -0,0 +1,36 @@
+package com.lantone.qc.kernel.catalogue.anesthesiarelated;
+
+import com.lantone.qc.kernel.catalogue.QCCatalogue;
+import com.lantone.qc.kernel.util.CatalogueUtil;
+import com.lantone.qc.pub.model.InputInfo;
+import com.lantone.qc.pub.model.OutputInfo;
+import com.lantone.qc.pub.model.doc.AnesthesiaRelatedDoc;
+import com.lantone.qc.pub.util.ListUtil;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @ClassName : ANES0676
+ * @Description : 麻醉记录无麻醉方法
+ * @Author : 胡敬
+ * @Date: 2020-03-30 11:05
+ */
+@Component
+public class ANES0676 extends QCCatalogue {
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        status.set("0");
+        List<AnesthesiaRelatedDoc> anesthesiaRelatedDocs = inputInfo.getAnesthesiaRelatedDocs();
+        if (ListUtil.isEmpty(anesthesiaRelatedDocs)) {
+            return;
+        }
+        for (AnesthesiaRelatedDoc anesthesiaRelatedDoc : anesthesiaRelatedDocs) {
+            Map<String, String> anesthesiaRelatedStructureMap = anesthesiaRelatedDoc.getStructureMap();
+            if (CatalogueUtil.isEmpty(anesthesiaRelatedStructureMap.get("麻醉方法"))) {
+                status.set("-1");
+                return;
+            }
+        }
+    }
+}

+ 36 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/anesthesiarelated/ANES0677.java

@@ -0,0 +1,36 @@
+package com.lantone.qc.kernel.catalogue.anesthesiarelated;
+
+import com.lantone.qc.kernel.catalogue.QCCatalogue;
+import com.lantone.qc.kernel.util.CatalogueUtil;
+import com.lantone.qc.pub.model.InputInfo;
+import com.lantone.qc.pub.model.OutputInfo;
+import com.lantone.qc.pub.model.doc.AnesthesiaRelatedDoc;
+import com.lantone.qc.pub.util.ListUtil;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @ClassName : ANES0677
+ * @Description : 麻醉记录无施麻醉者
+ * @Author : 胡敬
+ * @Date: 2020-03-30 11:05
+ */
+@Component
+public class ANES0677 extends QCCatalogue {
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        status.set("0");
+        List<AnesthesiaRelatedDoc> anesthesiaRelatedDocs = inputInfo.getAnesthesiaRelatedDocs();
+        if (ListUtil.isEmpty(anesthesiaRelatedDocs)) {
+            return;
+        }
+        for (AnesthesiaRelatedDoc anesthesiaRelatedDoc : anesthesiaRelatedDocs) {
+            Map<String, String> anesthesiaRelatedStructureMap = anesthesiaRelatedDoc.getStructureMap();
+            if (CatalogueUtil.isEmpty(anesthesiaRelatedStructureMap.get("施麻醉者"))) {
+                status.set("-1");
+                return;
+            }
+        }
+    }
+}

+ 36 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/anesthesiarelated/ANES0678.java

@@ -0,0 +1,36 @@
+package com.lantone.qc.kernel.catalogue.anesthesiarelated;
+
+import com.lantone.qc.kernel.catalogue.QCCatalogue;
+import com.lantone.qc.kernel.util.CatalogueUtil;
+import com.lantone.qc.pub.model.InputInfo;
+import com.lantone.qc.pub.model.OutputInfo;
+import com.lantone.qc.pub.model.doc.AnesthesiaRelatedDoc;
+import com.lantone.qc.pub.util.ListUtil;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @ClassName : ANES0678
+ * @Description : 麻醉记录未记录尿量
+ * @Author : 胡敬
+ * @Date: 2020-03-30 11:05
+ */
+@Component
+public class ANES0678 extends QCCatalogue {
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        status.set("0");
+        List<AnesthesiaRelatedDoc> anesthesiaRelatedDocs = inputInfo.getAnesthesiaRelatedDocs();
+        if (ListUtil.isEmpty(anesthesiaRelatedDocs)) {
+            return;
+        }
+        for (AnesthesiaRelatedDoc anesthesiaRelatedDoc : anesthesiaRelatedDocs) {
+            Map<String, String> anesthesiaRelatedStructureMap = anesthesiaRelatedDoc.getStructureMap();
+            if (CatalogueUtil.isEmpty(anesthesiaRelatedStructureMap.get("尿量"))) {
+                status.set("-1");
+                return;
+            }
+        }
+    }
+}

+ 36 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/anesthesiarelated/ANES0679.java

@@ -0,0 +1,36 @@
+package com.lantone.qc.kernel.catalogue.anesthesiarelated;
+
+import com.lantone.qc.kernel.catalogue.QCCatalogue;
+import com.lantone.qc.kernel.util.CatalogueUtil;
+import com.lantone.qc.pub.model.InputInfo;
+import com.lantone.qc.pub.model.OutputInfo;
+import com.lantone.qc.pub.model.doc.AnesthesiaRelatedDoc;
+import com.lantone.qc.pub.util.ListUtil;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @ClassName : ANES0679
+ * @Description : 麻醉记录未记录出血量
+ * @Author : 胡敬
+ * @Date: 2020-03-30 11:05
+ */
+@Component
+public class ANES0679 extends QCCatalogue {
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        status.set("0");
+        List<AnesthesiaRelatedDoc> anesthesiaRelatedDocs = inputInfo.getAnesthesiaRelatedDocs();
+        if (ListUtil.isEmpty(anesthesiaRelatedDocs)) {
+            return;
+        }
+        for (AnesthesiaRelatedDoc anesthesiaRelatedDoc : anesthesiaRelatedDocs) {
+            Map<String, String> anesthesiaRelatedStructureMap = anesthesiaRelatedDoc.getStructureMap();
+            if (CatalogueUtil.isEmpty(anesthesiaRelatedStructureMap.get("出血量"))) {
+                status.set("-1");
+                return;
+            }
+        }
+    }
+}

+ 131 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0001.java

@@ -0,0 +1,131 @@
+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.Clinical;
+import com.lantone.qc.pub.model.entity.Diag;
+import com.lantone.qc.pub.model.entity.PD;
+import com.lantone.qc.pub.model.label.ChiefLabel;
+import com.lantone.qc.pub.util.StringUtil;
+import org.springframework.stereotype.Component;
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+
+
+/**
+ * @ClassName : BEH0001
+ * @Description : 症状缺少时间描述
+ * @Author : 楼辉荣
+ * @Date: 2020-03-06 17:28
+ */
+@Component
+public class BEH0001 extends QCCatalogue {
+
+    private List<String> containList = Arrays.asList("检查", "术后", "药物", "发现", "误服", "确诊", "经", "异常", "诊断"
+            , "示", "超", "伤", "术", "复查", "体检", "血透", "血液透析");
+
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        //主诉缺少主症状不提示信息
+        if (outputInfo != null && outputInfo.getResult() != null) {
+            Map<String, Object> outputMap = outputInfo.getResult().get("BEH0009");
+            if (outputMap != null && "-1".equals(outputMap.get("status"))) {
+                status.set("0");
+                return;
+            }
+        }
+
+        if (inputInfo.getBeHospitalizedDoc() == null) {
+            status.set("0");
+            return;
+        }
+        ChiefLabel chiefLabel = inputInfo.getBeHospitalizedDoc().getChiefLabel();
+        if (chiefLabel == null) {
+            status.set("0");
+            return;
+        }
+        String chiefText = chiefLabel.getText();
+        if (StringUtil.isBlank(chiefText)) {
+            status.set("0");
+            return;
+        }
+        // 暂时逻辑,BEH0009执行在BEH0001之前时可以撤销
+        boolean isExistence = true;
+        List<Clinical> clinicals = chiefLabel.getClinicals();
+        if (clinicals != null && clinicals.size() > 0) {
+            isExistence = false;
+        }
+        for (String word : containList) {
+            if (chiefText.contains(word)) {
+                isExistence = false;
+            }
+        }
+        List<Diag> diags = chiefLabel.getDiags();
+        if (diags != null && diags.size() > 0) {
+            for (Diag diag : diags) {
+                String hospitalDiagName = diag.getHospitalDiagName();
+                if (hospitalDiagName.contains("术后") || hospitalDiagName.contains("癌") ||
+                        hospitalDiagName.contains("瘤") || hospitalDiagName.contains("复诊")) {
+                    isExistence = false;
+                    break;
+                }
+            }
+        }
+        //主诉缺少主症状不提示信息
+        if (isExistence) {
+            status.set("0");
+            return;
+        }
+
+        if (StringUtil.isNotBlank(chiefText)) {
+            if (chiefText.contains("检查") || chiefText.contains("术后") || chiefText.contains("药物")
+                    || chiefText.contains("天") || chiefText.contains("周") || chiefText.contains("月")
+                    || chiefText.contains("时") || chiefText.contains("秒") || chiefText.contains("半年")
+                    || chiefText.contains("日") || chiefText.contains("今") || chiefText.contains("余年")
+                    || chiefText.contains("年") || chiefText.contains("分") || isDate(chiefText)) {
+                status.set("0");
+                return;
+            }
+        } else {
+            List<PD> pds = chiefLabel.getPds();
+            if (pds != null && pds.size() > 0) {
+                for (PD pd : pds) {
+                    String pdName = pd.getName();
+                    if (StringUtil.isNotBlank(pdName)) {
+                        if (pdName.contains("天") || pdName.contains("周") || pdName.contains("月")
+                                || pdName.contains("时") || pdName.contains("秒") || pdName.contains("半年")
+                                || pdName.contains("日") || pdName.contains("今") || pdName.contains("余年")
+                                || pdName.contains("年") || pdName.contains("分") || isDate(pdName)) {
+                            status.set("0");
+                            break;
+                        }
+                    }
+                }
+            }
+       /*     List<Clinical> clinicals = inputInfo.getBeHospitalizedDoc().getChiefLabel().getClinicals();
+            if (clinicals.size() > 0) {
+                for (Clinical clinical : clinicals) {
+                    String clinicalName = clinical.getName();
+                    List<PD> timestamp = clinical.getTimestamp();
+                    if (ListUtil.isEmpty(timestamp)) {
+                        if (StringUtils.isEmpty(info.get())) {
+                            info.set(clinicalName);
+                        } else {
+                            info.set(info.get() + "," + clinicalName);
+                        }
+                    }
+                }
+            }*/
+        }
+     /*   if (StringUtils.isNotEmpty(info.get())) {
+            status.set("-1");
+        }*/
+    }
+
+    private boolean isDate(String pdName) {
+        String regex = "[0-9]{4}.?[0-9]{2}.?[0-9]{2}";
+        return pdName.matches(regex);
+    }
+}

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

@@ -0,0 +1,125 @@
+package com.lantone.qc.kernel.catalogue.behospitalized;
+
+import com.alibaba.fastjson.JSONArray;
+import com.lantone.qc.dbanaly.util.KernelConstants;
+import com.lantone.qc.dbanaly.util.SpecialStorageUtil;
+import com.lantone.qc.kernel.catalogue.QCCatalogue;
+import com.lantone.qc.kernel.client.ChiefPresentSimilarityServiceClient;
+import com.lantone.qc.kernel.structure.ai.ModelAI;
+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.Clinical;
+import com.lantone.qc.pub.model.entity.Diag;
+import com.lantone.qc.pub.model.label.ChiefLabel;
+import com.lantone.qc.pub.model.label.DiagLabel;
+import com.lantone.qc.pub.util.StringUtil;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+import java.util.Map;
+
+
+/**
+ * @ClassName : BEH0002
+ * @Description : 主诊断与主诉不符
+ * @Author : 楼辉荣
+ * @Date: 2020-03-06 17:28
+ */
+@Component
+public class BEH0002 extends QCCatalogue {
+    @Autowired
+    private SpecialStorageUtil specialStorageUtil;
+    @Autowired
+    ChiefPresentSimilarityServiceClient chiefPresentSimilarityServiceClient;
+
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        BeHospitalizedDoc beHospitalizedDoc = inputInfo.getBeHospitalizedDoc();
+        if (beHospitalizedDoc == null) {
+            status.set("0");
+            return;
+        }
+        boolean bool = false;
+        ChiefLabel chiefLabel = beHospitalizedDoc.getChiefLabel();
+        DiagLabel initialDiagLabel = beHospitalizedDoc.getInitialDiagLabel();
+        if (chiefLabel == null || initialDiagLabel == null) {
+            status.set("0");
+            return;
+        }
+        List<Diag> chiefDiags = chiefLabel.getDiags();
+        List<Diag> diags = initialDiagLabel.getDiags();
+        if (chiefDiags.size() > 0) {
+            for (Diag diag : chiefDiags) {
+                String hospitalDiagName = diag.getHospitalDiagName();
+                if (hospitalDiagName.contains("术后") || hospitalDiagName.contains("癌") ||
+                        hospitalDiagName.contains("瘤") || hospitalDiagName.contains("复诊")) {
+                    status.set("0");
+                    break;
+                }
+                {
+                    bool = true;
+                }
+            }
+        } else {
+            bool = true;
+        }
+        if (bool) {
+            String firstDiag = diags.get(0).getName();
+            String firstHDiag = diags.get(0).getHospitalDiagName();
+            String mainDiag = StringUtil.isBlank(firstHDiag) ? firstDiag : firstHDiag;
+            List<String> symptoms = null;
+            //Map<String, String> hostpital_standDiag = specialStorageUtil.getJsonStringValue(KernelConstants.HOSPITAL_DIAG_MAP);
+            //if (!hostpital_standDiag.containsKey(mainDiag)) {
+            //    status.set("0");
+            //    return;
+            //}
+            Map<String, Map<String, Object>> diagMap = specialStorageUtil.getJsonStringValue(KernelConstants.CONCEPT_DIAG_PROPERTY_MAP);
+            Map<String, Object> map = (Map<String, Object>) diagMap.get(mainDiag);
+            if (map != null && map.size() > 0) {
+                symptoms = (List<String>) map.get("symptoms");
+            }
+            if (symptoms == null) {
+                status.set("0");
+                return;
+            }
+            List<Clinical> clinicals = inputInfo.getBeHospitalizedDoc().getChiefLabel().getClinicals();
+            if (clinicals != null && clinicals.size() > 0) {
+                String firstClinical = clinicals.get(0).getName();
+                /* 主诉现病史相似度算法接口 */
+                ModelAI modelAI = new ModelAI();
+                JSONArray jsonArray = modelAI.loadChiefPresentSimilarAI(firstClinical, symptoms, false
+                        , "chief_present", chiefPresentSimilarityServiceClient);
+                if (jsonArray.size() == 2) {
+                    /* 相似度最高症状 */
+                    String symptom = jsonArray.getString(0);
+                    /* 相似度分数 */
+                    double likeRate = jsonArray.getDoubleValue(1);
+                    if (likeRate > 0.9) {
+                        status.set("0");
+                    } else {
+                        status.set("-1");
+                        info.set(symptom);
+                    }
+                }
+
+                //if (symptoms.contains(firstClinical)) {
+                //    status.set("0");
+                //}
+                //for (Clinical clinical : clinicals) {
+                //    String clinicalName = clinical.getName();
+                //    if (symptoms != null && !symptoms.contains(clinicalName)) {
+                //        if (StringUtils.isEmpty(info.get())) {
+                //            info.set(clinicalName);
+                //        } else {
+                //            info.set(info.get() + "," + clinicalName);
+                //        }
+                //    }
+                //}
+            }
+            //if (StringUtils.isEmpty(info.get())) {
+            //    status.set("0");
+            //}
+        }
+    }
+}

+ 35 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0003.java

@@ -0,0 +1,35 @@
+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;
+
+
+/**
+ * @ClassName : BEH0003
+ * @Description : 主诉字数超过20个字
+ * @Author : 楼辉荣
+ * @Date: 2020-03-06 17:28
+ */
+@Component
+public class BEH0003 extends QCCatalogue {
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        if (inputInfo.getBeHospitalizedDoc() == null || inputInfo.getBeHospitalizedDoc().getChiefLabel() == null) {
+            status.set("0");
+            return;
+        }
+        String chiefText = inputInfo.getBeHospitalizedDoc().getChiefLabel().getText();
+        if (StringUtil.isBlank(chiefText)) {
+            status.set("0");
+            return;
+        }
+        if (StringUtil.isNotBlank(chiefText)) {
+            int chiefTextLength = chiefText.replaceAll("[\\p{Punct}\\pP]", "").length();
+            if (chiefTextLength <= 20) {
+                status.set("0");
+            }
+        }
+    }
+}

+ 41 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0004.java

@@ -0,0 +1,41 @@
+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 org.apache.commons.lang3.StringUtils;
+import org.springframework.stereotype.Component;
+
+import java.util.Map;
+
+
+/**
+ * @ClassName : BEH0004
+ * @Description : 入院记录个人基本信息缺项或信息错误
+ * @Author : 楼辉荣
+ * @Date: 2020-03-06 17:28
+ */
+@Component
+public class BEH0004 extends QCCatalogue {
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+
+        status.set("0");
+        if(inputInfo.getBeHospitalizedDoc() == null){
+            return;
+        }
+        Map<String, String> structureMap = inputInfo.getBeHospitalizedDoc().getStructureMap();
+        if(structureMap != null){
+            String basePassage = structureMap.get("个人基本信息");
+            if(StringUtils.isNotEmpty(basePassage)){
+                String[] baseFilds = basePassage.split(",");
+                for (String fild:baseFilds) {
+                    if(StringUtils.isBlank(structureMap.get(fild))){
+                        status.set("-1");
+                        break;
+                    }
+                }
+            }
+        }
+
+    }
+}

+ 70 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0005.java

@@ -0,0 +1,70 @@
+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.entity.PD;
+import com.lantone.qc.pub.model.label.ChiefLabel;
+import com.lantone.qc.pub.util.StringUtil;
+import org.springframework.stereotype.Component;
+
+import java.util.ArrayList;
+import java.util.List;
+
+
+/**
+ * @ClassName : BEH0005
+ * @Description :主诉症状时间描述前后不合理
+ * @Author : 楼辉荣
+ * @Date: 2020-03-06 17:28
+ */
+@Component
+public class BEH0005 extends QCCatalogue {
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        status.set("0");
+        if (inputInfo.getBeHospitalizedDoc() == null) {
+            return;
+        }
+        List<Integer> timeIndex = new ArrayList<>();
+        ChiefLabel chiefLabel = inputInfo.getBeHospitalizedDoc().getChiefLabel();
+        if (chiefLabel == null) {
+            return;
+        }
+        List<PD> pds = chiefLabel.getPds();
+        String chiefText = chiefLabel.getText();
+        if (StringUtil.isNotBlank(chiefText)) {
+            chiefText = chiefText.replace("月经", "");/* 月经这个词会影响逻辑判断,这里把月经这个词去除 */
+            if (chiefText.contains("检查") || chiefText.contains("术后") || chiefText.contains("药物")) {
+                return;
+            } else {
+                List<String> words = Lists.newArrayList("年", "月", "周", "天", "日", "时", "分");
+                String name;
+                for (PD pd : pds) {
+                    name = pd.getName();
+                    if (StringUtil.isBlank(name)) {
+                        continue;
+                    }
+                    for (String word : words) {
+                        if (name.contains(word)) {
+                            timeIndex.add(chiefText.indexOf(word));
+                            break;
+                        }
+                    }
+
+                }
+            }
+            if (timeIndex.size() > 0) {
+                int min = timeIndex.get(0);
+                for (Integer data : timeIndex) {
+                    if (data < min) {
+                        min = data;
+                    }
+                }
+                if (min != timeIndex.get(0)) {
+                    status.set("-1");
+                }
+            }
+        }
+    }
+}

+ 122 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0006.java

@@ -0,0 +1,122 @@
+package com.lantone.qc.kernel.catalogue.behospitalized;
+
+import com.lantone.qc.kernel.catalogue.QCCatalogue;
+import com.lantone.qc.kernel.util.CatalogueUtil;
+import com.lantone.qc.pub.model.InputInfo;
+import com.lantone.qc.pub.model.OutputInfo;
+import com.lantone.qc.pub.model.entity.PD;
+import com.lantone.qc.pub.model.label.ChiefLabel;
+import com.lantone.qc.pub.util.StringUtil;
+import org.springframework.stereotype.Component;
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+
+
+/**
+ * @ClassName : BEH0006
+ * @Description :主诉症状缺少近期时间描述
+ * @Author : 楼辉荣
+ * @Date: 2020-03-06 17:28
+ */
+@Component
+public class BEH0006 extends QCCatalogue {
+    private List<String> containList = Arrays.asList("半年", "术后");
+
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        if (outputInfo != null && outputInfo.getResult() != null) {
+            Map<String, Object> outputMap = outputInfo.getResult().get("BEH0009");
+            if (outputMap != null && "-1".equals(outputMap.get("status"))) {
+                status.set("0");
+                return;
+            }
+        }
+        if (inputInfo.getBeHospitalizedDoc() == null) {
+            status.set("0");
+            return;
+        }
+        ChiefLabel chiefLabel = inputInfo.getBeHospitalizedDoc().getChiefLabel();
+        if (chiefLabel == null || StringUtil.isBlank(chiefLabel.getText())) {
+            status.set("0");
+            return;
+        }
+//        List<Clinical> clinicalList = chiefLabel.getClinicals();
+//        boolean flag = true;
+//        // 主诉症状不超过1年就不报错,单位不包含“年”
+//        if (ListUtil.isNotEmpty(clinicalList)) {
+//            for (Clinical c : clinicalList) {
+//                List<PD> pds = c.getTimestamp();
+//                if (ListUtil.isNotEmpty(pds)) {
+//                    for (PD pd : pds) {
+//                        if (StringUtil.isNotBlank(pd.getName()) &&
+//                                pd.getName().contains("年") && !"半年".equals(pd.getName())) {
+//                            flag = false;
+//                            break;
+//                        }
+//                    }
+//                }
+//            }
+//            if (flag) {
+//                status.set("0");
+//                return;
+//            }
+//        }
+        String chiefText = chiefLabel.getText();
+        if (StringUtil.isNotBlank(chiefText)) {
+            for (String fild : containList) {
+                if (chiefText.contains(fild)) {
+                    status.set("0");
+                    return;
+                }
+            }
+            List<PD> pds = chiefLabel.getPds();
+            if (pds != null && pds.size() > 0) {
+                if (pds.size() == 2) {
+                    status.set("0");
+                    return;
+                }
+                for (PD pd : pds) {
+                    String pdName = pd.getName();
+                    if (!CatalogueUtil.isEmpty(pdName)) {
+                        if (pdName.contains("天") || pdName.contains("周") || pdName.contains("月")
+                                || pdName.contains("时") || pdName.contains("半年") || pdName.contains("秒")
+                                || pdName.contains("分") || pdName.contains("日") || pdName.contains("今")
+                                || pdName.contains("1年") || pdName.contains("一年")) {
+                            status.set("0");
+                            break;
+                        }
+                    }
+                }
+            } else {
+                if (StringUtil.isNotBlank(chiefLabel.getText())) {
+                    status.set("0");
+                    return;
+                }
+            }
+        }
+            /*List<Clinical> clinicals = chiefLabel.getClinicals();
+            if(clinicals.size()>0){
+                for (Clinical clinical:clinicals) {
+                    List<PD> timestamp = clinical.getTimestamp();
+                    if(timestamp != null){
+                        for (PD pd:timestamp) {
+                            if(!CatalogueUtil.isEmpty(pd.getName())){
+                                if(pd.getName().contains("天") || pd.getName().contains("周")|| pd.getName().contains("月")
+                                        || pd.getName().contains("时") || pd.getName().contains("半年") || pd.getName().contains("秒")
+                                        || pd.getName().contains("日")|| pd.getName().contains("今")){
+                                    status.set("0");
+                                    break;
+                                }
+                            }
+                        }
+                        if(status.get().equals("0")){
+                            break;
+                        }
+                    }
+                }
+            }else {
+                status.set("0");
+            }*/
+    }
+}

+ 66 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0007.java

@@ -0,0 +1,66 @@
+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.Clinical;
+import com.lantone.qc.pub.model.entity.PD;
+import com.lantone.qc.pub.model.label.ChiefLabel;
+import com.lantone.qc.pub.util.StringUtil;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+
+
+/**
+ * @ClassName : BEH0007
+ * @Description :主诉症状时间描述模糊
+ * 主诉中不能出现数天,数月,数年等带“数”字这种描述,如果出现,均视为模糊不清
+ * @Author : 楼辉荣
+ * @Date: 2020-03-06 17:28
+ */
+@Component
+public class BEH0007 extends QCCatalogue {
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        if (inputInfo.getBeHospitalizedDoc() == null) {
+            status.set("0");
+            return;
+        }
+        ChiefLabel chiefLabel = inputInfo.getBeHospitalizedDoc().getChiefLabel();
+        if (chiefLabel == null) {
+            status.set("0");
+            return;
+        }
+        String chiefText = chiefLabel.getText();
+        if (StringUtil.isBlank(chiefText)) {
+            status.set("0");
+            return;
+        }
+        if (StringUtil.isNotBlank(chiefText) && (chiefText.contains("检查") || chiefText.contains("术后") || chiefText.contains("药物"))) {
+            status.set("0");
+        } else {
+            List<Clinical> clinicals = chiefLabel.getClinicals();
+            if (clinicals != null && clinicals.size() > 0) {
+                Clinical clinical = clinicals.get(0);
+                List<PD> timestamp = clinical.getTimestamp();
+                if (timestamp.size() > 0) {
+                    for (PD pd : timestamp) {
+                        String value = pd.getValue();
+                        String unit = pd.getUnit();
+                        if (StringUtils.isEmpty(unit) && value.contains("数")) {
+                            status.set("-1");
+                            break;
+                        } else {
+                            status.set("0");
+                        }
+                    }
+                } else {
+                    status.set("0");
+                }
+            } else {
+                status.set("0");
+            }
+        }
+    }
+}

+ 43 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0008.java

@@ -0,0 +1,43 @@
+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.Clinical;
+import com.lantone.qc.pub.model.label.ChiefLabel;
+import com.lantone.qc.pub.util.StringUtil;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+
+
+/**
+ * @ClassName : BEH0008
+ * @Description :主诉症状超过3个
+ * @Author : 楼辉荣
+ * @Date: 2020-03-06 17:28
+ */
+@Component
+public class BEH0008 extends QCCatalogue {
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        if (inputInfo.getBeHospitalizedDoc() == null) {
+            status.set("0");
+            return;
+        }
+        ChiefLabel chiefLabel = inputInfo.getBeHospitalizedDoc().getChiefLabel();
+        if (chiefLabel == null) {
+            status.set("0");
+            return;
+        }
+        String chiefText = chiefLabel.getText();
+        if (StringUtil.isBlank(chiefText)) {
+            status.set("0");
+            return;
+        }
+        List<Clinical> clinicals = chiefLabel.getClinicals();
+        if (clinicals != null && clinicals.size() <= 3) {
+            status.set("0");
+        }
+
+    }
+}

+ 67 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0009.java

@@ -0,0 +1,67 @@
+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.Clinical;
+import com.lantone.qc.pub.model.entity.Diag;
+import com.lantone.qc.pub.model.label.ChiefLabel;
+import com.lantone.qc.pub.util.StringUtil;
+import org.springframework.stereotype.Component;
+
+import java.util.Arrays;
+import java.util.List;
+
+
+/**
+ * @ClassName : BEH0009
+ * @Description :主诉缺少主症状
+ * @Author : 楼辉荣
+ * @Date: 2020-03-06 17:28
+ */
+@Component
+public class BEH0009 extends QCCatalogue {
+    private List<String> containList = Arrays.asList("检查", "术后", "药物", "发现", "误服", "确诊", "经", "异常", "诊断"
+            , "示", "超", "伤", "术", "复查", "体检", "血透", "血液透析","孕");
+
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        if (inputInfo.getBeHospitalizedDoc() == null) {
+            status.set("0");
+            return;
+        }
+        ChiefLabel chiefLabel = inputInfo.getBeHospitalizedDoc().getChiefLabel();
+        if (chiefLabel == null) {
+            status.set("0");
+            return;
+        }
+        String chiefText = chiefLabel.getText();
+        if (StringUtil.isBlank(chiefText)) {
+            status.set("0");
+            return;
+        }
+        if (StringUtil.isNotBlank(chiefText)) {
+            for (String word : containList) {
+                if (chiefText.contains(word)) {
+                    status.set("0");
+                    return;
+                }
+            }
+            List<Clinical> clinicals = chiefLabel.getClinicals();
+            if (clinicals != null && clinicals.size() > 0) {
+                status.set("0");
+                return;
+            }
+            List<Diag> diags = chiefLabel.getDiags();
+            if (diags != null && diags.size() > 0) {
+                for (Diag diag : diags) {
+                    String hospitalDiagName = diag.getHospitalDiagName();
+                    if (hospitalDiagName.contains("术后") || hospitalDiagName.contains("癌") ||
+                            hospitalDiagName.contains("瘤") || hospitalDiagName.contains("复诊")) {
+                        status.set("0");
+                        break;
+                    }
+                }
+            }
+        }
+    }
+}

+ 73 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0010.java

@@ -0,0 +1,73 @@
+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.ChiefLabel;
+import com.lantone.qc.pub.util.StringUtil;
+import org.springframework.stereotype.Component;
+
+import java.util.Arrays;
+import java.util.List;
+
+
+/**
+ * @ClassName : BEH0010
+ * @Description : 主诉中出现诊断名称(病理确诊:如肿瘤疾病、再入院除外)
+ * @Author : 楼辉荣
+ * @Date: 2020-03-06 17:28
+ */
+@Component
+public class BEH0010 extends QCCatalogue {
+    private List<String> containList = Arrays.asList("癌", "瘤", "复诊", "术后", "化疗后", "发现", "体检", "检查", "确诊"
+            , "诊断", "复查", "复发", "示", "超", "CT", "血透", "血液透析");
+
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        status.set("0");
+        if (inputInfo.getBeHospitalizedDoc() == null) {
+            return;
+        }
+        ChiefLabel chiefLabel = inputInfo.getBeHospitalizedDoc().getChiefLabel();
+        if (chiefLabel == null) {
+            status.set("0");
+            return;
+        }
+        String chiefText = chiefLabel.getText();
+        if (StringUtil.isNotBlank(chiefText)) {
+            for (String word : containList) {
+                if (chiefText.contains(word)) {
+                    status.set("0");
+                    return;
+                }
+            }
+        }
+        List<Diag> diags = chiefLabel.getDiags();
+        /*
+        if (diags != null && diags.size() > 0) {
+            Iterator<Diag> diagIterator = diags.iterator();
+            while (diagIterator.hasNext()) {
+                Diag diag = diagIterator.next();
+                String diagName = diag.getHospitalDiagName();
+                for (String word: containList) {
+                    if (diagName.contains(word)){
+                        diagIterator.remove();
+                        break;
+                    }
+                }
+            }
+        }
+         */
+        if (diags != null && diags.size() > 0) {
+            status.set("-1");
+            for (Diag diag : diags) {
+                if (StringUtil.isEmpty(info.get())) {
+                    info.set(diag.getHospitalDiagName());
+                } else {
+                    info.set(info.get() + "," + diag.getHospitalDiagName());
+                }
+            }
+        }
+
+    }
+}

+ 242 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0011.java

@@ -0,0 +1,242 @@
+package com.lantone.qc.kernel.catalogue.behospitalized;
+
+import com.alibaba.fastjson.JSONArray;
+import com.lantone.qc.kernel.catalogue.QCCatalogue;
+import com.lantone.qc.kernel.client.ChiefPresentSimilarityServiceClient;
+import com.lantone.qc.kernel.structure.ai.ModelAI;
+import com.lantone.qc.kernel.util.CatalogueUtil;
+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.entity.GeneralDesc;
+import com.lantone.qc.pub.model.label.DiagLabel;
+import com.lantone.qc.pub.model.label.PastLabel;
+import com.lantone.qc.pub.model.label.PresentLabel;
+import com.lantone.qc.pub.util.StringUtil;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.stream.Collectors;
+
+/**
+ * @ClassName : BEH0011
+ * @Description : 初步诊断不完整
+ * 原逻辑 --初步诊断没有既往史里的慢性疾病
+ * 现逻辑 --检查现病史中一般情况之后的疾病名称,既往史中的疾病名称是否都在初步诊断里
+ * @Author : 楼辉荣
+ * @Date: 2020-03-06 17:28
+ */
+@Component
+public class BEH0011 extends QCCatalogue {
+    //    @Autowired
+    //    private SpecialStorageUtil specialStorageUtil;
+    @Autowired
+    ChiefPresentSimilarityServiceClient chiefPresentSimilarityServiceClient;
+
+    private List<String> containList = Arrays.asList("脑萎缩", "慢性", "纤颤", "高血压", "糖尿", "冠状", "冠心病", "支架", "起搏器", "房颤", "风湿");
+    private List<String> filterList = Arrays.asList("心脏病", "低血糖", "急性", ";");
+
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        if (inputInfo.getBeHospitalizedDoc() == null) {
+            status.set("0");
+            return;
+        }
+        Map<String, String> structureMap = inputInfo.getBeHospitalizedDoc().getStructureMap();
+        String age = structureMap.get("年龄");
+        if (StringUtil.isNotBlank(age)) {
+            if (age.contains("月") || age.contains("天")) {
+                status.set("0");
+                return;
+            }
+            age = age.replaceAll("岁", "");
+            try {
+                if (Integer.parseInt(age) < 10) {
+                    status.set("0");
+                    return;
+                }
+            } catch (Exception e) {
+                System.out.println("BEH0011--解析age出错:" + "->" + age);
+            }
+        }
+        PresentLabel presentLabel = inputInfo.getBeHospitalizedDoc().getPresentLabel();
+        DiagLabel initialDiagLabel = inputInfo.getBeHospitalizedDoc().getInitialDiagLabel();
+        /*补充诊断*/
+        DiagLabel suppleDiagLabel = inputInfo.getBeHospitalizedDoc().getSuppleDiagLabel();
+        PastLabel pastLabel = inputInfo.getBeHospitalizedDoc().getPastLabel();
+        if (initialDiagLabel == null) {
+            status.set("0");
+            return;
+        }
+        Set<String> presentPastDiags = new HashSet<>();
+        if (presentLabel != null) {
+            List<GeneralDesc> generals = presentLabel.getGenerals();
+            if (generals.size() > 0) {
+                String presentText = presentLabel.getText();
+                List<Diag> presentDiags = presentLabel.getDiags();
+                /* 取现病史中一般情况之后的疾病名称 */
+                if (StringUtil.isNotBlank(presentText) && presentDiags.size() > 0) {
+                    String lastGeneral = generals.get(generals.size() - 1).getName();
+                    int lastGeneralIndex = presentText.indexOf(lastGeneral);
+                    for (Diag presentDiag : presentDiags) {
+                        if (presentDiag.getNegative() != null || presentDiag.getHospitalDiagName().contains("否认")) {
+                            continue;
+                        }
+                        /* 现病史中一般情况之后的疾病名称 */
+                        if (presentText.indexOf(presentDiag.getHospitalDiagName()) > lastGeneralIndex) {
+                            if (isContains(presentDiag.getHospitalDiagName()) && !isFilter(presentDiag.getHospitalDiagName())) {
+                                presentPastDiags.add(presentDiag.getHospitalDiagName());
+                            }
+                        }
+                    }
+                }
+            }
+        }
+        /* 取既往史中疾病名称 */
+        if (pastLabel != null && StringUtils.isNotEmpty(pastLabel.getText())) {
+            List<Diag> pastDiags = pastLabel.getDiags();
+            addDiagHospitalName(presentPastDiags, pastDiags);
+        } else {            //结构化数据
+            List<Diag> pastDiags = new ArrayList<>();
+
+//            Map<String, String> structureMap = inputInfo.getBeHospitalizedDoc().getStructureMap();
+            String a1 = structureMap.get("高血压");
+            if (StringUtils.isNotEmpty(a1) && !"否认".equals(a1)) {
+                Diag diag = new Diag();
+                diag.setName("高血压");
+                diag.setHospitalDiagName("高血压");
+                if (!isHave(presentPastDiags, "高血压")) {
+                    pastDiags.add(diag);
+                }
+            }
+            a1 = structureMap.get("糖尿病");
+            if (StringUtils.isNotEmpty(a1) && !"否认".equals(a1)) {
+                Diag diag = new Diag();
+                diag.setName("糖尿病");
+                diag.setHospitalDiagName("糖尿病");
+                if (!isHave(presentPastDiags, "糖尿病")) {
+                    pastDiags.add(diag);
+                }
+            }
+            addDiagHospitalName(presentPastDiags, pastDiags);
+        }
+        /* 取初步诊断中疾病名称 */
+        List<String> initDiags = new ArrayList<>();
+        List<Diag> initialDiagDiags = initialDiagLabel.getDiags();
+        addInitDiagHospitalName(initDiags, initialDiagDiags);
+        if(suppleDiagLabel !=null){
+            List<Diag> suppleDiagDiags = suppleDiagLabel.getDiags();
+            addInitDiagHospitalName(initDiags, suppleDiagDiags);
+        }
+        initDiags = initDiags.stream().distinct().collect(Collectors.toList());
+
+        String infoStr = "";
+        int matchSum = 0;
+        ModelAI modelAI = new ModelAI();
+        for (String presentPastDiag : presentPastDiags) {
+            JSONArray jsonArray = modelAI.loadChiefPresentSimilarAI(presentPastDiag, initDiags, false
+                    , "diagnose", chiefPresentSimilarityServiceClient);
+            if (jsonArray.size() == 2) {
+                /* 相似度最高症状 */
+                String symptom = jsonArray.getString(0);
+                /* 相似度分数 */
+                double likeRate = jsonArray.getDoubleValue(1);
+                if (likeRate > 0.80) {
+                    matchSum++;
+                } else {
+                    infoStr = CatalogueUtil.concatInfo(infoStr, presentPastDiag);
+                }
+            } else {
+                infoStr = CatalogueUtil.concatInfo(infoStr, presentPastDiag);
+            }
+        }
+        info.set(infoStr);
+        if (matchSum == presentPastDiags.size()) {
+            status.set("0");
+        }
+        /*
+        if (initDiags.containsAll(presentPastDiags)) {
+            status.set("0");
+        }
+         */
+    }
+
+    private void addDiagHospitalName(Set<String> presentPastDiag, List<Diag> pastDiags) {
+        for (Diag pastDiag : pastDiags) {
+            if (pastDiag.getNegative() != null) {
+                continue;
+            }
+            if (isContains(pastDiag.getHospitalDiagName()) && !isFilter(pastDiag.getHospitalDiagName())) {
+                presentPastDiag.add(pastDiag.getHospitalDiagName());
+            }
+        }
+    }
+
+    private void addInitDiagHospitalName(List<String> presentPastDiag, List<Diag> pastDiags) {
+        for (Diag pastDiag : pastDiags) {
+            if (pastDiag.getNegative() != null) {
+                continue;
+            }
+            presentPastDiag.add(pastDiag.getHospitalDiagName());
+        }
+    }
+
+    private boolean isHave(Set<String> presentDiag, String diagName) {
+        for (String haveDiag : presentDiag) {
+            if (haveDiag.contains(diagName) || diagName.contains(haveDiag)) {
+                return true;
+            }
+        }
+        return false;
+    }
+
+    private boolean isContains(String diagName) {
+        for (String c : containList) {
+            if (diagName.contains(c)) {
+                return true;
+            }
+        }
+        return false;
+    }
+
+    private boolean isFilter(String diagName) {
+        for (String c : filterList) {
+            if (diagName.contains(c)) {
+                return true;
+            }
+        }
+        return false;
+    }
+    /* 原逻辑
+    Map<String, Map<String, Object>> diagMap = specialStorageUtil.getJsonStringValue(KernelConstants.CONCEPT_DIAG_PROPERTY_MAP);
+    String initDiagText = CatalogueUtil.removeSpecialChar(initialDiagLabel.getText());
+        if (pastLabel.getDiags() != null) {
+            List<Diag> diags = pastLabel.getDiags().stream().filter(diag -> diag.getNegative() == null).collect(Collectors.toList());
+            List<String> initDiags = Arrays.asList(initDiagText.split(","));
+            if (diags.size() > 0) {
+                for (Diag diag : diags) {
+                    Map<String, Object> map = (Map<String, Object>) diagMap.get(diag.getName());
+                    if (map != null && map.size() > 0) {
+                        String chronic = (String) map.get("chronic");//1是慢病
+                        if ("1".equals(chronic) && !initDiags.contains(diag.getName())) {
+                            if (StringUtils.isEmpty(info.get())) {
+                                info.set(diag.getName());
+                            } else {
+                                info.set(info.get() + "," + diag.getName());
+                            }
+                        }
+                    }
+                }
+            }
+        }
+        if (StringUtils.isEmpty(info.get())) {
+            status.set("0");
+        }
+     */
+}

+ 79 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0012.java

@@ -0,0 +1,79 @@
+package com.lantone.qc.kernel.catalogue.behospitalized;
+
+import com.lantone.qc.dbanaly.util.KernelConstants;
+import com.lantone.qc.dbanaly.util.SpecialStorageUtil;
+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 org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+
+
+/**
+ * @ClassName : BEH0012
+ * @Description :  入院诊断名称不标准
+ * 取redis中hospital_concept_diag_map为key的map
+ * @Author : 楼辉荣
+ * @Date: 2020-03-06 17:28
+ */
+@Component
+public class BEH0012 extends QCCatalogue {
+    private static String[] strings = { "2型糖尿病" };
+    @Autowired
+    private SpecialStorageUtil specialStorageUtil;
+
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        if (inputInfo.getBeHospitalizedDoc() == null) {
+            status.set("0");
+            return;
+        }
+        List<String> diags_out = new ArrayList<>();
+        Map<String, String> hostpital_standDiag = specialStorageUtil.getJsonStringValue(KernelConstants.HOSPITAL_DIAG_MAP);
+        if (hostpital_standDiag == null) {
+            status.set("0");
+            return;
+        }
+        List<Diag> diags = null;
+        if (inputInfo.getBeHospitalizedDoc().getInitialDiagLabel() != null) {
+            diags = inputInfo.getBeHospitalizedDoc().getInitialDiagLabel().getDiags();
+        }
+        if (diags != null && diags.size() > 0) {
+            for (Diag diag : diags) {
+                List<String> disList = Arrays.asList(strings);
+                for (String diagSplit : diag.getHospitalDiagName().split("、")) {
+                    if ("ACT".equals(diagSplit)) {
+                        continue;
+                    }
+                    String hospitalDiagName = diagSplit.trim().replace("待查", "").replace("?", "").replace("?", "");
+                    if (hospitalDiagName.contains("伴")) {
+                        hospitalDiagName = hospitalDiagName.substring(0, hospitalDiagName.indexOf("伴"));
+                    }
+                    if (hospitalDiagName.length() > 15) {
+                        continue;
+                    }
+                    if (!disList.contains(hospitalDiagName)) {
+                        hospitalDiagName = hospitalDiagName.replaceAll("^[0-9]", "");
+                    }
+                    if (!hostpital_standDiag.containsKey(hospitalDiagName)) {
+                        diags_out.add(hospitalDiagName);
+                    }
+                }
+            }
+            if (diags_out.size() > 0) {
+                info.set(diags_out.toString().replace("[", "").replace("]", ""));
+            } else {
+                status.set("0");
+            }
+        } else {
+            status.set("0");
+        }
+
+
+    }
+}

+ 82 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0013.java

@@ -0,0 +1,82 @@
+package com.lantone.qc.kernel.catalogue.behospitalized;
+
+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.model.doc.BeHospitalizedDoc;
+import com.lantone.qc.pub.model.entity.Clinical;
+import com.lantone.qc.pub.model.label.PastLabel;
+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.List;
+
+
+/**
+ * @ClassName : BEH0013
+ * @Description :  现病史缺少有鉴别意义的阴性症状
+ * @Author : 楼辉荣
+ * @Date: 2020-03-06 17:28
+ */
+@Component
+public class BEH0013 extends QCCatalogue {
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        status.set("0");
+        if (inputInfo.getBeHospitalizedDoc() == null) {
+            return;
+        }
+        BeHospitalizedDoc beHospitalizedDoc = inputInfo.getBeHospitalizedDoc();
+        //现病史
+        PresentLabel presentLabel = beHospitalizedDoc.getPresentLabel();
+        if(checkContent(beHospitalizedDoc))
+        {
+            return;
+        }
+        String text = presentLabel.getText();
+        if (StringUtil.isNotBlank(text)) {
+            if ((text.contains("无") || text.contains("否认") || text.contains("内固定")) && !text.contains("诱因")) {
+                return;
+            }
+        }
+        List<Clinical> clinicalNegative = new ArrayList<>();
+        List<Clinical> clinicals = presentLabel.getClinicals();
+        if (clinicals.size() > 0) {
+            for (Clinical clinical : clinicals) {
+                if (clinical.getNegative() != null) {
+                    clinicalNegative.add(clinical);
+                }
+            }
+        }
+        if (clinicalNegative.size() == 0) {
+            status.set("-1");
+        }
+    }
+
+    private boolean checkContent(BeHospitalizedDoc beHospitalizedDoc) {
+        boolean flag = false;
+        //现病史
+        PresentLabel presentLabel = beHospitalizedDoc.getPresentLabel();
+        //既往史
+        PastLabel pastLabel = beHospitalizedDoc.getPastLabel();
+        switch (Content.hospital_Id)
+        {
+            case "1":                            //长兴需求不需要判断既往史
+                if ((presentLabel == null || StringUtil.isBlank(presentLabel.getText()) || "。".equals(presentLabel.getText()))
+                ) {
+                    flag = true;
+                }
+                break;
+            default:
+                if ((presentLabel == null || StringUtil.isBlank(presentLabel.getText()) || "。".equals(presentLabel.getText()))
+                        && (StringUtil.isBlank(pastLabel.getText()) || "。".equals(pastLabel.getText()))) {
+                    flag = true;
+                }
+                break;
+        }
+
+        return flag;
+    }
+}

+ 127 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0014.java

@@ -0,0 +1,127 @@
+package com.lantone.qc.kernel.catalogue.behospitalized;
+
+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.model.doc.BeHospitalizedDoc;
+import com.lantone.qc.pub.model.entity.Cause;
+import com.lantone.qc.pub.model.entity.Clinical;
+import com.lantone.qc.pub.model.entity.Diag;
+import com.lantone.qc.pub.model.label.PastLabel;
+import com.lantone.qc.pub.model.label.PresentLabel;
+import com.lantone.qc.pub.util.ListUtil;
+import com.lantone.qc.pub.util.StringUtil;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.stereotype.Component;
+
+import java.util.Arrays;
+import java.util.List;
+
+
+/**
+ * @ClassName : BEH0014
+ * @Description :  现病史症状缺少诱因
+ * @Author : 楼辉荣
+ * @Date: 2020-03-06 17:28
+ */
+@Component
+public class BEH0014 extends QCCatalogue {
+    private List<String> containList = Arrays.asList("体检", "发现", "检查", "因", "确诊", "诊断", "复查", "术后"
+            , "药物", "误服", "查", "撞", "伤", "月经", "暴力", "超", "术");
+
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        if (inputInfo.getBeHospitalizedDoc() == null) {
+            status.set("0");
+            return;
+        }
+        /*List<Clinical> clinicals = inputInfo.getBeHospitalizedDoc().getPresentLabel().getClinicals();
+        if(clinicals.size()>0){
+            Clinical clinical = clinicals.get(0);
+            String clinicalName = clinical.getName();
+            Cause cause = clinical.getCause();
+            if(cause == null){
+                info.set(clinicalName);
+            }else {
+                status.set("0");
+            }
+        }*/
+        PresentLabel presentLabel = inputInfo.getBeHospitalizedDoc().getPresentLabel();
+        if(checkContent(inputInfo.getBeHospitalizedDoc()))
+        {
+            status.set("0");
+            return;
+        }
+//        if ((presentLabel == null || StringUtil.isBlank(presentLabel.getText()) || "。".equals(presentLabel.getText()))
+//                && (StringUtil.isBlank(pastLabel.getText()) || "。".equals(pastLabel.getText()))) {
+//            status.set("0");
+//            return;
+//        }
+        List<Clinical> clinicals = presentLabel.getClinicals();
+        if (ListUtil.isNotEmpty(clinicals)) {
+            for (Clinical clinical : clinicals) {
+                if (clinical.getCause() != null) {
+                    status.set("0");
+                    return;
+                }
+            }
+        }
+        //硬规则匹配 前30个字有"体检"或"发现"或"检查"(containList)字样
+        String present = presentLabel.getText();
+        if (StringUtils.isNotEmpty(present)) {
+            if (present.length() > 30) {
+                present = present.substring(0, 30);
+            }
+            present = present.replaceAll("[\"“”]", "");
+            for (String word : containList) {
+                if (present.contains(word)) {
+                    status.set("0");
+                    return;
+                }
+            }
+            //模型在现病史前30个字里能提出来疾病,那也可以算有诱因
+            List<Diag> presentDiags = presentLabel.getDiags();
+            if (presentDiags.size() > 0) {
+                for (Diag diag : presentDiags) {
+                    String hospitalDiagName = diag.getHospitalDiagName();
+                    if (StringUtil.isBlank(hospitalDiagName)) {
+                        continue;
+                    }
+                    if (present.contains(hospitalDiagName)) {
+                        status.set("0");
+                        return;
+                    }
+                }
+            }
+        }
+
+        List<Cause> causes = presentLabel.getCauses();
+        if (causes != null && causes.size() > 0) {
+            status.set("0");
+        }
+    }
+    private boolean checkContent(BeHospitalizedDoc beHospitalizedDoc) {
+        boolean flag = false;
+        //现病史
+        PresentLabel presentLabel = beHospitalizedDoc.getPresentLabel();
+        //既往史
+        PastLabel pastLabel = beHospitalizedDoc.getPastLabel();
+        switch (Content.hospital_Id)
+        {
+            case "1":                            //长兴需求不需要判断既往史
+                if ((presentLabel == null || StringUtil.isBlank(presentLabel.getText()) || "。".equals(presentLabel.getText()))
+                ) {
+                    flag = true;
+                }
+                break;
+            default:
+                if ((presentLabel == null || StringUtil.isBlank(presentLabel.getText()) || "。".equals(presentLabel.getText()))
+                        && (StringUtil.isBlank(pastLabel.getText()) || "。".equals(pastLabel.getText()))) {
+                    flag = true;
+                }
+                break;
+        }
+
+        return flag;
+    }
+}

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

@@ -0,0 +1,45 @@
+package com.lantone.qc.kernel.catalogue.behospitalized;
+
+import com.lantone.qc.dbanaly.util.KernelConstants;
+import com.lantone.qc.dbanaly.util.SpecialStorageUtil;
+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.BodyPart;
+import com.lantone.qc.pub.model.entity.Clinical;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+
+
+/**
+ * @ClassName : BEH0015
+ * @Description :  现病史症状缺少部位,只判断现病史中的第一个症状
+ * @Author : 楼辉荣
+ * @Date: 2020-03-06 17:28
+ */
+@Component
+public class BEH0015 extends QCCatalogue {
+    @Autowired
+    private SpecialStorageUtil specialStorageUtil;
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        status.set("0");
+        if(inputInfo.getBeHospitalizedDoc() == null){
+            return;
+        }
+        List<String> clinicalList = (List<String>) specialStorageUtil.getJsonStringValue(KernelConstants.CONCEPT_CLINIC_BODYPART_PROPERTIES_LIST);
+        List<Clinical> clinicals = inputInfo.getBeHospitalizedDoc().getPresentLabel().getClinicals();
+        if(clinicals.size()>0){
+            Clinical clinical = clinicals.get(0);
+            if(clinicalList.contains(clinical.getName())){
+                BodyPart bodyPart = clinical.getBodyPart();
+                if(bodyPart == null){
+                    status.set("-1");
+                    info.set(clinical.getName());
+                }
+            }
+
+        }
+    }
+}

+ 38 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0016.java

@@ -0,0 +1,38 @@
+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.Clinical;
+import com.lantone.qc.pub.model.entity.Property;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+
+
+/**
+ * @ClassName : BEH0016
+ * @Description :  现病史症状缺少性质
+ * @Author : 楼辉荣
+ * @Date: 2020-03-06 17:28
+ */
+@Component
+public class BEH0016 extends QCCatalogue {
+
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        if(inputInfo.getBeHospitalizedDoc() == null){
+            status.set("0");
+            return;
+        }
+        List<Clinical> clinicals = inputInfo.getBeHospitalizedDoc().getPresentLabel().getClinicals();
+        if(clinicals.size()>0){
+            Clinical clinical = clinicals.get(0);
+            Property property = clinical.getProperty();
+            if(property == null){
+                info.set(clinical.getName());
+                status.set("-1");
+            }
+        }
+
+        }
+    }

+ 64 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0017.java

@@ -0,0 +1,64 @@
+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.Clinical;
+import com.lantone.qc.pub.model.entity.PD;
+import com.lantone.qc.pub.model.label.PresentLabel;
+import com.lantone.qc.pub.util.ListUtil;
+import com.lantone.qc.pub.util.StringUtil;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+
+
+/**
+ * @ClassName : BEH0017
+ * @Description :  现病史症状缺少时间描述
+ * @Author : 楼辉荣
+ * @Date: 2020-03-06 17:28
+ */
+@Component
+public class BEH0017 extends QCCatalogue {
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        if (inputInfo.getBeHospitalizedDoc() == null) {
+            status.set("0");
+            return;
+        }
+        PresentLabel presentLabel = inputInfo.getBeHospitalizedDoc().getPresentLabel();
+        if (presentLabel == null) {
+            status.set("0");
+            return;
+        }
+        String presentText = presentLabel.getText();
+        if (StringUtil.isBlank(presentText) ||
+                (StringUtil.isNotBlank(presentText) && presentText.contains("复查"))) {
+            status.set("0");
+            return;
+        }
+        List<Clinical> clinicals = presentLabel.getClinicals();
+        if (clinicals.size() > 0) {
+            for (Clinical clinical : clinicals) {
+                List<PD> timestamp = clinical.getTimestamp();
+                if (ListUtil.isNotEmpty(timestamp)) {
+                    status.set("0");
+                    return;
+                }
+            }
+            //现病史取第一个症状
+            //            Clinical clinical = clinicals.get(0);
+            //            List<PD> timestamp = clinical.getTimestamp();
+            //            if (timestamp == null) {
+            //                info.set(clinical.getName());
+            //            } else {
+            //                status.set("0");
+            //            }
+        } else {
+            status.set("0");
+        }
+        if (presentLabel.getPds().size() > 0) {
+            status.set("0");
+        }
+    }
+}

+ 81 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0018.java

@@ -0,0 +1,81 @@
+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.Clinical;
+import com.lantone.qc.pub.model.entity.PD;
+import com.lantone.qc.pub.model.label.ChiefLabel;
+import com.lantone.qc.pub.model.label.PresentLabel;
+import com.lantone.qc.pub.util.ListUtil;
+import com.lantone.qc.pub.util.StringUtil;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+
+
+/**
+ * @ClassName : BEH0018
+ * @Description :现病史症状缺少近期时间描述
+ * @Author : 楼辉荣
+ * @Date: 2020-03-06 17:28
+ */
+@Component
+public class BEH0018 extends QCCatalogue {
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        if (inputInfo.getBeHospitalizedDoc() == null) {
+            status.set("0");
+            return;
+        }
+        ChiefLabel chiefLabel = inputInfo.getBeHospitalizedDoc().getChiefLabel();
+        if (chiefLabel != null && ListUtil.isNotEmpty(chiefLabel.getClinicals())) {
+            List<Clinical> clinicalList = chiefLabel.getClinicals();
+            boolean flag = true;
+            // 主诉症状不超过1年就不报错,单位不包含“年”
+            for (Clinical c : clinicalList) {
+                List<PD> pds = c.getTimestamp();
+                if (ListUtil.isNotEmpty(pds)) {
+                    for (PD pd : pds) {
+                        if (StringUtil.isNotBlank(pd.getName()) &&
+                                pd.getName().contains("年") && !"半年".equals(pd.getName())) {
+                            flag = false;
+                            break;
+                        }
+                    }
+                }
+            }
+            if (flag) {
+                status.set("0");
+                return;
+            }
+        }
+        PresentLabel presentLabel = inputInfo.getBeHospitalizedDoc().getPresentLabel();
+        List<PD> pds = presentLabel.getPds();
+        if (pds == null || pds.size() == 0) {
+            status.set("0");
+            return;
+        }
+        for (PD pd : pds) {
+            String pdName = pd.getName();
+            if (StringUtil.isNotBlank(pdName)) {
+                if (pdName.contains("天") || pdName.contains("周") || pdName.contains("月")
+                        || pdName.contains("时") || pdName.contains("秒") || pdName.contains("半年")
+                        || pdName.contains("日") || pdName.contains("今") || pdName.contains("余年")
+                        || pdName.contains("年") || pdName.contains("分") || pdName.contains("点")
+                        || pdName.contains("早") || pdName.contains("午") || pdName.contains("晚")
+                        || pdName.contains("夜") || pdName.contains("晨")
+                        || isDate(pdName)) {
+                    status.set("0");
+                    break;
+                }
+            }
+        }
+
+    }
+
+    private boolean isDate(String pdName) {
+        String regex = "[0-9]{4}.?[0-9]{2}.?[0-9]{2}";
+        return pdName.matches(regex);
+    }
+}
+

+ 42 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0019.java

@@ -0,0 +1,42 @@
+package com.lantone.qc.kernel.catalogue.behospitalized;
+
+import com.lantone.qc.dbanaly.util.SpecialStorageUtil;
+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.Clinical;
+import com.lantone.qc.pub.model.entity.Degree;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+
+
+/**
+ * @ClassName : BEH0019
+ * @Description :  现病史症状缺少程度
+ * crf模型中只标注到修饰的程度,需要用词库去配出哪些是程度。
+ * @Author : 楼辉荣
+ * @Date: 2020-03-06 17:28
+ */
+@Component
+public class BEH0019 extends QCCatalogue {
+    @Autowired
+    private SpecialStorageUtil specialStorageUtil;
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        if(inputInfo.getBeHospitalizedDoc() == null){
+            status.set("0");
+            return;
+        }
+        List<Clinical> clinicals = inputInfo.getBeHospitalizedDoc().getPresentLabel().getClinicals();
+        if(clinicals.size()>0){
+            Clinical clinical = clinicals.get(0);
+            Degree degree = clinical.getDegree();
+            if(degree == null){
+                info.set(clinical.getName());
+            }else {
+                status.set("0");
+            }
+        }
+    }
+}

+ 38 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0020.java

@@ -0,0 +1,38 @@
+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.Clinical;
+import com.lantone.qc.pub.model.entity.Modification;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+
+
+/**
+ * @ClassName : BEH0020
+ * @Description :  现病史症状缺少缓解情况
+ * crf模型中只标注趋势,需要用词库去配出哪些是缓解情况。
+ * @Author : 楼辉荣
+ * @Date: 2020-03-06 17:28
+ */
+@Component
+public class BEH0020 extends QCCatalogue {
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        if(inputInfo.getBeHospitalizedDoc() == null){
+            status.set("0");
+            return;
+        }
+        List<Clinical> clinicals = inputInfo.getBeHospitalizedDoc().getPresentLabel().getClinicals();
+        if(clinicals.size()>0){
+            Clinical clinical = clinicals.get(0);
+            Modification modification = clinical.getModification();
+            if(modification == null || !modification.getName().contains("缓")){
+                info.set(clinical.getName());
+            }else {
+                status.set("0");
+            }
+        }
+    }
+}

+ 43 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0021.java

@@ -0,0 +1,43 @@
+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.Clinical;
+import com.lantone.qc.pub.model.entity.General;
+import com.lantone.qc.pub.model.entity.GeneralDesc;
+import com.lantone.qc.pub.model.entity.Modification;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+
+
+/**
+ * @ClassName : BEH0021
+ * @Description :  现病史症状缺少加剧情况
+ *  crf模型中只标注趋势,需要用词库去配出哪些是加剧情况。
+ * @Author : 楼辉荣
+ * @Date: 2020-03-06 17:28
+ */
+@Component
+public class BEH0021 extends QCCatalogue {
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        if(inputInfo.getBeHospitalizedDoc() == null){
+            status.set("0");
+            return;
+        }
+        List<General> gens = inputInfo.getBeHospitalizedDoc().getPresentLabel().getGens();
+        List<GeneralDesc> generals = inputInfo.getBeHospitalizedDoc().getPresentLabel().getGenerals();
+        List<Clinical> clinicals = inputInfo.getBeHospitalizedDoc().getPresentLabel().getClinicals();
+        if(clinicals.size()>0){
+            Clinical clinical = clinicals.get(0);
+            Modification modification = clinical.getModification();
+            if(modification == null || (!modification.getName().contains("严重") && !modification.getName().contains("加剧")
+                    && !modification.getName().contains("加重"))){
+                info.set(clinical.getName());
+            }else {
+                status.set("0");
+            }
+        }
+    }
+}

+ 44 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0022.java

@@ -0,0 +1,44 @@
+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.General;
+import com.lantone.qc.pub.model.entity.GeneralDesc;
+import com.lantone.qc.pub.model.label.PresentLabel;
+import com.lantone.qc.pub.util.StringUtil;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+
+
+/**
+ * @ClassName : BEH0022
+ * @Description :  现病史缺少发病以来一般情况描述
+ * @Author : 楼辉荣
+ * @Date: 2020-03-06 17:28
+ */
+@Component
+public class BEH0022 extends QCCatalogue {
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        if (inputInfo.getBeHospitalizedDoc() == null) {
+            status.set("0");
+            return;
+        }
+        PresentLabel presentLabel = inputInfo.getBeHospitalizedDoc().getPresentLabel();
+        if (presentLabel == null || StringUtil.isBlank(presentLabel.getText())) {
+            status.set("0");
+            return;
+        }
+        List<GeneralDesc> generals = presentLabel.getGenerals();
+        if (generals != null && generals.size() > 0) {
+            status.set("0");
+            return;
+        }
+        List<General> gens = inputInfo.getBeHospitalizedDoc().getPresentLabel().getGens();
+        if (gens != null && gens.size() > 0) {
+            status.set("0");
+            return;
+        }
+    }
+}

+ 47 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0023.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.model.entity.Lis;
+import com.lantone.qc.pub.model.entity.Medicine;
+import com.lantone.qc.pub.model.entity.Operation;
+import com.lantone.qc.pub.model.entity.Pacs;
+import com.lantone.qc.pub.model.entity.Treat;
+import com.lantone.qc.pub.model.label.PresentLabel;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+
+
+/**
+ * @ClassName : BEH0023
+ * @Description :  现病史未描述入院前有无相关治疗检查
+ * @Author : 楼辉荣
+ * @Date: 2020-03-06 17:28
+ */
+@Component
+public class BEH0023 extends QCCatalogue {
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        status.set("0");
+        if (inputInfo.getBeHospitalizedDoc() == null) {
+            return;
+        }
+        PresentLabel presentLabel = inputInfo.getBeHospitalizedDoc().getPresentLabel();
+        if (presentLabel == null) {
+            return;
+        }
+        List<Lis> lises = presentLabel.getLises();
+        List<Pacs> pacses = presentLabel.getPacses();
+        List<Treat> treats = presentLabel.getTreats();
+        List<Operation> operations = presentLabel.getOperations();
+        List<Medicine> medicines = presentLabel.getMedicines();
+        if (lises == null && pacses.size() == 0 && treats.size() == 0 && operations.size() == 0 && medicines.size() == 0) {
+            status.set("-1");
+        }
+        //添加硬规则
+        if (inputInfo.getBeHospitalizedDoc().getPresentLabel().getText().contains("未予以重视")) {
+            status.set("0");
+        }
+    }
+}

+ 56 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0024.java

@@ -0,0 +1,56 @@
+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.Wound;
+import com.lantone.qc.pub.model.label.PastLabel;
+import com.lantone.qc.pub.util.ListUtil;
+import com.lantone.qc.pub.util.StringUtil;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @Description: 外伤史未填写
+ * @author: rengb
+ * @time: 2020/3/10 13:53
+ */
+@Component
+public class BEH0024 extends QCCatalogue {
+
+    @Override
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        if (inputInfo.getBeHospitalizedDoc() == null) {
+            status.set("0");
+            return;
+        }
+        //台州结构化
+        Map<String, String> behStructureMap = inputInfo.getBeHospitalizedDoc().getStructureMap();
+        if (StringUtils.isNotEmpty(behStructureMap.get("手术外伤史"))) {
+            status.set("0");
+            return;
+        }
+        PastLabel pastLabel = inputInfo.getBeHospitalizedDoc().getPastLabel();
+        /* 如果既往史为空或者既往史文本为空,则不报错 */
+        if (pastLabel == null || StringUtil.isBlank(pastLabel.getText())) {
+            status.set("0");
+            return;
+        }
+        List<Wound> wounds = pastLabel.getWounds();
+        if (ListUtil.isNotEmpty(wounds)) {
+            if (wounds.stream().map(i -> i.getName()).filter(i -> StringUtil.isNotBlank(i)).count() > 0) {
+                status.set("0");
+                return;
+            }
+        }
+        //硬规则匹配
+        String pastLabelText = pastLabel.getText();
+        if (pastLabelText.contains("外伤") || pastLabelText.contains("详见") || pastLabelText.contains("骨折")
+                || pastLabelText.contains("见旧病历") || pastLabelText.contains("见既往病历") || pastLabelText.contains("右根骨手术")) {
+            status.set("0");
+        }
+    }
+}

+ 70 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0025.java

@@ -0,0 +1,70 @@
+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.entity.Operation;
+import com.lantone.qc.pub.model.label.PastLabel;
+import com.lantone.qc.pub.util.ListUtil;
+import com.lantone.qc.pub.util.StringUtil;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @Description: 手术史未填写
+ * @author: rengb
+ * @time: 2020/3/10 14:02
+ */
+@Component
+public class BEH0025 extends QCCatalogue {
+
+    @Override
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        if (inputInfo.getBeHospitalizedDoc() == null) {
+            status.set("0");
+            return;
+        }
+        //台州结构化
+        Map<String, String> behStructureMap = inputInfo.getBeHospitalizedDoc().getStructureMap();
+        if (StringUtils.isNotEmpty(behStructureMap.get("手术外伤史"))) {
+            status.set("0");
+            return;
+        }
+        PastLabel pastLabel = inputInfo.getBeHospitalizedDoc().getPastLabel();
+        /* 如果既往史为空或者既往史文本为空,则不报错 */
+        if (pastLabel == null || StringUtil.isBlank(pastLabel.getText())) {
+            status.set("0");
+            return;
+        }
+        List<Operation> operations = pastLabel.getOperations();
+        if (ListUtil.isNotEmpty(operations)) {
+            if (operations.stream().map(i -> i.getName()).filter(i -> StringUtil.isNotBlank(i)).count() > 0) {
+                status.set("0");
+                return;
+            }
+        }
+        /* 疾病名称:**术后**,算是有手术史 */
+        List<Diag> diags = pastLabel.getDiags();
+        for (Diag diag : diags) {
+            String hospitalDiagName = diag.getHospitalDiagName();
+            if (StringUtil.isBlank(hospitalDiagName)) {
+                continue;
+            }
+            if (hospitalDiagName.contains("术后")) {
+                status.set("0");
+                return;
+            }
+        }
+        //规则硬匹配
+        String pastLabelText = pastLabel.getText();
+        if (pastLabelText.contains("手术") || pastLabelText.contains("详见")
+                || pastLabelText.contains("见旧病历") || pastLabelText.contains("见既往病历")|| pastLabelText.contains("体外碎石")) {
+            status.set("0");
+        }
+    }
+
+}

+ 61 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0026.java

@@ -0,0 +1,61 @@
+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.Allergy;
+import com.lantone.qc.pub.model.label.PastLabel;
+import com.lantone.qc.pub.util.ListUtil;
+import com.lantone.qc.pub.util.StringUtil;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @Description: 食物过敏史未填写
+ * @author: rengb
+ * @time: 2020/3/10 14:02
+ */
+@Component
+public class BEH0026 extends QCCatalogue {
+
+    @Override
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        if (inputInfo.getBeHospitalizedDoc() == null) {
+            status.set("0");
+            return;
+        }
+        Map<String, String> structureMap = inputInfo.getBeHospitalizedDoc().getStructureMap();
+        if (StringUtils.isNotEmpty(structureMap.get("过敏史"))) {
+            status.set("0");
+            return;
+        }
+        PastLabel pastLabel = inputInfo.getBeHospitalizedDoc().getPastLabel();
+        /* 如果既往史为空或者既往史文本为空,则不报错 */
+        if (pastLabel == null || StringUtil.isBlank(pastLabel.getText())) {
+            status.set("0");
+            return;
+        }
+        String pastText = pastLabel.getText();
+        if (pastText.contains("食物过敏史") || pastText.contains("食物、药物过敏") || pastText.contains("详见") ||
+                pastText.contains("见旧病历") || pastText.contains("见既往病历")) {
+            status.set("0");
+            return;
+        }
+        List<Allergy> allergies = pastLabel.getAllergies();
+        if (ListUtil.isNotEmpty(allergies)) {
+            long count = allergies.stream().filter(
+                    i -> i != null
+                            && StringUtil.isNotBlank(i.getName())
+                    //                            && i.getAllergyFood() != null
+                    //                            && StringUtil.isNotBlank(i.getAllergyFood().getName())
+            ).count();
+            if (count > 0) {
+                status.set("0");
+            }
+        }
+    }
+
+}

+ 52 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0027.java

@@ -0,0 +1,52 @@
+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.Allergy;
+import com.lantone.qc.pub.model.label.PastLabel;
+import com.lantone.qc.pub.util.ListUtil;
+import com.lantone.qc.pub.util.StringUtil;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+
+/**
+ * @Description: 药物过敏史未填写
+ * @author: rengb
+ * @time: 2020/3/10 14:02
+ */
+@Component
+public class BEH0027 extends QCCatalogue {
+
+    @Override
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        if (inputInfo.getBeHospitalizedDoc() == null) {
+            status.set("0");
+            return;
+        }
+        PastLabel pastLabel = inputInfo.getBeHospitalizedDoc().getPastLabel();
+        if (pastLabel == null) {
+            status.set("0");
+            return;
+        }
+        String pastText = pastLabel.getText();
+        if (StringUtil.isNotBlank(pastText) && pastText.contains("药物过敏史")) {
+            status.set("0");
+            return;
+        }
+        List<Allergy> allergies = pastLabel.getAllergies();
+        if (ListUtil.isNotEmpty(allergies)) {
+            long count = allergies.stream().filter(
+                    i -> i != null
+                            && StringUtil.isNotBlank(i.getName())
+                            && i.getAllergyMedicine() != null
+                            && StringUtil.isNotBlank(i.getAllergyMedicine().getName())
+            ).count();
+            if (count > 0) {
+                status.set("0");
+            }
+        }
+    }
+
+}

+ 54 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0028.java

@@ -0,0 +1,54 @@
+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.BloodTransfusion;
+import com.lantone.qc.pub.model.label.PastLabel;
+import com.lantone.qc.pub.util.ListUtil;
+import com.lantone.qc.pub.util.StringUtil;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @Description: 输血史未填写
+ * @author: rengb
+ * @time: 2020/3/10 14:02
+ */
+@Component
+public class BEH0028 extends QCCatalogue {
+
+    @Override
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        if (inputInfo.getBeHospitalizedDoc() == null) {
+            status.set("0");
+            return;
+        }
+        Map<String, String> behStructure = inputInfo.getBeHospitalizedDoc().getStructureMap();
+        if (StringUtils.isNotEmpty(behStructure.get("输血史"))) {
+            status.set("0");
+            return;
+        }
+        PastLabel pastLabel = inputInfo.getBeHospitalizedDoc().getPastLabel();
+        /* 如果既往史为空或者既往史文本为空,则不报错 */
+        if (pastLabel == null || StringUtil.isBlank(pastLabel.getText())) {
+            status.set("0");
+            return;
+        }
+        String pastText = pastLabel.getText();
+        if (pastText.contains("输血") || pastText.contains("详见")|| pastText.contains("见旧病历") || pastText.contains("见既往病历")) {
+            status.set("0");
+            return;
+        }
+        List<BloodTransfusion> bloodTransfusions = pastLabel.getBloodTransfusions();
+        if (ListUtil.isNotEmpty(bloodTransfusions)) {
+            if (bloodTransfusions.stream().map(i -> i.getName()).filter(i -> StringUtil.isNotBlank(i)).count() > 0) {
+                status.set("0");
+            }
+        }
+    }
+
+}

+ 72 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0029.java

@@ -0,0 +1,72 @@
+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.doc.BeHospitalizedDoc;
+import com.lantone.qc.pub.model.entity.Vaccinate;
+import com.lantone.qc.pub.model.label.PastLabel;
+import com.lantone.qc.pub.model.label.PersonalLabel;
+import com.lantone.qc.pub.util.ListUtil;
+import com.lantone.qc.pub.util.StringUtil;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @Description: 预防接种史未填写
+ * @author: rengb
+ * @time: 2020/3/10 14:02
+ */
+@Component
+public class BEH0029 extends QCCatalogue {
+
+    @Override
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        if (inputInfo.getBeHospitalizedDoc() == null) {
+            status.set("0");
+            return;
+        }
+        BeHospitalizedDoc beHospitalizedDoc = inputInfo.getBeHospitalizedDoc();
+        //台州结构化
+        Map<String, String> structureMap = beHospitalizedDoc.getStructureMap();
+        if (StringUtils.isNotEmpty(structureMap.get("预防接种史"))) {
+            status.set("0");
+            return;
+        }
+        //既往史
+        PastLabel pastLabel = beHospitalizedDoc.getPastLabel();
+        //个人史
+        PersonalLabel personalLabel = beHospitalizedDoc.getPersonalLabel();
+        /* 如果既往史为空或者既往史文本为空,则不报错 */
+        if ((pastLabel == null || StringUtil.isBlank(pastLabel.getText())) &&
+                (personalLabel == null || StringUtil.isBlank(personalLabel.getText()))) {
+            status.set("0");
+            return;
+        }
+        if (pastLabel != null) {
+            String pastText = pastLabel.getText();
+            if (StringUtil.isNotBlank(pastText) && (pastText.contains("详见") || pastText.contains("预防接种") || pastText.contains("预防免疫接种")
+                    || pastText.contains("见旧病历") || pastText.contains("见既往病历"))) {
+                status.set("0");
+                return;
+            }
+            List<Vaccinate> vaccinates = pastLabel.getVaccinates();
+            if (ListUtil.isNotEmpty(vaccinates)) {
+                if (vaccinates.stream().map(i -> i.getName()).filter(i -> StringUtil.isNotBlank(i)).count() > 0) {
+                    status.set("0");
+                    return;
+                }
+            }
+        }
+        if (personalLabel != null) {
+            String personText = personalLabel.getText();
+            if (StringUtil.isNotBlank(personText) && (personText.contains("详见") || personText.contains("预防接种"))) {
+                status.set("0");
+                return;
+            }
+        }
+    }
+}

+ 56 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0030.java

@@ -0,0 +1,56 @@
+package com.lantone.qc.kernel.catalogue.behospitalized;
+
+import com.lantone.qc.kernel.catalogue.QCCatalogue;
+import com.lantone.qc.kernel.util.CatalogueUtil;
+import com.lantone.qc.pub.model.InputInfo;
+import com.lantone.qc.pub.model.OutputInfo;
+import com.lantone.qc.pub.model.label.PastLabel;
+import com.lantone.qc.pub.util.ListUtil;
+import com.lantone.qc.pub.util.StringUtil;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.stereotype.Component;
+
+import java.util.Map;
+
+/**
+ * @Description: 传染病史未填写
+ * @author: rengb
+ * @time: 2020/3/10 14:02
+ */
+@Component
+public class BEH0030 extends QCCatalogue {
+
+    @Override
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        if (inputInfo.getBeHospitalizedDoc() == null) {
+            status.set("0");
+            return;
+        }
+        Map<String, String> structureMap = inputInfo.getBeHospitalizedDoc().getStructureMap();
+        if (StringUtils.isNotEmpty(structureMap.get("结核病")) || StringUtils.isNotEmpty(structureMap.get("病毒性肝炎"))) {
+            status.set("0");
+            return;
+        }
+        PastLabel pastLabel = inputInfo.getBeHospitalizedDoc().getPastLabel();
+        /* 如果既往史为空或者既往史文本为空,则不报错 */
+        if (pastLabel == null || StringUtil.isBlank(pastLabel.getText())) {
+            status.set("0");
+            return;
+        }
+        if (ListUtil.isNotEmpty(
+                CatalogueUtil.filterDiagsByNature(
+                        pastLabel.getDiags(),
+                        "infectious",
+                        "1"
+                )
+        )) {
+            status.set("0");
+        }
+        String pastText = pastLabel.getText();
+        if (pastText.contains("肝炎") || pastText.contains("结核") || pastText.contains("详见原病历")
+                || pastText.contains("见旧病历") || pastText.contains("见既往病历") || pastText.contains("乙肝")) {
+            status.set("0");
+        }
+    }
+
+}

+ 69 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0031.java

@@ -0,0 +1,69 @@
+package com.lantone.qc.kernel.catalogue.behospitalized;
+
+import com.google.common.collect.Lists;
+import com.lantone.qc.kernel.catalogue.QCCatalogue;
+import com.lantone.qc.kernel.util.CatalogueUtil;
+import com.lantone.qc.pub.model.InputInfo;
+import com.lantone.qc.pub.model.OutputInfo;
+import com.lantone.qc.pub.model.label.PastLabel;
+import com.lantone.qc.pub.util.ListUtil;
+import com.lantone.qc.pub.util.StringUtil;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @Description: 慢病史未填写
+ * @author: rengb
+ * @time: 2020/3/10 14:02
+ */
+@Component
+public class BEH0031 extends QCCatalogue {
+
+    @Override
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        if (inputInfo.getBeHospitalizedDoc() == null) {
+            status.set("0");
+            return;
+        }
+        Map<String, String> structureMap = inputInfo.getBeHospitalizedDoc().getStructureMap();
+        if (StringUtils.isNotEmpty(structureMap.get("高血压"))) {
+            status.set("0");
+            return;
+        }
+        PastLabel pastLabel = inputInfo.getBeHospitalizedDoc().getPastLabel();
+        if (pastLabel != null && StringUtil.isNotBlank(pastLabel.getText())) {
+            if (ListUtil.isNotEmpty(
+                    CatalogueUtil.filterDiagsByNature(
+                            pastLabel.getDiags(),
+                            "chronic",
+                            "1"
+                    )
+            )) {
+                status.set("0");
+            }
+            //硬规则匹配
+            String text = pastLabel.getText();
+            if (StringUtils.isNotEmpty(text)) {
+                List<String> words = Lists.newArrayList("高血压", "糖尿病", "阿尔茨海默病", "帕金森", "冠心病心律失常型"
+                        , "冠状动脉性心脏病", "冠状动脉粥样硬化性心脏病", "慢性肾炎综合征", "肾病", "慢性肾衰竭", "肾功能异常", "哮喘"
+                        , "肺结核", "腹膜透析", "慢性阻塞性肺病", "精神分裂症", "分裂情感性精神病", "双相情感障碍,目前为缓解状态", "前列腺增生"
+                        , "高脂血症", "高低密度脂蛋白胆固醇血症", "高胆固醇血症", "高甘油三酯血症", "骨质疏松", "慢性乙型病毒性肝炎"
+                        , "慢性庚型肝炎", "慢性肝炎", "慢性丁型肝炎", "慢性病毒性肝炎", "慢性丙型病毒性肝炎", "酒精性肝病", "脂肪肝"
+                        , "肝硬化", "肝恶性肿瘤", "肝恶性细胞瘤", "肝病", "类风湿性关节炎", "心脑血管", "内分泌","见旧病历","见既往病历");
+                for (String word : words) {
+                    if (text.contains(word)) {
+                        status.set("0");
+                        return;
+                    }
+                }
+            }
+        } else {
+            status.set("0");
+            return;
+        }
+    }
+
+}

+ 72 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0032.java

@@ -0,0 +1,72 @@
+package com.lantone.qc.kernel.catalogue.behospitalized;
+
+import com.lantone.qc.kernel.catalogue.QCCatalogue;
+import com.lantone.qc.kernel.util.CatalogueUtil;
+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.PastLabel;
+import com.lantone.qc.pub.util.ListUtil;
+import com.lantone.qc.pub.util.StringUtil;
+import org.springframework.stereotype.Component;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * @Description: 疾病名未标引号
+ * @author: rengb
+ * @time: 2020/3/10 14:02
+ */
+@Component
+public class BEH0032 extends QCCatalogue {
+
+    @Override
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        status.set("0");
+        if (inputInfo.getBeHospitalizedDoc() == null) {
+            return;
+        }
+        PastLabel pastLabel = inputInfo.getBeHospitalizedDoc().getPastLabel();
+        if (pastLabel == null) {
+            return;
+        }
+        List<Diag> diags = pastLabel.getDiags();
+        if (ListUtil.isEmpty(diags)) {
+            return;
+        }
+        List<String> wtDiagNames = CatalogueUtil.noInQuotes(
+                diags.stream().filter(diag -> diag.getNegative() == null).map(i -> i.getHospitalDiagName()).filter(i -> StringUtil.isNotEmpty(i)).distinct().collect(Collectors.toList()),
+                pastLabel.getText().replace("“", "\"").replace("”", "\"")
+        );
+        String pastText = pastLabel.getText();
+        List<String> wtDiagList = new ArrayList<>();
+        if (ListUtil.isNotEmpty(wtDiagNames)) {
+            for (String wtDiagName : wtDiagNames) {
+                int index = pastText.indexOf(wtDiagName);
+                if (index - 1 > 0) {
+                    String markText = pastText.substring(index - 1, index);
+                    if (markText.contains("\"") || markText.contains("“")) {
+                        continue;
+                    }
+                }
+                if (index + wtDiagName.length() + 1 < pastText.length() && index > 0) {
+                    String markText = pastText.substring(index + wtDiagName.length(), index + wtDiagName.length() + 1);
+                    if (markText.contains("\"") || markText.contains("”")) {
+                        continue;
+                    }
+                }
+                wtDiagList.add(wtDiagName);
+            }
+        }
+
+        if (ListUtil.isNotEmpty(wtDiagList)) {
+            status.set("-1");
+            for (String wtDiag : wtDiagList) {
+                info.set(info.get() + wtDiag + " ");
+            }
+        }
+    }
+
+}

+ 23 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0033.java

@@ -0,0 +1,23 @@
+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 org.springframework.stereotype.Component;
+
+/**
+ * @Description:
+ * @author: rengb
+ * @time: 2020/3/10 14:02
+ */
+@Component
+public class BEH0033 extends QCCatalogue {
+
+    @Override
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        if(inputInfo.getBeHospitalizedDoc() == null){
+            status.set("0");
+            return;
+        }
+    }
+}

+ 71 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0034.java

@@ -0,0 +1,71 @@
+package com.lantone.qc.kernel.catalogue.behospitalized;
+
+import com.lantone.qc.kernel.catalogue.QCCatalogue;
+import com.lantone.qc.kernel.util.CatalogueUtil;
+import com.lantone.qc.pub.model.InputInfo;
+import com.lantone.qc.pub.model.OutputInfo;
+import com.lantone.qc.pub.model.entity.Operation;
+import com.lantone.qc.pub.model.label.PastLabel;
+import com.lantone.qc.pub.util.ListUtil;
+import com.lantone.qc.pub.util.StringUtil;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * @Description: 手术名称未标引号
+ * @author: rengb
+ * @time: 2020/3/10 14:02
+ */
+@Component
+public class BEH0034 extends QCCatalogue {
+
+    @Override
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        status.set("0");
+        if (inputInfo.getBeHospitalizedDoc() == null) {
+            return;
+        }
+        PastLabel pastLabel = inputInfo.getBeHospitalizedDoc().getPastLabel();
+        List<Operation> operations = pastLabel.getOperations();
+        if (ListUtil.isEmpty(operations)) {
+            return;
+        }
+        List<String> wtOperationNames = CatalogueUtil.noInQuotes(
+                operations.stream()
+                        .filter(i ->
+                                i != null && StringUtil.isNotBlank(i.getName()) && i.getNegative() == null
+                                        && !"手术史".equals(i.getName()) && !"手术".equals(i.getName()) && !"手术治疗".equals(i.getName())
+                                        && !"手术无手术史".equals(i.getName())
+                        )
+                        .map(i -> i.getName())
+                        .distinct()
+                        .collect(Collectors.toList()),
+                pastLabel.getText().replace("“", "\"").replace("”", "\"")
+        );
+        if (ListUtil.isNotEmpty(wtOperationNames)) {
+            String pastLabelText = pastLabel.getText();
+            for (String wtOperationName : wtOperationNames) {
+                if (isASMark(pastLabelText, wtOperationName)) {
+                    continue;
+                }
+                status.set("-1");
+                info.set(info.get() + wtOperationName + " ");
+            }
+        }
+    }
+
+    private boolean isASMark(String pastLabelText, String wtOperationName) {
+        String operName = wtOperationName.replace("手术", "");
+        int index = pastLabelText.indexOf(operName);
+        if (index != -1 && index + operName.length() != pastLabelText.length()) {
+            String substring = pastLabelText.substring(index + operName.length(), index + operName.length() + 1);
+            if (substring.equals("\"") || substring.equals("”")) {
+                return true;
+            }
+        }
+        return false;
+    }
+
+}

+ 79 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0035.java

@@ -0,0 +1,79 @@
+package com.lantone.qc.kernel.catalogue.behospitalized;
+
+import com.lantone.qc.kernel.catalogue.QCCatalogue;
+import com.lantone.qc.kernel.util.CatalogueUtil;
+import com.lantone.qc.pub.model.InputInfo;
+import com.lantone.qc.pub.model.OutputInfo;
+import com.lantone.qc.pub.model.entity.Allergy;
+import com.lantone.qc.pub.model.label.PastLabel;
+import com.lantone.qc.pub.util.ListUtil;
+import com.lantone.qc.pub.util.StringUtil;
+import org.springframework.stereotype.Component;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * @Description: 过敏药物未标引号
+ * @author: rengb
+ * @time: 2020/3/10 14:02
+ */
+@Component
+public class BEH0035 extends QCCatalogue {
+
+    @Override
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        status.set("0");
+        if(inputInfo.getBeHospitalizedDoc() == null){
+            return;
+        }
+        PastLabel pastLabel = inputInfo.getBeHospitalizedDoc().getPastLabel();
+        List<Allergy> allergies = pastLabel.getAllergies();
+        if (ListUtil.isEmpty(allergies)) {
+            return;
+        }
+
+        List<String> wtAmNames = CatalogueUtil.noInQuotes(
+                allergies.stream().filter(
+                        i -> i != null && StringUtil.isNotBlank(i.getName())
+                                && i.getNegative() == null
+                                && i.getAllergyMedicine() != null
+                                && StringUtil.isNotBlank(i.getAllergyMedicine().getName())
+                                && !i.getAllergyMedicine().getName().equals("药物"))
+                        .map(i -> i.getAllergyMedicine().getName()).distinct().collect(Collectors.toList()),
+                pastLabel.getText()
+        );
+        if(wtAmNames.contains("止痛片")){
+            return;
+        }
+        String pastText = pastLabel.getText();
+        List<String> wtDiagList = new ArrayList<>();
+        if (ListUtil.isNotEmpty(wtAmNames)) {
+            for (String wtDiagName : wtAmNames) {
+                int index = pastText.indexOf(wtDiagName);
+                if (index - 1 > 0) {
+                    String markText = pastText.substring(index - 1, index);
+                    if (markText.contains("\"") || markText.contains("“")) {
+                        continue;
+                    }
+                }
+                if (index + wtDiagName.length() + 1 < pastText.length() && index > 0) {
+                    String markText = pastText.substring(index + wtDiagName.length(), index + wtDiagName.length() + 1);
+                    if (markText.contains("\"") || markText.contains("”")) {
+                        continue;
+                    }
+                }
+                wtDiagList.add(wtDiagName);
+            }
+        }
+
+        if (ListUtil.isNotEmpty(wtDiagList)) {
+            status.set("-1");
+            for (String wtAmName : wtDiagList) {
+                info.set(info.get() + wtAmName + " ");
+            }
+        }
+    }
+
+}

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

@@ -0,0 +1,50 @@
+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.Operation;
+import com.lantone.qc.pub.util.ListUtil;
+import com.lantone.qc.pub.util.StringUtil;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+
+/**
+ * @Description: 手术史描述不完整
+ * @author: rengb
+ * @time: 2020/3/10 14:02
+ */
+@Component
+public class BEH0036 extends QCCatalogue {
+
+    @Override
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        status.set("0");
+        if (inputInfo.getBeHospitalizedDoc() == null) {
+            return;
+        }
+        List<Operation> operations = inputInfo.getBeHospitalizedDoc().getPastLabel().getOperations();
+        if (ListUtil.isEmpty(operations)) {
+            return;
+        }
+        for (Operation operation : operations) {
+            if (operation == null || StringUtil.isBlank(operation.getName())) {
+                continue;
+            }
+            if ("手术史".equals(operation.getName()) || "手术".equals(operation.getName()) || "手术治疗".equals(operation.getName()) || "手术无手术史".equals(operation.getName())) {
+                continue;
+            }
+            if ((operation.getNegative() == null || StringUtil.isBlank(operation.getNegative().getName()))
+                    && (operation.getPd() == null || StringUtil.isBlank(operation.getPd().getName()))
+                    && (operation.getOperationResult() == null || StringUtil.isBlank(operation.getOperationResult().getName()))
+                    && (operation.getDiag() == null || StringUtil.isBlank(operation.getDiag().getName()))) {
+                info.set(info.get() + operation.getName() + " ");
+            }
+        }
+        if (StringUtil.isNotBlank(info.get())) {
+            status.set("-1");
+        }
+    }
+
+}

+ 60 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0037.java

@@ -0,0 +1,60 @@
+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.Wound;
+import com.lantone.qc.pub.model.label.PastLabel;
+import com.lantone.qc.pub.util.ListUtil;
+import com.lantone.qc.pub.util.StringUtil;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+
+/**
+ * @Description: 外伤史描述不完整
+ * @author: rengb
+ * @time: 2020/3/10 14:02
+ */
+@Component
+public class BEH0037 extends QCCatalogue {
+
+    @Override
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        status.set("0");
+        if (inputInfo.getBeHospitalizedDoc() == null) {
+            return;
+        }
+        PastLabel pastLabel = inputInfo.getBeHospitalizedDoc().getPastLabel();
+        if (pastLabel == null) {
+            return;
+        }
+        List<Wound> wounds = pastLabel.getWounds();
+        if (ListUtil.isEmpty(wounds)) {
+            return;
+        }
+        for (Wound wound : wounds) {
+            if (wound == null || StringUtil.isBlank(wound.getName())) {
+                continue;
+            }
+            if ((wound.getNegative() == null || StringUtil.isBlank(wound.getNegative().getName()))
+                    && (wound.getPd() == null || StringUtil.isBlank(wound.getPd().getName()))
+                    && (wound.getBodyPart() == null || StringUtil.isBlank(wound.getBodyPart().getName()))
+                    && (wound.getDegree() == null || StringUtil.isBlank(wound.getDegree().getName()))
+                    && (wound.getTreat() == null || StringUtil.isBlank(wound.getTreat().getName()))
+                    && (wound.getOperation() == null || StringUtil.isBlank(wound.getOperation().getName()))) {
+                info.set(info.get() + wound.getName() + " ");
+            }
+        }
+        //硬规则匹配
+        String pastLabelText = pastLabel.getText();
+        if (StringUtil.isNotBlank(pastLabelText) && pastLabelText.contains("外伤")) {
+            status.set("0");
+            return;
+        }
+        if (StringUtil.isNotBlank(info.get())) {
+            status.set("-1");
+        }
+    }
+
+}

+ 55 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0038.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.model.entity.BloodTransfusion;
+import com.lantone.qc.pub.model.label.PastLabel;
+import com.lantone.qc.pub.util.ListUtil;
+import com.lantone.qc.pub.util.StringUtil;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+
+/**
+ * @Description: 输血史描述不完整
+ * @author: rengb
+ * @time: 2020/3/10 14:02
+ */
+@Component
+public class BEH0038 extends QCCatalogue {
+
+    @Override
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        status.set("0");
+        if (inputInfo.getBeHospitalizedDoc() == null) {
+            return;
+        }
+        PastLabel pastLabel = inputInfo.getBeHospitalizedDoc().getPastLabel();
+        if (pastLabel == null) {
+            return;
+        }
+        String pastText = pastLabel.getText();
+        if (StringUtil.isNotBlank(pastText) && pastText.contains("输血")) {
+            return;
+        }
+        List<BloodTransfusion> bloodTransfusions = pastLabel.getBloodTransfusions();
+        if (ListUtil.isEmpty(bloodTransfusions)) {
+            return;
+        }
+        for (BloodTransfusion bloodTransfusion : bloodTransfusions) {
+            if (bloodTransfusion == null || StringUtil.isBlank(bloodTransfusion.getName())) {
+                continue;
+            }
+            if ((bloodTransfusion.getNegative() == null || StringUtil.isBlank(bloodTransfusion.getNegative().getName()))
+                    && (bloodTransfusion.getPd() == null || StringUtil.isBlank(bloodTransfusion.getPd().getName()))
+                    && (bloodTransfusion.getQuantity() == null || StringUtil.isBlank(bloodTransfusion.getQuantity().getName()))) {
+                info.set(info.get() + bloodTransfusion.getName() + " ");
+            }
+        }
+        if (StringUtil.isNotBlank(info.get())) {
+            status.set("-1");
+        }
+    }
+
+}

+ 61 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0039.java

@@ -0,0 +1,61 @@
+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.Allergy;
+import com.lantone.qc.pub.model.label.PastLabel;
+import com.lantone.qc.pub.util.ListUtil;
+import com.lantone.qc.pub.util.StringUtil;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+
+/**
+ * @Description: 食物过敏史描述不完整
+ * @author: rengb
+ * @time: 2020/3/10 14:02
+ */
+@Component
+public class BEH0039 extends QCCatalogue {
+
+    @Override
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        status.set("0");
+        if (inputInfo.getBeHospitalizedDoc() == null) {
+            return;
+        }
+        PastLabel pastLabel = inputInfo.getBeHospitalizedDoc().getPastLabel();
+        if (pastLabel == null) {
+            return;
+        }
+        String pastText = pastLabel.getText();
+        if (StringUtil.isNotBlank(pastText) && pastText.contains("食物过敏史")) {
+            return;
+        }
+        List<Allergy> allergies = pastLabel.getAllergies();
+        if (ListUtil.isEmpty(allergies)) {
+            return;
+        }
+        for (Allergy allergy : allergies) {
+            if (allergy == null
+                    || StringUtil.isBlank(allergy.getName())
+                    || allergy.getAllergyFood() == null
+                    || StringUtil.isBlank(allergy.getAllergyFood().getName())
+                    || allergy.getAllergyFood().getName().equals("食物")) {
+                continue;
+            }
+            //
+            if ((allergy.getNegative() == null || StringUtil.isBlank(allergy.getNegative().getName()) )
+                    && (allergy.getAllergyFood().getPd() == null || StringUtil.isBlank(allergy.getAllergyFood().getPd().getName()))
+                    && (allergy.getAllergyFood().getDegree() == null || StringUtil.isBlank(allergy.getAllergyFood().getDegree().getName()))
+                    && (allergy.getAllergyFood().getAllergyDesc() == null || StringUtil.isBlank(allergy.getAllergyFood().getAllergyDesc().getName()))) {
+                info.set(info.get() + allergy.getAllergyFood().getName() + " ");
+            }
+        }
+        if (StringUtil.isNotBlank(info.get())) {
+            status.set("-1");
+        }
+    }
+
+}

+ 59 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0040.java

@@ -0,0 +1,59 @@
+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.Allergy;
+import com.lantone.qc.pub.model.label.PastLabel;
+import com.lantone.qc.pub.util.ListUtil;
+import com.lantone.qc.pub.util.StringUtil;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+
+/**
+ * @Description: 药物过敏史描述不完整
+ * @author: rengb
+ * @time: 2020/3/10 14:02
+ */
+@Component
+public class BEH0040 extends QCCatalogue {
+
+    @Override
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        status.set("0");
+        if (inputInfo.getBeHospitalizedDoc() == null) {
+            return;
+        }
+        PastLabel pastLabel = inputInfo.getBeHospitalizedDoc().getPastLabel();
+        if (pastLabel == null) {
+            return;
+        }
+        String pastText = pastLabel.getText();
+        if (StringUtil.isNotBlank(pastText) && pastText.contains("药物过敏史")) {
+            return;
+        }
+        List<Allergy> allergies = pastLabel.getAllergies();
+        if (ListUtil.isEmpty(allergies)) {
+            return;
+        }
+        for (Allergy allergy : allergies) {
+            if (allergy == null
+                    || StringUtil.isBlank(allergy.getName())
+                    || allergy.getAllergyMedicine() == null
+                    || StringUtil.isBlank(allergy.getAllergyMedicine().getName())) {
+                continue;
+            }
+            if ((allergy.getNegative() == null || StringUtil.isBlank(allergy.getNegative().getName()))
+                    && (allergy.getAllergyMedicine().getPd() == null || StringUtil.isBlank(allergy.getAllergyMedicine().getPd().getName()))
+                    && (allergy.getAllergyMedicine().getDegree() == null || StringUtil.isBlank(allergy.getAllergyMedicine().getDegree().getName()))
+                    && (allergy.getAllergyMedicine().getAllergyDesc() == null || StringUtil.isBlank(allergy.getAllergyMedicine().getAllergyDesc().getName()))) {
+                info.set(info.get() + allergy.getAllergyMedicine().getName() + " ");
+            }
+        }
+        if (StringUtil.isNotBlank(info.get())) {
+            status.set("-1");
+        }
+    }
+
+}

+ 42 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0041.java

@@ -0,0 +1,42 @@
+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.apache.commons.lang3.StringUtils;
+import org.springframework.stereotype.Component;
+
+import java.util.Map;
+
+/**
+ * @Description: 个人史未填写
+ * @author: rengb
+ * @time: 2020/3/10 14:02
+ */
+@Component
+public class BEH0041 extends QCCatalogue {
+
+    @Override
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        if(inputInfo.getBeHospitalizedDoc() == null){
+            status.set("0");
+            return;
+        }
+        Map<String, String> structureMap = inputInfo.getBeHospitalizedDoc().getStructureMap();
+        //以台州为例,个人史细分很多结构化信息,取其一
+        if (StringUtils.isNotEmpty(structureMap.get("出生、生长史"))
+                || StringUtils.isNotEmpty(structureMap.get("疫区居留史"))
+                || StringUtils.isNotEmpty(structureMap.get("冶游史"))
+                || StringUtils.isNotEmpty(structureMap.get("工作性质"))
+                || StringUtils.isNotEmpty(structureMap.get("化学及放射性毒物接触史"))) {
+            status.set("0");
+            return;
+        }
+
+        if (StringUtil.isNotBlank(inputInfo.getBeHospitalizedDoc().getPersonalLabel().getText())) {
+            status.set("0");
+        }
+    }
+
+}

+ 68 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0042.java

@@ -0,0 +1,68 @@
+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.Address;
+import com.lantone.qc.pub.util.ListUtil;
+import com.lantone.qc.pub.util.StringUtil;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+import java.util.Map;
+import java.util.regex.Pattern;
+
+/**
+ * @Description: 出生地未描述
+ * @author: rengb
+ * @time: 2020/3/10 14:02
+ */
+@Component
+public class BEH0042 extends QCCatalogue {
+
+    @Override
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        if(inputInfo.getBeHospitalizedDoc() == null){
+            status.set("0");
+            return;
+        }
+        Map<String, String> structureMap = inputInfo.getBeHospitalizedDoc().getStructureMap();
+        if (StringUtils.isNotEmpty(structureMap.get("出生地"))) {
+            status.set("0");
+            return;
+        }
+
+        if (StringUtils.isNotEmpty(structureMap.get("籍贯"))) {
+            status.set("0");
+            return;
+        }
+
+        String text = inputInfo.getBeHospitalizedDoc().getPersonalLabel().getText();
+        if (StringUtil.isBlank(text)) {
+            return;
+        }
+        List<Address> addresses = inputInfo.getBeHospitalizedDoc().getPersonalLabel().getAddresses();
+        if (ListUtil.isNotEmpty(addresses)) {
+            long count = addresses.stream().filter(i -> {
+                boolean flag = false;
+                if (i != null && StringUtil.isNotBlank(i.getName())) {
+                    if (i.getName().indexOf("出生") > -1) {
+                        flag = true;
+                    } else {
+                        Pattern pattern = Pattern.compile("[\\s\\S]*(出生|生长)[\\s\\S]{0,5}" + i.getName() + "[\\s\\S]*");
+                        flag = pattern.matcher(text).matches();
+                    }
+                }
+                return flag;
+            }).count();
+            if (count > 0) {
+                status.set("0");
+            }
+        }
+        if (text.contains("出生")|| text.contains("见旧病历") || text.contains("见既往病历")) {
+            status.set("0");
+        }
+    }
+
+}

+ 70 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0043.java

@@ -0,0 +1,70 @@
+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.Address;
+import com.lantone.qc.pub.model.label.PersonalLabel;
+import com.lantone.qc.pub.util.ListUtil;
+import com.lantone.qc.pub.util.StringUtil;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+import java.util.Map;
+import java.util.regex.Pattern;
+
+/**
+ * @Description: 居住地未描述
+ * @author: rengb
+ * @time: 2020/3/10 14:02
+ */
+@Component
+public class BEH0043 extends QCCatalogue {
+
+    @Override
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        if (inputInfo.getBeHospitalizedDoc() == null) {
+            status.set("0");
+            return;
+        }
+        //台州结构化
+        Map<String, String> structureMap = inputInfo.getBeHospitalizedDoc().getStructureMap();
+        if (StringUtils.isNotEmpty(structureMap.get("联系地址")) || StringUtils.isNotEmpty(structureMap.get("现住址"))
+                || StringUtils.isNotEmpty(structureMap.get("家庭住址")) || StringUtils.isNotEmpty(structureMap.get("住址"))) {
+            status.set("0");
+            return;
+        }
+
+        PersonalLabel personalLabel = inputInfo.getBeHospitalizedDoc().getPersonalLabel();
+        if (personalLabel == null) {
+            status.set("0");
+            return;
+        }
+        String text = personalLabel.getText();
+        if (StringUtil.isBlank(text) || text.contains("居住") || text.contains("生长") || text.contains("生活") || text.contains("本地")
+                || text.contains("详见")|| text.contains("见旧病历") || text.contains("见既往病历")) {
+            status.set("0");
+            return;
+        }
+        List<Address> addresses = personalLabel.getAddresses();
+        if (ListUtil.isNotEmpty(addresses)) {
+            long count = addresses.stream().filter(i -> {
+                boolean flag = false;
+                if (i != null && StringUtil.isNotBlank(i.getName())) {
+                    if (i.getName().indexOf("居住") > -1) {
+                        flag = true;
+                    } else {
+                        Pattern pattern = Pattern.compile("[\\s\\S]*(居住|生长)[\\s\\S]{0,5}" + i.getName() + "[\\s\\S]*");
+                        flag = pattern.matcher(text).matches();
+                    }
+                }
+                return flag;
+            }).count();
+            if (count > 0) {
+                status.set("0");
+            }
+        }
+    }
+
+}

+ 56 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0044.java

@@ -0,0 +1,56 @@
+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.EpidemicArea;
+import com.lantone.qc.pub.model.label.PersonalLabel;
+import com.lantone.qc.pub.util.StringUtil;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.stereotype.Component;
+
+import java.util.Map;
+
+/**
+ * @Description: 疫区接触史未描述
+ * @author: rengb
+ * @time: 2020/3/10 14:02
+ */
+@Component
+public class BEH0044 extends QCCatalogue {
+
+    @Override
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        if (inputInfo.getBeHospitalizedDoc() == null) {
+            status.set("0");
+            return;
+        }
+        //台州结构化
+        Map<String, String> structureMap_beh = inputInfo.getBeHospitalizedDoc().getStructureMap();
+        if (StringUtils.isNotEmpty(structureMap_beh.get("疫区居留史"))) {
+            status.set("0");
+            return;
+        }
+        PersonalLabel personalLabel = inputInfo.getBeHospitalizedDoc().getPersonalLabel();
+        if (personalLabel == null || StringUtil.isBlank(personalLabel.getText())) {
+            status.set("0");
+            return;
+        }
+        String personalText = personalLabel.getText();
+        if (personalText.contains("详见病历")) {
+            status.set("0");
+            return;
+        }
+        //北仑硬匹配
+        if (personalText.contains("否认疫水疫源接触史") || personalText.contains("否认疫区、疫情、疫水接触史")
+                || personalText.contains("否认其他疫区、疫情、疫水接触史") || personalText.contains("否认发病前14天内曾接触过来自武汉")) {
+            status.set("0");
+            return;
+        }
+        EpidemicArea epidemicArea = personalLabel.getEpidemicArea();
+        if (epidemicArea != null && StringUtil.isNotBlank(epidemicArea.getName())) {
+            status.set("0");
+        }
+    }
+
+}

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

@@ -0,0 +1,50 @@
+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.MaritalHistory;
+import com.lantone.qc.pub.model.label.PersonalLabel;
+import com.lantone.qc.pub.util.StringUtil;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.stereotype.Component;
+
+import java.util.Map;
+
+/**
+ * @Description: 冶游史未描述
+ * @author: rengb
+ * @time: 2020/3/10 14:02
+ */
+@Component
+public class BEH0045 extends QCCatalogue {
+
+    @Override
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        if (inputInfo.getBeHospitalizedDoc() == null) {
+            status.set("0");
+            return;
+        }
+        //台州结构化
+        Map<String, String> structureMap = inputInfo.getBeHospitalizedDoc().getStructureMap();
+        if (StringUtils.isNotEmpty(structureMap.get("冶游史"))) {
+            status.set("0");
+            return;
+        }
+        PersonalLabel personalLabel = inputInfo.getBeHospitalizedDoc().getPersonalLabel();
+        if (personalLabel == null || StringUtil.isBlank(personalLabel.getText())) {
+            status.set("0");
+            return;
+        }
+        String personalText = personalLabel.getText();
+        if (personalText.contains("冶游史") || personalText.contains("详见")) {
+            status.set("0");
+            return;
+        }
+        MaritalHistory maritalHistory = personalLabel.getMaritalHistory();
+        if (maritalHistory != null && StringUtil.isNotBlank(maritalHistory.getName())) {
+            status.set("0");
+        }
+    }
+
+}

+ 51 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0046.java

@@ -0,0 +1,51 @@
+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.Smoking;
+import com.lantone.qc.pub.model.label.PersonalLabel;
+import com.lantone.qc.pub.util.StringUtil;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.stereotype.Component;
+
+import java.util.Map;
+
+/**
+ * @Description: 吸烟史未描述
+ * @author: rengb
+ * @time: 2020/3/10 14:02
+ */
+@Component
+public class BEH0046 extends QCCatalogue {
+
+    @Override
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        if (inputInfo.getBeHospitalizedDoc() == null) {
+            status.set("0");
+            return;
+        }
+        //台州结构化
+        Map<String, String> structureMap = inputInfo.getBeHospitalizedDoc().getStructureMap();
+        if (StringUtils.isNotEmpty(structureMap.get("吸烟"))) {
+            status.set("0");
+            return;
+        }
+        PersonalLabel personalLabel = inputInfo.getBeHospitalizedDoc().getPersonalLabel();
+        if (personalLabel == null) {
+            status.set("0");
+            return;
+        }
+        String personalText = personalLabel.getText();
+        if (StringUtil.isBlank(personalText) || personalText.contains("偶有") || personalText.contains("烟")
+                || personalText.contains("详见")) {
+            status.set("0");
+            return;
+        }
+        Smoking smoking = personalLabel.getSmoking();
+        if (smoking != null && StringUtil.isNotBlank(smoking.getName())) {
+            status.set("0");
+        }
+    }
+
+}

+ 53 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0047.java

@@ -0,0 +1,53 @@
+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.Drinking;
+import com.lantone.qc.pub.model.label.PersonalLabel;
+import com.lantone.qc.pub.util.StringUtil;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.stereotype.Component;
+
+import java.util.Map;
+
+/**
+ * @Description: 饮酒史未描述
+ * @author: rengb
+ * @time: 2020/3/10 14:02
+ */
+@Component
+public class BEH0047 extends QCCatalogue {
+
+    @Override
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        if (inputInfo.getBeHospitalizedDoc() == null) {
+            status.set("0");
+            return;
+        }
+        Map<String, String> structureMap = inputInfo.getBeHospitalizedDoc().getStructureMap();
+        if (StringUtils.isNotEmpty(structureMap.get("饮酒"))) {
+            status.set("0");
+            return;
+        }
+        PersonalLabel personalLabel = inputInfo.getBeHospitalizedDoc().getPersonalLabel();
+        if (personalLabel == null || StringUtil.isBlank(personalLabel.getText())) {
+            status.set("0");
+            return;
+        }
+        String pastText = personalLabel.getText();
+        if (pastText.contains("饮酒") || pastText.contains("详见")|| pastText.contains("见旧病历") || pastText.contains("见既往病历")) {
+            status.set("0");
+            return;
+        }
+
+        Drinking drinking = personalLabel.getDrinking();
+        if (drinking != null && StringUtil.isNotBlank(drinking.getName())) {
+            status.set("0");
+        }
+        //硬匹配规则
+        if (inputInfo.getBeHospitalizedDoc().getPersonalLabel().getText().contains("酒")) {
+            status.set("0");
+        }
+    }
+}

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

@@ -0,0 +1,50 @@
+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.Contact;
+import com.lantone.qc.pub.model.label.PersonalLabel;
+import com.lantone.qc.pub.util.StringUtil;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.stereotype.Component;
+
+import java.util.Map;
+
+/**
+ * @Description: 放射物、毒物、粉尘接触史未描述
+ * @author: rengb
+ * @time: 2020/3/10 14:02
+ */
+@Component
+public class BEH0048 extends QCCatalogue {
+
+    @Override
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        if (inputInfo.getBeHospitalizedDoc() == null) {
+            status.set("0");
+            return;
+        }
+        Map<String, String> structureMap = inputInfo.getBeHospitalizedDoc().getStructureMap();
+        if (StringUtils.isNotEmpty(structureMap.get("化学及放射性毒物接触史"))) {
+            status.set("0");
+            return;
+        }
+
+        PersonalLabel personalLabel = inputInfo.getBeHospitalizedDoc().getPersonalLabel();
+        if (personalLabel == null || StringUtil.isBlank(personalLabel.getText())) {
+            status.set("0");
+            return;
+        }
+        String personalText = personalLabel.getText();
+        if (personalText.contains("详见")) {
+            status.set("0");
+            return;
+        }
+        Contact contact = personalLabel.getContact();
+        if (contact != null && StringUtil.isNotBlank(contact.getName())) {
+            status.set("0");
+        }
+    }
+
+}

+ 41 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0049.java

@@ -0,0 +1,41 @@
+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.SpecialHobby;
+import com.lantone.qc.pub.model.label.PersonalLabel;
+import com.lantone.qc.pub.util.StringUtil;
+import org.springframework.stereotype.Component;
+
+/**
+ * @Description: 特殊嗜好未描述
+ * @author: rengb
+ * @time: 2020/3/10 14:02
+ */
+@Component
+public class BEH0049 extends QCCatalogue {
+
+    @Override
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        if(inputInfo.getBeHospitalizedDoc() == null){
+            status.set("0");
+            return;
+        }
+        PersonalLabel personalLabel = inputInfo.getBeHospitalizedDoc().getPersonalLabel();
+        if (personalLabel == null || StringUtil.isBlank(personalLabel.getText())) {
+            status.set("0");
+            return;
+        }
+        String personalText = personalLabel.getText();
+        if (personalText.contains("详见") || personalText.contains("特殊嗜好")) {
+            status.set("0");
+            return;
+        }
+        SpecialHobby specialHobby = personalLabel.getSpecialHobby();
+        if (specialHobby != null && StringUtil.isNotEmpty(specialHobby.getName())) {
+            status.set("0");
+        }
+    }
+
+}

+ 55 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0050.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.model.entity.Smoking;
+import com.lantone.qc.pub.model.entity.Usage;
+import com.lantone.qc.pub.model.label.PersonalLabel;
+import com.lantone.qc.pub.util.StringUtil;
+import org.springframework.stereotype.Component;
+
+/**
+ * @Description: 吸烟史患者描述不规范
+ * @author: rengb
+ * @time: 2020/3/10 14:02
+ */
+@Component
+public class BEH0050 extends QCCatalogue {
+
+    @Override
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        if(inputInfo.getBeHospitalizedDoc() == null){
+            status.set("0");
+            return;
+        }
+        PersonalLabel personalLabel = inputInfo.getBeHospitalizedDoc().getPersonalLabel();
+        if (personalLabel == null){
+            status.set("0");
+            return;
+        }
+        String personalText = personalLabel.getText();
+        if (StringUtil.isNotBlank(personalText) && personalText.contains("偶有")){
+            status.set("0");
+            return;
+        }
+        if (StringUtil.isNotBlank(personalText) && (personalText.contains("无吸烟史")|| personalText.contains("否认吸烟史"))){
+            status.set("0");
+            return;
+        }
+        Smoking smoking = personalLabel.getSmoking();
+        if (smoking == null
+                || StringUtil.isBlank(smoking.getName())
+                || (smoking.getNegative() != null && StringUtil.isNotBlank(smoking.getNegative().getName()))
+                || (smoking.getPd() != null && StringUtil.isNotBlank(smoking.getPd().getName()))
+                || (smoking.getUsage() != null && StringUtil.isNotBlank(smoking.getUsage().getName()))) {
+            status.set("0");
+        }
+        //出现用量实体,即认为规范
+        Usage usage = inputInfo.getBeHospitalizedDoc().getPersonalLabel().getUsage();
+        if (usage != null && StringUtil.isNotEmpty(usage.getName())) {
+            status.set("0");
+        }
+    }
+
+}

+ 51 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0051.java

@@ -0,0 +1,51 @@
+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.Drinking;
+import com.lantone.qc.pub.model.entity.Usage;
+import com.lantone.qc.pub.model.label.PersonalLabel;
+import com.lantone.qc.pub.util.StringUtil;
+import org.springframework.stereotype.Component;
+
+/**
+ * @Description: 饮酒史患者描述不规范
+ * @author: rengb
+ * @time: 2020/3/10 14:02
+ */
+@Component
+public class BEH0051 extends QCCatalogue {
+
+    @Override
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        if (inputInfo.getBeHospitalizedDoc() == null) {
+            status.set("0");
+            return;
+        }
+        PersonalLabel personalLabel = inputInfo.getBeHospitalizedDoc().getPersonalLabel();
+        if (personalLabel == null) {
+            status.set("0");
+            return;
+        }
+        String pastText = personalLabel.getText();
+        if (StringUtil.isNotBlank(pastText) && (pastText.contains("饮酒") || pastText.contains("喝酒"))) {
+            status.set("0");
+            return;
+        }
+        Drinking drinking = personalLabel.getDrinking();
+        if (drinking == null
+                || StringUtil.isBlank(drinking.getName())
+                || (drinking.getNegative() != null && StringUtil.isNotBlank(drinking.getNegative().getName()))
+                || (drinking.getPd() != null && StringUtil.isNotBlank(drinking.getPd().getName()))
+                || (drinking.getUsage() != null && StringUtil.isNotBlank(drinking.getUsage().getName()))) {
+            status.set("0");
+        }
+        //出现用量实体,即认为规范
+        Usage usage = inputInfo.getBeHospitalizedDoc().getPersonalLabel().getUsage();
+        if (usage != null && StringUtil.isNotEmpty(usage.getName())) {
+            status.set("0");
+        }
+    }
+
+}

+ 40 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0052.java

@@ -0,0 +1,40 @@
+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;
+
+/**
+ * @Description: 婚育史未填写
+ * @author: rengb
+ * @time: 2020/3/10 14:02
+ */
+@Component
+public class BEH0052 extends QCCatalogue {
+
+    @Override
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        if (inputInfo.getBeHospitalizedDoc() == null) {
+            status.set("0");
+            return;
+        }
+        Map<String, String> BehStructureMap = inputInfo.getBeHospitalizedDoc().getStructureMap();
+        String marry = BehStructureMap.get("婚姻");
+        if (StringUtil.isBlank(marry)) {
+            marry = BehStructureMap.get("婚姻状况");
+        }
+        if (StringUtil.isNotBlank(marry) && marry.contains("未婚")) {
+            status.set("0");
+            return;
+        }
+        if (inputInfo.getBeHospitalizedDoc().getMaritalLabel() == null
+                || StringUtil.isNotBlank(inputInfo.getBeHospitalizedDoc().getMaritalLabel().getText())) {
+            status.set("0");
+        }
+    }
+
+}

+ 65 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0053.java

@@ -0,0 +1,65 @@
+package com.lantone.qc.kernel.catalogue.behospitalized;
+
+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.model.doc.BeHospitalizedDoc;
+import com.lantone.qc.pub.model.entity.Marryiage;
+import com.lantone.qc.pub.model.label.MaritalLabel;
+import com.lantone.qc.pub.util.StringUtil;
+import org.springframework.stereotype.Component;
+
+import java.util.Map;
+
+/**
+ * @Description: 结婚年龄未描述
+ * @author: rengb
+ * @time: 2020/3/10 14:02
+ */
+@Component
+public class BEH0053 extends QCCatalogue {
+
+    @Override
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        BeHospitalizedDoc beHospitalizedDoc = inputInfo.getBeHospitalizedDoc();
+        if (beHospitalizedDoc == null) {
+            status.set("0");
+            return;
+        }
+        //先取一次结构化数据
+        Map<String, String> beHospitalizedStructureMap = beHospitalizedDoc.getStructureMap();
+        String marryiAgeStr = beHospitalizedStructureMap.get("结婚年龄");
+        if (StringUtil.isNotBlank(marryiAgeStr)) {
+            status.set("0");
+            return;
+        }
+        //硬规则 匹配未婚
+        String marry = beHospitalizedDoc.getStructureMap().get(Content.marry);
+        if (StringUtil.isBlank(marry)) {
+            marry = beHospitalizedDoc.getStructureMap().get("婚姻状况");
+        }
+        MaritalLabel maritalLabel = beHospitalizedDoc.getMaritalLabel();
+        if (maritalLabel == null || StringUtil.isBlank(maritalLabel.getText())) {
+            status.set("0");
+            return;
+        }
+        String maritalText = maritalLabel.getText();
+        if ("未婚".equals(marry) || maritalText.contains("未婚") || maritalText.contains("详见")
+                || maritalText.contains("离婚") || maritalText.contains("离异") || maritalText.contains("结婚")
+                || maritalText.contains("丧偶")|| maritalText.contains("见旧病历") || maritalText.contains("见既往病历")) {
+            status.set("0");
+            return;
+        }
+        if (beHospitalizedDoc.getMaritalLabel() == null
+                || StringUtil.isBlank(beHospitalizedDoc.getMaritalLabel().getText())) {
+            status.set("0");
+        }
+
+        Marryiage marryiage = beHospitalizedDoc.getMaritalLabel().getMarryiage();
+        if (marryiage != null && StringUtil.isNotBlank(marryiage.getName())) {
+            status.set("0");
+        }
+    }
+
+}

+ 54 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0054.java

@@ -0,0 +1,54 @@
+package com.lantone.qc.kernel.catalogue.behospitalized;
+
+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.model.entity.Consanguineous;
+import com.lantone.qc.pub.model.label.FamilyLabel;
+import com.lantone.qc.pub.model.label.MaritalLabel;
+import com.lantone.qc.pub.util.StringUtil;
+import org.springframework.stereotype.Component;
+
+/**
+ * @Description: 是否近亲结婚未描述
+ * @author: rengb
+ * @time: 2020/3/10 14:02
+ */
+@Component
+public class BEH0054 extends QCCatalogue {
+
+    @Override
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        if (inputInfo.getBeHospitalizedDoc() == null) {
+            status.set("0");
+            return;
+        }
+        //硬规则 未婚
+        String marry = inputInfo.getBeHospitalizedDoc().getStructureMap().get(Content.marry);
+        MaritalLabel maritalLabel = inputInfo.getBeHospitalizedDoc().getMaritalLabel();
+        FamilyLabel familyLabel = inputInfo.getBeHospitalizedDoc().getFamilyLabel();
+        if (maritalLabel == null) {
+            status.set("0");
+            return;
+        }
+        if ("未婚".equals(marry) || StringUtil.isBlank(maritalLabel.getText()) || maritalLabel.getText().contains("未婚")
+                || maritalLabel.getText().contains("详见")) {
+            status.set("0");
+            return;
+        }
+        /* 有少数病历的近亲结婚时会写在家族史中(普通病历会写在婚育史里) */
+        if (familyLabel != null) {
+            String familyText = familyLabel.getText();
+            if (StringUtil.isNotBlank(familyText) && familyText.contains("近亲结婚")) {
+                status.set("0");
+                return;
+            }
+        }
+        Consanguineous consanguineous = inputInfo.getBeHospitalizedDoc().getMaritalLabel().getConsanguineous();
+        if (consanguineous != null && StringUtil.isNotBlank(consanguineous.getName())) {
+            status.set("0");
+        }
+    }
+
+}

+ 23 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0055.java

@@ -0,0 +1,23 @@
+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 org.springframework.stereotype.Component;
+
+/**
+ * @Description:
+ * @author: rengb
+ * @time: 2020/3/10 14:02
+ */
+@Component
+public class BEH0055 extends QCCatalogue {
+
+    @Override
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        if(inputInfo.getBeHospitalizedDoc() == null){
+            status.set("0");
+            return;
+        }
+    }
+}

+ 70 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0056.java

@@ -0,0 +1,70 @@
+package com.lantone.qc.kernel.catalogue.behospitalized;
+
+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.model.doc.BeHospitalizedDoc;
+import com.lantone.qc.pub.model.entity.ConjugalRelation;
+import com.lantone.qc.pub.model.label.MaritalLabel;
+import com.lantone.qc.pub.util.StringUtil;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.stereotype.Component;
+
+import java.util.Map;
+
+/**
+ * @Description: 夫妻关系未描述
+ * @author: rengb
+ * @time: 2020/3/10 14:02
+ */
+@Component
+public class BEH0056 extends QCCatalogue {
+
+    @Override
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        if (inputInfo.getBeHospitalizedDoc() == null) {
+            status.set("0");
+            return;
+        }
+        BeHospitalizedDoc beHospitalizedDoc = inputInfo.getBeHospitalizedDoc();
+        Map<String, String> structureMap = beHospitalizedDoc.getStructureMap();
+        if (StringUtils.isNotEmpty(structureMap.get("夫妻关系"))) {
+            status.set("0");
+            return;
+        }
+        //婚育史未填写,直接返回;
+        MaritalLabel maritalLabel = beHospitalizedDoc.getMaritalLabel();
+        if (maritalLabel == null || StringUtils.isEmpty(maritalLabel.getText())) {
+            status.set("0");
+            return;
+        }
+        //硬规则 匹配未婚
+        String marry = structureMap.get(Content.marry);
+        String text = maritalLabel.getText();
+        if (StringUtil.isNotBlank(text)) {
+            if (text.contains("未婚") || text.contains("离异") || text.contains("离婚") || text.contains("丧偶")
+                    || "未婚".equals(marry) || text.contains("详见")) {
+                status.set("0");
+                return;
+            }
+        }
+        ConjugalRelation conjugalRelation = inputInfo.getBeHospitalizedDoc().getMaritalLabel().getConjugalRelation();
+        if (conjugalRelation != null) {
+            if (StringUtil.isNotBlank(conjugalRelation.getName())) {
+                status.set("0");
+                return;
+            }
+        }
+        if (inputInfo.getBeHospitalizedDoc().getMaritalLabel().getFamily() != null) {
+            long cont = inputInfo.getBeHospitalizedDoc().getMaritalLabel()
+                    .getFamily().stream()
+                    .filter(family -> family.getName().contains("配偶") && family.getDead() != null).count();
+            if (cont > 0) {
+                status.set("0");
+                return;
+            }
+        }
+    }
+
+}

+ 23 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0057.java

@@ -0,0 +1,23 @@
+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 org.springframework.stereotype.Component;
+
+/**
+ * @Description:
+ * @author: rengb
+ * @time: 2020/3/10 14:02
+ */
+@Component
+public class BEH0057 extends QCCatalogue {
+
+    @Override
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        if(inputInfo.getBeHospitalizedDoc() == null){
+            status.set("0");
+            return;
+        }
+    }
+}

+ 110 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0058.java

@@ -0,0 +1,110 @@
+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.Content;
+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.Family;
+import com.lantone.qc.pub.model.entity.Fertility;
+import com.lantone.qc.pub.model.label.MaritalLabel;
+import com.lantone.qc.pub.util.ListUtil;
+import com.lantone.qc.pub.util.StringUtil;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+import java.util.Map;
+import java.util.regex.Pattern;
+
+/**
+ * @Description: 子女数量情况未描述
+ * @author: rengb
+ * @time: 2020/3/10 14:02
+ */
+@Component
+public class BEH0058 extends QCCatalogue {
+
+    @Override
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        if (inputInfo.getBeHospitalizedDoc() == null) {
+            status.set("0");
+            return;
+        }
+        BeHospitalizedDoc beHospitalizedDoc = inputInfo.getBeHospitalizedDoc();
+        //硬规则 匹配未育
+        String marry = beHospitalizedDoc.getStructureMap().get(Content.marry);
+        MaritalLabel maritalLabel = beHospitalizedDoc.getMaritalLabel();
+        if (maritalLabel == null) {
+            status.set("0");
+            return;
+        }
+        Fertility fertility = maritalLabel.getFertility();
+        if (fertility != null) {
+            status.set("0");
+            return;
+        }
+        String maritalText = maritalLabel.getText();
+        if (StringUtil.isBlank(maritalText)) {
+            status.set("0");
+            return;
+        } else {
+            String regex = ".*\\d?子\\d?女.*";
+            boolean flag = maritalText.matches(regex);
+            regex = ".*\\d+-\\d+-\\d+-[1-9].*";
+            boolean matches = maritalText.matches(regex);
+            regex = ".*\\d+,\\d+,\\d+,[1-9].*|.*\\d个.*|.*\\d男.*|.*\\d女.*|.*\\d子.*";
+            boolean isComma = maritalText.matches(regex);
+            if (flag || matches || isComma) {
+                status.set("0");
+                return;
+            }
+        }
+        //硬规则 匹配未育
+        if ("未婚".equals(marry)) {
+            status.set("0");
+            return;
+        }
+        if (StringUtil.isNotBlank(maritalText)) {
+            List<String> words = Lists.newArrayList("未婚", "未育", "未婚育", "未生育", "未生", "0子0女"
+                    , "0-0-0-0", "详见", "0-0-0-0");
+            for (String word : words) {
+                if (maritalText.contains(word)) {
+                    status.set("0");
+                    return;
+                }
+            }
+        }
+        Map<String, String> structureMap = beHospitalizedDoc.getStructureMap();
+        String familyMembersHealth = structureMap.get("家庭成员健康情况");
+        List<Family> familyList = Lists.newArrayList();
+        List<Family> familiesFl = inputInfo.getBeHospitalizedDoc().getFamilyLabel().getFamilies();
+        List<Family> familiesMl = inputInfo.getBeHospitalizedDoc().getMaritalLabel().getFamily();
+        if (ListUtil.isNotEmpty(familiesFl)) {
+            familyList.addAll(familiesFl);
+        }
+        if (ListUtil.isNotEmpty(familiesMl)) {
+            familyList.addAll(familiesMl);
+        }
+        Pattern p = Pattern.compile("[儿子女]");
+        if (StringUtil.isNotBlank(familyMembersHealth)) {
+            if (p.matcher(familyMembersHealth).find()) {
+                status.set("0");
+                return;
+            }
+        }
+        long count = familyList
+                .stream()
+                .filter(
+                        i -> i != null
+                                && StringUtil.isNotBlank(i.getName())
+                                && StringUtil.isContainNumber(i.getName())
+                                && p.matcher(i.getName()).find()
+                )
+                .count();
+        if (count > 0) {
+            status.set("0");
+        }
+    }
+
+}

+ 65 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0059.java

@@ -0,0 +1,65 @@
+package com.lantone.qc.kernel.catalogue.behospitalized;
+
+import com.lantone.qc.kernel.catalogue.QCCatalogue;
+import com.lantone.qc.kernel.util.CatalogueUtil;
+import com.lantone.qc.pub.model.InputInfo;
+import com.lantone.qc.pub.model.OutputInfo;
+import com.lantone.qc.pub.model.label.MenstrualLabel;
+import com.lantone.qc.pub.util.StringUtil;
+import org.springframework.stereotype.Component;
+
+import java.util.Map;
+
+/**
+ * @ClassName : BEH0059
+ * @Description : 月经史未填写
+ * @Author : 胡敬
+ * @Date: 2020-03-10 10:10
+ */
+@Component
+public class BEH0059 extends QCCatalogue {
+    @Override
+    protected void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        if (inputInfo.getBeHospitalizedDoc() != null) {
+            if (inputInfo.getBeHospitalizedDoc().getStructureMap() == null
+                    || inputInfo.getBeHospitalizedDoc().getStructureMap().get("性别") == null
+                    || inputInfo.getBeHospitalizedDoc().getStructureMap().get("性别").contains("男")) {
+                status.set("0"); //如果性别是男,就不报错
+            } else {
+                String concatMenstrualText = concatMenstrualText(inputInfo);
+                if (StringUtil.isNotBlank(concatMenstrualText)) {
+                    status.set("0");
+                    return;
+                }
+                MenstrualLabel menstrualLabel = inputInfo.getBeHospitalizedDoc().getMenstrualLabel();
+                if (menstrualLabel == null) {
+                    return;
+                }
+                String menstrualText = StringUtil.removeBlank(menstrualLabel.getText()).replaceAll("[月经史|:|:|null]", "");
+                if (StringUtil.isBlank(menstrualText)) {
+                    return;
+                }
+                boolean containChinese = CatalogueUtil.isContainChinese(menstrualText);
+                if (containChinese) {
+                    status.set("0"); //如果性别是女,不为空就不报错
+                }
+            }
+        }else {
+            status.set("0");
+            return;
+        }
+    }
+
+    private String concatMenstrualText(InputInfo inputInfo) {
+        Map<String, String> beHospitalizedStructureMap = inputInfo.getBeHospitalizedDoc().getStructureMap();
+        StringBuilder sb = new StringBuilder();
+        for (Map.Entry<String, String> bhMap : beHospitalizedStructureMap.entrySet()) {
+            if (bhMap.getKey().contains("月经") || bhMap.getKey().contains("经期") || bhMap.getKey().contains("绝经")) {
+                if (StringUtil.isNotBlank(bhMap.getValue())) {
+                    sb.append(bhMap.getValue());
+                }
+            }
+        }
+        return sb.toString();
+    }
+}

+ 53 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0060.java

@@ -0,0 +1,53 @@
+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.Menses;
+import com.lantone.qc.pub.model.label.MenstrualLabel;
+import com.lantone.qc.pub.util.StringUtil;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @ClassName : BEH0060
+ * @Description : 月经史未描述初潮年龄
+ * @Author : 胡敬
+ * @Date: 2020-03-11 10:19
+ */
+@Component
+public class BEH0060 extends QCCatalogue {
+    @Override
+    protected void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        if (inputInfo.getBeHospitalizedDoc() != null) {
+            if (inputInfo.getBeHospitalizedDoc().getStructureMap() == null
+                    || inputInfo.getBeHospitalizedDoc().getStructureMap().get("性别") == null
+                    || inputInfo.getBeHospitalizedDoc().getStructureMap().get("性别").contains("男")) {
+                status.set("0"); //如果性别是男,就不报错
+            } else {
+                Map<String, String> structureMap = inputInfo.getBeHospitalizedDoc().getStructureMap();
+                if (StringUtil.isNotBlank(structureMap.get("月经初潮年龄"))){
+                    status.set("0");
+                    return;
+                }
+                if (inputInfo.getBeHospitalizedDoc().getMenstrualLabel() != null) {
+                    MenstrualLabel menstrualLabel = inputInfo.getBeHospitalizedDoc().getMenstrualLabel();
+                    String text = menstrualLabel.getText();
+                    if (StringUtil.isNotBlank(text) && text.contains("未行经")) {
+                        status.set("0");
+                        return;
+                    }
+                    List<Menses> mensesList = menstrualLabel.getMensesList();
+                    for (Menses menses : mensesList) {
+                        if (menses.getMenarcheAge() != null && StringUtil.isNotBlank(menses.getMenarcheAge().getName())) {
+                            status.set("0");
+                            return;
+                        }
+                    }
+                }
+            }
+        }
+    }
+}

+ 57 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0061.java

@@ -0,0 +1,57 @@
+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.Menses;
+import com.lantone.qc.pub.model.label.MenstrualLabel;
+import com.lantone.qc.pub.util.ListUtil;
+import com.lantone.qc.pub.util.StringUtil;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @ClassName : BEH0061
+ * @Description : 月经史未描述月经周期
+ * @Author : 胡敬
+ * @Date: 2020-03-11 14:18
+ */
+@Component
+public class BEH0061 extends QCCatalogue {
+    @Override
+    protected void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        if (inputInfo.getBeHospitalizedDoc() != null) {
+            if (inputInfo.getBeHospitalizedDoc().getStructureMap() == null
+                    || inputInfo.getBeHospitalizedDoc().getStructureMap().get("性别") == null
+                    || inputInfo.getBeHospitalizedDoc().getStructureMap().get("性别").contains("男")) {
+                status.set("0"); //如果性别是男,就不报错
+            } else {
+                Map<String, String> structureMap = inputInfo.getBeHospitalizedDoc().getStructureMap();
+                if (StringUtil.isNotBlank(structureMap.get("月经周期"))) {
+                    status.set("0");
+                    return;
+                }
+                if (inputInfo.getBeHospitalizedDoc().getMenstrualLabel() != null) {
+                    MenstrualLabel menstrualLabel = inputInfo.getBeHospitalizedDoc().getMenstrualLabel();
+                    String text = menstrualLabel.getText();
+                    if (StringUtil.isNotBlank(text) && text.contains("未行经")) {
+                        status.set("0");
+                        return;
+                    }
+                    List<Menses> mensesList = menstrualLabel.getMensesList();
+                    if (ListUtil.isEmpty(mensesList)) {
+                        return;
+                    }
+                    for (Menses menses : mensesList) {
+                        if (menses.getMenstrualCycle() != null && StringUtil.isNotBlank(menses.getMenstrualCycle().getName())) {
+                            status.set("0");
+                            return;
+                        }
+                    }
+                }
+            }
+        }
+    }
+}

+ 57 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0062.java

@@ -0,0 +1,57 @@
+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.Menses;
+import com.lantone.qc.pub.model.label.MenstrualLabel;
+import com.lantone.qc.pub.util.ListUtil;
+import com.lantone.qc.pub.util.StringUtil;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @ClassName : BEH0062
+ * @Description : 月经史未描述行经天数
+ * @Author : 胡敬
+ * @Date: 2020-03-11 14:20
+ */
+@Component
+public class BEH0062 extends QCCatalogue {
+    @Override
+    protected void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        if (inputInfo.getBeHospitalizedDoc() != null) {
+            if (inputInfo.getBeHospitalizedDoc().getStructureMap() == null
+                    || inputInfo.getBeHospitalizedDoc().getStructureMap().get("性别") == null
+                    || inputInfo.getBeHospitalizedDoc().getStructureMap().get("性别").contains("男")) {
+                status.set("0"); //如果性别是男,就不报错
+            } else {
+                Map<String, String> structureMap = inputInfo.getBeHospitalizedDoc().getStructureMap();
+                if (StringUtil.isNotBlank(structureMap.get("经期天数"))) {
+                    status.set("0");
+                    return;
+                }
+                if (inputInfo.getBeHospitalizedDoc().getMenstrualLabel() != null) {
+                    MenstrualLabel menstrualLabel = inputInfo.getBeHospitalizedDoc().getMenstrualLabel();
+                    String text = menstrualLabel.getText();
+                    if (StringUtil.isNotBlank(text) && text.contains("未行经")) {
+                        status.set("0");
+                        return;
+                    }
+                    List<Menses> mensesList = menstrualLabel.getMensesList();
+                    if (ListUtil.isEmpty(mensesList)) {
+                        return;
+                    }
+                    for (Menses menses : mensesList) {
+                        if (menses.getMensesDuration() != null && StringUtil.isNotBlank(menses.getMensesDuration().getName())) {
+                            status.set("0");
+                            return;
+                        }
+                    }
+                }
+            }
+        }
+    }
+}

+ 68 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0063.java

@@ -0,0 +1,68 @@
+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.Menses;
+import com.lantone.qc.pub.model.label.MenstrualLabel;
+import com.lantone.qc.pub.util.ListUtil;
+import com.lantone.qc.pub.util.StringUtil;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @ClassName : BEH0063
+ * @Description : 月经史未描述末次月经时间/闭经日期/绝经年龄
+ * @Author : 胡敬
+ * @Date: 2020-03-11 14:26
+ */
+@Component
+public class BEH0063 extends QCCatalogue {
+    @Override
+    protected void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        if (inputInfo.getBeHospitalizedDoc() != null) {
+            if (inputInfo.getBeHospitalizedDoc().getStructureMap() == null
+                    || inputInfo.getBeHospitalizedDoc().getStructureMap().get("性别") == null
+                    || inputInfo.getBeHospitalizedDoc().getStructureMap().get("性别").contains("男")) {
+                status.set("0"); //如果性别是男,就不报错
+            } else {
+                Map<String, String> structureMap = inputInfo.getBeHospitalizedDoc().getStructureMap();
+                if (StringUtil.isNotBlank(structureMap.get("末次月经日期"))
+                        || StringUtil.isNotBlank(structureMap.get("绝经年龄"))) {
+                    status.set("0");
+                    return;
+                }
+                if (inputInfo.getBeHospitalizedDoc().getMenstrualLabel() != null) {
+                    MenstrualLabel menstrualLabel = inputInfo.getBeHospitalizedDoc().getMenstrualLabel();
+                    String text = menstrualLabel.getText();
+                    if (StringUtil.isNotBlank(text) && text.contains("未行经")) {
+                        status.set("0");
+                        return;
+                    }
+                    List<Menses> mensesList = menstrualLabel.getMensesList();
+                    if (ListUtil.isEmpty(mensesList)) {
+                        return;
+                    }
+                    boolean isFindLastMenstrual = false, isFindMenopauseTime = false, isFindMenopauseAge = false;
+                    for (Menses menses : mensesList) {
+                        if (menses.getLastMenstrual() != null && StringUtil.isNotBlank(menses.getLastMenstrual().getName())) { //末次月经时间
+                            isFindLastMenstrual = true;
+                        }
+                        if (menses.getMenopauseTime() != null && StringUtil.isNotBlank(menses.getMenopauseTime().getName())) { //闭经日期
+                            isFindMenopauseTime = true;
+                        }
+                        if (menses.getMenopauseAge() != null && StringUtil.isNotBlank(menses.getMenopauseAge().getName())) { //绝经年龄
+                            isFindMenopauseAge = true;
+                        }
+                        if (isFindLastMenstrual && isFindMenopauseTime && isFindMenopauseAge) {
+                            status.set("0");
+                            return;
+                        }
+                    }
+                }
+            }
+        }
+    }
+}

+ 72 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0064.java

@@ -0,0 +1,72 @@
+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.Clinical;
+import com.lantone.qc.pub.model.entity.Menses;
+import com.lantone.qc.pub.model.label.MenstrualLabel;
+import com.lantone.qc.pub.util.ListUtil;
+import com.lantone.qc.pub.util.StringUtil;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @ClassName : BEH0064
+ * @Description : 月经史未描述月经量
+ * @Author : 胡敬
+ * @Date: 2020-03-11 14:41
+ */
+@Component
+public class BEH0064 extends QCCatalogue {
+    @Override
+    protected void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        if (inputInfo.getBeHospitalizedDoc() == null) {
+            status.set("0");
+            return;
+        }
+        if (inputInfo.getBeHospitalizedDoc().getStructureMap().get("性别") == null
+                || inputInfo.getBeHospitalizedDoc().getStructureMap().get("性别").contains("男")) {
+            status.set("0"); //如果性别是男,就不报错
+        } else {
+            Map<String, String> structureMap = inputInfo.getBeHospitalizedDoc().getStructureMap();
+            if (StringUtil.isNotBlank(structureMap.get("月经量"))) {
+                status.set("0");
+                return;
+            }
+            //硬规则匹配经量
+            if (StringUtil.isNotBlank(structureMap.get("月经史"))) {
+                if (structureMap.get("月经史").contains("经量")) {
+                    status.set("0");
+                    return;
+                }
+            }
+            if (inputInfo.getBeHospitalizedDoc().getMenstrualLabel() != null) {
+                MenstrualLabel menstrualLabel = inputInfo.getBeHospitalizedDoc().getMenstrualLabel();
+                String text = menstrualLabel.getText();
+                if (StringUtil.isNotBlank(text) && text.contains("未行经")) {
+                    status.set("0");
+                    return;
+                }
+                List<Menses> mensesList = menstrualLabel.getMensesList();
+                if (ListUtil.isEmpty(mensesList)) {
+                    return;
+                }
+                for (Menses menses : mensesList) {
+                    if (menses.getClinicals() == null) {
+                        continue;
+                    }
+                    List<Clinical> clinicals = menses.getClinicals();
+                    for (Clinical clinical : clinicals) {
+                        if (clinical.getName().contains("经量")) {
+                            status.set("0");
+                            return;
+                        }
+                    }
+                }
+            }
+        }
+    }
+}

+ 60 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0065.java

@@ -0,0 +1,60 @@
+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.Clinical;
+import com.lantone.qc.pub.model.entity.Menses;
+import com.lantone.qc.pub.model.label.MenstrualLabel;
+import com.lantone.qc.pub.util.ListUtil;
+import com.lantone.qc.pub.util.StringUtil;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+
+/**
+ * @ClassName : BEH0065
+ * @Description : 月经史未描述月经颜色
+ * @Author : 胡敬
+ * @Date: 2020-03-11 14:47
+ */
+@Component
+public class BEH0065 extends QCCatalogue {
+    @Override
+    protected void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        if (inputInfo.getBeHospitalizedDoc() == null) {
+            status.set("0");
+            return;
+        }
+        if (inputInfo.getBeHospitalizedDoc().getStructureMap().get("性别") == null
+                || inputInfo.getBeHospitalizedDoc().getStructureMap().get("性别").contains("男")) {
+            status.set("0"); //如果性别是男,就不报错
+        } else if (inputInfo.getBeHospitalizedDoc().getMenstrualLabel() == null
+                || inputInfo.getBeHospitalizedDoc().getMenstrualLabel().getText().contains("null")) {
+            status.set("0");
+        } else {
+            MenstrualLabel menstrualLabel = inputInfo.getBeHospitalizedDoc().getMenstrualLabel();
+            String text = menstrualLabel.getText();
+            if (StringUtil.isNotBlank(text) && (text.contains("未行经") || text.contains("颜色")|| text.contains("绝经")|| text.contains("未来潮"))) {
+                status.set("0");
+                return;
+            }
+            List<Menses> mensesList = menstrualLabel.getMensesList();
+            if (ListUtil.isEmpty(mensesList)) {
+                return;
+            }
+            for (Menses menses : mensesList) {
+                if (menses.getClinicals() == null) {
+                    continue;
+                }
+                List<Clinical> clinicals = menses.getClinicals();
+                for (Clinical clinical : clinicals) {
+                    if (clinical.getName().contains("颜色")) {
+                        status.set("0");
+                        return;
+                    }
+                }
+            }
+        }
+    }
+}

+ 57 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0066.java

@@ -0,0 +1,57 @@
+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.Clinical;
+import com.lantone.qc.pub.model.entity.Menses;
+import com.lantone.qc.pub.model.label.MenstrualLabel;
+import com.lantone.qc.pub.util.ListUtil;
+import com.lantone.qc.pub.util.StringUtil;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+
+/**
+ * @ClassName : BEH0066
+ * @Description : 月经史未描述月经血块情况
+ * @Author : 胡敬
+ * @Date: 2020-03-11 14:48
+ */
+@Component
+public class BEH0066 extends QCCatalogue {
+    @Override
+    protected void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        if (inputInfo.getBeHospitalizedDoc() == null) {
+            status.set("0");
+            return;
+        }
+        if (inputInfo.getBeHospitalizedDoc().getStructureMap().get("性别") == null
+                || inputInfo.getBeHospitalizedDoc().getStructureMap().get("性别").contains("男")) {
+            status.set("0"); //如果性别是男,就不报错
+        } else if (inputInfo.getBeHospitalizedDoc().getMenstrualLabel() != null) {
+            MenstrualLabel menstrualLabel = inputInfo.getBeHospitalizedDoc().getMenstrualLabel();
+            String text = menstrualLabel.getText();
+            if (StringUtil.isNotBlank(text) && text.contains("未行经")){
+                status.set("0");
+                return;
+            }
+            List<Menses> mensesList = menstrualLabel.getMensesList();
+            if (ListUtil.isEmpty(mensesList)) {
+                return;
+            }
+            for (Menses menses : mensesList) {
+                if (menses.getClinicals() == null) {
+                    continue;
+                }
+                List<Clinical> clinicals = menses.getClinicals();
+                for (Clinical clinical : clinicals) {
+                    if (clinical.getName().contains("血块")) {
+                        status.set("0");
+                        return;
+                    }
+                }
+            }
+        }
+    }
+}

+ 71 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0067.java

@@ -0,0 +1,71 @@
+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.Clinical;
+import com.lantone.qc.pub.model.entity.Menses;
+import com.lantone.qc.pub.model.label.MenstrualLabel;
+import com.lantone.qc.pub.util.ListUtil;
+import com.lantone.qc.pub.util.StringUtil;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @ClassName : BEH0067
+ * @Description : 月经史未描述月经痛经情况
+ * @Author : 胡敬
+ * @Date: 2020-03-11 14:49
+ */
+@Component
+public class BEH0067 extends QCCatalogue {
+    @Override
+    protected void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        if (inputInfo.getBeHospitalizedDoc() == null) {
+            status.set("0");
+            return;
+        }
+        if (inputInfo.getBeHospitalizedDoc().getStructureMap().get("性别") == null
+                || inputInfo.getBeHospitalizedDoc().getStructureMap().get("性别").contains("男")) {
+            status.set("0"); //如果性别是男,就不报错
+        } else {
+            Map<String, String> structureMap = inputInfo.getBeHospitalizedDoc().getStructureMap();
+            if (StringUtil.isNotBlank(structureMap.get("痛经"))) {
+                status.set("0");
+                return;
+            }
+            if (inputInfo.getBeHospitalizedDoc().getMenstrualLabel() != null) {
+                MenstrualLabel menstrualLabel = inputInfo.getBeHospitalizedDoc().getMenstrualLabel();
+                String labelText = menstrualLabel.getText();
+                if (StringUtil.isNotBlank(labelText) && (labelText.contains("未行经") ||labelText.contains("痛经"))) {
+                    status.set("0");
+                    return;
+                }
+
+                if (ListUtil.isEmpty(menstrualLabel.getMensesList())) {
+                    return;
+                }
+                List<Menses> mensesList = menstrualLabel.getMensesList();
+                if (ListUtil.isEmpty(mensesList)) {
+                    return;
+                }
+                for (Menses menses : mensesList) {
+                    if (menses.getClinicals() == null) {
+                        continue;
+                    }
+                    List<Clinical> clinicals = menses.getClinicals();
+                    if (ListUtil.isNotEmpty(clinicals)) {
+                        for (Clinical clinical : clinicals) {
+                            if (clinical.getName().contains("痛经")) {
+                                status.set("0");
+                                return;
+                            }
+                        }
+                    }
+                }
+            }
+        }
+    }
+}

+ 54 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0068.java

@@ -0,0 +1,54 @@
+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.label.MenstrualLabel;
+import com.lantone.qc.pub.util.StringUtil;
+import org.springframework.stereotype.Component;
+
+import java.util.Map;
+
+/**
+ * @ClassName : BEH0068
+ * @Description : 月经史未描述白带情况
+ * @Author : 胡敬
+ * @Date: 2020-03-11 14:49
+ */
+@Component
+public class BEH0068 extends QCCatalogue {
+    @Override
+    protected void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        if (inputInfo.getBeHospitalizedDoc() == null) {
+            status.set("0");
+            return;
+        }
+        if (inputInfo.getBeHospitalizedDoc().getStructureMap().get("性别") == null
+                || inputInfo.getBeHospitalizedDoc().getStructureMap().get("性别").contains("男")) {
+            status.set("0"); //如果性别是男,就不报错
+        } else if (inputInfo.getBeHospitalizedDoc().getMenstrualLabel() == null
+                || inputInfo.getBeHospitalizedDoc().getMenstrualLabel().getText().contains("null")) {
+            status.set("0");
+        } else {
+            Map<String, String> structureMap = inputInfo.getBeHospitalizedDoc().getStructureMap();
+            if (StringUtil.isNotBlank(structureMap.get("白带"))) {
+                status.set("0");
+                return;
+            }
+            if (inputInfo.getBeHospitalizedDoc().getMenstrualLabel() != null) {
+                MenstrualLabel menstrualLabel = inputInfo.getBeHospitalizedDoc().getMenstrualLabel();
+                String text = menstrualLabel.getText();
+                if (StringUtil.isNotBlank(text) && (text.contains("未行经") || text.contains("未来潮") || text.contains("绝经") || text.contains("白带正常"))) {
+                    status.set("0");
+                    return;
+                }
+                if (menstrualLabel.getLeukorrheas() == null) {
+                    return;
+                }
+                if (menstrualLabel.getLeukorrheas().size() > 0) {
+                    status.set("0");
+                }
+            }
+        }
+    }
+}

+ 44 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0069.java

@@ -0,0 +1,44 @@
+package com.lantone.qc.kernel.catalogue.behospitalized;
+
+import com.lantone.qc.kernel.catalogue.QCCatalogue;
+import com.lantone.qc.kernel.util.CatalogueUtil;
+import com.lantone.qc.pub.model.InputInfo;
+import com.lantone.qc.pub.model.OutputInfo;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.stereotype.Component;
+
+import java.util.Map;
+
+/**
+ * @ClassName : BEH0069
+ * @Description : 家族史未填写
+ * @Author : 胡敬
+ * @Date: 2020-03-10 15:08
+ */
+@Component
+public class BEH0069 extends QCCatalogue {
+    @Override
+    protected void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        //台州结构化
+        if (inputInfo.getBeHospitalizedDoc() == null) {
+            status.set("0");
+            return;
+        }
+        Map<String, String> structureMap = inputInfo.getBeHospitalizedDoc().getStructureMap();
+        if (StringUtils.isNotEmpty(structureMap.get("家庭成员类似病史"))
+                ||StringUtils.isNotEmpty(structureMap.get("外祖父母"))
+                ||StringUtils.isNotEmpty(structureMap.get("家族遗传病"))
+                ||StringUtils.isNotEmpty(structureMap.get("既往妊娠分娩情况"))
+                ||StringUtils.isNotEmpty(structureMap.get("近亲结婚史"))) {
+            status.set("0");
+            return;
+        }
+
+
+        if (inputInfo.getBeHospitalizedDoc() != null && inputInfo.getBeHospitalizedDoc().getFamilyLabel() != null) {
+            if (!CatalogueUtil.isEmpty(inputInfo.getBeHospitalizedDoc().getFamilyLabel().getText())) {
+                status.set("0");
+            }
+        }
+    }
+}

+ 70 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0070.java

@@ -0,0 +1,70 @@
+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.entity.Family;
+import com.lantone.qc.pub.model.label.FamilyLabel;
+import com.lantone.qc.pub.util.ListUtil;
+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 : BEH0070
+ * @Description : 家族史未描述是否有家族性遗传病史及传染病史
+ * @Author : 胡敬
+ * @Date: 2020-03-11 15:09
+ */
+@Component
+public class BEH0070 extends QCCatalogue {
+    @Override
+    protected void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        if (inputInfo.getBeHospitalizedDoc() == null) {
+            status.set("0");
+            return;
+        }
+        Map<String, String> structureMap = inputInfo.getBeHospitalizedDoc().getStructureMap();
+        String familyText = structureMap.get("家族史");
+        if (StringUtil.isNotBlank(familyText)) {
+            familyText = StringUtil.removeBlank(familyText);
+            if (familyText.contains("家族遗传病") || familyText.contains("结核") || familyText.contains("遗传病")) {
+                status.set("0");
+                return;
+            }
+        }
+        if (inputInfo.getBeHospitalizedDoc().getFamilyLabel() != null) {
+            FamilyLabel familyLabel = inputInfo.getBeHospitalizedDoc().getFamilyLabel();
+            List<Family> families = familyLabel.getFamilies();
+            if (ListUtil.isEmpty(families)) {
+                status.set("0");
+                return;
+            }
+            boolean isFindGeneticDiseaseKeyword = false, isFindDiagInfectious = false;
+            for (Family family : families) {
+                if (family.getGeneticDiseaseKeyword() != null && StringUtil.isNotBlank(family.getGeneticDiseaseKeyword().getName())) {
+                    isFindGeneticDiseaseKeyword = true;
+                }
+                if (family.getDiagInfectious() != null && StringUtil.isNotBlank(family.getDiagInfectious().getName())) {
+                    isFindDiagInfectious = true;
+                }
+                if (family.getDiags() != null) {
+                    List<Diag> diags = family.getDiags().stream().filter(diag ->
+                            (diag.getHospitalDiagName() != null && diag.getHospitalDiagName().contains("炎"))
+                                    || (diag.getHospitalDiagName() != null && diag.getHospitalDiagName().contains("核"))).collect(Collectors.toList());
+                    if (diags.size() > 0) {
+                        isFindDiagInfectious = true;
+                    }
+                }
+                if (isFindGeneticDiseaseKeyword || isFindDiagInfectious) {
+                    status.set("0");
+                    return;
+                }
+            }
+        }
+    }
+}

+ 38 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0071.java

@@ -0,0 +1,38 @@
+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.Family;
+import com.lantone.qc.pub.model.label.FamilyLabel;
+import com.lantone.qc.pub.util.StringUtil;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+
+/**
+ * @ClassName : BEH0071
+ * @Description : 父母、兄弟、姐妹及子女的健康状况未描述
+ * @Author : 胡敬
+ * @Date: 2020-03-11 15:09
+ */
+@Component
+public class BEH0071 extends QCCatalogue {
+    @Override
+    protected void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        if (inputInfo.getBeHospitalizedDoc() == null) {
+            status.set("0");
+            return;
+        }
+        if (inputInfo.getBeHospitalizedDoc().getFamilyLabel() != null) {
+            FamilyLabel familyLabel = inputInfo.getBeHospitalizedDoc().getFamilyLabel();
+            List<Family> families = familyLabel.getFamilies();
+            for (Family family:families) {
+                if (family.getHealthCondition() != null && StringUtil.isNotBlank(family.getHealthCondition().getName())){
+                    status.set("0");
+                    return;
+                }
+            }
+        }
+    }
+}

+ 59 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0072.java

@@ -0,0 +1,59 @@
+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.Dead;
+import com.lantone.qc.pub.model.entity.Family;
+import com.lantone.qc.pub.model.label.FamilyLabel;
+import com.lantone.qc.pub.util.ListUtil;
+import com.lantone.qc.pub.util.StringUtil;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+
+/**
+ * @ClassName : BEH0072
+ * @Description : 家属有死亡者,未记录死亡原因
+ * @Author : 胡敬
+ * @Date: 2020-03-11 16:44
+ */
+@Component
+public class BEH0072 extends QCCatalogue {
+    @Override
+    protected void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        status.set("0");
+        if (inputInfo.getBeHospitalizedDoc() != null && inputInfo.getBeHospitalizedDoc().getFamilyLabel() != null) {
+            FamilyLabel familyLabel = inputInfo.getBeHospitalizedDoc().getFamilyLabel();
+            if (familyLabel == null) {
+                return;
+            }
+            String familyText = familyLabel.getText();
+            if (StringUtil.isNotBlank(familyText)) {
+                familyText = familyText.substring(0, Math.min(15, familyText.length()));
+                if (familyText.contains("死因") || familyText.contains("原因") || familyText.contains("详")
+                || familyText.contains("因") || familyText.contains("死于")) {
+                    return;
+                }
+            }
+            List<Family> families = familyLabel.getFamilies();
+            if (ListUtil.isEmpty(families)) {
+                return;
+            }
+            for (Family family : families) {
+                if (family.getDead() != null) {
+                    Dead dead = family.getDead();
+                    if (family.getName().contains("年迈") || dead.getNegative() != null) {
+                        continue;
+                    }
+                    if (dead.getDeadReason() != null || dead.getUnknow() != null) {
+                        return;
+                    } else {
+                        status.set("-1");
+                        return;
+                    }
+                }
+            }
+        }
+    }
+}

+ 70 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0073.java

@@ -0,0 +1,70 @@
+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.entity.Family;
+import com.lantone.qc.pub.model.label.FamilyLabel;
+import com.lantone.qc.pub.util.ListUtil;
+import com.lantone.qc.pub.util.StringUtil;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @ClassName : BEH0073
+ * @Description : 家族中是否有肝炎、结核等病史未描述
+ * @Author : 胡敬
+ * @Date: 2020-03-11 17:05
+ */
+@Component
+public class BEH0073 extends QCCatalogue {
+    @Override
+    protected void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        if (inputInfo.getBeHospitalizedDoc() == null) {
+            status.set("0");
+            return;
+        }
+        Map<String, String> structureMap = inputInfo.getBeHospitalizedDoc().getStructureMap();
+        if (StringUtils.isNotEmpty(structureMap.get("病毒性肝炎")) || StringUtils.isNotEmpty(structureMap.get("结核病"))) {
+            status.set("0");
+            return;
+        }
+        FamilyLabel familyLabel = inputInfo.getBeHospitalizedDoc().getFamilyLabel();
+        if (familyLabel == null || StringUtil.isBlank(familyLabel.getText())) {
+            status.set("0");
+            return;
+        }
+        String familyText = familyLabel.getText();
+        if (familyText.contains("肝炎") || familyText.contains("结核") || familyText.contains("详见")) {
+            status.set("0");
+            return;
+        }
+        List<Family> families = familyLabel.getFamilies();
+        if (ListUtil.isNotEmpty(families)) {
+            for (Family family : families) {
+                if (family.getDiags() == null || family.getDiags().size() == 0) {
+                    continue;
+                }
+                for (Diag diag : family.getDiags()) {
+                    String hospitalDiagName = diag.getHospitalDiagName();
+                    String name = diag.getName();
+                    if (findDiag(hospitalDiagName) || findDiag(name)) {
+                        status.set("0");
+                        return;
+                    }
+                }
+            }
+        }
+    }
+
+    private boolean findDiag(String diagName) {
+        if (StringUtil.isBlank(diagName)) {
+            return false;
+        }
+        return diagName.contains("肝炎") || diagName.contains("结核");
+    }
+}

+ 60 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0074.java

@@ -0,0 +1,60 @@
+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.entity.Family;
+import com.lantone.qc.pub.model.label.FamilyLabel;
+import com.lantone.qc.pub.util.ListUtil;
+import com.lantone.qc.pub.util.StringUtil;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+
+/**
+ * @ClassName : BEH0074
+ * @Description : 两系三代内是否有肿瘤病史未描述
+ * @Author : 胡敬
+ * @Date: 2020-03-11 17:05
+ */
+@Component
+public class BEH0074 extends QCCatalogue {
+    @Override
+    protected void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        if (inputInfo.getBeHospitalizedDoc() == null) {
+            status.set("0");
+            return;
+        }
+        FamilyLabel familyLabel = inputInfo.getBeHospitalizedDoc().getFamilyLabel();
+        if (familyLabel == null) {
+            status.set("0");
+            return;
+        }
+        String familyText = familyLabel.getText();
+        if (StringUtil.isNotBlank(familyText) && (familyText.contains("瘤") || familyText.contains("癌"))) {
+            status.set("0");
+            return;
+        }
+        List<Family> families = familyLabel.getFamilies();
+        if (ListUtil.isEmpty(families)) {
+            status.set("0");
+            return;
+        }
+        for (Family family : families) {
+            if (family.getTumour() != null) {
+                status.set("0");
+                return;
+            }
+            for (Diag diag : family.getDiags()) {
+                if (diag.getNegative() == null &&
+                        (diag.getHospitalDiagName().contains("肿瘤") || diag.getHospitalDiagName().contains("癌"))) {
+                    status.set("0");
+                    return;
+                }
+            }
+
+        }
+
+    }
+}

+ 43 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0075.java

@@ -0,0 +1,43 @@
+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.Family;
+import com.lantone.qc.pub.model.label.FamilyLabel;
+import com.lantone.qc.pub.util.ListUtil;
+import com.lantone.qc.pub.util.StringUtil;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+
+/**
+ * @ClassName : BEH0075
+ * @Description : 类似疾病史未描述
+ * @Author : 胡敬
+ * @Date: 2020-03-11 17:37
+ */
+@Component
+public class BEH0075 extends QCCatalogue {
+    @Override
+    protected void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        status.set("0");
+        if (inputInfo.getBeHospitalizedDoc() != null && inputInfo.getBeHospitalizedDoc().getFamilyLabel() != null) {
+            FamilyLabel familyLabel = inputInfo.getBeHospitalizedDoc().getFamilyLabel();
+            List<Family> families = familyLabel.getFamilies();
+            if (ListUtil.isEmpty(families)) {
+                return;
+            }
+            boolean findSimilarDiag = false;
+            for (Family family : families) {
+                if (family.getSimilarDiag() != null && StringUtil.isNotBlank(family.getSimilarDiag().getName())) {
+                    findSimilarDiag = true;
+                    break;
+                }
+            }
+            if (!findSimilarDiag){
+                status.set("-1");
+            }
+        }
+    }
+}

+ 41 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0076.java

@@ -0,0 +1,41 @@
+package com.lantone.qc.kernel.catalogue.behospitalized;
+
+import com.lantone.qc.kernel.catalogue.QCCatalogue;
+import com.lantone.qc.kernel.util.CatalogueUtil;
+import com.lantone.qc.pub.model.InputInfo;
+import com.lantone.qc.pub.model.OutputInfo;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.stereotype.Component;
+
+import java.util.Map;
+
+/**
+ * @ClassName : BEH0076
+ * @Description : 体格检查未填写
+ * @Author : 胡敬
+ * @Date: 2020-03-10 15:10
+ */
+@Component
+public class BEH0076 extends QCCatalogue {
+    @Override
+    protected void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        if (inputInfo.getBeHospitalizedDoc() == null) {
+            status.set("0");
+            return;
+        }
+        Map<String, String> structureMap = inputInfo.getBeHospitalizedDoc().getStructureMap();
+        //以台州为例,个人史细分很多结构化信息,取其一
+        if (StringUtils.isNotEmpty(structureMap.get("体温(口)"))
+                || StringUtils.isNotEmpty(structureMap.get("脉搏"))
+                || StringUtils.isNotEmpty(structureMap.get("血压"))
+                || StringUtils.isNotEmpty(structureMap.get("身高"))) {
+            status.set("0");
+            return;
+        }
+        if (inputInfo.getBeHospitalizedDoc() != null && inputInfo.getBeHospitalizedDoc().getVitalLabel() != null) {
+            if (!CatalogueUtil.isEmpty(inputInfo.getBeHospitalizedDoc().getVitalLabel().getText())) {
+                status.set("0");
+            }
+        }
+    }
+}

+ 29 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0079.java

@@ -0,0 +1,29 @@
+package com.lantone.qc.kernel.catalogue.behospitalized;
+
+import com.lantone.qc.kernel.catalogue.QCCatalogue;
+import com.lantone.qc.kernel.util.CatalogueUtil;
+import com.lantone.qc.pub.model.InputInfo;
+import com.lantone.qc.pub.model.OutputInfo;
+import org.springframework.stereotype.Component;
+
+/**
+ * @ClassName : BEH0079
+ * @Description : 专科检查未填写
+ * @Author : 胡敬
+ * @Date: 2020-03-10 15:12
+ */
+@Component
+public class BEH0079 extends QCCatalogue {
+    @Override
+    protected void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        if (inputInfo.getBeHospitalizedDoc() == null) {
+            status.set("0");
+            return;
+        }
+        if (inputInfo.getBeHospitalizedDoc().getVitalLabelSpecial() != null) {
+            if (!CatalogueUtil.isEmpty(inputInfo.getBeHospitalizedDoc().getVitalLabelSpecial().getText())) {
+                status.set("0");
+            }
+        }
+    }
+}

+ 38 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0081.java

@@ -0,0 +1,38 @@
+package com.lantone.qc.kernel.catalogue.behospitalized;
+
+import com.lantone.qc.kernel.catalogue.QCCatalogue;
+import com.lantone.qc.kernel.util.CatalogueUtil;
+import com.lantone.qc.pub.model.InputInfo;
+import com.lantone.qc.pub.model.OutputInfo;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.stereotype.Component;
+
+import java.util.Map;
+
+/**
+ * @ClassName : BEH0081
+ * @Description : 辅助检查与结果未记录
+ * @Author : 胡敬
+ * @Date: 2020-03-11 19:29
+ */
+@Component
+public class BEH0081 extends QCCatalogue {
+    @Override
+    protected void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        if (inputInfo.getBeHospitalizedDoc() == null) {
+            status.set("0");
+            return;
+        }
+        Map<String, String> structureMap = inputInfo.getBeHospitalizedDoc().getStructureMap();
+        if (StringUtils.isNotEmpty(structureMap.get("辅助检查结果"))) {
+            status.set("0");
+            return;
+        }
+
+        if (inputInfo.getBeHospitalizedDoc() != null && inputInfo.getBeHospitalizedDoc().getPacsLabel() != null) {
+            if (!CatalogueUtil.isEmpty(inputInfo.getBeHospitalizedDoc().getPacsLabel().getText())) {
+                status.set("0");
+            }
+        }
+    }
+}

+ 49 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0082.java

@@ -0,0 +1,49 @@
+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.OuterCourtyard;
+import com.lantone.qc.pub.model.entity.Pacs;
+import com.lantone.qc.pub.util.StringUtil;
+import org.springframework.stereotype.Component;
+
+/**
+ * @ClassName : BEH0082
+ * @Description : 外院医疗机构检查记录不规范
+ * @Author : 胡敬
+ * @Date: 2020-03-12 16:29
+ */
+@Component
+public class BEH0082 extends QCCatalogue {
+    @Override
+    protected void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        if (inputInfo.getBeHospitalizedDoc() == null) {
+            status.set("0");
+            return;
+        }
+        if (inputInfo.getBeHospitalizedDoc().getPacsLabel() == null) {
+            status.set("0");
+            return;
+        }
+        if (inputInfo.getBeHospitalizedDoc().getPacsLabel().getPacses() == null) {
+            status.set("0");
+            return;
+        }
+        int outerCourtyardObjNum = 0;
+        for (Pacs pacs : inputInfo.getBeHospitalizedDoc().getPacsLabel().getPacses()) {
+            if (pacs.getOuterCourtyard() == null) {
+                outerCourtyardObjNum++;
+            } else {
+                OuterCourtyard outerCourtyard = pacs.getOuterCourtyard();
+                if (outerCourtyard.getPd().size() > 0 && StringUtil.isNotBlank(outerCourtyard.getPacsValue().getName())) {
+                    status.set("0");
+                    break;
+                }
+            }
+        }
+        if (outerCourtyardObjNum == inputInfo.getBeHospitalizedDoc().getPacsLabel().getPacses().size()) {
+            status.set("0");
+        }
+    }
+}

+ 32 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH02813.java

@@ -0,0 +1,32 @@
+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 : BEH02813
+ * @Description :  手术外伤史未填写
+ * @Author : 胡敬
+ * @Date: 2020-06-16 10:04
+ */
+@Component
+public class BEH02813 extends QCCatalogue {
+    @Override
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        status.set("0");
+        if (inputInfo.getBeHospitalizedDoc() == null) {
+            return;
+        }
+        if (inputInfo.getBeHospitalizedDoc() != null) {
+            Map<String, String> beHospitalStructureMap = inputInfo.getBeHospitalizedDoc().getStructureMap();
+            if (StringUtil.isBlank(beHospitalStructureMap.get("手术外伤史"))) {
+                status.set("-1");
+            }
+        }
+    }
+}

+ 30 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH02855.java

@@ -0,0 +1,30 @@
+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 : BEH02855
+ * @Description : 过敏史未填写
+ * @Author : 胡敬
+ * @Date: 2020-06-15 16:09
+ */
+@Component
+public class BEH02855 extends QCCatalogue {
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        if (inputInfo.getBeHospitalizedDoc() == null) {
+            status.set("0");
+            return;
+        }
+        Map<String, String> bhMap = inputInfo.getBeHospitalizedDoc().getStructureMap();
+        if (StringUtil.isNotEmpty(bhMap.get("过敏史"))) {
+            status.set("0");
+        }
+    }
+}

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


Some files were not shown because too many files changed in this diff