Browse Source

宁海县第一人民医院医院:初始化

rengb 4 years atrás
parent
commit
9bf53defc2
100 changed files with 5735 additions and 1 deletions
  1. 2 1
      kernel/src/main/java/com/lantone/qc/kernel/KernelApplication.java
  2. 36 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/ninghaiyiyi/anesthesiarelated/ANES0672.java
  3. 36 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/ninghaiyiyi/anesthesiarelated/ANES0673.java
  4. 36 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/ninghaiyiyi/anesthesiarelated/ANES0674.java
  5. 36 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/ninghaiyiyi/anesthesiarelated/ANES0675.java
  6. 36 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/ninghaiyiyi/anesthesiarelated/ANES0676.java
  7. 36 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/ninghaiyiyi/anesthesiarelated/ANES0677.java
  8. 36 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/ninghaiyiyi/anesthesiarelated/ANES0678.java
  9. 36 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/ninghaiyiyi/anesthesiarelated/ANES0679.java
  10. 131 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/ninghaiyiyi/behospitalized/BEH0001.java
  11. 125 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/ninghaiyiyi/behospitalized/BEH0002.java
  12. 35 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/ninghaiyiyi/behospitalized/BEH0003.java
  13. 41 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/ninghaiyiyi/behospitalized/BEH0004.java
  14. 70 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/ninghaiyiyi/behospitalized/BEH0005.java
  15. 122 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/ninghaiyiyi/behospitalized/BEH0006.java
  16. 66 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/ninghaiyiyi/behospitalized/BEH0007.java
  17. 43 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/ninghaiyiyi/behospitalized/BEH0008.java
  18. 67 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/ninghaiyiyi/behospitalized/BEH0009.java
  19. 73 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/ninghaiyiyi/behospitalized/BEH0010.java
  20. 240 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/ninghaiyiyi/behospitalized/BEH0011.java
  21. 79 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/ninghaiyiyi/behospitalized/BEH0012.java
  22. 58 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/ninghaiyiyi/behospitalized/BEH0013.java
  23. 98 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/ninghaiyiyi/behospitalized/BEH0014.java
  24. 45 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/ninghaiyiyi/behospitalized/BEH0015.java
  25. 38 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/ninghaiyiyi/behospitalized/BEH0016.java
  26. 63 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/ninghaiyiyi/behospitalized/BEH0017.java
  27. 81 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/ninghaiyiyi/behospitalized/BEH0018.java
  28. 42 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/ninghaiyiyi/behospitalized/BEH0019.java
  29. 38 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/ninghaiyiyi/behospitalized/BEH0020.java
  30. 43 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/ninghaiyiyi/behospitalized/BEH0021.java
  31. 44 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/ninghaiyiyi/behospitalized/BEH0022.java
  32. 47 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/ninghaiyiyi/behospitalized/BEH0023.java
  33. 55 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/ninghaiyiyi/behospitalized/BEH0024.java
  34. 70 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/ninghaiyiyi/behospitalized/BEH0025.java
  35. 60 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/ninghaiyiyi/behospitalized/BEH0026.java
  36. 52 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/ninghaiyiyi/behospitalized/BEH0027.java
  37. 54 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/ninghaiyiyi/behospitalized/BEH0028.java
  38. 71 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/ninghaiyiyi/behospitalized/BEH0029.java
  39. 56 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/ninghaiyiyi/behospitalized/BEH0030.java
  40. 69 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/ninghaiyiyi/behospitalized/BEH0031.java
  41. 72 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/ninghaiyiyi/behospitalized/BEH0032.java
  42. 23 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/ninghaiyiyi/behospitalized/BEH0033.java
  43. 70 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/ninghaiyiyi/behospitalized/BEH0034.java
  44. 79 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/ninghaiyiyi/behospitalized/BEH0035.java
  45. 50 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/ninghaiyiyi/behospitalized/BEH0036.java
  46. 60 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/ninghaiyiyi/behospitalized/BEH0037.java
  47. 55 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/ninghaiyiyi/behospitalized/BEH0038.java
  48. 61 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/ninghaiyiyi/behospitalized/BEH0039.java
  49. 59 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/ninghaiyiyi/behospitalized/BEH0040.java
  50. 42 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/ninghaiyiyi/behospitalized/BEH0041.java
  51. 63 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/ninghaiyiyi/behospitalized/BEH0042.java
  52. 70 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/ninghaiyiyi/behospitalized/BEH0043.java
  53. 56 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/ninghaiyiyi/behospitalized/BEH0044.java
  54. 50 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/ninghaiyiyi/behospitalized/BEH0045.java
  55. 51 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/ninghaiyiyi/behospitalized/BEH0046.java
  56. 53 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/ninghaiyiyi/behospitalized/BEH0047.java
  57. 50 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/ninghaiyiyi/behospitalized/BEH0048.java
  58. 41 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/ninghaiyiyi/behospitalized/BEH0049.java
  59. 55 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/ninghaiyiyi/behospitalized/BEH0050.java
  60. 51 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/ninghaiyiyi/behospitalized/BEH0051.java
  61. 40 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/ninghaiyiyi/behospitalized/BEH0052.java
  62. 65 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/ninghaiyiyi/behospitalized/BEH0053.java
  63. 54 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/ninghaiyiyi/behospitalized/BEH0054.java
  64. 23 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/ninghaiyiyi/behospitalized/BEH0055.java
  65. 70 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/ninghaiyiyi/behospitalized/BEH0056.java
  66. 23 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/ninghaiyiyi/behospitalized/BEH0057.java
  67. 110 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/ninghaiyiyi/behospitalized/BEH0058.java
  68. 65 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/ninghaiyiyi/behospitalized/BEH0059.java
  69. 53 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/ninghaiyiyi/behospitalized/BEH0060.java
  70. 57 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/ninghaiyiyi/behospitalized/BEH0061.java
  71. 57 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/ninghaiyiyi/behospitalized/BEH0062.java
  72. 68 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/ninghaiyiyi/behospitalized/BEH0063.java
  73. 72 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/ninghaiyiyi/behospitalized/BEH0064.java
  74. 60 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/ninghaiyiyi/behospitalized/BEH0065.java
  75. 57 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/ninghaiyiyi/behospitalized/BEH0066.java
  76. 71 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/ninghaiyiyi/behospitalized/BEH0067.java
  77. 54 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/ninghaiyiyi/behospitalized/BEH0068.java
  78. 44 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/ninghaiyiyi/behospitalized/BEH0069.java
  79. 70 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/ninghaiyiyi/behospitalized/BEH0070.java
  80. 38 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/ninghaiyiyi/behospitalized/BEH0071.java
  81. 59 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/ninghaiyiyi/behospitalized/BEH0072.java
  82. 70 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/ninghaiyiyi/behospitalized/BEH0073.java
  83. 60 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/ninghaiyiyi/behospitalized/BEH0074.java
  84. 43 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/ninghaiyiyi/behospitalized/BEH0075.java
  85. 41 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/ninghaiyiyi/behospitalized/BEH0076.java
  86. 29 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/ninghaiyiyi/behospitalized/BEH0079.java
  87. 38 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/ninghaiyiyi/behospitalized/BEH0081.java
  88. 49 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/ninghaiyiyi/behospitalized/BEH0082.java
  89. 32 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/ninghaiyiyi/behospitalized/BEH02813.java
  90. 30 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/ninghaiyiyi/behospitalized/BEH02855.java
  91. 53 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/ninghaiyiyi/behospitalized/BEH02860.java
  92. 106 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/ninghaiyiyi/behospitalized/BEH02887.java
  93. 78 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/ninghaiyiyi/behospitalized/BEH02902.java
  94. 55 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/ninghaiyiyi/behospitalized/BEH02903.java
  95. 49 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/ninghaiyiyi/behospitalized/BEH02908.java
  96. 124 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/ninghaiyiyi/behospitalized/BEH02909.java
  97. 31 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/ninghaiyiyi/behospitalized/BEH02914.java
  98. 30 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/ninghaiyiyi/behospitalized/BEH02915.java
  99. 30 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/ninghaiyiyi/behospitalized/BEH02916.java
  100. 0 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/ninghaiyiyi/behospitalized/BEH02917.java

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

@@ -23,7 +23,8 @@ import org.springframework.context.annotation.ComponentScan;
         "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.ywzxyy",
+        "com.lantone.qc.kernel.catalogue.ninghaiyiyi"
 })
 public class KernelApplication {
     public static void main(String[] args) {

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

@@ -0,0 +1,36 @@
+package com.lantone.qc.kernel.catalogue.ninghaiyiyi.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/ninghaiyiyi/anesthesiarelated/ANES0673.java

@@ -0,0 +1,36 @@
+package com.lantone.qc.kernel.catalogue.ninghaiyiyi.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/ninghaiyiyi/anesthesiarelated/ANES0674.java

@@ -0,0 +1,36 @@
+package com.lantone.qc.kernel.catalogue.ninghaiyiyi.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/ninghaiyiyi/anesthesiarelated/ANES0675.java

@@ -0,0 +1,36 @@
+package com.lantone.qc.kernel.catalogue.ninghaiyiyi.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/ninghaiyiyi/anesthesiarelated/ANES0676.java

@@ -0,0 +1,36 @@
+package com.lantone.qc.kernel.catalogue.ninghaiyiyi.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/ninghaiyiyi/anesthesiarelated/ANES0677.java

@@ -0,0 +1,36 @@
+package com.lantone.qc.kernel.catalogue.ninghaiyiyi.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/ninghaiyiyi/anesthesiarelated/ANES0678.java

@@ -0,0 +1,36 @@
+package com.lantone.qc.kernel.catalogue.ninghaiyiyi.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/ninghaiyiyi/anesthesiarelated/ANES0679.java

@@ -0,0 +1,36 @@
+package com.lantone.qc.kernel.catalogue.ninghaiyiyi.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/ninghaiyiyi/behospitalized/BEH0001.java

@@ -0,0 +1,131 @@
+package com.lantone.qc.kernel.catalogue.ninghaiyiyi.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/ninghaiyiyi/behospitalized/BEH0002.java

@@ -0,0 +1,125 @@
+package com.lantone.qc.kernel.catalogue.ninghaiyiyi.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/ninghaiyiyi/behospitalized/BEH0003.java

@@ -0,0 +1,35 @@
+package com.lantone.qc.kernel.catalogue.ninghaiyiyi.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/ninghaiyiyi/behospitalized/BEH0004.java

@@ -0,0 +1,41 @@
+package com.lantone.qc.kernel.catalogue.ninghaiyiyi.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/ninghaiyiyi/behospitalized/BEH0005.java

@@ -0,0 +1,70 @@
+package com.lantone.qc.kernel.catalogue.ninghaiyiyi.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/ninghaiyiyi/behospitalized/BEH0006.java

@@ -0,0 +1,122 @@
+package com.lantone.qc.kernel.catalogue.ninghaiyiyi.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/ninghaiyiyi/behospitalized/BEH0007.java

@@ -0,0 +1,66 @@
+package com.lantone.qc.kernel.catalogue.ninghaiyiyi.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.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/ninghaiyiyi/behospitalized/BEH0008.java

@@ -0,0 +1,43 @@
+package com.lantone.qc.kernel.catalogue.ninghaiyiyi.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/ninghaiyiyi/behospitalized/BEH0009.java

@@ -0,0 +1,67 @@
+package com.lantone.qc.kernel.catalogue.ninghaiyiyi.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/ninghaiyiyi/behospitalized/BEH0010.java

@@ -0,0 +1,73 @@
+package com.lantone.qc.kernel.catalogue.ninghaiyiyi.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());
+                }
+            }
+        }
+
+    }
+}

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

@@ -0,0 +1,240 @@
+package com.lantone.qc.kernel.catalogue.ninghaiyiyi.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);
+        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/ninghaiyiyi/behospitalized/BEH0012.java

@@ -0,0 +1,79 @@
+package com.lantone.qc.kernel.catalogue.ninghaiyiyi.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");
+        }
+
+
+    }
+}

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

@@ -0,0 +1,58 @@
+package com.lantone.qc.kernel.catalogue.ninghaiyiyi.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.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();
+        //既往史
+        PastLabel pastLabel = beHospitalizedDoc.getPastLabel();
+        if ((presentLabel == null || StringUtil.isBlank(presentLabel.getText()) || "。".equals(presentLabel.getText()))
+                && (StringUtil.isBlank(pastLabel.getText()) || "。".equals(pastLabel.getText()))) {
+            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");
+        }
+    }
+}

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

@@ -0,0 +1,98 @@
+package com.lantone.qc.kernel.catalogue.ninghaiyiyi.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.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();
+        //既往史
+        PastLabel pastLabel = inputInfo.getBeHospitalizedDoc().getPastLabel();
+        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");
+        }
+    }
+}

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

@@ -0,0 +1,45 @@
+package com.lantone.qc.kernel.catalogue.ninghaiyiyi.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/ninghaiyiyi/behospitalized/BEH0016.java

@@ -0,0 +1,38 @@
+package com.lantone.qc.kernel.catalogue.ninghaiyiyi.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");
+            }
+        }
+
+        }
+    }

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

@@ -0,0 +1,63 @@
+package com.lantone.qc.kernel.catalogue.ninghaiyiyi.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.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/ninghaiyiyi/behospitalized/BEH0018.java

@@ -0,0 +1,81 @@
+package com.lantone.qc.kernel.catalogue.ninghaiyiyi.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/ninghaiyiyi/behospitalized/BEH0019.java

@@ -0,0 +1,42 @@
+package com.lantone.qc.kernel.catalogue.ninghaiyiyi.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/ninghaiyiyi/behospitalized/BEH0020.java

@@ -0,0 +1,38 @@
+package com.lantone.qc.kernel.catalogue.ninghaiyiyi.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/ninghaiyiyi/behospitalized/BEH0021.java

@@ -0,0 +1,43 @@
+package com.lantone.qc.kernel.catalogue.ninghaiyiyi.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/ninghaiyiyi/behospitalized/BEH0022.java

@@ -0,0 +1,44 @@
+package com.lantone.qc.kernel.catalogue.ninghaiyiyi.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/ninghaiyiyi/behospitalized/BEH0023.java

@@ -0,0 +1,47 @@
+package com.lantone.qc.kernel.catalogue.ninghaiyiyi.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");
+        }
+    }
+}

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

@@ -0,0 +1,55 @@
+package com.lantone.qc.kernel.catalogue.ninghaiyiyi.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("骨折")) {
+            status.set("0");
+        }
+    }
+}

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

@@ -0,0 +1,70 @@
+package com.lantone.qc.kernel.catalogue.ninghaiyiyi.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("体外碎石")) {
+            status.set("0");
+        }
+    }
+
+}

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

@@ -0,0 +1,60 @@
+package com.lantone.qc.kernel.catalogue.ninghaiyiyi.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("详见原病历")) {
+            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/ninghaiyiyi/behospitalized/BEH0027.java

@@ -0,0 +1,52 @@
+package com.lantone.qc.kernel.catalogue.ninghaiyiyi.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/ninghaiyiyi/behospitalized/BEH0028.java

@@ -0,0 +1,54 @@
+package com.lantone.qc.kernel.catalogue.ninghaiyiyi.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("详见原病历")) {
+            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");
+            }
+        }
+    }
+
+}

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

@@ -0,0 +1,71 @@
+package com.lantone.qc.kernel.catalogue.ninghaiyiyi.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("预防接种"))) {
+                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/ninghaiyiyi/behospitalized/BEH0030.java

@@ -0,0 +1,56 @@
+package com.lantone.qc.kernel.catalogue.ninghaiyiyi.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("乙肝")) {
+            status.set("0");
+        }
+    }
+
+}

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

@@ -0,0 +1,69 @@
+package com.lantone.qc.kernel.catalogue.ninghaiyiyi.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/ninghaiyiyi/behospitalized/BEH0032.java

@@ -0,0 +1,72 @@
+package com.lantone.qc.kernel.catalogue.ninghaiyiyi.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/ninghaiyiyi/behospitalized/BEH0033.java

@@ -0,0 +1,23 @@
+package com.lantone.qc.kernel.catalogue.ninghaiyiyi.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;
+        }
+    }
+}

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

@@ -0,0 +1,70 @@
+package com.lantone.qc.kernel.catalogue.ninghaiyiyi.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())
+                        )
+                        .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) {
+            String substring = pastLabelText.substring(index + operName.toCharArray().length, index + operName.toCharArray().length + 1);
+            if (substring.equals("\"") || substring.equals("”")) {
+                return true;
+            }
+        }
+        return false;
+    }
+
+}

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

@@ -0,0 +1,79 @@
+package com.lantone.qc.kernel.catalogue.ninghaiyiyi.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/ninghaiyiyi/behospitalized/BEH0036.java

@@ -0,0 +1,50 @@
+package com.lantone.qc.kernel.catalogue.ninghaiyiyi.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())) {
+                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/ninghaiyiyi/behospitalized/BEH0037.java

@@ -0,0 +1,60 @@
+package com.lantone.qc.kernel.catalogue.ninghaiyiyi.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/ninghaiyiyi/behospitalized/BEH0038.java

@@ -0,0 +1,55 @@
+package com.lantone.qc.kernel.catalogue.ninghaiyiyi.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/ninghaiyiyi/behospitalized/BEH0039.java

@@ -0,0 +1,61 @@
+package com.lantone.qc.kernel.catalogue.ninghaiyiyi.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/ninghaiyiyi/behospitalized/BEH0040.java

@@ -0,0 +1,59 @@
+package com.lantone.qc.kernel.catalogue.ninghaiyiyi.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/ninghaiyiyi/behospitalized/BEH0041.java

@@ -0,0 +1,42 @@
+package com.lantone.qc.kernel.catalogue.ninghaiyiyi.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");
+        }
+    }
+
+}

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

@@ -0,0 +1,63 @@
+package com.lantone.qc.kernel.catalogue.ninghaiyiyi.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;
+        }
+
+        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("出生")) {
+            status.set("0");
+        }
+    }
+
+}

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

@@ -0,0 +1,70 @@
+package com.lantone.qc.kernel.catalogue.ninghaiyiyi.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("家庭住址"))) {
+            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("详见原病历")) {
+            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/ninghaiyiyi/behospitalized/BEH0044.java

@@ -0,0 +1,56 @@
+package com.lantone.qc.kernel.catalogue.ninghaiyiyi.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/ninghaiyiyi/behospitalized/BEH0045.java

@@ -0,0 +1,50 @@
+package com.lantone.qc.kernel.catalogue.ninghaiyiyi.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/ninghaiyiyi/behospitalized/BEH0046.java

@@ -0,0 +1,51 @@
+package com.lantone.qc.kernel.catalogue.ninghaiyiyi.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/ninghaiyiyi/behospitalized/BEH0047.java

@@ -0,0 +1,53 @@
+package com.lantone.qc.kernel.catalogue.ninghaiyiyi.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("详见原病历")) {
+            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/ninghaiyiyi/behospitalized/BEH0048.java

@@ -0,0 +1,50 @@
+package com.lantone.qc.kernel.catalogue.ninghaiyiyi.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/ninghaiyiyi/behospitalized/BEH0049.java

@@ -0,0 +1,41 @@
+package com.lantone.qc.kernel.catalogue.ninghaiyiyi.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/ninghaiyiyi/behospitalized/BEH0050.java

@@ -0,0 +1,55 @@
+package com.lantone.qc.kernel.catalogue.ninghaiyiyi.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/ninghaiyiyi/behospitalized/BEH0051.java

@@ -0,0 +1,51 @@
+package com.lantone.qc.kernel.catalogue.ninghaiyiyi.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/ninghaiyiyi/behospitalized/BEH0052.java

@@ -0,0 +1,40 @@
+package com.lantone.qc.kernel.catalogue.ninghaiyiyi.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/ninghaiyiyi/behospitalized/BEH0053.java

@@ -0,0 +1,65 @@
+package com.lantone.qc.kernel.catalogue.ninghaiyiyi.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("丧偶")) {
+            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/ninghaiyiyi/behospitalized/BEH0054.java

@@ -0,0 +1,54 @@
+package com.lantone.qc.kernel.catalogue.ninghaiyiyi.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/ninghaiyiyi/behospitalized/BEH0055.java

@@ -0,0 +1,23 @@
+package com.lantone.qc.kernel.catalogue.ninghaiyiyi.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/ninghaiyiyi/behospitalized/BEH0056.java

@@ -0,0 +1,70 @@
+package com.lantone.qc.kernel.catalogue.ninghaiyiyi.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/ninghaiyiyi/behospitalized/BEH0057.java

@@ -0,0 +1,23 @@
+package com.lantone.qc.kernel.catalogue.ninghaiyiyi.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/ninghaiyiyi/behospitalized/BEH0058.java

@@ -0,0 +1,110 @@
+package com.lantone.qc.kernel.catalogue.ninghaiyiyi.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个.*";
+            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/ninghaiyiyi/behospitalized/BEH0059.java

@@ -0,0 +1,65 @@
+package com.lantone.qc.kernel.catalogue.ninghaiyiyi.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/ninghaiyiyi/behospitalized/BEH0060.java

@@ -0,0 +1,53 @@
+package com.lantone.qc.kernel.catalogue.ninghaiyiyi.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/ninghaiyiyi/behospitalized/BEH0061.java

@@ -0,0 +1,57 @@
+package com.lantone.qc.kernel.catalogue.ninghaiyiyi.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/ninghaiyiyi/behospitalized/BEH0062.java

@@ -0,0 +1,57 @@
+package com.lantone.qc.kernel.catalogue.ninghaiyiyi.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/ninghaiyiyi/behospitalized/BEH0063.java

@@ -0,0 +1,68 @@
+package com.lantone.qc.kernel.catalogue.ninghaiyiyi.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/ninghaiyiyi/behospitalized/BEH0064.java

@@ -0,0 +1,72 @@
+package com.lantone.qc.kernel.catalogue.ninghaiyiyi.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/ninghaiyiyi/behospitalized/BEH0065.java

@@ -0,0 +1,60 @@
+package com.lantone.qc.kernel.catalogue.ninghaiyiyi.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/ninghaiyiyi/behospitalized/BEH0066.java

@@ -0,0 +1,57 @@
+package com.lantone.qc.kernel.catalogue.ninghaiyiyi.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/ninghaiyiyi/behospitalized/BEH0067.java

@@ -0,0 +1,71 @@
+package com.lantone.qc.kernel.catalogue.ninghaiyiyi.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/ninghaiyiyi/behospitalized/BEH0068.java

@@ -0,0 +1,54 @@
+package com.lantone.qc.kernel.catalogue.ninghaiyiyi.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/ninghaiyiyi/behospitalized/BEH0069.java

@@ -0,0 +1,44 @@
+package com.lantone.qc.kernel.catalogue.ninghaiyiyi.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/ninghaiyiyi/behospitalized/BEH0070.java

@@ -0,0 +1,70 @@
+package com.lantone.qc.kernel.catalogue.ninghaiyiyi.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/ninghaiyiyi/behospitalized/BEH0071.java

@@ -0,0 +1,38 @@
+package com.lantone.qc.kernel.catalogue.ninghaiyiyi.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/ninghaiyiyi/behospitalized/BEH0072.java

@@ -0,0 +1,59 @@
+package com.lantone.qc.kernel.catalogue.ninghaiyiyi.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/ninghaiyiyi/behospitalized/BEH0073.java

@@ -0,0 +1,70 @@
+package com.lantone.qc.kernel.catalogue.ninghaiyiyi.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/ninghaiyiyi/behospitalized/BEH0074.java

@@ -0,0 +1,60 @@
+package com.lantone.qc.kernel.catalogue.ninghaiyiyi.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/ninghaiyiyi/behospitalized/BEH0075.java

@@ -0,0 +1,43 @@
+package com.lantone.qc.kernel.catalogue.ninghaiyiyi.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/ninghaiyiyi/behospitalized/BEH0076.java

@@ -0,0 +1,41 @@
+package com.lantone.qc.kernel.catalogue.ninghaiyiyi.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/ninghaiyiyi/behospitalized/BEH0079.java

@@ -0,0 +1,29 @@
+package com.lantone.qc.kernel.catalogue.ninghaiyiyi.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/ninghaiyiyi/behospitalized/BEH0081.java

@@ -0,0 +1,38 @@
+package com.lantone.qc.kernel.catalogue.ninghaiyiyi.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/ninghaiyiyi/behospitalized/BEH0082.java

@@ -0,0 +1,49 @@
+package com.lantone.qc.kernel.catalogue.ninghaiyiyi.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/ninghaiyiyi/behospitalized/BEH02813.java

@@ -0,0 +1,32 @@
+package com.lantone.qc.kernel.catalogue.ninghaiyiyi.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/ninghaiyiyi/behospitalized/BEH02855.java

@@ -0,0 +1,30 @@
+package com.lantone.qc.kernel.catalogue.ninghaiyiyi.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");
+        }
+    }
+}

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

@@ -0,0 +1,53 @@
+package com.lantone.qc.kernel.catalogue.ninghaiyiyi.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.PD;
+import com.lantone.qc.pub.model.label.ChiefLabel;
+import com.lantone.qc.pub.util.ListUtil;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+import java.util.regex.Pattern;
+
+
+/**
+ * @ClassName : BEH02860
+ * @Description :主诉时间应该为阿拉伯数字
+ * @Author : 胡敬
+ * @Date: 2020-04-29 09:57
+ */
+@Component
+public class BEH02860 extends QCCatalogue {
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        status.set("0");
+        if (inputInfo.getBeHospitalizedDoc() == null) {
+            return;
+        }
+        ChiefLabel chiefLabel = inputInfo.getBeHospitalizedDoc().getChiefLabel();
+        if (chiefLabel == null) {
+            return;
+        }
+        String regex = "[零一二三四五六七八九十百千]";
+        List<PD> pds = chiefLabel.getPds();
+        if (ListUtil.isNotEmpty(pds)) {
+            String name = null, value = null;
+            for (PD pd : pds) {
+                name = pd.getName();
+                value = pd.getValue();
+                if(name.contains("半")){
+                    continue;
+                }
+                if (value != null && Pattern.matches(regex, value)) {
+                    status.set("-1");
+                    return;
+                }
+                if (name != null && Pattern.matches(regex, name)) {
+                    status.set("-1");
+                    return;
+                }
+            }
+        }
+    }
+}

+ 106 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/ninghaiyiyi/behospitalized/BEH02887.java

@@ -0,0 +1,106 @@
+package com.lantone.qc.kernel.catalogue.ninghaiyiyi.behospitalized;
+
+import com.lantone.qc.kernel.catalogue.QCCatalogue;
+import com.lantone.qc.pub.model.InputInfo;
+import com.lantone.qc.pub.model.OutputInfo;
+import com.lantone.qc.pub.model.entity.Diag;
+import com.lantone.qc.pub.model.label.DiagLabel;
+import com.lantone.qc.pub.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.List;
+
+/**
+ * @ClassName : BEH0738
+ * @Description: 患者病情前后描述不一致
+ * @author: 胡敬
+ * @time: 2020-05-08 16:45
+ */
+@Component
+public class BEH02887 extends QCCatalogue {
+
+    @Override
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        status.set("0");
+        if (inputInfo.getBeHospitalizedDoc() == null) {
+            return;
+        }
+        List<Diag> presentDiags = null;
+        List<Diag> pastDiags = null;
+        List<Diag> initialDiags = null;
+        PresentLabel presentLabel = inputInfo.getBeHospitalizedDoc().getPresentLabel();
+        PastLabel pastLabel = inputInfo.getBeHospitalizedDoc().getPastLabel();
+        DiagLabel initialDiagLabel = inputInfo.getBeHospitalizedDoc().getInitialDiagLabel();
+        if (presentLabel != null) {
+            presentDiags = presentLabel.getDiags();
+        }
+        if (pastLabel != null) {
+            pastDiags = pastLabel.getDiags();
+        }
+        if (initialDiagLabel != null) {
+            initialDiags = initialDiagLabel.getDiags();
+        }
+
+        if (presentDiags != null && pastDiags != null){
+            if (checkDiagDiff(presentDiags,pastDiags)){
+                status.set("-1");
+                return;
+            }
+        }
+
+        if (presentDiags != null && initialDiags != null){
+            if (checkDiagDiff(presentDiags,initialDiags)){
+                status.set("-1");
+                return;
+            }
+        }
+
+        if (pastDiags != null && initialDiags != null){
+            if (checkDiagDiff(pastDiags,initialDiags)){
+                status.set("-1");
+            }
+        }
+    }
+
+    /**
+     * 检查两个Diag列表是否前后描述不一致
+     * @param firstDiags
+     * @param secondDiags
+     * @return
+     */
+    private boolean checkDiagDiff(List<Diag> firstDiags, List<Diag> secondDiags) {
+        String firstDiagName = null, secondDiagName = null;
+        for (Diag firstDiag : firstDiags) {
+            firstDiagName = firstDiag.getHospitalDiagName();
+            if (StringUtil.isBlank(firstDiagName)) {
+                continue;
+            }
+            for (Diag secondDiag : secondDiags) {
+                secondDiagName = secondDiag.getHospitalDiagName();
+                if (StringUtil.isBlank(secondDiagName)) {
+                    continue;
+                }
+                if (firstDiagName.equals(secondDiagName)) {
+                    boolean checkNeg = checkNeg(firstDiag, secondDiag);
+                    if (!checkNeg) {
+                        //如果两个Diag一个为否定,一个不为否定,返回true
+                        return true;
+                    }
+                }
+            }
+        }
+        return false;
+    }
+
+    private boolean checkNeg(Diag firstDiag, Diag secondDiag) {
+        if (firstDiag.getNegative() == null && secondDiag.getNegative() == null) {
+            return true;
+        } else {
+            return firstDiag.getNegative() != null && secondDiag.getNegative() != null;
+        }
+    }
+
+
+}

+ 78 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/ninghaiyiyi/behospitalized/BEH02902.java

@@ -0,0 +1,78 @@
+package com.lantone.qc.kernel.catalogue.ninghaiyiyi.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.PD;
+import com.lantone.qc.pub.model.entity.Pacs;
+import com.lantone.qc.pub.model.label.PacsLabel;
+import com.lantone.qc.pub.util.StringUtil;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+
+/**
+ * @ClassName : BEH02902
+ * @Description : 辅助检查未注明地点
+ * @Author : 胡敬
+ * @Date: 2020-05-28 09:56
+ */
+@Component
+public class BEH02902 extends QCCatalogue {
+    @Override
+    protected void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        if (inputInfo.getBeHospitalizedDoc() == null) {
+            status.set("0");
+            return;
+        }
+
+        String pacsText = inputInfo.getBeHospitalizedDoc().getStructureMap().get("辅助检查");
+        if (StringUtil.isBlank(pacsText)) {
+            status.set("0");
+            return;
+        }
+
+        if (StringUtil.isNotBlank(pacsText) && (pacsText.contains("暂缺") || pacsText.contains("暂无"))) {
+            status.set("0");
+            return;
+        }
+
+        PacsLabel pacsLabel = inputInfo.getBeHospitalizedDoc().getPacsLabel();
+        if (pacsLabel == null || StringUtil.isBlank(pacsLabel.getText())) {
+            status.set("0");
+            return;
+        }
+        boolean findPlace = false;
+        pacsText = pacsLabel.getText();
+        List<Pacs> pacses = pacsLabel.getPacses();
+        if (pacses != null) {
+            for (Pacs pacs : pacses) {
+                /* 时间为入院检查的时间,模型输出处理后结构为 name为空,pd不为空 */
+                if (pacs.getName() == null && pacs.getPd() != null) {
+                    /* 模型先找到时间实体,找到后再从这个时间实体开始,往前往后找 */
+                    PD pd = pacs.getPd();
+                    String name = pd.getName();
+                    int timeIndex = pacsText.indexOf(name);
+                    String beforeTimeText = pacsText.substring(Math.max(timeIndex - 5, 0), timeIndex);
+                    String afterTimeText = pacsText.substring(timeIndex + name.length(), Math.min(timeIndex + name.length() + 10, pacsText.length()));
+                    if (beforeTimeText.contains("院") || afterTimeText.contains("院")) {
+                        findPlace = true;
+                        break;
+                    }
+                }
+            }
+        }
+
+        /* 如果模型没找到时间实体,则直接取辅助检查前20个字,判断有没有院字 */
+        if (!findPlace) {
+            String prefixText = pacsText.substring(0, Math.min(20, pacsText.length()));
+            if (prefixText.contains("院")) {
+                findPlace = true;
+            }
+        }
+
+        if (findPlace) {
+            status.set("0");
+        }
+    }
+}

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

@@ -0,0 +1,55 @@
+package com.lantone.qc.kernel.catalogue.ninghaiyiyi.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.Pacs;
+import com.lantone.qc.pub.model.label.PacsLabel;
+import com.lantone.qc.pub.util.StringUtil;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+
+/**
+ * @ClassName : BEH02903
+ * @Description : 辅助检查未注明时间
+ * @Author : 胡敬
+ * @Date: 2020-05-28 09:56
+ */
+@Component
+public class BEH02903 extends QCCatalogue {
+    @Override
+    protected void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        if (inputInfo.getBeHospitalizedDoc() == null) {
+            status.set("0");
+            return;
+        }
+
+        String pacsText = inputInfo.getBeHospitalizedDoc().getStructureMap().get("辅助检查");
+        if (StringUtil.isBlank(pacsText)) {
+            status.set("0");
+            return;
+        }
+
+        if (StringUtil.isNotBlank(pacsText) && (pacsText.contains("暂缺") || pacsText.contains("暂无"))) {
+            status.set("0");
+            return;
+        }
+
+        PacsLabel pacsLabel = inputInfo.getBeHospitalizedDoc().getPacsLabel();
+        if (pacsLabel == null) {
+            status.set("0");
+            return;
+        }
+
+        List<Pacs> pacses = pacsLabel.getPacses();
+        if (pacses != null && pacses.size() > 0) {
+            for (Pacs pacs : pacses) {
+                if (pacs.getPd() != null && pacs.getPd().getName() != null) {
+                    status.set("0");
+                    return;
+                }
+            }
+        }
+    }
+}

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

@@ -0,0 +1,49 @@
+package com.lantone.qc.kernel.catalogue.ninghaiyiyi.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.ChiefLabel;
+import com.lantone.qc.pub.model.label.PresentLabel;
+import com.lantone.qc.pub.util.StringUtil;
+import org.springframework.stereotype.Component;
+
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+/**
+ * @ClassName : BEH02908
+ * @Description : 现病史症状性质描述与主诉不符
+ * @Author : 胡敬
+ * @Date: 2020-06-11 15:54
+ */
+@Component
+public class BEH02908 extends QCCatalogue {
+    @Override
+    protected void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        status.set("0");
+        if (inputInfo.getBeHospitalizedDoc() == null) {
+            return;
+        }
+        String chiefProperty = "";
+        ChiefLabel chiefLabel = inputInfo.getBeHospitalizedDoc().getChiefLabel();
+        PresentLabel presentLabel = inputInfo.getBeHospitalizedDoc().getPresentLabel();
+        if (chiefLabel == null || presentLabel == null) {
+            return;
+        }
+        String chiefText = chiefLabel.getText();
+        String presentText = presentLabel.getText();
+        if (StringUtil.isBlank(chiefText) || StringUtil.isBlank(presentText)) {
+            return;
+        }
+        String regex = "\\d+次";
+        Pattern pattern = Pattern.compile(regex);
+        Matcher matcher = pattern.matcher(chiefText);
+        if (matcher.find()) {
+            chiefProperty = matcher.group(0);
+        }
+        if (StringUtil.isNotBlank(chiefProperty) && !presentText.contains(chiefProperty)) {
+            status.set("-1");
+        }
+    }
+}

+ 124 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/ninghaiyiyi/behospitalized/BEH02909.java

@@ -0,0 +1,124 @@
+package com.lantone.qc.kernel.catalogue.ninghaiyiyi.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.GeneralDesc;
+import com.lantone.qc.pub.model.entity.Medicine;
+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 : BEH02909
+ * @Description : 目前使用药物情况与现病史描述不一致
+ * @Author : 胡敬
+ * @Date: 2020-06-11 16:10
+ */
+@Component
+public class BEH02909 extends QCCatalogue {
+
+    @Override
+    protected void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        if (inputInfo.getBeHospitalizedDoc() == null) {
+            status.set("0");
+            return;
+        }
+        String drugsCurrentlyInUse = inputInfo.getBeHospitalizedDoc().getStructureMap().get("目前使用的药物");
+        if (StringUtil.isBlank(drugsCurrentlyInUse)) {
+            status.set("0");
+            return;
+        }
+        /*if (drugsCurrentlyInUse.contains("见现病史")) {
+            status.set("0");
+            return;
+        }*/
+        /*List<String> drug = getDrug(drugsCurrentlyInUse);*/
+        PresentLabel presentLabel = inputInfo.getBeHospitalizedDoc().getPresentLabel();
+        if (presentLabel == null) {
+            status.set("0");
+            return;
+        }
+        List<String> drugFromPresent = new ArrayList<>();
+        List<GeneralDesc> generals = presentLabel.getGenerals();
+        if (generals.size() > 0) {
+            String presentText = presentLabel.getText();
+            List<Medicine> medicines = presentLabel.getMedicines();
+            /* 取现病史中一般情况之后的药品名称 */
+            if (StringUtil.isNotBlank(presentText) && medicines != null && medicines.size() > 0) {
+                String lastGeneral = generals.get(generals.size() - 1).getName();
+                int lastGeneralIndex = presentText.indexOf(lastGeneral);
+                for (Medicine medicine : medicines) {
+                    /* 现病史中一般情况之后的药品名称,并且不包含不详 */
+                    if (presentText.indexOf(medicine.getName()) > lastGeneralIndex && !medicine.getName().contains("不详")) {
+                        drugFromPresent.add(medicine.getName().replaceAll("[“”药物晨晚]",""));
+                    }
+                }
+            }
+        }
+        if (drugFromPresent.size() == 0) {
+            status.set("0");
+        } else {
+            String infoStr = "";
+            int matchSum = 0;
+            for (String drug : drugFromPresent) {
+                if (drugsCurrentlyInUse.contains(drug)) {
+                    matchSum++;
+                } else {
+                    infoStr = concatInfo(infoStr,drug);
+                }
+            }
+            info.set(infoStr);
+            if (matchSum == drugFromPresent.size()) {
+                status.set("0");
+            }
+        }
+    }
+
+    private String concatInfo(String infoStr, String drug) {
+        if (StringUtil.isBlank(infoStr)) {
+            infoStr += drug;
+        } else {
+            if (!infoStr.contains(drug)) {
+                infoStr += "," + drug;
+            }
+        }
+        return infoStr;
+    }
+
+    private List<String> getDrug(String drugsCurrentlyInUse) {
+        List<String> drugs = new ArrayList<>();
+        String medicine = "药物名称", usage = "用法", continueUse = "本次住院是否继续使用";
+        while (drugsCurrentlyInUse.length() > 0) {
+            if (drugsCurrentlyInUse.contains(medicine) && drugsCurrentlyInUse.contains(usage) && drugsCurrentlyInUse.contains(continueUse)) {
+                int medicineIndex = drugsCurrentlyInUse.indexOf(medicine);
+                int usageIndex = drugsCurrentlyInUse.indexOf(usage);
+                int continueUseIndex = drugsCurrentlyInUse.indexOf(continueUse);
+                String drug = drugsCurrentlyInUse.substring(medicineIndex + medicine.length() + 1, usageIndex);
+                if (StringUtil.isNotBlank(drug)) {
+                    drug = StringUtil.removeBlank(drug);
+                    drugs.add(drug);
+                }
+                drugsCurrentlyInUse = drugsCurrentlyInUse.substring(continueUseIndex + continueUse.length() + 1);
+            } else {
+                break;
+            }
+        }
+        return drugs;
+    }
+
+    private List<String> getDrugFromPresent(List<Medicine> medicines) {
+        List<String> drugs = new ArrayList<>();
+        String name;
+        for (Medicine medicine : medicines) {
+            name = medicine.getName();
+            if (StringUtil.isNotBlank(name)) {
+                drugs.add(name.replaceAll("[“”\"]", ""));
+            }
+        }
+        return drugs;
+    }
+}

+ 31 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/ninghaiyiyi/behospitalized/BEH02914.java

@@ -0,0 +1,31 @@
+package com.lantone.qc.kernel.catalogue.ninghaiyiyi.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 : BEH02914
+ * @Description :  影像学检查未填写
+ * @Author : 胡敬
+ * @Date: 2020-07-03 10:42
+ */
+@Component
+public class BEH02914 extends QCCatalogue {
+    @Override
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        status.set("0");
+        if (inputInfo.getBeHospitalizedDoc() == null) {
+            return;
+        }
+        Map<String, String> beHospitalStructureMap = inputInfo.getBeHospitalizedDoc().getStructureMap();
+        String check = beHospitalStructureMap.get("影像学检查");
+        if (StringUtil.isBlank(check)) {
+            status.set("-1");
+        }
+    }
+}

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

@@ -0,0 +1,30 @@
+package com.lantone.qc.kernel.catalogue.ninghaiyiyi.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 : BEH02915
+ * @Description :  体格检查神志未填写
+ * @Author : 胡敬
+ * @Date: 2020-06-13 15:51
+ */
+@Component
+public class BEH02915 extends QCCatalogue {
+    @Override
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        status.set("0");
+        if (inputInfo.getBeHospitalizedDoc() == null) {
+            return;
+        }
+        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/ninghaiyiyi/behospitalized/BEH02916.java

@@ -0,0 +1,30 @@
+package com.lantone.qc.kernel.catalogue.ninghaiyiyi.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 : BEH02916
+ * @Description :  体格检查查体合作性未填写
+ * @Author : 胡敬
+ * @Date: 2020-06-13 15:51
+ */
+@Component
+public class BEH02916 extends QCCatalogue {
+    @Override
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        status.set("0");
+        if (inputInfo.getBeHospitalizedDoc() == null) {
+            return;
+        }
+        Map<String, String> beHospitalStructureMap = inputInfo.getBeHospitalizedDoc().getStructureMap();
+        if (StringUtil.isBlank(beHospitalStructureMap.get("查体合作性"))) {
+            status.set("-1");
+        }
+    }
+}

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


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