浏览代码

Merge remote-tracking branch 'origin/hb/beilun'

# Conflicts:
#	kernel/src/main/java/com/lantone/qc/kernel/catalogue/hospital/ningbozhongyi/clinicalblood/CLI0306.java
#	kernel/src/main/java/com/lantone/qc/kernel/catalogue/hospital/ningbozhongyi/clinicalblood/CLI0307.java
#	kernel/src/main/java/com/lantone/qc/kernel/catalogue/hospital/ningbozhongyi/clinicalblood/CLI0562.java
#	kernel/src/main/java/com/lantone/qc/kernel/catalogue/hospital/ningbozhongyi/clinicalblood/CLI0564.java
#	kernel/src/main/java/com/lantone/qc/kernel/catalogue/hospital/ningbozhongyi/clinicalblood/CLI0571.java
zhaops 3 年之前
父节点
当前提交
86d2b860bd
共有 100 个文件被更改,包括 2112 次插入156 次删除
  1. 1 1
      dbanaly/src/main/java/com/lantone/qc/dbanaly/facade/comsis/ModuleHelper.java
  2. 152 0
      dbanaly/src/main/java/com/lantone/qc/dbanaly/facade/qdnzyy/QdnzyyXmlUtil.java
  3. 2 2
      dbanaly/src/main/resources/application-debug.yml
  4. 2 2
      dbanaly/src/main/resources/application-dev.yml
  5. 10 10
      dbanaly/src/main/resources/application-local.yml
  6. 5 5
      dbanaly/src/main/resources/application-master.yml
  7. 7 7
      dbanaly/src/main/resources/application-test.yml
  8. 16 0
      dbanaly/src/main/resources/rebel.xml
  9. 4 1
      kernel/pom.xml
  10. 2 2
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/QCCatalogue.java
  11. 1 1
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0002.java
  12. 2 2
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0006.java
  13. 1 1
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0009.java
  14. 1 1
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0010.java
  15. 19 1
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0011.java
  16. 1 1
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0014.java
  17. 1 1
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0026.java
  18. 2 2
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0029.java
  19. 1 1
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0030.java
  20. 1 1
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0034.java
  21. 1 1
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0035.java
  22. 2 1
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0036.java
  23. 1 1
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0058.java
  24. 62 22
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0059.java
  25. 1 1
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0072.java
  26. 9 3
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH02966.java
  27. 1 1
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH03176.java
  28. 5 4
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0372.java
  29. 6 1
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0378.java
  30. 3 3
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0397.java
  31. 1 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0411.java
  32. 1 1
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0441.java
  33. 2 2
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0493.java
  34. 1 1
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/clinicalblood/CLI0301.java
  35. 241 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/clinicalblood/CLI0304.java
  36. 3 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/crisisvaluereport/CRI0382.java
  37. 3 2
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/deathrecord/DEAR0342.java
  38. 1 1
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/deathrecord/DEAR0344.java
  39. 1 1
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/deathrecord/DEAR0347.java
  40. 6 6
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/difficultcasediscuss/DIF0118.java
  41. 5 2
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/difficultcasediscuss/DIF0119.java
  42. 6 6
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstcourserecord/FIRC0084.java
  43. 21 1
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstcourserecord/FIRC0095.java
  44. 9 2
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstcourserecord/FIRC03086.java
  45. 3 2
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstcourserecord/FIRC03087.java
  46. 56 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstcourserecord/FIRC03230.java
  47. 56 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstcourserecord/FIRC03231.java
  48. 76 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstcourserecord/FIRC03232.java
  49. 2 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP0160.java
  50. 3 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP0161.java
  51. 5 1
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP0162.java
  52. 7 1
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP0163.java
  53. 5 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP0166.java
  54. 5 2
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP0170.java
  55. 3 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP0175.java
  56. 12 11
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP0181.java
  57. 31 7
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP0184.java
  58. 1 1
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP0185.java
  59. 2 2
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP0193.java
  60. 1 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP0196.java
  61. 1 1
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP0209.java
  62. 6 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP0211.java
  63. 6 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP0214.java
  64. 12 3
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP0225.java
  65. 2 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP0248.java
  66. 2 1
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP0250.java
  67. 6 2
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP0255.java
  68. 5 1
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP02905.java
  69. 1 1
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP02972.java
  70. 10 9
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP03038.java
  71. 1 6
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP03110.java
  72. 39 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP03195.java
  73. 72 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP03196.java
  74. 74 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP03197.java
  75. 33 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP03200.java
  76. 40 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP03201.java
  77. 33 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP03202.java
  78. 37 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP03203.java
  79. 33 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP03204.java
  80. 34 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP03205.java
  81. 39 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP03206.java
  82. 39 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP03207.java
  83. 40 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP03208.java
  84. 40 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP03209.java
  85. 39 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP03210.java
  86. 51 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP03211.java
  87. 40 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP03212.java
  88. 80 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP03213.java
  89. 41 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP03214.java
  90. 40 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP03215.java
  91. 43 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP03216.java
  92. 32 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP03217.java
  93. 35 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP03218.java
  94. 29 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP03219.java
  95. 47 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP03220.java
  96. 29 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP03221.java
  97. 34 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP03222.java
  98. 29 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP03223.java
  99. 47 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP03224.java
  100. 0 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP03225.java

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

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

+ 152 - 0
dbanaly/src/main/java/com/lantone/qc/dbanaly/facade/qdnzyy/QdnzyyXmlUtil.java

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

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

@@ -5,7 +5,7 @@ spring:
     druid:
       lantone:
         driver-class-name: com.mysql.jdbc.Driver
-        url: jdbc:mysql://192.168.2.237:3307/qc?useUnicode=true&characterEncoding=utf8&useSSL=false
+        url: jdbc:mysql://192.168.2.237:3307/qc_xszyy?useUnicode=true&characterEncoding=utf8&useSSL=false
         username: root
         password: lantone
         initial-size: 8
@@ -41,7 +41,7 @@ spring:
         min-idle: 0 # 连接池中的最小空闲连接
     timeout: 20000 # 连接超时时间(毫秒)
 
-xml-is-encryped: true
+xml-is-encryped: false
 
 CRF:
   url: http://192.168.2.234:3456/api/mr_info_ex/entity_predict

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

@@ -43,10 +43,10 @@ spring:
 xml-is-encryped: true
 
 CRF:
-  url: http://192.168.3.150:3456/api/mr_info_ex/entity_predict
+  url: http://192.168.2.234:3456/api/mr_info_ex/entity_predict
 
 Similarity:
-  url: http://192.168.3.150:3456/api/mr_info_ex/similarity
+  url: http://192.168.2.234:3456/api/mr_info_ex/similarity
 
 NewSimilarity:
   url: http://192.168.2.234:23232/api/similarity

+ 10 - 10
dbanaly/src/main/resources/application-local.yml

@@ -5,7 +5,7 @@ spring:
     druid:
       lantone:
         driver-class-name: com.mysql.jdbc.Driver
-        url: jdbc:mysql://192.168.2.237:3306/qc?useUnicode=true&characterEncoding=utf8&useSSL=false
+        url: jdbc:mysql://192.168.0.195:3306/qc?useUnicode=true&characterEncoding=utf8&useSSL=false
         username: root
         password: lantone
         initial-size: 8
@@ -28,9 +28,9 @@ spring:
     database:
       cache: 10 # cache索引
       token: 10 # Token索引
-    host: 192.168.2.237 #Redis服务器地址
-    port: 63791 # Redis服务器连接端口(本地环境端口6378,其他环境端口是6379)
-    password: emrais # Redis服务器连接密码(默认为空)
+    host: 192.168.0.196 #Redis服务器地址
+    port: 6379 # Redis服务器连接端口(本地环境端口6378,其他环境端口是6379)
+    password: lantone # Redis服务器连接密码(默认为空)
     lettuce:
       pool:
         max-active: 8 # 连接池最大连接数(使用负值表示没有限制)
@@ -39,19 +39,19 @@ spring:
         min-idle: 0 # 连接池中的最小空闲连接
     timeout: 20000 # 连接超时时间(毫秒)
 
-xml-is-encryped: true
+xml-is-encryped: false
 
 CRF:
-  url: http://192.168.3.150:3456/api/mr_info_ex/entity_predict
+  url: http://192.168.0.196:3456/api/mr_info_ex/entity_predict
 
 Similarity:
-  url: http://192.168.3.150:3456/api/mr_info_ex/similarity
+  url: http://192.168.0.196:3456/api/mr_info_ex/similarity
 
 NewSimilarity:
-  url: http://192.168.2.234:23232/api/similarity
+  url: http://192.168.0.196:23232/api/similarity
 
 NewBatchSimilarity:
-  url: http://192.168.2.234:23232/api/similarity_batch
+  url: http://192.168.0.196:23232/api/similarity_batch
 
 ChiefPresentSimilarity:
-  url: http://192.168.2.234:3456/api/mr_info_ex/chief_present_similarity
+  url: http://192.168.0.196:3456/api/mr_info_ex/chief_present_similarity

+ 5 - 5
dbanaly/src/main/resources/application-master.yml

@@ -5,7 +5,7 @@ spring:
     druid:
       lantone:
         driver-class-name: com.mysql.jdbc.Driver
-        url: jdbc:mysql://192.168.2.125:3308/qc?useUnicode=true&characterEncoding=utf8&useSSL=false
+        url: jdbc:mysql://192.168.2.129:3307/qc?useUnicode=true&characterEncoding=utf8&useSSL=false
         username: root
         password: LangT0ng@122lt
         initial-size: 8
@@ -28,8 +28,8 @@ spring:
     database:
       cache: 10 # cache索引
       token: 10 # Token索引
-    host: 192.168.2.125 # Redis服务器地址
-    port: 63791 # Redis服务器连接端口(本地环境端口6378,其他环境端口是6379)
+    host: 192.168.2.129 # Redis服务器地址
+    port: 6379 # Redis服务器连接端口(本地环境端口6378,其他环境端口是6379)
     password: lantone # Redis服务器连接密码(默认为空)
     lettuce:
       pool:
@@ -42,10 +42,10 @@ spring:
 xml-is-encryped: true
 
 CRF:
-  url: http://192.168.3.150:3456/api/mr_info_ex/entity_predict
+  url: http://192.168.2.234:3456/api/mr_info_ex/entity_predict
 
 Similarity:
-  url: http://192.168.3.150:3456/api/mr_info_ex/similarity
+  url: http://192.168.2.234:3456/api/mr_info_ex/similarity
 
 NewSimilarity:
   url: http://192.168.2.234:23232/api/similarity

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

@@ -5,9 +5,9 @@ spring:
     druid:
       lantone:
         driver-class-name: com.mysql.jdbc.Driver
-        url: jdbc:mysql://192.168.2.126:3307/qc_xy?useUnicode=true&characterEncoding=utf8&useSSL=false
+        url: jdbc:mysql://192.168.2.237:3307/qc_wenfuyi_20220510?useUnicode=true&characterEncoding=utf8&useSSL=false
         username: root
-        password: Lat0ne@tesT
+        password: lantone
         initial-size: 8
         min-idle: 1
         max-active: 20
@@ -26,8 +26,8 @@ spring:
         use-global-data-source-stat: true
   redis:
     database:
-      cache: 6 # cache索引
-      token: 6 # Token索引
+      cache: 10 # cache索引
+      token: 10 # Token索引
     host: 192.168.2.126  #Redis服务器地址
     port: 6379 # Redis服务器连接端口(本地环境端口6378,其他环境端口是6379)
     password: lantone # Redis服务器连接密码(默认为空)
@@ -42,10 +42,10 @@ spring:
 xml-is-encryped: true
 
 CRF:
-  url: http://192.168.3.150:3456/api/mr_info_ex/entity_predict
+  url: http://192.168.2.234:3456/api/mr_info_ex/entity_predict
 
 Similarity:
-  url: http://192.168.3.150:3456/api/mr_info_ex/similarity
+  url: http://192.168.2.234:3456/api/mr_info_ex/similarity
 
 NewSimilarity:
   url: http://192.168.2.234:23232/api/similarity
@@ -54,4 +54,4 @@ NewBatchSimilarity:
   url: http://192.168.2.234:23232/api/similarity_batch
 
 ChiefPresentSimilarity:
-  url: http://192.168.2.234:3456/api/mr_info_ex/chief_present_similarity
+  url: http://192.168.2.234:3456/api/mr_info_ex/chief_present_similarity

+ 16 - 0
dbanaly/src/main/resources/rebel.xml

@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+  This is the JRebel configuration file. It maps the running application to your IDE workspace, enabling JRebel reloading for this project.
+  Refer to https://manuals.jrebel.com/jrebel/standalone/config.html for more information.
+-->
+<application generated-by="intellij" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.zeroturnaround.com" xsi:schemaLocation="http://www.zeroturnaround.com http://update.zeroturnaround.com/jrebel/rebel-2_3.xsd">
+
+	<id>dbanaly</id>
+
+	<classpath>
+		<dir name="C:/Users/10185/Desktop/work/后端/aiPlat/qc/dbanaly/target/classes">
+		</dir>
+	</classpath>
+
+</application>

+ 4 - 1
kernel/pom.xml

@@ -47,7 +47,10 @@
             <groupId>org.springframework.boot</groupId>
             <artifactId>spring-boot-starter-web</artifactId>
         </dependency>
-
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-thymeleaf</artifactId>
+        </dependency>
         <!-- LOGGING begin -->
         <!-- 代码直接调用commons-logging会被桥接到slf4j -->
         <dependency>

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

@@ -43,7 +43,7 @@ public class QCCatalogue {
         //        long t2 = System.currentTimeMillis();
         //        log.error(inputInfo.getMedicalRecordInfoDoc().getStructureMap().get("behospitalCode") + "-----" + className + "(规则)  耗时:" + (t2 - t1));
         insertOpt(outputInfo);
-    }
+     }
 
     private void insertOpt(OutputInfo outputInfo) {
         Map<String, Object> resultDetail = Maps.newHashMap();
@@ -52,7 +52,7 @@ public class QCCatalogue {
         resultDetail.put("id", id.get());
         resultDetail.put("extData", extData.get());
         outputInfo.getResult().put(className, resultDetail);
-        status.remove();
+        status.remove(); 
         info.remove();
         id.remove();
         extData.remove();

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

@@ -53,7 +53,7 @@ public class BEH0002 extends QCCatalogue {
             for (Diag diag : chiefDiags) {
                 String hospitalDiagName = diag.getHospitalDiagName();
                 if (hospitalDiagName.contains("术后") || hospitalDiagName.contains("癌") ||
-                        hospitalDiagName.contains("瘤") || hospitalDiagName.contains("复诊")) {
+                        hospitalDiagName.contains("瘤") || hospitalDiagName.contains("复诊") ||hospitalDiagName.contains("粘液血便")) {
                     status.set("0");
                     break;
                 }

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

@@ -22,7 +22,7 @@ import java.util.Map;
  */
 @Component
 public class BEH0006 extends QCCatalogue {
-    private List<String> containList = Arrays.asList("半年", "术后");
+    private List<String> containList = Arrays.asList("半年", "术后","h");
 
     public void start(InputInfo inputInfo, OutputInfo outputInfo) {
         if (outputInfo != null && outputInfo.getResult() != null) {
@@ -82,7 +82,7 @@ public class BEH0006 extends QCCatalogue {
                         if (pdName.contains("天") || pdName.contains("周") || pdName.contains("月")
                                 || pdName.contains("时") || pdName.contains("半年") || pdName.contains("秒")
                                 || pdName.contains("分") || pdName.contains("日") || pdName.contains("今")
-                                || pdName.contains("1年") || pdName.contains("一年")) {
+                                || pdName.contains("1年") || pdName.contains("一年") || pdName.contains("h")) {
                             status.set("0");
                             break;
                         }

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

@@ -22,7 +22,7 @@ import java.util.List;
 @Component
 public class BEH0009 extends QCCatalogue {
     private List<String> containList = Arrays.asList("检查", "术后", "药物", "发现", "误服", "确诊", "经", "异常", "诊断"
-            , "示", "超", "伤", "术", "复查", "体检", "血透", "血液透析","孕");
+            , "示", "超", "伤", "术", "复查", "体检", "血透", "血液透析", "孕", "农药", "呻吟", "颈椎");
 
     public void start(InputInfo inputInfo, OutputInfo outputInfo) {
         if (inputInfo.getBeHospitalizedDoc() == null) {

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

@@ -21,7 +21,7 @@ import java.util.List;
 @Component
 public class BEH0010 extends QCCatalogue {
     private List<String> containList = Arrays.asList("癌", "瘤", "复诊", "术后", "化疗后", "发现", "体检", "检查", "确诊"
-            , "诊断", "复查", "复发", "示", "超", "CT", "血透", "血液透析");
+            , "诊断", "复查", "复发", "示", "超", "CT", "血透", "血液透析", "治疗后", "痛");
 
     public void start(InputInfo inputInfo, OutputInfo outputInfo) {
         status.set("0");

+ 19 - 1
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0011.java

@@ -12,6 +12,7 @@ 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.ListUtil;
 import com.lantone.qc.pub.util.StringUtil;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -83,7 +84,7 @@ public class BEH0011 extends QCCatalogue {
                 /* 取现病史中一般情况之后的疾病名称 */
                 if (StringUtil.isNotBlank(presentText) && presentDiags.size() > 0) {
                     String lastGeneral = generals.get(generals.size() - 1).getName();
-                    int lastGeneralIndex = presentText.indexOf(lastGeneral);
+                    int lastGeneralIndex = presentText.lastIndexOf(lastGeneral);
                     for (Diag presentDiag : presentDiags) {
                         if (presentDiag.getNegative() != null || presentDiag.getHospitalDiagName().contains("否认")) {
                             continue;
@@ -98,9 +99,26 @@ public class BEH0011 extends QCCatalogue {
                 }
             }
         }
+        if(presentPastDiags!= null && presentPastDiags.size()>0){
+            List<String> markStr = Arrays.asList("病以来", "病来");
+            String text = presentLabel.getText();
+            for (String str : markStr) {
+                if(text.contains(str)){
+                    String textStr = text.substring(text.lastIndexOf(str));
+                    presentPastDiags = presentPastDiags.stream().filter(obj->textStr.contains(obj)).collect(Collectors.toSet());
+                    break;
+                }
+            }
+        }
         /* 取既往史中疾病名称 */
         if (pastLabel != null && StringUtils.isNotEmpty(pastLabel.getText())) {
             List<Diag> pastDiags = pastLabel.getDiags();
+            String text = pastLabel.getText();
+            String pattern = "[\\s\\S]*(?=妊娠).{0,4}((?=高血压)|(?=糖尿病))[\\s\\S]*";
+            if(text.matches(pattern) && ListUtil.isNotEmpty(pastDiags)){
+                List<String> dis = Arrays.asList("高血压", "糖尿病");
+                pastDiags = pastDiags.stream().filter(obj -> !dis.contains(obj.getHospitalDiagName())).collect(Collectors.toList());
+            }
             addDiagHospitalName(presentPastDiags, pastDiags, pastLabel.getText());
         } else {            //结构化数据
             List<Diag> pastDiags = new ArrayList<>();

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

@@ -28,7 +28,7 @@ import java.util.List;
 @Component
 public class BEH0014 extends QCCatalogue {
     private List<String> containList = Arrays.asList("体检", "发现", "检查", "因", "确诊", "诊断", "复查", "术后"
-            , "药物", "误服", "查", "撞", "伤", "月经", "暴力", "超", "术");
+            , "药物", "误服", "查", "撞", "伤", "跌", "月经", "暴力", "超", "术","不慎","出现");
 
     public void start(InputInfo inputInfo, OutputInfo outputInfo) {
         if (inputInfo.getBeHospitalizedDoc() == null) {

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

@@ -41,7 +41,7 @@ public class BEH0026 extends QCCatalogue {
         String pastText = pastLabel.getText();
         if (pastText.contains("食物过敏史") || pastText.contains("食物、药物过敏") || pastText.contains("详见") ||
                 pastText.contains("见旧病历") || pastText.contains("见既往病历") || pastText.contains("食物药物过敏史")
-                || pastText.contains("食物及药物过敏史")) {
+                || pastText.contains("食物及药物过敏史") || pastText.contains("食物、药物及其他过敏")) {
             status.set("0");
             return;
         }

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

@@ -48,7 +48,7 @@ public class BEH0029 extends QCCatalogue {
         }
         if (pastLabel != null) {
             String pastText = pastLabel.getText();
-            if (StringUtil.isNotBlank(pastText) && (pastText.contains("详见") || pastText.contains("预防接种") || pastText.contains("预防免疫接种")
+            if (StringUtil.isNotBlank(pastText) && (pastText.contains("详见") || pastText.contains("接种")|| pastText.contains("预防接种") || pastText.contains("预防免疫接种")
                     || pastText.contains("见旧病历") || pastText.contains("见既往病历"))) {
                 status.set("0");
                 return;
@@ -63,7 +63,7 @@ public class BEH0029 extends QCCatalogue {
         }
         if (personalLabel != null) {
             String personText = personalLabel.getText();
-            if (StringUtil.isNotBlank(personText) && (personText.contains("详见") || personText.contains("预防接种"))) {
+            if (StringUtil.isNotBlank(personText) && (personText.contains("详见") || personText.contains("接种")|| personText.contains("预防接种"))) {
                 status.set("0");
                 return;
             }

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

@@ -47,7 +47,7 @@ public class BEH0030 extends QCCatalogue {
             status.set("0");
         }
         String pastText = pastLabel.getText();
-        if (pastText.contains("肝炎") || pastText.contains("结核") || pastText.contains("详见原病历")
+        if (pastText.contains("肝炎") || pastText.contains("传染病") || pastText.contains("结核") || pastText.contains("详见原病历")
                 || pastText.contains("见旧病历") || pastText.contains("见既往病历") || pastText.contains("乙肝")) {
             status.set("0");
         }

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

@@ -37,7 +37,7 @@ public class BEH0034 extends QCCatalogue {
                         .filter(i ->
                                 i != null && StringUtil.isNotBlank(i.getName()) && i.getNegative() == null
                                         && !"手术史".equals(i.getName()) && !"手术".equals(i.getName()) && !"手术治疗".equals(i.getName())
-                                        && !"手术无手术史".equals(i.getName())
+                                        && !"手术无手术史".equals(i.getName())&& !"手术处理".equals(i.getName())&& !"其他手术史".equals(i.getName())
                         )
                         .map(i -> i.getName())
                         .distinct()

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

@@ -44,7 +44,7 @@ public class BEH0035 extends QCCatalogue {
                         .map(i -> i.getAllergyMedicine().getName()).distinct().collect(Collectors.toList()),
                 pastLabel.getText()
         );
-        if(wtAmNames.contains("止痛片")){
+        if(wtAmNames.contains("止痛片") || wtAmNames.contains("胶布") || wtAmNames.contains("菌菇类")){
             return;
         }
         String pastText = pastLabel.getText();

+ 2 - 1
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0036.java

@@ -32,7 +32,8 @@ public class BEH0036 extends QCCatalogue {
             if (operation == null || StringUtil.isBlank(operation.getName())) {
                 continue;
             }
-            if ("手术史".equals(operation.getName()) || "手术".equals(operation.getName()) || "手术治疗".equals(operation.getName()) || "手术无手术史".equals(operation.getName())) {
+            if ("手术史".equals(operation.getName()) || "其他手术史".equals(operation.getName()) || "手术".equals(operation.getName())
+                    || "手术治疗".equals(operation.getName()) || "手术无手术史".equals(operation.getName()) || "手术处理".equals(operation.getName())) {
                 continue;
             }
             if ((operation.getNegative() == null || StringUtil.isBlank(operation.getNegative().getName()))

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

@@ -80,7 +80,7 @@ public class BEH0058 extends QCCatalogue {
         }
         if (StringUtil.isNotBlank(maritalText)) {
             List<String> words = Lists.newArrayList("未婚", "未育", "未婚育", "未生育", "未生", "0子0女"
-                    , "0-0-0-0", "详见", "0-0-0-0");
+                    , "0-0-0-0", "详见", "0-0-0-0","无子女","未孕", "见旧病历", "见既往病历");
             for (String word : words) {
                 if (maritalText.contains(word)) {
                     status.set("0");

+ 62 - 22
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0059.java

@@ -4,8 +4,10 @@ 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.MedicalRecordInfoDoc;
 import com.lantone.qc.pub.model.label.MenstrualLabel;
 import com.lantone.qc.pub.util.StringUtil;
+import lombok.extern.slf4j.Slf4j;
 import org.springframework.stereotype.Component;
 
 import java.util.Map;
@@ -17,44 +19,82 @@ import java.util.Map;
  * @Date: 2020-03-10 10:10
  */
 @Component
+@Slf4j
 public class BEH0059 extends QCCatalogue {
+    /**
+     * 1.判断住院信息表"科室"若为包含(儿科/新生儿)则通过
+     * 2..判断入院记录是否存在,若不存在则通过
+     * 3.获取性别(住院信息表/入院记录),若是性别不存在或性别为男则通过。然后获取年龄(住院信息表/入院记录),若是年龄小于10岁则通过。
+     * 4.获取入院记录结构化数据若是其中存在"月经"、"经期"、"绝经"且不为空则通过,
+     * 然后获取入院记录月经史,若不存在则报错返回,
+     * 若存在则去除符合规则‘[月经史|:|:|null]’的情况若是去除之后月经史为空则触发规则返回,若是不为空则判断其中是否包含中文字,若是包含则通过
+     */
     @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)) {
+        MedicalRecordInfoDoc medicalRecordInfoDoc = inputInfo.getMedicalRecordInfoDoc();
+        if (medicalRecordInfoDoc != null && medicalRecordInfoDoc.getStructureMap() != null) {
+            //科室
+            String behDeptName = medicalRecordInfoDoc.getStructureMap().get("behDeptName");
+            if (StringUtil.isNotBlank(behDeptName) && (behDeptName.contains("儿科") || behDeptName.contains("新生儿"))) {
+                status.set("0");
+                return;
+            }
+            //性别
+            String sex = medicalRecordInfoDoc.getStructureMap().get("sex");
+            if (StringUtil.isNotBlank(sex) && (sex.contains("男"))) {
+                status.set("0");
+                return;
+            }
+        }
+
+        if (inputInfo.getBeHospitalizedDoc() == null || inputInfo.getBeHospitalizedDoc().getStructureMap() == null) {
+            status.set("0");
+            return;
+        }
+        if (inputInfo.getBeHospitalizedDoc().getStructureMap().get("性别") != null &&
+                inputInfo.getBeHospitalizedDoc().getStructureMap().get("性别").contains("男")) {
+            status.set("0"); //如果性别是男,就不报错
+        }
+        //年龄
+        String age = inputInfo.getBeHospitalizedDoc().getStructureMap().get("年龄");
+        if (StringUtil.isNotBlank(age)) {
+            try {
+                age = age.replace("岁", "");
+                int ageNum = Integer.parseInt(age);
+                if (ageNum < 10) {
                     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"); //如果性别是女,不为空就不报错
-                }
+            } catch (Exception e) {
+                log.error(e.getMessage(), e + "BEH0059 :  日期转换异常");
             }
-        }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"); //如果性别是女,不为空就不报错
+        }
+
+
     }
 
     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 (bhMap.getKey().contains("月经") || bhMap.getKey().contains("经期") || bhMap.getKey().contains("绝经") || bhMap.getKey().contains("月经史")) {
                 if (StringUtil.isNotBlank(bhMap.getValue())) {
                     sb.append(bhMap.getValue());
                 }

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

@@ -32,7 +32,7 @@ public class BEH0072 extends QCCatalogue {
             if (StringUtil.isNotBlank(familyText)) {
                 familyText = familyText.substring(0, Math.min(15, familyText.length()));
                 if (familyText.contains("死因") || familyText.contains("原因") || familyText.contains("详")
-                || familyText.contains("因") || familyText.contains("死于")) {
+                || familyText.contains("因") || familyText.contains("死于")|| familyText.contains("自然死")) {
                     return;
                 }
             }

+ 9 - 3
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH02966.java

@@ -35,11 +35,11 @@ public class BEH02966 extends QCCatalogue {
         if (gender.contains("男")) {
             /* 男性不合理词 */
             noMatchWords = Lists.newArrayList("阴道", "宫颈", "子宫", "宫底", "胎位", "胎数", "胎心",
-                    "宫缩", "宫口", "输卵管", "卵巢", "输卵管", "阴唇", "阴蒂", "阴道前庭", "前庭大腺", "处女膜");
+                    "宫缩", "宫口", "输卵管", "卵巢", "输卵管", "阴唇", "阴蒂", "阴道前庭", "前庭大腺", "处女膜", "女");
         } else if (gender.contains("女")) {
             /* 女性不合理词 */
             noMatchWords = Lists.newArrayList("睾丸", "阴茎", "精索", "包皮", "输精管",
-                    "射精管", "尿道海绵体", "冠状沟", "精阜", "精囊腺", "阴囊");
+                    "射精管", "尿道海绵体", "冠状沟", "精阜", "精囊腺", "阴囊", "男");
         }
         if (noMatchWords == null || noMatchWords.size() == 0) {
             return;
@@ -48,9 +48,15 @@ public class BEH02966 extends QCCatalogue {
         List<String> keys = Lists.newArrayList("主诉", "现病史", "既往史", "体格检查", "一般情况"
                 , "初步诊断", "专科体格检查", "神经系统检查", "实验室检查", "影像学检查");
         String text = CatalogueUtil.structureMapJoin(beHospitalStructureMap, keys);
-
+        String rex = "(?<!((母孕期|母亲|妈妈|分娩期|分娩|出生时|母亲怀孕|怀孕时|孕期)[^。,;。、,;]{0,15}))(阴道|宫颈|子宫|宫底|胎位|胎数|胎心|宫缩|宫口|卵巢|输卵管|阴唇|阴蒂|阴道前庭|前庭大腺|处女膜)";
         for (String noMatchWord : noMatchWords) {
             if (text.contains(noMatchWord)) {
+                if (gender.contains("男")) {
+                    if (!text.matches(rex)) {
+                        status.set("0");
+                        return;
+                    }
+                }
                 status.set("-1");
                 info.set(noMatchWord);
                 return;

+ 1 - 1
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH03176.java

@@ -23,7 +23,7 @@ import java.util.List;
 @Component
 public class BEH03176 extends QCCatalogue {
 
-    private List<String> containList = Arrays.asList("心血管");
+    private List<String> containList = Arrays.asList("心血管", "心力衰竭", "心衰", "心律失常", "冠心病", "心绞痛", "心肌梗死", "高血压", "心肌病", "心肌炎", "心脏病", "高血脂", "高血糖", "糖尿病", "遗传");
 
     public void start(InputInfo inputInfo, OutputInfo outputInfo) {
 

+ 5 - 4
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0372.java

@@ -28,11 +28,12 @@ public class BEH0372 extends QCCatalogue {
         if (StringUtil.isBlank(bhbasicInfoStatus)) {
             bhbasicInfoStatus = inputInfo.getBeHospitalizedDoc().getStructureMap().get("婚姻");
         }
-        if (StringUtil.isBlank(basicInfoStatus) || basicInfoStatus.contains("详见") || StringUtil.isBlank(bhbasicInfoStatus)) {
+        if (StringUtil.isBlank(basicInfoStatus) || basicInfoStatus.contains("详见")
+                || basicInfoStatus.contains("见旧病历") || basicInfoStatus.contains("见既往病历") || StringUtil.isBlank(bhbasicInfoStatus)) {
             status.set("0");
             return;
         }
-
+        bhbasicInfoStatus = bhbasicInfoStatus.replace(" ", "");
         if (bhbasicInfoStatus.equals("未婚") && (basicInfoStatus.contains("未婚") || basicInfoStatus.contains("未结婚"))) {
             status.set("0");
             return;
@@ -51,13 +52,13 @@ public class BEH0372 extends QCCatalogue {
         }
 
         if ((bhbasicInfoStatus.equals("离婚") || bhbasicInfoStatus.equals("离异")) &&
-                (basicInfoStatus.contains("离异") || basicInfoStatus.equals("离婚"))) {
+                (basicInfoStatus.contains("离异") || basicInfoStatus.contains("离婚"))) {
             status.set("0");
             return;
         }
 
         if (bhbasicInfoStatus.equals("已婚") && (basicInfoStatus.contains("结婚") || basicInfoStatus.contains("再婚")
-                || basicInfoStatus.contains("育有") || basicInfoStatus.contains("已婚"))) {
+                || basicInfoStatus.contains("育有") || basicInfoStatus.contains("已婚") || basicInfoStatus.contains("婚育"))) {
             status.set("0");
             return;
         }

+ 6 - 1
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0378.java

@@ -41,7 +41,7 @@ public class BEH0378 extends QCCatalogue {
             familiesFl = familyLabel.getFamilies();
             //规则匹配
             String familyText = familyLabel.getText();
-            if (StringUtil.isNotBlank(familyText) && familyText.contains("自然死亡")) {
+            if (StringUtil.isNotBlank(familyText) && (familyText.contains("自然死亡")|| familyText.matches("[\\s\\S]*(?=配偶因)[^,;,;。]{0,15}(?=已故)[\\s\\S]*"))) {
                 status.set("0");
                 return;
             }
@@ -95,5 +95,10 @@ public class BEH0378 extends QCCatalogue {
                 status.set("0");
             }
         }
+        String maritalText = maritalLabel.getText();
+        if (StringUtil.isNotBlank(maritalText) && maritalText.matches("[\\s\\S]*(?=配偶因)[^,;,;。]{0,15}(?=已故)[\\s\\S]*")) {
+            status.set("0");
+            return;
+        }
     }
 }

+ 3 - 3
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0397.java

@@ -60,10 +60,10 @@ public class BEH0397 extends QCCatalogue {
         if ((StringUtil.isNotBlank(familyText)
                 && ((familyText.contains("父") || familyText.contains("双亲") || familyText.contains("母"))
                 && (familyText.contains("已故") || familyText.contains("体健") || familyText.contains("去世") || familyText.contains("健康"))
-                || familyText.contains("详见") || familyText.contains("见旧病历") || familyText.contains("见既往病历"))
+                || familyText.contains("离世")|| familyText.contains("详见") || familyText.contains("见旧病历") || familyText.contains("见既往病历"))
                 || (StringUtil.isNotBlank(maritalText) && ((maritalText.contains("父") || maritalText.contains("双亲") || maritalText.contains("母"))
-                && (maritalText.contains("已故") || maritalText.contains("体健") || maritalText.contains("去世") || familyText.contains("健康"))
-                || maritalText.contains("详见") || maritalText.contains("见旧病历") || maritalText.contains("见既往病历"))))) {
+                && (maritalText.contains("已故") || maritalText.contains("体健") || maritalText.contains("去世") || maritalText.contains("健康"))
+                || maritalText.contains("离世")|| maritalText.contains("详见") || maritalText.contains("见旧病历") || maritalText.contains("见既往病历"))))) {
             status.set("0");
             return;
         }

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

@@ -39,6 +39,7 @@ public class BEH0411 extends QCCatalogue {
         {
             case "1":                            //长兴
             case "2":
+            case "11":
                 return "记录日期";
             case "7":                            //厦门
                 return "记录日期";

+ 1 - 1
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0441.java

@@ -34,7 +34,7 @@ public class BEH0441 extends QCCatalogue {
             return;
         }
         List<String> words = Lists.newArrayList("胃纳", "食纳", "食欲", "未纳", "纳眠", "饮食", "睡眠"
-                , "禁食", "未食", "鼻饲", "饮", "未进食");
+                , "禁食", "未食", "鼻饲", "饮", "未进食", "开奶", "吃奶", "胃管");
         String presentText = presentLabel.getText();
         if (StringUtil.isNotBlank(presentText)) {
             for (String word : words) {

+ 2 - 2
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0493.java

@@ -36,13 +36,13 @@ public class BEH0493 extends QCCatalogue {
             return;
         }
         PacsLabel pacsLabel = inputInfo.getBeHospitalizedDoc().getPacsLabel();
-        if (pacsLabel != null && StringUtil.isNotBlank(pacsLabel.getText())) {
+        if (pacsLabel != null && StringUtil.isNotBlank(pacsLabel.getText()) && !"。".equals(pacsLabel.getText())) {
             status.set("0");
         }
     }
 
     private String getKeyByHopitalId() {
-        switch (Content.hospital_Id){
+        switch (Content.hospital_Id) {
             case "1":
             case "2":
                 return "辅助检查结果";

+ 1 - 1
kernel/src/main/java/com/lantone/qc/kernel/catalogue/clinicalblood/CLI0301.java

@@ -79,7 +79,7 @@ public class CLI0301 extends QCCatalogue {
                         continue;
                     }
                     String rex="[\\s\\S]*(?=输血)[^,;,;。]{0,10}(?=知情同意书)[\\s\\S]*";
-                    if(Content.BLOODRECORDLIST.contains(str)||str.matches(rex)){
+                    if(Content.BLOODRECORDLIST.stream().anyMatch(obj -> str.contains(obj))||str.matches(rex)){
                         status.set("0");
                         return;
                     }

+ 241 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/clinicalblood/CLI0304.java

@@ -0,0 +1,241 @@
+package com.lantone.qc.kernel.catalogue.clinicalblood;
+
+import com.google.common.collect.Lists;
+import com.lantone.qc.kernel.catalogue.QCCatalogue;
+import com.lantone.qc.kernel.util.RegexUtil;
+import com.lantone.qc.pub.model.InputInfo;
+import com.lantone.qc.pub.model.OutputInfo;
+import com.lantone.qc.pub.model.doc.ClinicalBloodDoc;
+import com.lantone.qc.pub.model.doc.DoctorAdviceDoc;
+import com.lantone.qc.pub.model.doc.FirstPageRecordDoc;
+import com.lantone.qc.pub.util.DateUtil;
+import com.lantone.qc.pub.util.ListUtil;
+import com.lantone.qc.pub.util.StringUtil;
+import org.springframework.stereotype.Component;
+
+import java.math.BigDecimal;
+import java.util.Comparator;
+import java.util.Date;
+import java.util.List;
+import java.util.Objects;
+import java.util.stream.Collectors;
+
+/**
+ * @Description :无输血前化验检查
+ * @Author : zhaops
+ * @Date 2022/7/8 10:19
+ */
+@Component
+public class CLI0304 extends QCCatalogue {
+    /**
+     * 1.病历包含【输血*记录】时,获取【临时医嘱】处方类型为(化验/检验/检查)是否存在:(输血前检查/术前三项/术前四项/感染四项/输血前四项/输血前筛查)中任意一项,
+     * 1.1若不存在查(乙*肝、丙*肝、人类免疫缺陷病毒、梅毒)是否全部存在,仍不存在报出。
+     * 1.2存在后再查(血型/血型鉴定/血型血清学检查/血型鉴定与抗体筛查)是否存在任意一项,不存在则报出。
+     * 1.3都存在时判断化验医嘱开始日期是否都在“输血*记录”之前。多份输血记录时只走第一份时间,日期只对比到天数
+     * 2.【临时医嘱】包含【输*血/输*红细胞/输*血小板/输*血浆/输*冷沉淀因子】但排除带“预约”。出现时。获取【临时医嘱】处方类型为(化验/检验/检查)是否存在:
+     * 2.1(输血前检查/术前三项/术前四项/感染四项/输血前四项/输血前筛查)中任意一项。若不存在查(乙*肝、丙*肝、人类免疫缺陷病毒、梅毒)是否全部存在,仍不存在报出,
+     * 2.2存在后再查(血型/血型鉴定/血型血清学检查/血型鉴定与抗体筛查)是否存在任意一项,不存在则报出。
+     * 2.3都存在时判断化验医嘱开始日期是否都在“输血医嘱”之前。多份输血医嘱只走最早时间,只对比到天数
+     * 3.【病案首页】(血费>0)出现时,获取【临时医嘱】处方类型为(化验/检验/检查)是否存在:(输血前检查/术前三项/术前四项/感染四项/输血前四项/输血前筛查)中任意一项。
+     * 3.1若不存在查(乙*肝、丙*肝、人类免疫缺陷病毒、梅毒)是否全部存在,仍不存在报出,
+     * 3.2存在后再查(血型/血型鉴定/血型血清学检查/血型鉴定与抗体筛查)是否存在任意一项,不存在则报出。
+     */
+
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        List<ClinicalBloodDoc> clinicalBloodDocs = inputInfo.getClinicalBloodDocs();
+        List<DoctorAdviceDoc> doctorAdviceDocs = inputInfo.getDoctorAdviceDocs();
+        FirstPageRecordDoc firstPageRecordDoc = inputInfo.getFirstPageRecordDoc();
+
+        if (ListUtil.isEmpty(doctorAdviceDocs)) {
+            status.set("0");
+            return;
+        }
+
+        String regex1 = "输血前检查|术前三项|术前四项|感染四项|输血前四项|输血前筛查";
+        String regex2 = "乙[\\u4E00-\\u9FA5A-Za-z]{0,}肝";
+        String regex3 = "丙[\\u4E00-\\u9FA5A-Za-z]{0,}肝";
+        String regex4 = "血型|血型鉴定|血型血清学检查|血型鉴定与抗体筛查";
+        String regex5 = "输[\\u4E00-\\u9FA5A-Za-z]{0,}(血|红细胞|血小板|血浆|冷沉淀因子)";
+        List<String> strList = Lists.newArrayList("输血前检查", "术前三项", "术前四项", "感染四项", "输血前四项");
+
+        //医嘱类型判别:临时医嘱,医嘱处方类型:化验、检验、检查
+        List<DoctorAdviceDoc> filterDAList = doctorAdviceDocs.stream().filter(Objects::nonNull)
+                .filter(i -> StringUtil.isNotBlank(i.getStructureMap().get("医嘱类型判别")) && i.getStructureMap().get("医嘱类型判别").equals("临时医嘱"))
+                .filter(i -> StringUtil.isNotBlank(i.getStructureMap().get("医嘱处方类型"))
+                        && (i.getStructureMap().get("医嘱处方类型").equals("化验")
+                        || i.getStructureMap().get("医嘱处方类型").equals("检验")
+                        || i.getStructureMap().get("医嘱处方类型").equals("检查")))
+                .collect(Collectors.toList());
+        if (ListUtil.isEmpty(filterDAList)) {
+            status.set("0");
+            return;
+        }
+
+        //病历包含【输血*记录】时
+        if (ListUtil.isNotEmpty(clinicalBloodDocs)) {
+            List<DoctorAdviceDoc> itemDAList = filterDAList.stream().filter(i -> StringUtil.isNotBlank(i.getStructureMap().get("医嘱项目名称"))
+                            && (RegexUtil.getRegexRes(i.getStructureMap().get("医嘱项目名称"), regex1)))
+                    .collect(Collectors.toList());
+
+            if (ListUtil.isEmpty(itemDAList)) {
+                List<DoctorAdviceDoc> l1 = filterDAList.stream().filter(i -> StringUtil.isNotBlank(i.getStructureMap().get("医嘱项目名称"))
+                                && (RegexUtil.getRegexRes(i.getStructureMap().get("医嘱项目名称"), regex2)))
+                        .collect(Collectors.toList());
+                List<DoctorAdviceDoc> l2 = filterDAList.stream().filter(i -> StringUtil.isNotBlank(i.getStructureMap().get("医嘱项目名称"))
+                                && (RegexUtil.getRegexRes(i.getStructureMap().get("医嘱项目名称"), regex3)))
+                        .collect(Collectors.toList());
+                List<DoctorAdviceDoc> l3 = filterDAList.stream().filter(i -> StringUtil.isNotBlank(i.getStructureMap().get("医嘱项目名称"))
+                                && (RegexUtil.getRegexRes(i.getStructureMap().get("医嘱项目名称"), "人类免疫缺陷病毒")))
+                        .collect(Collectors.toList());
+                List<DoctorAdviceDoc> l4 = filterDAList.stream().filter(i -> StringUtil.isNotBlank(i.getStructureMap().get("医嘱项目名称"))
+                                && (RegexUtil.getRegexRes(i.getStructureMap().get("医嘱项目名称"), "梅毒")))
+                        .collect(Collectors.toList());
+                if (ListUtil.isNotEmpty(l1) && ListUtil.isNotEmpty(l2) && ListUtil.isNotEmpty(l3) && ListUtil.isNotEmpty(l4)) {
+                    status.set("-1");
+                    return;
+                }
+            } else {
+                List<DoctorAdviceDoc> l1 = filterDAList.stream().filter(i -> StringUtil.isNotBlank(i.getStructureMap().get("医嘱项目名称"))
+                                && (RegexUtil.getRegexRes(i.getStructureMap().get("医嘱项目名称"), regex4)))
+                        .collect(Collectors.toList());
+                if (ListUtil.isEmpty(l1)) {
+                    status.set("-1");
+                    return;
+                }
+            }
+
+            if (filterDAList.stream().map(i -> i.getStructureMap().get("医嘱项目名称")).collect(Collectors.toList())
+                    .containsAll(strList)) {
+                //输血记录日期
+                List<Date> cBDateList = clinicalBloodDocs.stream()
+                        .filter(Objects::nonNull)
+                        .filter(i -> StringUtil.isNotBlank(i.getStructureMap().get("病历日期")))
+                        .map(i -> DateUtil.getFirstTimeOfDay(StringUtil.parseDateTime(i.getStructureMap().get("病历日期"))))
+                        .sorted((Comparator.comparing(i -> i)))
+                        .collect(Collectors.toList());
+
+                //医嘱日期
+                List<Date> daDateList = filterDAList.stream()
+                        .filter(Objects::nonNull)
+                        .filter(i -> StringUtil.isNotBlank(i.getStructureMap().get("医嘱开始时间")))
+                        .map(i -> DateUtil.getFirstTimeOfDay(StringUtil.parseDateTime(i.getStructureMap().get("医嘱开始时间"))))
+                        .sorted((Comparator.comparing(i -> i)))
+                        .collect(Collectors.toList());
+
+                if (ListUtil.isNotEmpty(cBDateList) && ListUtil.isNotEmpty(daDateList)
+                        && cBDateList.get(0).after(daDateList.get(daDateList.size() - 1))) {
+                    status.set("-1");
+                    return;
+                }
+            }
+        }
+
+        //输血临时医嘱
+        List<DoctorAdviceDoc> clinicalBloodDAList = doctorAdviceDocs.stream().filter(Objects::nonNull)
+                .filter(i -> StringUtil.isNotBlank(i.getStructureMap().get("医嘱类型判别")) && i.getStructureMap().get("医嘱类型判别").equals("临时医嘱"))
+                .filter(i -> StringUtil.isNotBlank(i.getStructureMap().get("医嘱项目名称"))
+                        && (!i.getStructureMap().get("医嘱项目名称").contains("预约"))
+                        && RegexUtil.getRegexRes(i.getStructureMap().get("医嘱项目名称"), regex5))
+                .collect(Collectors.toList());
+        if (ListUtil.isNotEmpty(clinicalBloodDAList)) {
+            if (ListUtil.isNotEmpty(filterDAList)) {
+                List<DoctorAdviceDoc> itemDAList = filterDAList.stream().filter(i -> StringUtil.isNotBlank(i.getStructureMap().get("医嘱项目名称"))
+                                && (RegexUtil.getRegexRes(i.getStructureMap().get("医嘱项目名称"), regex1)))
+                        .collect(Collectors.toList());
+
+                if (ListUtil.isEmpty(itemDAList)) {
+                    List<DoctorAdviceDoc> l1 = filterDAList.stream().filter(i -> StringUtil.isNotBlank(i.getStructureMap().get("医嘱项目名称"))
+                                    && (RegexUtil.getRegexRes(i.getStructureMap().get("医嘱项目名称"), regex2)))
+                            .collect(Collectors.toList());
+                    List<DoctorAdviceDoc> l2 = filterDAList.stream().filter(i -> StringUtil.isNotBlank(i.getStructureMap().get("医嘱项目名称"))
+                                    && (RegexUtil.getRegexRes(i.getStructureMap().get("医嘱项目名称"), regex3)))
+                            .collect(Collectors.toList());
+                    List<DoctorAdviceDoc> l3 = filterDAList.stream().filter(i -> StringUtil.isNotBlank(i.getStructureMap().get("医嘱项目名称"))
+                                    && (RegexUtil.getRegexRes(i.getStructureMap().get("医嘱项目名称"), "人类免疫缺陷病毒")))
+                            .collect(Collectors.toList());
+                    List<DoctorAdviceDoc> l4 = filterDAList.stream().filter(i -> StringUtil.isNotBlank(i.getStructureMap().get("医嘱项目名称"))
+                                    && (RegexUtil.getRegexRes(i.getStructureMap().get("医嘱项目名称"), "梅毒")))
+                            .collect(Collectors.toList());
+                    if (ListUtil.isNotEmpty(l1) && ListUtil.isNotEmpty(l2) && ListUtil.isNotEmpty(l3) && ListUtil.isNotEmpty(l4)) {
+                        status.set("-1");
+                        return;
+                    }
+                } else {
+                    List<DoctorAdviceDoc> l1 = filterDAList.stream().filter(i -> StringUtil.isNotBlank(i.getStructureMap().get("医嘱项目名称"))
+                                    && (RegexUtil.getRegexRes(i.getStructureMap().get("医嘱项目名称"), regex4)))
+                            .collect(Collectors.toList());
+                    if (ListUtil.isEmpty(l1)) {
+                        status.set("-1");
+                        return;
+                    }
+                }
+
+                if (filterDAList.stream().map(i -> i.getStructureMap().get("医嘱项目名称")).collect(Collectors.toList())
+                        .containsAll(strList)) {
+                    //输血医嘱日期
+                    List<Date> cBDateList = clinicalBloodDAList.stream()
+                            .filter(Objects::nonNull)
+                            .filter(i -> StringUtil.isNotBlank(i.getStructureMap().get("医嘱开始时间")))
+                            .map(i -> DateUtil.getFirstTimeOfDay(StringUtil.parseDateTime(i.getStructureMap().get("医嘱开始时间"))))
+                            .sorted((Comparator.comparing(i -> i)))
+                            .collect(Collectors.toList());
+
+                    //医嘱日期
+                    List<Date> daDateList = filterDAList.stream()
+                            .filter(Objects::nonNull)
+                            .filter(i -> StringUtil.isNotBlank(i.getStructureMap().get("医嘱开始时间")))
+                            .map(i -> DateUtil.getFirstTimeOfDay(StringUtil.parseDateTime(i.getStructureMap().get("医嘱开始时间"))))
+                            .sorted((Comparator.comparing(i -> i)))
+                            .collect(Collectors.toList());
+
+                    if (ListUtil.isNotEmpty(cBDateList) && ListUtil.isNotEmpty(daDateList)
+                            && cBDateList.get(0).after(daDateList.get(daDateList.size() - 1))) {
+                        status.set("-1");
+                        return;
+                    }
+
+                }
+
+            }
+        }
+
+        //【病案首页】(血费>0)出现时
+        if (firstPageRecordDoc != null && firstPageRecordDoc.getStructureMap().containsKey("血费")) {
+            if (BigDecimal.valueOf(Double.valueOf(firstPageRecordDoc.getStructureMap().get("血费"))).compareTo(BigDecimal.ZERO) == 1) {
+                List<DoctorAdviceDoc> itemDAList = filterDAList.stream().filter(i -> StringUtil.isNotBlank(i.getStructureMap().get("医嘱项目名称"))
+                                && (RegexUtil.getRegexRes(i.getStructureMap().get("医嘱项目名称"), regex1)))
+                        .collect(Collectors.toList());
+
+                if (ListUtil.isEmpty(itemDAList)) {
+                    List<DoctorAdviceDoc> l1 = filterDAList.stream().filter(i -> StringUtil.isNotBlank(i.getStructureMap().get("医嘱项目名称"))
+                                    && (RegexUtil.getRegexRes(i.getStructureMap().get("医嘱项目名称"), regex2)))
+                            .collect(Collectors.toList());
+                    List<DoctorAdviceDoc> l2 = filterDAList.stream().filter(i -> StringUtil.isNotBlank(i.getStructureMap().get("医嘱项目名称"))
+                                    && (RegexUtil.getRegexRes(i.getStructureMap().get("医嘱项目名称"), regex3)))
+                            .collect(Collectors.toList());
+                    List<DoctorAdviceDoc> l3 = filterDAList.stream().filter(i -> StringUtil.isNotBlank(i.getStructureMap().get("医嘱项目名称"))
+                                    && (RegexUtil.getRegexRes(i.getStructureMap().get("医嘱项目名称"), "人类免疫缺陷病毒")))
+                            .collect(Collectors.toList());
+                    List<DoctorAdviceDoc> l4 = filterDAList.stream().filter(i -> StringUtil.isNotBlank(i.getStructureMap().get("医嘱项目名称"))
+                                    && (RegexUtil.getRegexRes(i.getStructureMap().get("医嘱项目名称"), "梅毒")))
+                            .collect(Collectors.toList());
+                    if (ListUtil.isNotEmpty(l1) && ListUtil.isNotEmpty(l2) && ListUtil.isNotEmpty(l3) && ListUtil.isNotEmpty(l4)) {
+                        status.set("-1");
+                        return;
+                    }
+                } else {
+                    List<DoctorAdviceDoc> l1 = filterDAList.stream().filter(i -> StringUtil.isNotBlank(i.getStructureMap().get("医嘱项目名称"))
+                                    && (RegexUtil.getRegexRes(i.getStructureMap().get("医嘱项目名称"), regex4)))
+                            .collect(Collectors.toList());
+                    if (ListUtil.isEmpty(l1)) {
+                        status.set("-1");
+                        return;
+                    }
+                }
+            }
+        }
+
+        status.set("0");
+        return;
+    }
+}

+ 3 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/crisisvaluereport/CRI0382.java

@@ -78,6 +78,9 @@ public class CRI0382 extends QCCatalogue {
                     companyNum = companyNum.replaceAll("单位:", "");
                 }
             }
+            if (crisisName.matches("[\\s\\S]*[(?==)][^,;,;。]{0,8}(?=秒)[\\s\\S]*")) {
+                crisisName = crisisName.split("=")[0];
+            }
             allCrisises.add(reptTime);
             if (StringUtils.isNotEmpty(reptTime)) {
                 //当前时间和报告时间未超过6小时,规则通过

+ 3 - 2
kernel/src/main/java/com/lantone/qc/kernel/catalogue/deathrecord/DEAR0342.java

@@ -27,13 +27,14 @@ public class DEAR0342 extends QCCatalogue {
             }
         }
     }
+
     private String getKeyByHospitalId() {
-        switch (Content.hospital_Id)
-        {
+        switch (Content.hospital_Id) {
             case "1":               //长兴
             case "2":
             case "5":
             case "35":
+            case "11":
                 return "诊疗经过";
             default:
                 return "诊疗经过(重点记录病情演变、抢救经过)";

+ 1 - 1
kernel/src/main/java/com/lantone/qc/kernel/catalogue/deathrecord/DEAR0344.java

@@ -24,7 +24,7 @@ public class DEAR0344 extends QCCatalogue {
             if (CatalogueUtil.isEmpty(diagnosisTreatmentProcess)) {
                 return;
             }
-            if (!diagnosisTreatmentProcess.contains("抢救")) {
+            if (!diagnosisTreatmentProcess.contains("抢救") && !diagnosisTreatmentProcess.contains("胸外按压") && !diagnosisTreatmentProcess.contains("心肺复苏")) {
                 status.set("-1");
             }
         }

+ 1 - 1
kernel/src/main/java/com/lantone/qc/kernel/catalogue/deathrecord/DEAR0347.java

@@ -20,7 +20,7 @@ public class DEAR0347 extends QCCatalogue {
         status.set("0");
         if (inputInfo.getDeathRecordDoc() != null && inputInfo.getDeathRecordDoc().getStructureMap() != null) {
             Map<String, String> deathRecordStructureMap = inputInfo.getDeathRecordDoc().getStructureMap();
-            if (CatalogueUtil.isEmpty(deathRecordStructureMap.get("死亡时间"))) {
+            if (CatalogueUtil.isEmpty(deathRecordStructureMap.get("死亡时间")) && CatalogueUtil.isEmpty(deathRecordStructureMap.get("死亡日期"))) {
                 status.set("-1");
             }
         }

+ 6 - 6
kernel/src/main/java/com/lantone/qc/kernel/catalogue/difficultcasediscuss/DIF0118.java

@@ -23,15 +23,15 @@ public class DIF0118 extends QCCatalogue {
     public void start(InputInfo inputInfo, OutputInfo outputInfo) {
         status.set("0");
         List<DifficultCaseDiscussDoc> difficultCaseDiscussDocs = inputInfo.getDifficultCaseDiscussDocs();
-        if(ListUtil.isEmpty(difficultCaseDiscussDocs)){
+        if (ListUtil.isEmpty(difficultCaseDiscussDocs)) {
             return;
         }
-        if(difficultCaseDiscussDocs != null && difficultCaseDiscussDocs.size()>0){
-            for (DifficultCaseDiscussDoc dcdd:difficultCaseDiscussDocs) {
+        if (difficultCaseDiscussDocs != null && difficultCaseDiscussDocs.size() > 0) {
+            for (DifficultCaseDiscussDoc dcdd : difficultCaseDiscussDocs) {
                 Map<String, String> dcddStructureMap = dcdd.getStructureMap();
                 String key = getKeyByHospitalId();
                 String diisDate = dcddStructureMap.get(key);
-                if(CatalogueUtil.isEmpty(diisDate)){
+                if (CatalogueUtil.isEmpty(diisDate)) {
                     status.set("-1");
                     break;
                 }
@@ -40,10 +40,10 @@ public class DIF0118 extends QCCatalogue {
     }
 
     private String getKeyByHospitalId() {
-        switch (Content.hospital_Id)
-        {
+        switch (Content.hospital_Id) {
             case "1":               //长兴
             case "2":
+            case "11":
                 return "主持人";
             default:
                 return "主持人姓名及专业技术职务";

+ 5 - 2
kernel/src/main/java/com/lantone/qc/kernel/catalogue/difficultcasediscuss/DIF0119.java

@@ -38,10 +38,13 @@ public class DIF0119 extends QCCatalogue {
             }
         }
     }
+
     private String getKeyByHospitalId() {
-        switch (Content.hospital_Id)
-        {
+        switch (Content.hospital_Id) {
             case "5":
+            case "11":
+                return "参加人员的姓名及专业技术职务";
+            case "20":
                 return "参加人员的姓名及专业技术职务";
             default:
                 return "参加人员";

+ 6 - 6
kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstcourserecord/FIRC0084.java

@@ -36,27 +36,27 @@ public class FIRC0084 extends QCCatalogue {
                 }
                 String tretment_plan = courseRecordDocStructureMap.get("诊疗计划");
                 if (StringUtils.isNotEmpty(tretment_plan)) {
-                    if (CatalogueUtil.removeSpecialChar(tretment_plan).contains("同上")) {
+                    if (CatalogueUtil.removeSpecialChar(tretment_plan).equals("同上")) {
                         status.set("-1");
                     }
                 } else if (StringUtils.isNotEmpty(identify_diag)) {
-                    if (CatalogueUtil.removeSpecialChar(identify_diag).contains("同上")) {
+                    if (CatalogueUtil.removeSpecialChar(identify_diag).equals("同上")) {
                         status.set("-1");
                     }
                 } else if (StringUtils.isNotEmpty(characteristic)) {
-                    if (CatalogueUtil.removeSpecialChar(characteristic).contains("同上")) {
+                    if (CatalogueUtil.removeSpecialChar(characteristic).equals("同上")) {
                         status.set("-1");
                     }
                 } else if (StringUtils.isNotEmpty(initDiags)) {
-                    if (CatalogueUtil.removeSpecialChar(initDiags).contains("同上")) {
+                    if (CatalogueUtil.removeSpecialChar(initDiags).equals("同上")) {
                         status.set("-1");
                     }
                 } else if (StringUtils.isNotEmpty(condition)) {
-                    if (CatalogueUtil.removeSpecialChar(condition).contains("同上")) {
+                    if (CatalogueUtil.removeSpecialChar(condition).equals("同上")) {
                         status.set("-1");
                     }
                 } else if (StringUtils.isNotEmpty(pacs)) {
-                    if (CatalogueUtil.removeSpecialChar(pacs).contains("同上")) {
+                    if (CatalogueUtil.removeSpecialChar(pacs).equals("同上")) {
                         status.set("-1");
                     }
                 }

+ 21 - 1
kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstcourserecord/FIRC0095.java

@@ -12,6 +12,7 @@ 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.ListUtil;
 import com.lantone.qc.pub.util.StringUtil;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -78,7 +79,7 @@ public class FIRC0095 extends QCCatalogue {
                 /* 取现病史中一般情况之后的疾病名称 */
                 if (StringUtil.isNotBlank(presentText) && presentDiags.size() > 0) {
                     String lastGeneral = generals.get(generals.size() - 1).getName();
-                    int lastGeneralIndex = presentText.indexOf(lastGeneral);
+                    int lastGeneralIndex = presentText.lastIndexOf(lastGeneral);
                     for (Diag presentDiag : presentDiags) {
                         if (presentDiag.getNegative() != null || presentDiag.getHospitalDiagName().contains("否认")) {
                             continue;
@@ -93,9 +94,28 @@ public class FIRC0095 extends QCCatalogue {
                 }
             }
         }
+
+        if(presentPastDiags!= null && presentPastDiags.size()>0){
+            List<String> markStr = Arrays.asList("病以来", "病来");
+            String text = initialDiagLabel.getText();
+            for (String str : markStr) {
+                if(text.contains(str)){
+                    String textStr = text.substring(text.lastIndexOf(str));
+                    presentPastDiags = presentPastDiags.stream().filter(obj->textStr.contains(obj)).collect(Collectors.toSet());
+                    break;
+                }
+            }
+        }
+
         /* 取既往史中疾病名称 */
         if (pastLabel != null && StringUtils.isNotEmpty(pastLabel.getText())) {
             List<Diag> pastDiags = pastLabel.getDiags();
+            String text = pastLabel.getText();
+            String pattern = "[\\s\\S]*(?=妊娠).{0,4}((?=高血压)|(?=糖尿病))[\\s\\S]*";
+            if(text.matches(pattern) && ListUtil.isNotEmpty(pastDiags)){
+                List<String> dis = Arrays.asList("高血压", "糖尿病");
+                pastDiags = pastDiags.stream().filter(obj -> !dis.contains(obj.getHospitalDiagName())).collect(Collectors.toList());
+            }
             addDiagHospitalName(presentPastDiags, pastDiags, pastLabel.getText());
         } else {            //结构化数据
             List<Diag> pastDiags = new ArrayList<>();

+ 9 - 2
kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstcourserecord/FIRC03086.java

@@ -40,16 +40,23 @@ public class FIRC03086 extends QCCatalogue {
             status.set("0");
             return;
         }
+        //规则匹配增加
+        if (structureV.contains("护理") && (structureV.contains("一级") || structureV.contains("二级") || structureV.contains("三级") ||
+                structureV.contains("Ⅰ级") || structureV.contains("Ⅱ级") || structureV.contains("Ⅲ级") ||
+                structureV.contains("I级") || structureV.contains("II级") || structureV.contains("III级"))) {
+            status.set("0");
+            return;
+        }
         if (StringUtil.isNotBlank(structureV) && structureV.contains("护理")) {
             findText = true;
         }
         if (treatPlanLabel.getNursingLevel() != null) {
-            if (findText && !treatPlanLabel.getNursingLevel().getName().contains("护理常规")) {
+            if (findText && !"护理常规".equals(treatPlanLabel.getNursingLevel().getName())) {
                 status.set("0");
                 return;
             }
         }
-        if (treatPlanLabel.getNursingLevel() == null || treatPlanLabel.getNursingLevel().getName().contains("护理常规")) {
+        if (treatPlanLabel.getNursingLevel() == null || "护理常规".equals(treatPlanLabel.getNursingLevel().getName())) {
             status.set("-1");
             return;
         }

+ 3 - 2
kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstcourserecord/FIRC03087.java

@@ -29,8 +29,9 @@ public class FIRC03087 extends QCCatalogue {
             return;
         }
         String text = treatPlanLabel.getText();
-        if (StringUtil.isBlank(text) || text.contains("检查") || text.contains("检验")
-                || text.contains("三大常规") || text.contains("血常规") || text.contains("CT")) {
+        if (StringUtil.isBlank(text) || text.contains("检查") || text.contains("检验") || text.contains("培养")
+                || text.contains("三大常规") || text.contains("血常规") || text.contains("CT")
+                || text.contains("血液") || text.contains("生化") || text.contains("肿瘤")) {
             status.set("0");
             return;
         }

+ 56 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstcourserecord/FIRC03230.java

@@ -0,0 +1,56 @@
+package com.lantone.qc.kernel.catalogue.firstcourserecord;
+
+import com.lantone.qc.kernel.catalogue.QCCatalogue;
+import com.lantone.qc.kernel.util.RegexUtil;
+import com.lantone.qc.pub.model.InputInfo;
+import com.lantone.qc.pub.model.OutputInfo;
+import com.lantone.qc.pub.model.doc.FirstCourseRecordDoc;
+import com.lantone.qc.pub.util.StringUtil;
+import org.springframework.stereotype.Component;
+
+/**
+ * @Description : 未记录中医辩证分析
+ * @Author : zhaops
+ *
+ * @Date 2022/7/7 10:30
+ */
+@Component
+public class FIRC03230 extends QCCatalogue {
+
+    /**
+     * 首先找到首次病程录,未找到则通过。
+     * 首次病程录结构化数据或文本数据存在,然后获取"诊断依据"
+     * 1,文本形式是否包含有“辨证/辨病/论治/中医辨病辨证依据”。
+     * 或2.结构化“中医辨病辨证依据/辨[^。,;。,;]{0,5}证[^。,;。,;]{0,5}依据”后数据不为空,仅为标点符号或阿拉伯数字,或非文字则报出
+     */
+
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        FirstCourseRecordDoc firstCourseRecordDoc = inputInfo.getFirstCourseRecordDoc();
+        if (firstCourseRecordDoc == null) {
+            status.set("0");
+            return;
+        }
+
+        String text = firstCourseRecordDoc.getText();
+        String diagnoseText = firstCourseRecordDoc.getStructureMap() != null
+                ? firstCourseRecordDoc.getStructureMap().get("诊断依据")
+                : "";
+
+        if (StringUtil.isBlank(text) && StringUtil.isBlank(diagnoseText)) {
+            status.set("0");
+            return;
+        }
+        String regex1 = "辨证|辨病|论治|中医辨病辨证依据";
+        String regex2 = "(中医辨病辨证依据|(辨[^。,;。,;]{0,5}证[^。,;。,;]{0,5}依据))[。,;:。,;:\\d]{0,}[\\u4E00-\\u9FA5A-Za-z]+";
+
+        if ((StringUtil.isNotBlank(text) && RegexUtil.getRegexRes(text, regex1))
+                || (StringUtil.isNotBlank(diagnoseText) && RegexUtil.getRegexRes(diagnoseText, regex2))) {
+            status.set("0");
+            return;
+        } else {
+            status.set("-1");
+            return;
+        }
+
+    }
+}

+ 56 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstcourserecord/FIRC03231.java

@@ -0,0 +1,56 @@
+package com.lantone.qc.kernel.catalogue.firstcourserecord;
+
+
+import com.lantone.qc.kernel.catalogue.QCCatalogue;
+import com.lantone.qc.kernel.util.RegexUtil;
+import com.lantone.qc.pub.model.InputInfo;
+import com.lantone.qc.pub.model.OutputInfo;
+import com.lantone.qc.pub.model.doc.FirstCourseRecordDoc;
+import com.lantone.qc.pub.util.StringUtil;
+import org.springframework.stereotype.Component;
+
+/**
+ * @Description : 无中医鉴别诊断
+ * @Author : zhaops
+ *
+ * @Date 2022/7/7 10:30
+ */
+@Component
+public class FIRC03231 extends QCCatalogue {
+    /**
+     * 首先找到首次病程录,未找到则通过。
+     * 首次病程录结构化数据或文本数据存在,然后获取"鉴别诊断"
+     * 1,文本形式是否包含有“中医鉴别诊断/中医[^。,;。,;]{0,5}鉴别”,无则报出
+     * 或2.结构化“中医鉴别诊断/中医[^。,;。,;]{0,5}鉴别”后数据不为空,仅为标点符号或阿拉伯数字,或非文字则报出
+     */
+
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        FirstCourseRecordDoc firstCourseRecordDoc = inputInfo.getFirstCourseRecordDoc();
+        if (firstCourseRecordDoc == null) {
+            status.set("0");
+            return;
+        }
+
+        String text = firstCourseRecordDoc.getText();
+        String diagText = firstCourseRecordDoc.getStructureMap() != null
+                ? firstCourseRecordDoc.getStructureMap().get("鉴别诊断")
+                : "";
+
+        if (StringUtil.isBlank(text) && StringUtil.isBlank(diagText)) {
+            status.set("0");
+            return;
+        }
+        String regex1 = "中医鉴别诊断|(中医[^。,;。,;]{0,5}鉴别)";
+        String regex2 = "(中医鉴别诊断|(中医[^。,;。,;]{0,5}鉴别))[。,;:。,;:\\d]{0,}[\\u4E00-\\u9FA5A-Za-z]+";
+
+        if ((StringUtil.isNotBlank(text) && RegexUtil.getRegexRes(text, regex1))
+                || (StringUtil.isNotBlank(diagText) && RegexUtil.getRegexRes(diagText, regex2))) {
+            status.set("0");
+            return;
+        } else {
+            status.set("-1");
+            return;
+        }
+
+    }
+}

+ 76 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstcourserecord/FIRC03232.java

@@ -0,0 +1,76 @@
+package com.lantone.qc.kernel.catalogue.firstcourserecord;
+
+
+import com.lantone.qc.kernel.catalogue.QCCatalogue;
+import com.lantone.qc.kernel.util.RegexUtil;
+import com.lantone.qc.pub.model.InputInfo;
+import com.lantone.qc.pub.model.OutputInfo;
+import com.lantone.qc.pub.model.doc.FirstCourseRecordDoc;
+import com.lantone.qc.pub.model.label.CaseCharacteristicLabel;
+import com.lantone.qc.pub.model.label.DiagnosisLabel;
+import com.lantone.qc.pub.util.StringUtil;
+import org.springframework.stereotype.Component;
+
+/**
+ * @Description :无中医四诊
+ * @Author : zhaops
+ *
+ * @Date 2022/7/7 10:30
+ */
+@Component
+public class FIRC03232 extends QCCatalogue {
+    /**
+     * 首先找到首次病程录,未找到则通过。
+     * 首次病程录结构化数据或文本数据存在,然后获取"病例特点/诊断依据"
+     * 查找"病例特点/诊断依据"文本形式内是否包含有
+     * “四诊/神色/神态/面色/面[^。,;。,;]{0,5}(黄|红|青|暗|紫|黑|白)/气血/形态/语声/语气/音色/声音[^。,;。,;]{0,5}弱/气息/舌象/舌/苔/脉/血虚/气血/",
+     * 其中任意两项则通过。
+     * 或(模型标注四诊),若存在则通过
+     */
+
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        FirstCourseRecordDoc firstCourseRecordDoc = inputInfo.getFirstCourseRecordDoc();
+        if (firstCourseRecordDoc == null) {
+            status.set("0");
+            return;
+        }
+
+        String text = firstCourseRecordDoc.getText();
+        String diagnoseText = firstCourseRecordDoc.getStructureMap() != null
+                ? firstCourseRecordDoc.getStructureMap().get("诊断依据")
+                : "";
+        String caseCharacteristicText = firstCourseRecordDoc.getStructureMap() != null
+                ? firstCourseRecordDoc.getStructureMap().get("病例特点")
+                : "";
+
+        //病历特点
+        CaseCharacteristicLabel caseCharacteristicLabel = firstCourseRecordDoc.getCaseCharacteristicLabel();
+        //诊断依据
+        DiagnosisLabel diagnosisLabel = firstCourseRecordDoc.getDiagnosisLabel();
+
+        if (StringUtil.isBlank(text) && StringUtil.isBlank(diagnoseText) && StringUtil.isBlank(caseCharacteristicText)
+                && null == caseCharacteristicLabel
+                && null == diagnosisLabel) {
+            status.set("0");
+            return;
+        }
+
+        String diagnoseText_crf = diagnosisLabel.getText();
+        String caseCharacteristicText_crf = caseCharacteristicLabel.getText();
+
+        String regex = "四诊|神色|神态|面色|(面[^。,;。,;]{0,5}(黄|红|青|暗|紫|黑|白))|气血|形态|语声|语气|音色|(声音[^。,;。,;]{0,5}弱)|气息|舌象|舌|苔|脉|血虚|气血";
+
+        if ((StringUtil.isNotBlank(text) && RegexUtil.getRegexRes(text, regex, 2))
+                || (StringUtil.isNotBlank(diagnoseText) && RegexUtil.getRegexRes(diagnoseText, regex, 2))
+                || (StringUtil.isNotBlank(caseCharacteristicText) && RegexUtil.getRegexRes(caseCharacteristicText, regex, 2))
+                || (StringUtil.isNotBlank(diagnoseText_crf) && RegexUtil.getRegexRes(diagnoseText_crf, "四诊"))
+                || (StringUtil.isNotBlank(caseCharacteristicText_crf) && RegexUtil.getRegexRes(caseCharacteristicText_crf, "四诊"))) {
+            status.set("0");
+            return;
+        } else {
+            status.set("-1");
+            return;
+        }
+
+    }
+}

+ 2 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP0160.java

@@ -29,6 +29,8 @@ public class FIRP0160 extends QCCatalogue {
             if (StringUtil.isBlank(firstAdmissionGender) || StringUtil.isBlank(admissionGender)){
                 return;
             }
+            firstAdmissionGender = firstAdmissionGender.replace("性","");
+            admissionGender = admissionGender.replace("性","");
             if (!CatalogueUtil.compareToken(firstAdmissionGender,admissionGender)) {
                 status.set("-1");
             }

+ 3 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP0161.java

@@ -46,6 +46,9 @@ public class FIRP0161 extends QCCatalogue {
             if (StringUtil.isNotBlank(admissionAge) && admissionAge.contains("岁")) {
                 admissAge = admissionAge.substring(0, admissionAge.indexOf("岁"));
             }
+            if (StringUtil.isNotBlank(admissionAge) && !admissionAge.contains("岁")) {
+                admissAge = admissionAge;
+            }
             String firstadmissAge = "";
             if (StringUtil.isNotBlank(firstAdmissionAge) && firstAdmissionAge.contains("岁")) {
                 firstadmissAge = firstAdmissionAge.substring(0, firstAdmissionAge.indexOf("岁"));

+ 5 - 1
kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP0162.java

@@ -19,12 +19,16 @@ import java.util.Map;
  */
 @Component
 public class FIRP0162 extends QCCatalogue {
-    private List<String> containList = Arrays.asList("-", "—", "拒", "无", "不详", "未上户口");
+    private List<String> containList = Arrays.asList("-", "—", "拒", "无", "不详", "未上户口", "提供");
 
     public void start(InputInfo inputInfo, OutputInfo outputInfo) {
         status.set("0");
         if (inputInfo.getFirstPageRecordDoc() != null && inputInfo.getFirstPageRecordDoc().getStructureMap() != null) {
             Map<String, String> firstpageStructureMap = inputInfo.getFirstPageRecordDoc().getStructureMap();
+            String nationality = firstpageStructureMap.get(Content.nationality);
+            if (StringUtil.isNotBlank(nationality) && !"中国".equals(nationality)) {
+                return;
+            }
             String idNumber = firstpageStructureMap.get(Content.idNumber);
             if (StringUtil.isNotBlank(idNumber)) {
                 for (String word : containList) {

+ 7 - 1
kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP0163.java

@@ -5,6 +5,7 @@ import com.lantone.qc.kernel.util.CatalogueUtil;
 import com.lantone.qc.pub.Content;
 import com.lantone.qc.pub.model.InputInfo;
 import com.lantone.qc.pub.model.OutputInfo;
+import com.lantone.qc.pub.util.StringUtil;
 import org.springframework.stereotype.Component;
 
 import java.util.Map;
@@ -18,12 +19,17 @@ import java.util.Map;
 @Component
 public class FIRP0163 extends QCCatalogue {
     public void start(InputInfo inputInfo, OutputInfo outputInfo) {
-        if (inputInfo.getFirstPageRecordDoc() == null){
+        if (inputInfo.getFirstPageRecordDoc() == null) {
             status.set("0");
             return;
         }
         if (inputInfo.getFirstPageRecordDoc().getStructureMap() != null) {
             Map<String, String> firstpageStructureMap = inputInfo.getFirstPageRecordDoc().getStructureMap();
+            String nationality = firstpageStructureMap.get(Content.nationality);
+            if (StringUtil.isNotBlank(nationality) && !"中国".equals(nationality)) {
+                status.set("0");
+                return;
+            }
             String idNumber = firstpageStructureMap.get(Content.idNumber);
             if (!CatalogueUtil.isEmpty(idNumber)) {
                 status.set("0");

+ 5 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP0166.java

@@ -29,6 +29,11 @@ public class FIRP0166 extends QCCatalogue {
             if (StringUtil.isBlank(firstAdmissionMarry) || StringUtil.isBlank(admissionMarry)) {
                 return;
             }
+            firstAdmissionMarry = firstAdmissionMarry.replace("离异","离婚");
+            admissionMarry = admissionMarry.replace("离异","离婚");
+            if (firstAdmissionMarry.equals("丧偶") && admissionMarry.contains("已故")) {
+                return;
+            }
             if (!CatalogueUtil.compareToken(firstAdmissionMarry, admissionMarry)) {
                 status.set("-1");
             }

+ 5 - 2
kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP0170.java

@@ -19,13 +19,16 @@ import java.util.Map;
 public class FIRP0170 extends QCCatalogue {
     public void start(InputInfo inputInfo, OutputInfo outputInfo) {
         status.set("0");
-        if (inputInfo.getFirstPageRecordDoc() == null){
+        if (inputInfo.getFirstPageRecordDoc() == null) {
+            return;
+        }
+        if (inputInfo.getTransferRecordDocs() == null) {
             return;
         }
         if (inputInfo.getFirstPageRecordDoc().getStructureMap() != null) {
             Map<String, String> firstpageStructureMap = inputInfo.getFirstPageRecordDoc().getStructureMap();
             String transferDept = firstpageStructureMap.get(Content.transferDept);
-            if (StringUtils.isEmpty(transferDept) || "【转科科室】".equals(transferDept)){
+            if (StringUtils.isEmpty(transferDept) || "【转科科室】".equals(transferDept)) {
                 status.set("-1");
             }
         }

+ 3 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP0175.java

@@ -55,6 +55,9 @@ public class FIRP0175 extends QCCatalogue {
                         if (firstpageleaveDiag.contains("伴")) {
                             firstpageleaveDiag = firstpageleaveDiag.substring(0, firstpageleaveDiag.indexOf("伴"));
                         }
+                        if(diags.contains(firstpageleaveDiag)){
+                            firstpageleaveDiag = firstpageleaveDiag.replaceAll("^[0-9]", "");
+                        }
                     }
                     break;
                 }

+ 12 - 11
kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP0181.java

@@ -13,33 +13,34 @@ import java.util.Map;
 /**
  * @ClassName : FIRP0181
  * @Description :未填写
- *  * @Author : 损伤、中毒的外部原因未填写
+ * * @Author : 损伤、中毒的外部原因未填写
  * @Date: 2020-03-16 11:33
  */
 @Component
 public class FIRP0181 extends QCCatalogue {
     public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        status.set("0");
         if (inputInfo.getFirstPageRecordDoc() == null) {
-            status.set("0");
             return;
         }
 
         if (inputInfo.getFirstCourseRecordDoc() != null) {
-            Map<String, String> structureMap = inputInfo.getFirstCourseRecordDoc().getStructureMap();
-            String EDStr = structureMap.get("病例特点");
-            if (StringUtil.isNotBlank(EDStr) && !EDStr.contains("损伤中毒")) {
-                status.set("0");
-                return;
-            }
+            return;
+        }
+        Map<String, String> structureMap = inputInfo.getFirstCourseRecordDoc().getStructureMap();
+        String EDStr = structureMap.get("病例特点");
+        if (StringUtil.isNotBlank(EDStr) && !EDStr.contains("损伤中毒")) {
+            return;
         }
 
         if (inputInfo.getFirstPageRecordDoc().getStructureMap() != null) {
             Map<String, String> firstpageStructureMap = inputInfo.getFirstPageRecordDoc().getStructureMap();
             String transferDept = firstpageStructureMap.get(Content.dp_out);
             String transferDept_changxing = firstpageStructureMap.get("损伤中毒因素");
-            if ((!CatalogueUtil.isEmpty(transferDept) && !"[]".equals(transferDept))
-                    || (!CatalogueUtil.isEmpty(transferDept_changxing) && !"[]".equals(transferDept_changxing))) {
-                status.set("0");
+            if ((CatalogueUtil.isEmpty(transferDept) || "[]".equals(transferDept))
+                    || (CatalogueUtil.isEmpty(transferDept_changxing) || "[]".equals(transferDept_changxing))) {
+                status.set("-1");
+                return;
             }
         }
     }

+ 31 - 7
kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP0184.java

@@ -5,8 +5,13 @@ import com.lantone.qc.kernel.util.CatalogueUtil;
 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.AllergyMedicine;
+import com.lantone.qc.pub.model.label.PastLabel;
+import com.lantone.qc.pub.util.StringUtil;
 import org.springframework.stereotype.Component;
 
+import java.util.List;
 import java.util.Map;
 
 /**
@@ -18,16 +23,35 @@ import java.util.Map;
 @Component
 public class FIRP0184 extends QCCatalogue {
     public void start(InputInfo inputInfo, OutputInfo outputInfo) {
-        if (inputInfo.getFirstPageRecordDoc() == null){
-            status.set("0");
+        status.set("0");
+        BeHospitalizedDoc beHospitalizedDoc = inputInfo.getBeHospitalizedDoc();
+        if (inputInfo.getFirstPageRecordDoc() == null || beHospitalizedDoc == null) {
             return;
         }
-        if (inputInfo.getFirstPageRecordDoc().getStructureMap() != null) {
-            Map<String, String> firstpageStructureMap = inputInfo.getFirstPageRecordDoc().getStructureMap();
+        Map<String, String> firstpageStructureMap = inputInfo.getFirstPageRecordDoc().getStructureMap();
+        PastLabel pastLabel = beHospitalizedDoc.getPastLabel();
+        if (pastLabel == null) {
+            return;
+        }
+        List<AllergyMedicine> allergyMedicines = pastLabel.getAllergyMedicines();
+        if (allergyMedicines == null) {
+            return;
+        }
+
+        long count = allergyMedicines.stream().filter(allergyMedicine -> {
+            boolean flag = false;
+            if (allergyMedicine.getNegative() == null
+                    && StringUtil.isNotBlank(allergyMedicine.getName())) {
+                flag = true;
+            }
+            return flag;
+        }).count();
+
+        if (count > 0 && firstpageStructureMap != null) {
             String drugAllergy = firstpageStructureMap.get(Content.drugAllergy);
-//            String allergyDrug = firstpageStructureMap.get(Content.allergyDrug);
-            if (!CatalogueUtil.isEmpty(drugAllergy)) {
-                status.set("0");
+            if (CatalogueUtil.isEmpty(drugAllergy)) {
+                status.set("-1");
+                return;
             }
         }
     }

+ 1 - 1
kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP0185.java

@@ -18,7 +18,7 @@ import java.util.Map;
 
 /**
  * @ClassName : FIRP0185
- * @Description :药物过敏史未在首页中填报
+ * @Description :药物过敏与既往史不一致
  * @Author : 胡敬
  * @Date: 2020-03-18 14:07
  */

+ 2 - 2
kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP0193.java

@@ -27,7 +27,7 @@ public class FIRP0193 extends QCCatalogue {
     public void start(InputInfo inputInfo, OutputInfo outputInfo) {
         status.set("0");
         FirstPageRecordDoc firstPageRecordDoc = inputInfo.getFirstPageRecordDoc();
-        if (firstPageRecordDoc == null){
+        if (firstPageRecordDoc == null) {
             return;
         }
         List<OperationDoc> operationDocs = inputInfo.getOperationDocs();
@@ -40,7 +40,7 @@ public class FIRP0193 extends QCCatalogue {
                     continue;
                 }
                 String operativeMethod = operationDiscussionDoc.getStructureMap().get("手术方式");
-                if (StringUtil.isBlank(operativeMethod)){
+                if (StringUtil.isBlank(operativeMethod)) {
                     continue;
                 }
                 operations.add(operativeMethod);

+ 1 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP0196.java

@@ -19,6 +19,7 @@ import java.util.Map;
 public class FIRP0196 extends QCCatalogue {
     public void start(InputInfo inputInfo, OutputInfo outputInfo) {
         /**
+         * 入院记录中现病史未描述昏迷,不提示规则
          * 如果入院前天数和入院后天数不为空,且不是数字,例如是“-”,就不报错
          * 如果天数是数字,那么小时和分都不能为空
          */

+ 1 - 1
kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP0209.java

@@ -20,7 +20,7 @@ import java.util.Map;
 @Component
 public class FIRP0209 extends QCCatalogue {
 
-    private List<String> containList = Arrays.asList("农民", "家务", "自由职业者", "个体经营者", "无业人员", "儿童");
+    private List<String> containList = Arrays.asList("退(离)休人员","农民", "家务", "自由职业者", "个体经营者", "无业人员", "儿童");
 
     public void start(InputInfo inputInfo, OutputInfo outputInfo) {
         status.set("0");

+ 6 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP0211.java

@@ -24,6 +24,12 @@ public class FIRP0211 extends QCCatalogue {
             String dischargeTime = firstpageStructureMap.get(Content.work_unit_phone);
             //工作单位 (无工作单位者无需填写单位邮编、电话及地址)
             String workUnit = firstpageStructureMap.get(Content.work_unit);
+            if(StringUtil.isNotBlank(workUnit)){
+                workUnit = workUnit .replace("-无", "—").replace("无", "—")
+                                    .replace("----", "—") .replace("---", "—")
+                                    .replace("--", "—").replace("-", "—")
+                                    .replace("/", "—").replace("-", "—");
+                        }
             if (StringUtil.isBlank(workUnit) || "—".equals(workUnit)) {
                 return;
             }

+ 6 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP0214.java

@@ -24,6 +24,12 @@ public class FIRP0214 extends QCCatalogue {
             String dischargeTime = firstpageStructureMap.get(Content.work_unit_zipcode);
             //工作单位 (无工作单位者无需填写单位邮编、电话及地址)
             String workUnit = firstpageStructureMap.get(Content.work_unit);
+            if(StringUtil.isNotBlank(workUnit)){
+                workUnit = workUnit .replace("-无", "—").replace("无", "—")
+                                    .replace("----", "—") .replace("---", "—")
+                                    .replace("--", "—").replace("-", "—")
+                                    .replace("/", "—").replace("-", "—");
+            }
             if (StringUtil.isBlank(workUnit) || "—".equals(workUnit)) {
                 return;
             }

+ 12 - 3
kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP0225.java

@@ -5,9 +5,12 @@ import com.lantone.qc.kernel.util.CatalogueUtil;
 import com.lantone.qc.pub.Content;
 import com.lantone.qc.pub.model.InputInfo;
 import com.lantone.qc.pub.model.OutputInfo;
+import com.lantone.qc.pub.util.DateUtil;
 import com.lantone.qc.pub.util.StringUtil;
 import org.springframework.stereotype.Component;
 
+import java.text.SimpleDateFormat;
+import java.util.Date;
 import java.util.Map;
 
 /**
@@ -22,14 +25,20 @@ public class FIRP0225 extends QCCatalogue {
         status.set("0");
         if (inputInfo.getFirstPageRecordDoc() != null && inputInfo.getFirstPageRecordDoc().getStructureMap() != null
                 && inputInfo.getLeaveHospitalDoc() != null && inputInfo.getLeaveHospitalDoc().getStructureMap() != null) {
-            Map<String, String> firstpageStructureMap = inputInfo.getFirstPageRecordDoc().getStructureMap();
+             Map<String, String> firstpageStructureMap = inputInfo.getFirstPageRecordDoc().getStructureMap();
             Map<String, String> leaveHospitalStructureMap = inputInfo.getLeaveHospitalDoc().getStructureMap();
             String firstDischargeTime = firstpageStructureMap.get(Content.dischargeTime);//病案首页出院时间
             String dischargeTime = leaveHospitalStructureMap.get(Content.dischargeTime);//出院小结出院时间
-            if (StringUtil.isBlank(firstDischargeTime) || StringUtil.isBlank(dischargeTime)){
+
+            Date firstDate = DateUtil.parseDate(firstDischargeTime,DateUtil.DATE_TIME_FORMAT); //将带字符串的YYYY-DD-MM HH:MM:SS 转成日期
+            Date dischargeDate = DateUtil.parseDateTime(dischargeTime,DateUtil.FORMAT_LONG_CN_MI);
+            String firstDatStr = DateUtil.format(firstDate, DateUtil.DATE_FORMAT);  //将对应的YYYY-MM-DD HH:MM:SS 日期转成对应的YYYY-MM-DD字符串
+            String dischargeDateStr = DateUtil.format(dischargeDate, DateUtil.DATE_FORMAT);
+
+            if (StringUtil.isBlank(firstDatStr) || StringUtil.isBlank(dischargeDateStr)){
                 return;
             }
-            if (!CatalogueUtil.equalsDate(firstDischargeTime, dischargeTime, "yyyy-MM-dd")) {
+            if (!CatalogueUtil.equalsDate(firstDatStr, dischargeDateStr, "yyyy-MM-dd")) {
                 status.set("-1");
             }
         }

+ 2 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP0248.java

@@ -5,6 +5,8 @@ import com.lantone.qc.kernel.util.CatalogueUtil;
 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.RescueDoc;
+import com.lantone.qc.pub.util.ListUtil;
 import com.lantone.qc.pub.util.StringUtil;
 import org.springframework.stereotype.Component;
 

+ 2 - 1
kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP0250.java

@@ -73,7 +73,8 @@ public class FIRP0250 extends QCCatalogue {
             // 跟医学部确认,从抢救措施中读取数据
             String key = getKeyByHospitalId();
             String qjgc = structureMap.get(key);
-            if (StringUtil.isNotBlank(qjgc) && !qjgc.contains("死亡")) {
+            String detail = structureMap.get("抢救结果");
+            if ((StringUtil.isNotBlank(qjgc) && !qjgc.contains("死亡")) ||  (StringUtil.isNotBlank(detail) && detail.equals("成功"))) {
                 i++;
             }
         }

+ 6 - 2
kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP0255.java

@@ -5,6 +5,8 @@ import com.lantone.qc.kernel.util.CatalogueUtil;
 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.LeaveHospitalDoc;
+import com.lantone.qc.pub.util.StringUtil;
 import org.springframework.stereotype.Component;
 
 import java.util.Map;
@@ -19,10 +21,12 @@ import java.util.Map;
 public class FIRP0255 extends QCCatalogue {
     public void start(InputInfo inputInfo, OutputInfo outputInfo) {
         status.set("0");
-        if (inputInfo.getFirstPageRecordDoc() != null && inputInfo.getFirstPageRecordDoc().getStructureMap() != null) {
+        LeaveHospitalDoc leaveHospitalDoc = inputInfo.getLeaveHospitalDoc();
+        if (inputInfo.getFirstPageRecordDoc() != null && inputInfo.getFirstPageRecordDoc().getStructureMap() != null && leaveHospitalDoc != null) {
+            Map<String, String> leaveHospitalStructureMap = leaveHospitalDoc.getStructureMap();
             Map<String, String> firstpageStructureMap = inputInfo.getFirstPageRecordDoc().getStructureMap();
             String name = firstpageStructureMap.get(Content.outcome);
-            if (CatalogueUtil.isEmpty(name)){
+            if (CatalogueUtil.isEmpty(name) && StringUtil.isNotBlank(leaveHospitalStructureMap.get("治疗结果"))) {
                 status.set("-1");
             }
         }

+ 5 - 1
kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP02905.java

@@ -33,8 +33,12 @@ public class FIRP02905 extends QCCatalogue {
             Map<String, String> firstpageStructureMap = inputInfo.getFirstPageRecordDoc().getStructureMap();
             String outWay = firstpageStructureMap.get(Content.outWay);
             String name = firstpageStructureMap.get(Content.receivingOrganization);
+            if (StringUtil.isBlank(outWay)) {
+                status.set("0");
+                return;
+            }
             //医嘱离院不需要接受机构(宁海一院)
-            if (StringUtil.isNotBlank(outWay) && ("医嘱离院".equals(outWay) || "死亡".equals(outWay))) {
+            if (StringUtil.isNotBlank(outWay) && ("医嘱离院".equals(outWay) || "死亡".equals(outWay) || "非医嘱离院".equals(outWay))) {
                 status.set("0");
                 return;
             }

+ 1 - 1
kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP02972.java

@@ -26,7 +26,7 @@ public class FIRP02972 extends QCCatalogue {
             String address = firstpageStructureMap.get(Content.current_address);
             if (!CatalogueUtil.isEmpty(address)) {
                 String suffix = (address.length() <= 5) ? address : (address.substring(address.length() - 5));
-                if (suffix.contains("村")) {
+                if (suffix.contains("村") || suffix.contains("-")) {
                     return;
                 }
                 Pattern p = Pattern.compile("[0-9一二三四五六七八九0123456789]");

+ 10 - 9
kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP03038.java

@@ -23,27 +23,28 @@ import java.util.Map;
 public class FIRP03038 extends QCCatalogue {
     @Autowired
     private SpecialStorageUtil specialStorageUtil;
+
     public void start(InputInfo inputInfo, OutputInfo outputInfo) {
         status.set("0");
         if (inputInfo.getFirstPageRecordDoc() == null) {
             return;
         }
-        Map<String, Map<String,String>> hostpital_standDiag = specialStorageUtil.getJsonStringValue(KernelConstants.HOSPITAL_DIAG_MAP);
+        Map<String, Map<String, String>> hostpital_standDiag = specialStorageUtil.getJsonStringValue(KernelConstants.HOSPITAL_DIAG_MAP);
         if (inputInfo.getFirstPageRecordDoc().getStructureMap() != null) {
             Map<String, Object> firstpageStructureMap = inputInfo.getFirstPageRecordDoc().getStructureExtMap();
-            JSONArray out_diag = (JSONArray)firstpageStructureMap.get("出院诊断");
+            JSONArray out_diag = (JSONArray) firstpageStructureMap.get("出院诊断");
             if (out_diag.size() > 0) {
-                for (int i=0;i<out_diag.size();i++) {
+                for (int i = 0; i < out_diag.size(); i++) {
                     JSONObject jsonObject = out_diag.getJSONObject(i);
-                    String diag_code = (String)jsonObject.get("诊断编码");
+                    String diag_code = (String) jsonObject.get("诊断编码");
                     String diag_name = (String) jsonObject.get("诊断名称");
-                    if(StringUtils.isNotBlank(diag_code) && hostpital_standDiag.containsKey(diag_name)){
-                        Map<String,String> s = hostpital_standDiag.get(diag_name);
-                        if(s != null){
+                    if (StringUtils.isNotBlank(diag_code) && hostpital_standDiag.containsKey(diag_name)) {
+                        Map<String, String> s = hostpital_standDiag.get(diag_name);
+                        if (s != null) {
                             String icd10 = s.get("icd10");
-                            if(StringUtils.isNotBlank(icd10) && icd10.equals(diag_code)){
+                            if (StringUtils.isNotBlank(icd10) && icd10.equals(diag_code)) {
                                 status.set("0");
-                            }else {
+                            } else {
                                 status.set("-1");
                                 return;
                             }

+ 1 - 6
kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP03110.java

@@ -5,14 +5,10 @@ import com.lantone.qc.kernel.util.CatalogueUtil;
 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.DoctorAdviceDoc;
-import com.lantone.qc.pub.model.doc.FirstPageRecordDoc;
 import com.lantone.qc.pub.util.DateUtil;
-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;
 
 /**
@@ -26,8 +22,7 @@ public class FIRP03110 extends QCCatalogue {
     @Override
     public void start(InputInfo inputInfo, OutputInfo outputInfo) {
         status.set("0");
-        FirstPageRecordDoc firstPageRecordDoc = inputInfo.getFirstPageRecordDoc();
-        if (firstPageRecordDoc!=null) {
+        if (inputInfo.getFirstPageRecordDoc() != null && inputInfo.getFirstPageRecordDoc().getStructureMap() != null) {
             Map<String, String> firstPageRecordMap = inputInfo.getFirstPageRecordDoc().getStructureMap();
             String admisDate = firstPageRecordMap.get(Content.dischargeTime);
             String recordTime = firstPageRecordMap.get("创建时间");

+ 39 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP03195.java

@@ -0,0 +1,39 @@
+package com.lantone.qc.kernel.catalogue.firstpagerecord;
+
+import com.lantone.qc.kernel.catalogue.QCCatalogue;
+import com.lantone.qc.pub.Content;
+import com.lantone.qc.pub.model.InputInfo;
+import com.lantone.qc.pub.model.OutputInfo;
+import com.lantone.qc.pub.util.StringUtil;
+import org.springframework.stereotype.Component;
+
+import java.util.Map;
+
+/**
+ * @ClassName : FIRP03195
+ * @Description :病理诊断编码未填写
+ * @Author : wsy
+ * @Date: 2021-03-16 20:11
+ */
+@Component
+public class FIRP03195 extends QCCatalogue {
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        if (inputInfo.getFirstPageRecordDoc() == null) {
+            status.set("0");
+            return;
+        }
+        if (inputInfo.getFirstPageRecordDoc().getStructureMap() != null) {
+            Map<String, String> firstpageStructureMap = inputInfo.getFirstPageRecordDoc().getStructureMap();
+            String bingDiag = firstpageStructureMap.get(Content.pathologyDiagnose);
+            String cost = firstpageStructureMap.get(Content.pathologyDiagnoseCost);
+            String code = firstpageStructureMap.get("病理诊断编码");
+            if (StringUtil.isBlank(cost) || "0".equals(cost)) {
+                status.set("0");
+                return;
+            }
+            if (StringUtil.isNotBlank(bingDiag) && !bingDiag.equals("[]") && StringUtil.isNotBlank(code)) {
+                status.set("0");
+            }
+        }
+    }
+}

+ 72 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP03196.java

@@ -0,0 +1,72 @@
+package com.lantone.qc.kernel.catalogue.firstpagerecord;
+
+import com.google.common.collect.Lists;
+import com.lantone.qc.kernel.catalogue.QCCatalogue;
+import com.lantone.qc.pub.Content;
+import com.lantone.qc.pub.model.InputInfo;
+import com.lantone.qc.pub.model.OutputInfo;
+import com.lantone.qc.pub.model.doc.FirstPageRecordDoc;
+import com.lantone.qc.pub.util.StringUtil;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @ClassName : FIRP03196
+ * @Description :  主要手术及操作麻醉方式未填写
+ * @Author : wsy
+ * @Date: 2022-2-9 15:51
+ */
+@Component
+public class FIRP03196 extends QCCatalogue {
+    @Override
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        status.set("0");
+        FirstPageRecordDoc firstPageRecordDoc = inputInfo.getFirstPageRecordDoc();
+        if (firstPageRecordDoc == null) {
+            return;
+        }
+        Map<String, Object> structureExtMap = firstPageRecordDoc.getStructureExtMap();
+        if (structureExtMap == null) {
+            return;
+        }
+        String operativeName = "";
+        String anesthesiaMode = "";
+        List<Map<String, String>> operative_information = (List<Map<String, String>>) structureExtMap.get(Content.operative_information);
+        if (operative_information == null || operative_information.size() == 0) {
+            return;
+        }
+        //手术名称
+        operativeName = operative_information.get(0).get(Content.operative_name);
+        //麻醉方式
+        anesthesiaMode = operative_information.get(0).get(Content.anesthesia_mode);
+
+        if (StringUtil.isNotBlank(anesthesiaMode)) {
+            return;
+        }
+
+        if (StringUtil.isBlank(operativeName)) {
+            return;
+        }
+
+        List<String> noMatchWords = Lists.newArrayList("其他周围血管药物洗脱支架置入","经皮降主动脉药物洗脱支架置入术","经皮周围动脉药物洗脱支架置入术",
+                "经皮周围静脉药物洗脱支架置入术","经皮尺动脉药物洗脱支架置入术","经皮腓动脉药物洗脱支架置入术","经皮肱动脉药物洗脱支架置入术","经皮桡动脉药物洗脱支架置入术",
+                "经皮上肢静脉药物洗脱支架置入术","经皮头臂静脉药物洗脱支架置入术","经皮外周动脉可降解支架置入术","锁骨下动脉药物洗脱支架置入术","股总动脉药物洗脱支架置入术",
+                "表浅股动脉药物洗脱支架置入","经皮股动脉药物洗脱支架置入术","颅外血管经皮血管成形术","经皮颈总动脉球囊扩张成形术","经皮颈静脉球囊扩张成形术","经皮颈动脉球囊扩张成形术",
+                "经皮椎动脉球囊扩张成形术","颅内血管经皮血管成形术","经皮大脑中动脉球囊扩张成形术","经皮大脑前动脉球囊扩张成形术","经皮大脑后动脉球囊扩张成形术","经皮椎动脉颅内段球囊扩张成形术",
+                "经皮颈内动脉颅内段球囊扩张成形术","经皮基底动脉球囊扩张成形术","经皮交通动脉血管球囊扩张成形术","颈动脉支架经皮置入术","经皮颈动脉远端保护装置置入术","经皮颈动脉覆膜支架置入术",
+                "经皮颈动脉药物洗脱支架置入术","脑保护伞下颈动脉支架置入术","其他颅外动脉支架经皮置入","经皮基底动脉支架置入术","经皮椎动脉支架置入术","经皮颅外动脉远端保护装置置入术",
+                "经皮椎动脉药物洗脱支架置入术","经皮椎动脉覆膜支架置入术","经皮椎动脉非药物洗脱支架置入术","颅内血管支架经皮置入","经皮颅内动脉支架置入术","经皮颅内动脉远端保护装置置入术",
+                "经皮颅内静脉窦支架置入术","经皮大脑前动脉支架置入术","经皮大脑后动脉支架置入术","经皮大脑中动脉支架置入术","经皮冠状动脉腔内血管成形术[PTCA]","经皮冠状动脉球囊扩张成形术",
+                "经皮冠状动脉药物球囊扩张成形术");
+
+        for (String noMatchWord : noMatchWords) {
+            if (operativeName.contains(noMatchWord) && StringUtil.isBlank(anesthesiaMode)) {
+                status.set("-1");
+                info.set(noMatchWord);
+                return;
+            }
+        }
+    }
+}

+ 74 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP03197.java

@@ -0,0 +1,74 @@
+package com.lantone.qc.kernel.catalogue.firstpagerecord;
+
+import com.google.common.collect.Lists;
+import com.lantone.qc.kernel.catalogue.QCCatalogue;
+import com.lantone.qc.pub.Content;
+import com.lantone.qc.pub.model.InputInfo;
+import com.lantone.qc.pub.model.OutputInfo;
+import com.lantone.qc.pub.model.doc.FirstPageRecordDoc;
+import com.lantone.qc.pub.util.StringUtil;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @ClassName : FIRP03197
+ * @Description :  其他手术及操作麻醉方式未填写
+ * @Author : wsy
+ * @Date: 2022-2-9 15:51
+ */
+@Component
+public class FIRP03197 extends QCCatalogue {
+    @Override
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        status.set("0");
+        List<String> noMatchWords = Lists.newArrayList("其他周围血管药物洗脱支架置入","经皮降主动脉药物洗脱支架置入术","经皮周围动脉药物洗脱支架置入术",
+                "经皮周围静脉药物洗脱支架置入术","经皮尺动脉药物洗脱支架置入术","经皮腓动脉药物洗脱支架置入术","经皮肱动脉药物洗脱支架置入术","经皮桡动脉药物洗脱支架置入术",
+                "经皮上肢静脉药物洗脱支架置入术","经皮头臂静脉药物洗脱支架置入术","经皮外周动脉可降解支架置入术","锁骨下动脉药物洗脱支架置入术","股总动脉药物洗脱支架置入术",
+                "表浅股动脉药物洗脱支架置入","经皮股动脉药物洗脱支架置入术","颅外血管经皮血管成形术","经皮颈总动脉球囊扩张成形术","经皮颈静脉球囊扩张成形术","经皮颈动脉球囊扩张成形术",
+                "经皮椎动脉球囊扩张成形术","颅内血管经皮血管成形术","经皮大脑中动脉球囊扩张成形术","经皮大脑前动脉球囊扩张成形术","经皮大脑后动脉球囊扩张成形术","经皮椎动脉颅内段球囊扩张成形术",
+                "经皮颈内动脉颅内段球囊扩张成形术","经皮基底动脉球囊扩张成形术","经皮交通动脉血管球囊扩张成形术","颈动脉支架经皮置入术","经皮颈动脉远端保护装置置入术","经皮颈动脉覆膜支架置入术",
+                "经皮颈动脉药物洗脱支架置入术","脑保护伞下颈动脉支架置入术","其他颅外动脉支架经皮置入","经皮基底动脉支架置入术","经皮椎动脉支架置入术","经皮颅外动脉远端保护装置置入术",
+                "经皮椎动脉药物洗脱支架置入术","经皮椎动脉覆膜支架置入术","经皮椎动脉非药物洗脱支架置入术","颅内血管支架经皮置入","经皮颅内动脉支架置入术","经皮颅内动脉远端保护装置置入术",
+                "经皮颅内静脉窦支架置入术","经皮大脑前动脉支架置入术","经皮大脑后动脉支架置入术","经皮大脑中动脉支架置入术","经皮冠状动脉腔内血管成形术[PTCA]","经皮冠状动脉球囊扩张成形术",
+                "经皮冠状动脉药物球囊扩张成形术");
+
+        FirstPageRecordDoc firstPageRecordDoc = inputInfo.getFirstPageRecordDoc();
+        if (firstPageRecordDoc == null) {
+            return;
+        }
+        Map<String, Object> structureExtMap = firstPageRecordDoc.getStructureExtMap();
+        if (structureExtMap == null) {
+            return;
+        }
+        String operativeName = "";
+        String anesthesiaMode = "";
+        List<Map<String, String>> operative_information = (List<Map<String, String>>) structureExtMap.get(Content.operative_information);
+        if (operative_information == null || operative_information.size() == 0) {
+            return;
+        }
+
+        for (int i = 1; i < operative_information.size(); i++) {
+            //手术名称
+            operativeName = operative_information.get(i).get(Content.operative_name);
+            //麻醉方式
+            anesthesiaMode = operative_information.get(i).get(Content.anesthesia_mode);
+            if (StringUtil.isNotBlank(anesthesiaMode)) {
+                return;
+            }
+
+            if (StringUtil.isBlank(operativeName)) {
+                return;
+            }
+
+            for (String noMatchWord : noMatchWords) {
+                if (operativeName.contains(noMatchWord) && StringUtil.isBlank(anesthesiaMode)) {
+                    status.set("-1");
+                    info.set(noMatchWord);
+                    return;
+                }
+            }
+        }
+    }
+}

+ 33 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP03200.java

@@ -0,0 +1,33 @@
+package com.lantone.qc.kernel.catalogue.firstpagerecord;
+
+import com.lantone.qc.kernel.catalogue.QCCatalogue;
+import com.lantone.qc.pub.Content;
+import com.lantone.qc.pub.model.InputInfo;
+import com.lantone.qc.pub.model.OutputInfo;
+import com.lantone.qc.pub.util.StringUtil;
+import org.springframework.stereotype.Component;
+
+import java.util.Map;
+
+/**
+ * @ClassName : FIRP03200
+ * @Description :治疗类别未填写
+ * @Author : wsy
+ * @Date: 2022-03-16 20:11
+ */
+@Component
+public class FIRP03200 extends QCCatalogue {
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        if (inputInfo.getFirstPageRecordDoc() == null) {
+            status.set("0");
+            return;
+        }
+        if (inputInfo.getFirstPageRecordDoc().getStructureMap() != null) {
+            Map<String, String> firstPageStructureMap = inputInfo.getFirstPageRecordDoc().getStructureMap();
+            String treatmentType = firstPageStructureMap.get(Content.treatmentType);//治疗类别
+            if (StringUtil.isNotBlank(treatmentType)) {
+                status.set("0");
+            }
+        }
+    }
+}

+ 40 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP03201.java

@@ -0,0 +1,40 @@
+package com.lantone.qc.kernel.catalogue.firstpagerecord;
+
+import com.lantone.qc.kernel.catalogue.QCCatalogue;
+import com.lantone.qc.pub.Content;
+import com.lantone.qc.pub.model.InputInfo;
+import com.lantone.qc.pub.model.OutputInfo;
+import com.lantone.qc.pub.util.StringUtil;
+import org.springframework.stereotype.Component;
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @ClassName : FIRP03201
+ * @Description : 治疗类别填写错误
+ * @Author : wsy
+ * @Date: 2022-03-15 16:13
+ */
+@Component
+public class FIRP03201 extends QCCatalogue {
+    public List<String> wordList = Arrays.asList("中医", "民族医", "中西医", "西医");
+
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        status.set("0");
+        if (inputInfo.getFirstPageRecordDoc() == null) {
+            return;
+        }
+        if (inputInfo.getFirstPageRecordDoc().getStructureMap() != null) {
+            Map<String, String> firstPageStructureMap = inputInfo.getFirstPageRecordDoc().getStructureMap();
+            String treatmentType = firstPageStructureMap.get(Content.treatmentType);//治疗类别
+            if (StringUtil.isBlank(treatmentType)) {
+                return;
+            }
+            if (!wordList.contains(treatmentType)) {
+                status.set("-1");
+            }
+        }
+    }
+}

+ 33 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP03202.java

@@ -0,0 +1,33 @@
+package com.lantone.qc.kernel.catalogue.firstpagerecord;
+
+import com.lantone.qc.kernel.catalogue.QCCatalogue;
+import com.lantone.qc.pub.Content;
+import com.lantone.qc.pub.model.InputInfo;
+import com.lantone.qc.pub.model.OutputInfo;
+import com.lantone.qc.pub.util.StringUtil;
+import org.springframework.stereotype.Component;
+
+import java.util.Map;
+
+/**
+ * @ClassName : FIRP03202
+ * @Description :门(急)诊诊断(中医)未填写
+ * @Author : wsy
+ * @Date: 2022-03-16 20:11
+ */
+@Component
+public class FIRP03202 extends QCCatalogue {
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        if (inputInfo.getFirstPageRecordDoc() == null) {
+            status.set("0");
+            return;
+        }
+        if (inputInfo.getFirstPageRecordDoc().getStructureMap() != null) {
+            Map<String, String> firstPageStructureMap = inputInfo.getFirstPageRecordDoc().getStructureMap();
+            String outpatientEmrChDiagnose = firstPageStructureMap.get(Content.outpatientEmrChDiagnose);//门急诊诊断(中医)
+            if (StringUtil.isNotBlank(outpatientEmrChDiagnose)) {
+                status.set("0");
+            }
+        }
+    }
+}

+ 37 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP03203.java

@@ -0,0 +1,37 @@
+package com.lantone.qc.kernel.catalogue.firstpagerecord;
+
+import com.lantone.qc.kernel.catalogue.QCCatalogue;
+import com.lantone.qc.pub.Content;
+import com.lantone.qc.pub.model.InputInfo;
+import com.lantone.qc.pub.model.OutputInfo;
+import com.lantone.qc.pub.util.StringUtil;
+import org.springframework.stereotype.Component;
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @ClassName : FIRP03203
+ * @Description : 门(急)诊诊断(中医)填写不标准
+ * @Author : wsy
+ * @Date: 2022-03-15 16:13
+ */
+@Component
+public class FIRP03203 extends QCCatalogue {
+    public List<String> wordlist = Arrays.asList("中医", "民族医", "中西医", "西医");
+
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        status.set("0");
+//        if (inputInfo.getFirstPageRecordDoc() == null) {
+//            return;
+//        }
+//        if (inputInfo.getFirstPageRecordDoc().getStructureMap() != null) {
+//            Map<String, String> firstPageStructureMap = inputInfo.getFirstPageRecordDoc().getStructureMap();
+//            String outpatientEmrChDiagnose = firstPageStructureMap.get(Content.outpatientEmrChDiagnose);//门急诊诊断(中医)
+//            if (StringUtil.isBlank(treatmentType)) {
+                return;
+//            }
+//        }
+    }
+}

+ 33 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP03204.java

@@ -0,0 +1,33 @@
+package com.lantone.qc.kernel.catalogue.firstpagerecord;
+
+import com.lantone.qc.kernel.catalogue.QCCatalogue;
+import com.lantone.qc.pub.Content;
+import com.lantone.qc.pub.model.InputInfo;
+import com.lantone.qc.pub.model.OutputInfo;
+import com.lantone.qc.pub.util.StringUtil;
+import org.springframework.stereotype.Component;
+
+import java.util.Map;
+
+/**
+ * @ClassName : FIRP03204
+ * @Description :门(急)诊诊断(中医)疾病编码未填写
+ * @Author : wsy
+ * @Date: 2022-03-16 20:11
+ */
+@Component
+public class FIRP03204 extends QCCatalogue {
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        if (inputInfo.getFirstPageRecordDoc() == null) {
+            status.set("0");
+            return;
+        }
+        if (inputInfo.getFirstPageRecordDoc().getStructureMap() != null) {
+            Map<String, String> firstPageStructureMap = inputInfo.getFirstPageRecordDoc().getStructureMap();
+            String outpatientEmrChDiagnoseCode = firstPageStructureMap.get(Content.outpatientEmrChDiagnoseCode);//门急诊诊断编码(中医)
+            if (StringUtil.isNotBlank(outpatientEmrChDiagnoseCode)) {
+                status.set("0");
+            }
+        }
+    }
+}

+ 34 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP03205.java

@@ -0,0 +1,34 @@
+package com.lantone.qc.kernel.catalogue.firstpagerecord;
+
+import com.lantone.qc.kernel.catalogue.QCCatalogue;
+import com.lantone.qc.pub.model.InputInfo;
+import com.lantone.qc.pub.model.OutputInfo;
+import org.springframework.stereotype.Component;
+
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * @ClassName : FIRP03205
+ * @Description : 门(急)诊诊断(中医)疾病编码填写不标准
+ * @Author : wsy
+ * @Date: 2022-03-15 16:13
+ */
+@Component
+public class FIRP03205 extends QCCatalogue {
+    public List<String> wordlist = Arrays.asList("中医", "民族医", "中西医", "西医");
+
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        status.set("0");
+//        if (inputInfo.getFirstPageRecordDoc() == null) {
+//            return;
+//        }
+//        if (inputInfo.getFirstPageRecordDoc().getStructureMap() != null) {
+//            Map<String, String> firstPageStructureMap = inputInfo.getFirstPageRecordDoc().getStructureMap();
+//            String outpatientEmrChDiagnose = firstPageStructureMap.get(Content.outpatientEmrChDiagnose);//门急诊诊断(中医)
+//            if (StringUtil.isBlank(treatmentType)) {
+                return;
+//            }
+//        }
+    }
+}

+ 39 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP03206.java

@@ -0,0 +1,39 @@
+package com.lantone.qc.kernel.catalogue.firstpagerecord;
+
+import com.lantone.qc.kernel.catalogue.QCCatalogue;
+import com.lantone.qc.kernel.util.CatalogueUtil;
+import com.lantone.qc.pub.Content;
+import com.lantone.qc.pub.model.InputInfo;
+import com.lantone.qc.pub.model.OutputInfo;
+import com.lantone.qc.pub.util.ListUtil;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @ClassName : FIRP03206
+ * @Description : 出院中医主病名称未填写
+ * @Author : wsy
+ * @Date: 2022-03-06 17:28
+ */
+@Component
+public class FIRP03206 extends QCCatalogue {
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        status.set("0");
+        if (inputInfo.getFirstPageRecordDoc() != null && inputInfo.getFirstPageRecordDoc().getStructureMap() != null) {
+            Map<String, Object> firstpageStructureMapExt = inputInfo.getFirstPageRecordDoc().getStructureExtMap();
+            List<Map<String, String>> dischargeDiag = (List) firstpageStructureMapExt.get(Content.dischargeDiag);
+            if (ListUtil.isEmpty(dischargeDiag)) {
+                return;
+            }
+            for (Map<String, String> stringStringMap : dischargeDiag) {
+                if ("中医".equals(stringStringMap.get(Content.chinese_western_type))) {
+                    if ("主病".equals(stringStringMap.get(Content.diagnose_type)) && CatalogueUtil.isEmpty(stringStringMap.get(Content.diagnose_name))) {
+                        status.set("-1");
+                    }
+                }
+            }
+        }
+    }
+}

+ 39 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP03207.java

@@ -0,0 +1,39 @@
+package com.lantone.qc.kernel.catalogue.firstpagerecord;
+
+import com.lantone.qc.kernel.catalogue.QCCatalogue;
+import com.lantone.qc.kernel.util.CatalogueUtil;
+import com.lantone.qc.pub.Content;
+import com.lantone.qc.pub.model.InputInfo;
+import com.lantone.qc.pub.model.OutputInfo;
+import com.lantone.qc.pub.util.ListUtil;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @ClassName : FIRP03207
+ * @Description : 出院中医主病名称填写不标准
+ * @Author : wsy
+ * @Date: 2022-03-06 17:28
+ */
+@Component
+public class FIRP03207 extends QCCatalogue {
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        status.set("0");
+//        if (inputInfo.getFirstPageRecordDoc() != null && inputInfo.getFirstPageRecordDoc().getStructureMap() != null) {
+//            Map<String, Object> firstpageStructureMapExt = inputInfo.getFirstPageRecordDoc().getStructureExtMap();
+//            List<Map<String, String>> dischargeDiag = (List) firstpageStructureMapExt.get(Content.dischargeDiag);
+//            if (ListUtil.isEmpty(dischargeDiag)) {
+//                return;
+//            }
+//            for (Map<String, String> stringStringMap : dischargeDiag) {
+//                if ("中医".equals(stringStringMap.get(Content.chinese_western_type))) {
+//                    if ("主病".equals(stringStringMap.get(Content.diagnose_type)) && CatalogueUtil.isEmpty(stringStringMap.get(Content.diagnose_name))) {
+//
+//                    }
+//                }
+//            }
+//        }
+    }
+}

+ 40 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP03208.java

@@ -0,0 +1,40 @@
+package com.lantone.qc.kernel.catalogue.firstpagerecord;
+
+import com.lantone.qc.kernel.catalogue.QCCatalogue;
+import com.lantone.qc.kernel.util.CatalogueUtil;
+import com.lantone.qc.pub.Content;
+import com.lantone.qc.pub.model.InputInfo;
+import com.lantone.qc.pub.model.OutputInfo;
+import com.lantone.qc.pub.util.ListUtil;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @ClassName : FIRP03208
+ * @Description : 出院中医主病编码未填写
+ * @Author : wsy
+ * @Date: 2022-03-06 17:28
+ */
+@Component
+public class FIRP03208 extends QCCatalogue {
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        status.set("0");
+        if (inputInfo.getFirstPageRecordDoc() != null && inputInfo.getFirstPageRecordDoc().getStructureMap() != null) {
+            Map<String, Object> firstpageStructureMapExt = inputInfo.getFirstPageRecordDoc().getStructureExtMap();
+            List<Map<String, String>> dischargeDiag = (List) firstpageStructureMapExt.get(Content.dischargeDiag);
+            if (ListUtil.isEmpty(dischargeDiag)) {
+                return;
+            }
+            for (Map<String, String> stringStringMap : dischargeDiag) {
+                if ("中医".equals(stringStringMap.get(Content.chinese_western_type))) {
+                    if ("主病".equals(stringStringMap.get(Content.diagnose_type)) && !CatalogueUtil.isEmpty(stringStringMap.get(Content.diagnose_name))
+                            && CatalogueUtil.isEmpty(stringStringMap.get(Content.icd_code))) {
+                        status.set("-1");
+                    }
+                }
+            }
+        }
+    }
+}

+ 40 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP03209.java

@@ -0,0 +1,40 @@
+package com.lantone.qc.kernel.catalogue.firstpagerecord;
+
+import com.lantone.qc.kernel.catalogue.QCCatalogue;
+import com.lantone.qc.kernel.util.CatalogueUtil;
+import com.lantone.qc.pub.Content;
+import com.lantone.qc.pub.model.InputInfo;
+import com.lantone.qc.pub.model.OutputInfo;
+import com.lantone.qc.pub.util.ListUtil;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @ClassName : FIRP03209
+ * @Description : 出院中医主病编码填写不标准
+ * @Author : wsy
+ * @Date: 2022-03-06 17:28
+ */
+@Component
+public class FIRP03209 extends QCCatalogue {
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        status.set("0");
+//        if (inputInfo.getFirstPageRecordDoc() != null && inputInfo.getFirstPageRecordDoc().getStructureMap() != null) {
+//            Map<String, Object> firstpageStructureMapExt = inputInfo.getFirstPageRecordDoc().getStructureExtMap();
+//            List<Map<String, String>> dischargeDiag = (List) firstpageStructureMapExt.get(Content.dischargeDiag);
+//            if (ListUtil.isEmpty(dischargeDiag)) {
+//                return;
+//            }
+//            for (Map<String, String> stringStringMap : dischargeDiag) {
+//                if ("中医".equals(stringStringMap.get(Content.chinese_western_type))) {
+//                    if ("主病".equals(stringStringMap.get(Content.diagnose_type)) && !CatalogueUtil.isEmpty(stringStringMap.get(Content.diagnose_name))
+//                            && CatalogueUtil.isEmpty(stringStringMap.get(Content.icd_code))) {
+//
+//                    }
+//                }
+//            }
+//        }
+    }
+}

+ 39 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP03210.java

@@ -0,0 +1,39 @@
+package com.lantone.qc.kernel.catalogue.firstpagerecord;
+
+import com.lantone.qc.kernel.catalogue.QCCatalogue;
+import com.lantone.qc.kernel.util.CatalogueUtil;
+import com.lantone.qc.pub.Content;
+import com.lantone.qc.pub.model.InputInfo;
+import com.lantone.qc.pub.model.OutputInfo;
+import com.lantone.qc.pub.util.ListUtil;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @ClassName : FIRP03210
+ * @Description : 出院主病入院病情未填写
+ * @Author : wsy
+ * @Date: 2022-03-06 17:28
+ */
+@Component
+public class FIRP03210 extends QCCatalogue {
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        status.set("0");
+        if (inputInfo.getFirstPageRecordDoc() != null && inputInfo.getFirstPageRecordDoc().getStructureMap() != null) {
+            Map<String, Object> firstpageStructureMapExt = inputInfo.getFirstPageRecordDoc().getStructureExtMap();
+            List<Map<String, String>> dischargeDiag = (List) firstpageStructureMapExt.get(Content.dischargeDiag);
+            if (ListUtil.isEmpty(dischargeDiag)) {
+                return;
+            }
+            for (Map<String, String> stringStringMap : dischargeDiag) {
+                if ("中医".equals(stringStringMap.get(Content.chinese_western_type))) {
+                    if ("主病".equals(stringStringMap.get(Content.diagnose_type)) && CatalogueUtil.isEmpty(stringStringMap.get(Content.inStatus))) {
+                        status.set("-1");
+                    }
+                }
+            }
+        }
+    }
+}

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

@@ -0,0 +1,51 @@
+package com.lantone.qc.kernel.catalogue.firstpagerecord;
+
+import com.lantone.qc.kernel.catalogue.QCCatalogue;
+import com.lantone.qc.pub.Content;
+import com.lantone.qc.pub.model.InputInfo;
+import com.lantone.qc.pub.model.OutputInfo;
+import com.lantone.qc.pub.util.ListUtil;
+import com.lantone.qc.pub.util.StringUtil;
+import org.springframework.stereotype.Component;
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @ClassName : FIRP03211
+ * @Description : 主病“入院病情”不在编码范围内
+ * @Author : wsy
+ * @Date: 2022-03-15 16:13
+ */
+@Component
+public class FIRP03211 extends QCCatalogue {
+    public List<String> wordList = Arrays.asList("有", "临床未确定", "情况不明", "无");
+
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        status.set("0");
+        String inStatus = "";
+        if (inputInfo.getFirstPageRecordDoc() == null) {
+            return;
+        }
+        if (inputInfo.getFirstPageRecordDoc().getStructureMap() != null) {
+            Map<String, Object> firstpageStructureMapExt = inputInfo.getFirstPageRecordDoc().getStructureExtMap();
+            List<Map<String, String>> dischargeDiag = (List) firstpageStructureMapExt.get(Content.dischargeDiag);
+            if (ListUtil.isEmpty(dischargeDiag)) {
+                return;
+            }
+            for (Map<String, String> stringStringMap : dischargeDiag) {
+                if ("中医".equals(stringStringMap.get(Content.chinese_western_type))) {
+                    if ("主病".equals(stringStringMap.get(Content.diagnose_type))) {
+                        inStatus = stringStringMap.get(Content.inStatus);
+                    }
+                }
+            }
+
+            if (StringUtil.isNotBlank(inStatus) && !wordList.contains(inStatus)) {
+                status.set("-1");
+                return;
+            }
+        }
+    }
+}

+ 40 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP03212.java

@@ -0,0 +1,40 @@
+package com.lantone.qc.kernel.catalogue.firstpagerecord;
+
+import com.lantone.qc.kernel.catalogue.QCCatalogue;
+import com.lantone.qc.kernel.util.CatalogueUtil;
+import com.lantone.qc.pub.Content;
+import com.lantone.qc.pub.model.InputInfo;
+import com.lantone.qc.pub.model.OutputInfo;
+import com.lantone.qc.pub.util.ListUtil;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @ClassName : FIRP03212
+ * @Description : 出院中医主证名称未填写
+ * @Author : Wsy
+ * @Date: 2022-03-06 17:28
+ */
+@Component
+public class FIRP03212 extends QCCatalogue {
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        status.set("0");
+        if (inputInfo.getFirstPageRecordDoc() != null && inputInfo.getFirstPageRecordDoc().getStructureMap() != null) {
+            Map<String, Object> firstpageStructureMapExt = inputInfo.getFirstPageRecordDoc().getStructureExtMap();
+            List<Map<String, String>> dischargeDiag = (List) firstpageStructureMapExt.get(Content.dischargeDiag);
+            if (ListUtil.isEmpty(dischargeDiag)) {
+                return;
+            }
+            for (Map<String, String> stringStringMap : dischargeDiag) {
+                if ("中医".equals(stringStringMap.get(Content.chinese_western_type))) {
+                    if ("主症".equals(stringStringMap.get(Content.diagnose_type)) && CatalogueUtil.isEmpty(stringStringMap.get(Content.diagnose_name))) {
+                        status.set("-1");
+                        return;
+                    }
+                }
+            }
+        }
+    }
+}

+ 80 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP03213.java

@@ -0,0 +1,80 @@
+package com.lantone.qc.kernel.catalogue.firstpagerecord;
+
+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.Content;
+import com.lantone.qc.pub.model.InputInfo;
+import com.lantone.qc.pub.model.OutputInfo;
+import com.lantone.qc.pub.model.doc.FirstPageRecordDoc;
+import com.lantone.qc.pub.util.StringUtil;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @ClassName : FIRP03213
+ * @Description :  出院中医主病诊断编码与性别不符
+ * @Author : Wsy
+ * @Date: 2022-3-13 15:51
+ */
+@Component
+public class FIRP03213 extends QCCatalogue {
+    @Override
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        status.set("0");
+        FirstPageRecordDoc firstPageRecordDoc = inputInfo.getFirstPageRecordDoc();
+        if (firstPageRecordDoc == null) {
+            return;
+        }
+        Map<String, Object> structureExtMap = firstPageRecordDoc.getStructureExtMap();
+        if (structureExtMap == null) {
+            return;
+        }
+        String icdCode = "";
+        List<Map<String, String>> outpatientEmergencyDiag = (List) structureExtMap.get(Content.dischargeDiag);
+        if (outpatientEmergencyDiag == null || outpatientEmergencyDiag.size() == 0) {
+            return;
+        }
+
+        for (Map<String, String> map : outpatientEmergencyDiag) {
+            if (StringUtil.isNotBlank(map.get(Content.diagnose_type)) && "主病".equals(map.get(Content.diagnose_type))) {
+                icdCode = map.get(Content.icd_code);
+            }
+        }
+
+        if (StringUtil.isBlank(icdCode)) {
+            return;
+        }
+
+        String gender = (String) structureExtMap.get("性别");
+        if (StringUtil.isBlank(gender)) {
+            return;
+        }
+        List<String> noMatchWords = null;
+        if (gender.contains("男")) {
+            /* 男性不合理诊断编码 */
+            noMatchWords = Lists.newArrayList("BF", "BFY", "BFY010", "BFY020", "BFY030", "BFY040", "BFY050", "BFY060", "BFY080", "BFY090", "BFY100", "BFY110", "BFY120", "BFY130", "BFY140",
+                    "BFY150", "BFY160", "BFY170", "BFY180", "BFY190", "BFY200", "BFY210", "BFY220", "BFY70", "BFD", "BFD010", "BFR", "BFR010", "BFR020", "BFR030", "BFR040", "BFR050", "BFR051", "BFR052",
+                    "BFR060", "BFR070", "BFR080", "BFR090", "BFR100", "BFR110", "BFR120", "BFR130", "BFR140", "BFR150", "BFR160", "BFR170", "BFR180", "BFR190", "BFR200", "BFC", "BFC010", "BFC011", "BFC020",
+                    "BFC030", "BFC040", "BFC050", "BFC060", "BFC070", "BFC080", "BFC081", "BFC090", "BFC091", "BFC100", "BFC110", "BFC120", "BFC130", "BFC140", "BFC150", "BFC160", "BFC170", "BFC180", "BFL",
+                    "BFL000", "BFA", "BFA000", "BFZ", "BFZ010", "BFZ020", "BFZ030", "BFZ040", "BFZ050", "BFZ060", "BFZ070", "BFZ080");
+        } else if (gender.contains("女")) {
+            /* 女性不合理诊断编码 */
+            noMatchWords = Lists.newArrayList("BNS160", "BNS161", "BNS162", "BNS170", "BNS180", "BWN", "BWN050", "BWN010", "BWN020", "BWN030", "BWN040",
+                    "BWN060", "BWN070", "BWN080", "ZBMRD1", "ZBRS20", "ZYV071", "ZYV231", "ZYV252", "ZYX111", "ZZPF11", "ZZS110", "ZZS120", "ZZSM20", "ZLHR20");
+        }
+        if (noMatchWords == null || noMatchWords.size() == 0) {
+            return;
+        }
+
+        for (String noMatchWord : noMatchWords) {
+            if (icdCode.equals(noMatchWord)) {
+                status.set("-1");
+                info.set(noMatchWord);
+                return;
+            }
+        }
+    }
+}

+ 41 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP03214.java

@@ -0,0 +1,41 @@
+package com.lantone.qc.kernel.catalogue.firstpagerecord;
+
+import com.lantone.qc.kernel.catalogue.QCCatalogue;
+import com.lantone.qc.kernel.util.CatalogueUtil;
+import com.lantone.qc.pub.Content;
+import com.lantone.qc.pub.model.InputInfo;
+import com.lantone.qc.pub.model.OutputInfo;
+import com.lantone.qc.pub.util.ListUtil;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+/**
+ * @ClassName : FIRP03214
+ * @Description : 出院中医主证编码未填写
+ * @Author : cy
+ * @Date: 2022-03-06 17:28
+ */
+@Component
+public class FIRP03214 extends QCCatalogue {
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        status.set("0");
+        if (inputInfo.getFirstPageRecordDoc() != null && inputInfo.getFirstPageRecordDoc().getStructureMap() != null) {
+            Map<String, Object> firstpageStructureMapExt = inputInfo.getFirstPageRecordDoc().getStructureExtMap();
+            List<Map<String, String>> dischargeDiag = (List) firstpageStructureMapExt.get(Content.dischargeDiag);
+            if (ListUtil.isEmpty(dischargeDiag)) {
+                return;
+            }
+            for (Map<String, String> stringStringMap : dischargeDiag) {
+                if ("中医".equals(stringStringMap.get(Content.chinese_western_type))) {
+                    if ("主症".equals(stringStringMap.get(Content.diagnose_type)) && !CatalogueUtil.isEmpty(stringStringMap.get(Content.diagnose_name))
+                            && CatalogueUtil.isEmpty(stringStringMap.get(Content.icd_code))) {
+                        status.set("-1");
+                    }
+                }
+            }
+        }
+    }
+}

+ 40 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP03215.java

@@ -0,0 +1,40 @@
+package com.lantone.qc.kernel.catalogue.firstpagerecord;
+
+import com.lantone.qc.kernel.catalogue.QCCatalogue;
+import com.lantone.qc.kernel.util.CatalogueUtil;
+import com.lantone.qc.pub.Content;
+import com.lantone.qc.pub.model.InputInfo;
+import com.lantone.qc.pub.model.OutputInfo;
+import com.lantone.qc.pub.util.ListUtil;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @ClassName : FIRP03215
+ * @Description : 出院主证入院病情未填写
+ * @Author : cy
+ * @Date: 2022-03-06 17:28
+ */
+@Component
+public class FIRP03215 extends QCCatalogue {
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        status.set("0");
+        if (inputInfo.getFirstPageRecordDoc() != null && inputInfo.getFirstPageRecordDoc().getStructureMap() != null) {
+            Map<String, Object> firstpageStructureMapExt = inputInfo.getFirstPageRecordDoc().getStructureExtMap();
+            List<Map<String, String>> dischargeDiag = (List) firstpageStructureMapExt.get(Content.dischargeDiag);
+            if (ListUtil.isEmpty(dischargeDiag)) {
+                return;
+            }
+            for (Map<String, String> stringStringMap : dischargeDiag) {
+                if ("中医".equals(stringStringMap.get(Content.chinese_western_type))) {
+                    if ("主症".equals(stringStringMap.get(Content.diagnose_type)) && !CatalogueUtil.isEmpty(stringStringMap.get(Content.diagnose_name))
+                            && CatalogueUtil.isEmpty(stringStringMap.get(Content.inStatus))) {
+                        status.set("-1");
+                    }
+                }
+            }
+        }
+    }
+}

+ 43 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP03216.java

@@ -0,0 +1,43 @@
+package com.lantone.qc.kernel.catalogue.firstpagerecord;
+
+import com.lantone.qc.kernel.catalogue.QCCatalogue;
+import com.lantone.qc.kernel.util.CatalogueUtil;
+import com.lantone.qc.pub.Content;
+import com.lantone.qc.pub.model.InputInfo;
+import com.lantone.qc.pub.model.OutputInfo;
+import com.lantone.qc.pub.util.ListUtil;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @ClassName : FIRP03216
+ * @Description : 出院主证入院病情填写错误
+ * @Author : cy
+ * @Date: 2022-03-06 17:28
+ */
+@Component
+public class FIRP03216 extends QCCatalogue {
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        status.set("0");
+        if (inputInfo.getFirstPageRecordDoc() != null && inputInfo.getFirstPageRecordDoc().getStructureMap() != null) {
+            Map<String, Object> firstpageStructureMapExt = inputInfo.getFirstPageRecordDoc().getStructureExtMap();
+            List<Map<String, String>> dischargeDiag = (List) firstpageStructureMapExt.get(Content.dischargeDiag);
+            if (ListUtil.isEmpty(dischargeDiag)) {
+                return;
+            }
+            for (Map<String, String> stringStringMap : dischargeDiag) {
+                if ("中医".equals(stringStringMap.get(Content.chinese_western_type))) {
+                    if ("主症".equals(stringStringMap.get(Content.diagnose_type)) && !CatalogueUtil.isEmpty(stringStringMap.get(Content.diagnose_name))
+                            && !CatalogueUtil.isEmpty(stringStringMap.get(Content.inStatus))) {
+                        String inStatus = stringStringMap.get(Content.inStatus);
+                        if(!Content.ADMISSIONCONDITION.stream().anyMatch(obj->inStatus.equals(obj))){
+                            status.set("-1");
+                        }
+                    }
+                }
+            }
+        }
+    }
+}

+ 32 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP03217.java

@@ -0,0 +1,32 @@
+package com.lantone.qc.kernel.catalogue.firstpagerecord;
+
+import com.lantone.qc.kernel.catalogue.QCCatalogue;
+import com.lantone.qc.kernel.util.CatalogueUtil;
+import com.lantone.qc.pub.Content;
+import com.lantone.qc.pub.model.InputInfo;
+import com.lantone.qc.pub.model.OutputInfo;
+import com.lantone.qc.pub.util.ListUtil;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @ClassName : FIRP03217
+ * @Description : 实施临床路径未填写
+ * @Author : cy
+ * @Date: 2022-03-06 17:28
+ */
+@Component
+public class FIRP03217 extends QCCatalogue {
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        status.set("0");
+        if (inputInfo.getFirstPageRecordDoc() != null && inputInfo.getFirstPageRecordDoc().getStructureMap() != null) {
+
+            Map<String, String> structureMap = inputInfo.getFirstPageRecordDoc().getStructureMap();
+            if(CatalogueUtil.isEmpty(structureMap.get(Content.implementation_clinical_pathway))){
+                status.set("-1");
+            }
+        }
+    }
+}

+ 35 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP03218.java

@@ -0,0 +1,35 @@
+package com.lantone.qc.kernel.catalogue.firstpagerecord;
+
+import com.lantone.qc.kernel.catalogue.QCCatalogue;
+import com.lantone.qc.kernel.util.CatalogueUtil;
+import com.lantone.qc.pub.Content;
+import com.lantone.qc.pub.model.InputInfo;
+import com.lantone.qc.pub.model.OutputInfo;
+import org.springframework.stereotype.Component;
+
+import java.util.Map;
+
+import static com.lantone.qc.pub.Content.inStatus;
+
+/**
+ * @ClassName : FIRP03218
+ * @Description : 实施临床路径填写错误
+ * @Author : cy
+ * @Date: 2022-03-06 17:28
+ */
+@Component
+public class FIRP03218 extends QCCatalogue {
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        status.set("0");
+        if (inputInfo.getFirstPageRecordDoc() != null && inputInfo.getFirstPageRecordDoc().getStructureMap() != null) {
+
+            Map<String, String> structureMap = inputInfo.getFirstPageRecordDoc().getStructureMap();
+            if(!CatalogueUtil.isEmpty(structureMap.get(Content.implementation_clinical_pathway))){
+                String str = structureMap.get(Content.implementation_clinical_pathway);
+                if(!Content.CLINICALPATHWAY.stream().anyMatch(obj->str.equals(obj))){
+                    status.set("-1");
+                }
+            }
+        }
+    }
+}

+ 29 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP03219.java

@@ -0,0 +1,29 @@
+package com.lantone.qc.kernel.catalogue.firstpagerecord;
+
+import com.lantone.qc.kernel.catalogue.QCCatalogue;
+import com.lantone.qc.kernel.util.CatalogueUtil;
+import com.lantone.qc.pub.Content;
+import com.lantone.qc.pub.model.InputInfo;
+import com.lantone.qc.pub.model.OutputInfo;
+import org.springframework.stereotype.Component;
+
+import java.util.Map;
+
+/**
+ * @ClassName : FIRP03219
+ * @Description : 使用医疗机构中药制剂未填写
+ * @Author : cy
+ * @Date: 2022-03-06 17:28
+ */
+@Component
+public class FIRP03219 extends QCCatalogue {
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        status.set("0");
+        if (inputInfo.getFirstPageRecordDoc() != null && inputInfo.getFirstPageRecordDoc().getStructureMap() != null) {
+            Map<String, String> structureMap = inputInfo.getFirstPageRecordDoc().getStructureMap();
+            if(CatalogueUtil.isEmpty(structureMap.get(Content.is_chinese_medicine_preparation))){
+                    status.set("-1");
+            }
+        }
+    }
+}

+ 47 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP03220.java

@@ -0,0 +1,47 @@
+package com.lantone.qc.kernel.catalogue.firstpagerecord;
+
+import com.lantone.qc.kernel.catalogue.QCCatalogue;
+import com.lantone.qc.kernel.util.CatalogueUtil;
+import com.lantone.qc.pub.Content;
+import com.lantone.qc.pub.model.InputInfo;
+import com.lantone.qc.pub.model.OutputInfo;
+import org.springframework.stereotype.Component;
+
+import java.util.Arrays;
+import java.util.Map;
+
+/**
+ * @ClassName : FIRP03220
+ * @Description : 使用医疗机构中药制剂填写错误
+ * @Author : cy
+ * @Date: 2022-03-06 17:28
+ */
+@Component
+public class FIRP03220 extends QCCatalogue {
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        status.set("0");
+        if (inputInfo.getFirstPageRecordDoc() != null && inputInfo.getFirstPageRecordDoc().getStructureMap() != null) {
+
+            Map<String, String> structureMap = inputInfo.getFirstPageRecordDoc().getStructureMap();
+            if(!CatalogueUtil.isEmpty(structureMap.get(Content.is_chinese_medicine_preparation))){
+                String str = structureMap.get(Content.is_chinese_medicine_preparation);
+                if(! Content.MARK.stream().anyMatch(obj->str.equals(obj))){
+                    status.set("-1");
+                }
+                String feeStr = structureMap.get(Content.chn_med_fee);
+                String feeSec = structureMap.get(Content.chn_herb_fee);
+                Double feeStrDou = 0D;
+                Double feeSecDou = 0D;
+               if( !CatalogueUtil.isEmpty(feeStr)){
+                   feeStrDou = Double.valueOf(feeStr);
+               }
+                if( !CatalogueUtil.isEmpty(feeSec)){
+                    feeSecDou = Double.valueOf(feeSec);
+                }
+                if((feeStrDou+feeSecDou)>0 &&  "否".equals(str)){
+                    status.set("-1");
+                }
+            }
+        }
+    }
+}

+ 29 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP03221.java

@@ -0,0 +1,29 @@
+package com.lantone.qc.kernel.catalogue.firstpagerecord;
+
+import com.lantone.qc.kernel.catalogue.QCCatalogue;
+import com.lantone.qc.kernel.util.CatalogueUtil;
+import com.lantone.qc.pub.Content;
+import com.lantone.qc.pub.model.InputInfo;
+import com.lantone.qc.pub.model.OutputInfo;
+import org.springframework.stereotype.Component;
+
+import java.util.Map;
+
+/**
+ * @ClassName : FIRP03221
+ * @Description : 使用中医诊疗设备未填写
+ * @Author : cy
+ * @Date: 2022-03-06 17:28
+ */
+@Component
+public class FIRP03221 extends QCCatalogue {
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        status.set("0");
+        if (inputInfo.getFirstPageRecordDoc() != null && inputInfo.getFirstPageRecordDoc().getStructureMap() != null) {
+            Map<String, String> structureMap = inputInfo.getFirstPageRecordDoc().getStructureMap();
+            if(CatalogueUtil.isEmpty(structureMap.get(Content.is_chinese_diagnose_equipment))){
+                    status.set("-1");
+            }
+        }
+    }
+}

+ 34 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP03222.java

@@ -0,0 +1,34 @@
+package com.lantone.qc.kernel.catalogue.firstpagerecord;
+
+import com.lantone.qc.kernel.catalogue.QCCatalogue;
+import com.lantone.qc.kernel.util.CatalogueUtil;
+import com.lantone.qc.pub.Content;
+import com.lantone.qc.pub.model.InputInfo;
+import com.lantone.qc.pub.model.OutputInfo;
+import org.springframework.stereotype.Component;
+
+import java.util.Arrays;
+import java.util.Map;
+
+/**
+ * @ClassName : FIRP03218
+ * @Description : 使用中医诊疗设备填写错误
+ * @Author : cy
+ * @Date: 2022-03-06 17:28
+ */
+@Component
+public class FIRP03222 extends QCCatalogue {
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        status.set("0");
+        if (inputInfo.getFirstPageRecordDoc() != null && inputInfo.getFirstPageRecordDoc().getStructureMap() != null) {
+
+            Map<String, String> structureMap = inputInfo.getFirstPageRecordDoc().getStructureMap();
+            if(!CatalogueUtil.isEmpty(structureMap.get(Content.is_chinese_diagnose_equipment))){
+                String str = structureMap.get(Content.is_chinese_diagnose_equipment);
+                if(!Content.MARK.stream().anyMatch(obj->str.equals(obj))){
+                    status.set("-1");
+                }
+            }
+        }
+    }
+}

+ 29 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP03223.java

@@ -0,0 +1,29 @@
+package com.lantone.qc.kernel.catalogue.firstpagerecord;
+
+import com.lantone.qc.kernel.catalogue.QCCatalogue;
+import com.lantone.qc.kernel.util.CatalogueUtil;
+import com.lantone.qc.pub.Content;
+import com.lantone.qc.pub.model.InputInfo;
+import com.lantone.qc.pub.model.OutputInfo;
+import org.springframework.stereotype.Component;
+
+import java.util.Map;
+
+/**
+ * @ClassName : FIRP03223
+ * @Description : 使用中医诊疗技术未填写
+ * @Author : cy
+ * @Date: 2022-03-06 17:28
+ */
+@Component
+public class FIRP03223 extends QCCatalogue {
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        status.set("0");
+        if (inputInfo.getFirstPageRecordDoc() != null && inputInfo.getFirstPageRecordDoc().getStructureMap() != null) {
+            Map<String, String> structureMap = inputInfo.getFirstPageRecordDoc().getStructureMap();
+            if(CatalogueUtil.isEmpty(structureMap.get(Content.is_chinese_diagnose_technology))){
+                    status.set("-1");
+            }
+        }
+    }
+}

+ 47 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP03224.java

@@ -0,0 +1,47 @@
+package com.lantone.qc.kernel.catalogue.firstpagerecord;
+
+import com.lantone.qc.kernel.catalogue.QCCatalogue;
+import com.lantone.qc.kernel.util.CatalogueUtil;
+import com.lantone.qc.pub.Content;
+import com.lantone.qc.pub.model.InputInfo;
+import com.lantone.qc.pub.model.OutputInfo;
+import org.springframework.stereotype.Component;
+
+import java.util.Arrays;
+import java.util.Map;
+
+/**
+ * @ClassName : FIRP03224
+ * @Description : 使用中医诊疗技术填写错误
+ * @Author : cy
+ * @Date: 2022-03-06 17:28
+ */
+@Component
+public class FIRP03224 extends QCCatalogue {
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        status.set("0");
+        if (inputInfo.getFirstPageRecordDoc() != null && inputInfo.getFirstPageRecordDoc().getStructureMap() != null) {
+
+            Map<String, String> structureMap = inputInfo.getFirstPageRecordDoc().getStructureMap();
+            if(!CatalogueUtil.isEmpty(structureMap.get(Content.is_chinese_diagnose_technology))){
+                String str = structureMap.get(Content.is_chinese_diagnose_technology);
+                if(! Content.MARK.stream().anyMatch(obj->str.equals(obj))){
+                    status.set("-1");
+                }
+                String feeStr = structureMap.get(Content.chn_med_fee);
+                String feeSec = structureMap.get(Content.chn_herb_fee);
+                Double feeStrDou = 0D;
+                Double feeSecDou = 0D;
+               if( !CatalogueUtil.isEmpty(feeStr)){
+                   feeStrDou = Double.valueOf(feeStr);
+               }
+                if( !CatalogueUtil.isEmpty(feeSec)){
+                    feeSecDou = Double.valueOf(feeSec);
+                }
+                if((feeStrDou+feeSecDou)>0 &&  "否".equals(str)){
+                    status.set("-1");
+                }
+            }
+        }
+    }
+}

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


部分文件因为文件数量过多而无法显示