Browse Source

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

zhanghang 3 years atrás
parent
commit
7c4b8399e5
100 changed files with 59540 additions and 74 deletions
  1. 3 3
      dbanaly/src/main/resources/application-test.yml
  2. 37 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP0191.java
  3. 29 6
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP0244.java
  4. 29 6
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP0246.java
  5. 1 1
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP0251.java
  6. 61 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP02973.java
  7. 45 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP03179.java
  8. 44 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP03184.java
  9. 78 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP03186.java
  10. 61 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP0521.java
  11. 49 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/hospital/changshaxy/behospitalized/BEH0041.java
  12. 51 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/hospital/changshaxy/behospitalized/BEH0069.java
  13. 91 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/hospital/changshaxy/firstpagerecord/FIRP0161.java
  14. 36 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/hospital/changshaxy/firstpagerecord/FIRP0183.java
  15. 31 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/hospital/changshaxy/firstpagerecord/FIRP0191.java
  16. 30 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/hospital/changshaxy/firstpagerecord/FIRP0239.java
  17. 30 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/hospital/changshaxy/firstpagerecord/FIRP02836.java
  18. 33 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/hospital/changshaxy/firstpagerecord/FIRP02837.java
  19. 45 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/hospital/changshaxy/firstpagerecord/FIRP03237.java
  20. 35 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/hospital/changshaxy/firstpagerecord/FIRP03238.java
  21. 44 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/hospital/changshaxy/firstpagerecord/FIRP03239.java
  22. 36 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/hospital/changshaxy/firstpagerecord/FIRP03240.java
  23. 33 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/hospital/changshaxy/firstpagerecord/FIRP03241.java
  24. 41 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/hospital/changshaxy/firstpagerecord/FIRP03242.java
  25. 38 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/hospital/changshaxy/firstpagerecord/FIRP03245.java
  26. 43 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/hospital/changshaxy/firstpagerecord/FIRP03246.java
  27. 37 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/hospital/changshaxy/firstpagerecord/FIRP03247.java
  28. 42 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/hospital/changshaxy/firstpagerecord/FIRP03248.java
  29. 43 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/hospital/changshaxy/firstpagerecord/FIRP03250.java
  30. 33 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/hospital/changshaxy/firstpagerecord/FIRP03255.java
  31. 38 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/hospital/changshaxy/firstpagerecord/FIRP03260.java
  32. 30 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/hospital/changshaxy/firstpagerecord/FIRP03261.java
  33. 30 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/hospital/changshaxy/firstpagerecord/FIRP03262.java
  34. 30 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/hospital/changshaxy/firstpagerecord/FIRP03263.java
  35. 40 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/hospital/changshaxy/firstpagerecord/FIRP03265.java
  36. 40 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/hospital/changshaxy/firstpagerecord/FIRP03266.java
  37. 41 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/hospital/changshaxy/firstpagerecord/FIRP03267.java
  38. 53 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/hospital/changshaxy/firstpagerecord/FIRP03268.java
  39. 67 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/hospital/changshaxy/firstpagerecord/FIRP03269.java
  40. 32 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/hospital/changshaxy/firstpagerecord/FIRP03275.java
  41. 38 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/hospital/changshaxy/firstpagerecord/FIRP03276.java
  42. 32 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/hospital/changshaxy/firstpagerecord/FIRP03277.java
  43. 42 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/hospital/changshaxy/firstpagerecord/FIRP03278.java
  44. 37 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/hospital/changshaxy/firstpagerecord/FIRP03279.java
  45. 39 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/hospital/changshaxy/firstpagerecord/FIRP03280.java
  46. 43 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/hospital/changshaxy/firstpagerecord/FIRP03282.java
  47. 61 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/hospital/changshaxy/leavehospital/LEA0148.java
  48. 111 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/hospital/changshaxy/leavehospital/LEA0149.java
  49. 54 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/hospital/changshaxy/leavehospital/LEA02901.java
  50. 68 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/hospital/changshaxy/operationdiscussion/OPE0351.java
  51. 173 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/hospital/changshaxy/operationdiscussion/OPE0369.java
  52. 119 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/hospital/changshaxy/threelevelward/THR02900.java
  53. 88 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/hospital/changshaxy/threelevelward/THR03090.java
  54. 143 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/hospital/changshaxy/threelevelward/THR0601.java
  55. 152 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/hospital/ningbozhongyi/threelevelward/THR0588.java
  56. 4 5
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/hospital/xiamen/operationdiscussion/OPE0369.java
  57. 275 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/hospital/xiamen/threelevelward/THR0128.java
  58. 6 1
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/threelevelward/THR0130.java
  59. 7 1
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/threelevelward/THR0135.java
  60. 1 1
      kernel/src/main/resources/bootstrap.yml
  61. 84 0
      kernel/src/main/resources/cache/36/concept_clinic_bodypart_properties.dict
  62. 25358 0
      kernel/src/main/resources/cache/36/concept_diag_properties.dict
  63. 25358 0
      kernel/src/main/resources/cache/36/hospital_diag_info.dict
  64. 3123 0
      kernel/src/main/resources/cache/36/hospital_doctor_info.dict
  65. 10 10
      trans/src/main/java/com/lantone/qc/trans/beilun/BeiLunThreeLevelWardDocTrans.java
  66. 9 10
      trans/src/main/java/com/lantone/qc/trans/changshaxy/util/comsis/XyCommonAnalysisUtil.java
  67. 8 2
      trans/src/main/java/com/lantone/qc/trans/ningbozhenhai/ThreeLevelWardDocTrans.java
  68. 7 5
      trans/src/main/java/com/lantone/qc/trans/ningbozhenhai/util/BeHospitalizedHtmlAnalysis.java
  69. 3 1
      trans/src/main/java/com/lantone/qc/trans/ningbozhenhai/util/CriticallyIllNoticeHtmlAnalysis.java
  70. 9 7
      trans/src/main/java/com/lantone/qc/trans/ningbozhenhai/util/DifficultCaseDiscussHtmlAnalysis.java
  71. 11 3
      trans/src/main/java/com/lantone/qc/trans/ningbozhenhai/util/LeaveHospitalHtmlAnalysis.java
  72. 22 6
      trans/src/main/java/com/lantone/qc/trans/ningbozhenhai/util/OperationRecordHtmlAnalysis.java
  73. 11 4
      trans/src/main/java/com/lantone/qc/trans/ningbozhenhai/util/ThreeLevelWardHtmlAnalysis.java
  74. 13 2
      trans/src/main/java/com/lantone/qc/trans/xiamen/XiamenThreeLevelWardDocTrans.java
  75. 38 0
      trans/src/main/java/com/lantone/qc/trans/yuhangsy/AnesthesiaRecordDocTrans.java
  76. 52 0
      trans/src/main/java/com/lantone/qc/trans/yuhangsy/YuhangsyADLGradeDocTrans.java
  77. 75 0
      trans/src/main/java/com/lantone/qc/trans/yuhangsy/YuhangsyBeHospitalizedDocTrans.java
  78. 72 0
      trans/src/main/java/com/lantone/qc/trans/yuhangsy/YuhangsyClinicBloodEffectDocTrans.java
  79. 76 0
      trans/src/main/java/com/lantone/qc/trans/yuhangsy/YuhangsyClinicalBloodDocTrans.java
  80. 275 0
      trans/src/main/java/com/lantone/qc/trans/yuhangsy/YuhangsyConsultationDocTrans.java
  81. 36 0
      trans/src/main/java/com/lantone/qc/trans/yuhangsy/YuhangsyCrisisInfoDocTrans.java
  82. 74 0
      trans/src/main/java/com/lantone/qc/trans/yuhangsy/YuhangsyCrisisValueReportDocTrans.java
  83. 77 0
      trans/src/main/java/com/lantone/qc/trans/yuhangsy/YuhangsyCriticallyIllNoticeDocTrans.java
  84. 68 0
      trans/src/main/java/com/lantone/qc/trans/yuhangsy/YuhangsyDeathCaseDiscussDocTrans.java
  85. 67 0
      trans/src/main/java/com/lantone/qc/trans/yuhangsy/YuhangsyDeathRecordDocTrans.java
  86. 90 0
      trans/src/main/java/com/lantone/qc/trans/yuhangsy/YuhangsyDifficultCaseDiscussDocTrans.java
  87. 331 0
      trans/src/main/java/com/lantone/qc/trans/yuhangsy/YuhangsyDocTrans.java
  88. 36 0
      trans/src/main/java/com/lantone/qc/trans/yuhangsy/YuhangsyDoctorAdviceDocTrans.java
  89. 72 0
      trans/src/main/java/com/lantone/qc/trans/yuhangsy/YuhangsyDutyShiftSystemDocTrans.java
  90. 83 0
      trans/src/main/java/com/lantone/qc/trans/yuhangsy/YuhangsyFirstCourseRecordDocTrans.java
  91. 54 0
      trans/src/main/java/com/lantone/qc/trans/yuhangsy/YuhangsyFirstPageRecordDocTrans.java
  92. 90 0
      trans/src/main/java/com/lantone/qc/trans/yuhangsy/YuhangsyInformedConsentDocTrans.java
  93. 75 0
      trans/src/main/java/com/lantone/qc/trans/yuhangsy/YuhangsyInvasiveOperationDocTrans.java
  94. 75 0
      trans/src/main/java/com/lantone/qc/trans/yuhangsy/YuhangsyLeaveHospitalDocTrans.java
  95. 36 0
      trans/src/main/java/com/lantone/qc/trans/yuhangsy/YuhangsyLisDocTrans.java
  96. 26 0
      trans/src/main/java/com/lantone/qc/trans/yuhangsy/YuhangsyMedicalRecordInfoDocTrans.java
  97. 457 0
      trans/src/main/java/com/lantone/qc/trans/yuhangsy/YuhangsyOperationDocTrans.java
  98. 40 0
      trans/src/main/java/com/lantone/qc/trans/yuhangsy/YuhangsyOutDepDocTrans.java
  99. 36 0
      trans/src/main/java/com/lantone/qc/trans/yuhangsy/YuhangsyPacsDocTrans.java
  100. 0 0
      trans/src/main/java/com/lantone/qc/trans/yuhangsy/YuhangsyRescueDocTrans.java

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

@@ -28,9 +28,9 @@ spring:
     database:
       cache: 6 # cache索引
       token: 6 # Token索引
-    host: 192.168.2.236  #Redis服务器地址
-    port: 6379 # Redis服务器连接端口(本地环境端口6378,其他环境端口是6379)
-    password: lantone # Redis服务器连接密码(默认为空)
+    host: 192.168.2.237  #Redis服务器地址
+    port: 63791 # Redis服务器连接端口(本地环境端口6378,其他环境端口是6379)
+    password: emrais # Redis服务器连接密码(默认为空)
     lettuce:
       pool:
         max-active: 8 # 连接池最大连接数(使用负值表示没有限制)

+ 37 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP0191.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.model.doc.FirstPageRecordDoc;
+import com.lantone.qc.pub.model.doc.operation.OperationDoc;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @ClassName : FIRP0191
+ * @Description : 主要手术及操作名称未填写
+ * @Author : wsy
+ * @Date: 2021-10-12 20:28
+ */
+@Component
+public class FIRP0191 extends QCCatalogue {
+
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        status.set("0");
+        FirstPageRecordDoc firstPageRecordDoc = inputInfo.getFirstPageRecordDoc();
+        List<OperationDoc> operationDocs = inputInfo.getOperationDocs();
+        if (firstPageRecordDoc == null || operationDocs.size() == 0) {
+            return;
+        }
+        Map<String, Object> firstPageRecordDocStructureMap = firstPageRecordDoc.getStructureExtMap();
+        List<Map<String, String>> mapList = (List<Map<String, String>>) firstPageRecordDocStructureMap.get(Content.operative_information);
+        if (mapList == null || mapList.size() == 0) {
+            status.set("-1");
+            return;
+        }
+    }
+}

+ 29 - 6
kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP0244.java

@@ -5,6 +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.operation.OperationDiscussionDoc;
+import com.lantone.qc.pub.model.doc.operation.OperationDoc;
+import com.lantone.qc.pub.util.ListUtil;
+import com.lantone.qc.pub.util.StringUtil;
 import org.springframework.stereotype.Component;
 
 import java.util.List;
@@ -20,17 +24,36 @@ import java.util.Map;
 public class FIRP0244 extends QCCatalogue {
     public void start(InputInfo inputInfo, OutputInfo outputInfo) {
         status.set("0");
+        List<OperationDoc> operationDocs = inputInfo.getOperationDocs();
+        String operations = "";
+        String operations_first = "";
+        if (ListUtil.isNotEmpty(operationDocs)) {
+            OperationDiscussionDoc operationDiscussionDoc = operationDocs.get(0).getOperationDiscussionDoc();
+            if (operationDiscussionDoc == null) {
+                return;
+            }
+            operations = operationDiscussionDoc.getStructureMap().get(Content.notch_grade);
+        }
+        if (StringUtil.isBlank(operations)) {
+            return;
+        }
         if (inputInfo.getFirstPageRecordDoc() != null && inputInfo.getFirstPageRecordDoc().getStructureMap() != null) {
             Map<String, Object> firstpageStructureMap = inputInfo.getFirstPageRecordDoc().getStructureExtMap();
             List<Map<String, String>> operative_information = (List<Map<String, String>>) firstpageStructureMap.get(Content.operative_information);
-            if(operative_information != null && operative_information.size()>0){
-                for (Map<String,String> opInfo:operative_information) {
-                    if(!CatalogueUtil.isEmpty(opInfo.get(Content.operative_name)) && CatalogueUtil.isEmpty(opInfo.get(Content.notch_grade))){
-                        status.set("-1");
-                        break;
-                    }
+            if (operative_information != null && operative_information.size() > 0) {
+                operations_first = operative_information.get(0).get(Content.notch_grade);
+                if (!CatalogueUtil.isEmpty(operative_information.get(0).get(Content.operative_name)) || CatalogueUtil.isEmpty(operations_first)) {
+                    return;
                 }
             }
         }
+        if (StringUtil.isBlank(operations_first)) {
+            return;
+        }
+
+        if (!operations.contains(operations_first)) {
+            status.set("");
+            return;
+        }
     }
 }

+ 29 - 6
kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP0246.java

@@ -5,6 +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.operation.OperationDiscussionDoc;
+import com.lantone.qc.pub.model.doc.operation.OperationDoc;
+import com.lantone.qc.pub.util.ListUtil;
+import com.lantone.qc.pub.util.StringUtil;
 import org.springframework.stereotype.Component;
 
 import java.util.List;
@@ -19,19 +23,38 @@ import java.util.Map;
 @Component
 public class FIRP0246 extends QCCatalogue {
     public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+
         status.set("0");
-        if (inputInfo.getFirstPageRecordDoc() != null && inputInfo.getFirstPageRecordDoc().getStructureExtMap() != null) {
+        List<OperationDoc> operationDocs = inputInfo.getOperationDocs();
+        String operations = "";
+        String operations_first = "";
+        if (ListUtil.isNotEmpty(operationDocs)) {
+            OperationDiscussionDoc operationDiscussionDoc = operationDocs.get(0).getOperationDiscussionDoc();
+            if (operationDiscussionDoc == null) {
+                return;
+            }
+            operations = operationDiscussionDoc.getStructureMap().get(Content.healing_level);
+        }
+        if (StringUtil.isBlank(operations)) {
+            return;
+        }
+        if (inputInfo.getFirstPageRecordDoc() != null && inputInfo.getFirstPageRecordDoc().getStructureMap() != null) {
             Map<String, Object> firstpageStructureMap = inputInfo.getFirstPageRecordDoc().getStructureExtMap();
             List<Map<String, String>> operative_information = (List<Map<String, String>>) firstpageStructureMap.get(Content.operative_information);
             if (operative_information != null && operative_information.size() > 0) {
-                for (Map<String, String> opInfo : operative_information) {
-                    if (!CatalogueUtil.isEmpty(opInfo.get(Content.operative_name)) && CatalogueUtil.isEmpty(opInfo.get(Content.healing_level))) {
-                        status.set("-1");
-                        break;
-                    }
+                operations_first = operative_information.get(0).get(Content.healing_level);
+                if (!CatalogueUtil.isEmpty(operative_information.get(0).get(Content.operative_name)) || CatalogueUtil.isEmpty(operations_first)) {
+                    return;
                 }
             }
+        }
+        if (StringUtil.isBlank(operations_first)) {
+            return;
+        }
 
+        if (!operations.contains(operations_first)) {
+            status.set("-1");
+            return;
         }
     }
 }

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

@@ -10,7 +10,7 @@ import org.springframework.stereotype.Component;
 import java.util.Map;
 
 /**
- * @ClassName : FIRP0253
+ * @ClassName : FIRP0251
  * @Description : 单病种管理未填
  * @Author : 楼辉荣
  * @Date: 2020-03-06 17:28ss

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

@@ -0,0 +1,61 @@
+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.model.doc.operation.OperationDiscussionDoc;
+import com.lantone.qc.pub.model.doc.operation.OperationDoc;
+import com.lantone.qc.pub.util.ListUtil;
+import com.lantone.qc.pub.util.StringUtil;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @ClassName : FIRP02973
+ * @Description : 手术日期与手术记录中手术日期不一致
+ * @Author : wsy
+ * @Date: 2021-10-13 20:28
+ */
+@Component
+public class FIRP02973 extends QCCatalogue {
+
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+
+        status.set("0");
+        List<OperationDoc> operationDocs = inputInfo.getOperationDocs();
+        String operations = "";
+        String operations_first = "";
+        if (ListUtil.isNotEmpty(operationDocs)) {
+            OperationDiscussionDoc operationDiscussionDoc = operationDocs.get(0).getOperationDiscussionDoc();
+            if (operationDiscussionDoc == null) {
+                return;
+            }
+            operations = operationDiscussionDoc.getStructureMap().get(Content.operative_date);
+        }
+        if (StringUtil.isBlank(operations)) {
+            return;
+        }
+        if (inputInfo.getFirstPageRecordDoc() != null && inputInfo.getFirstPageRecordDoc().getStructureMap() != null) {
+            Map<String, Object> firstpageStructureMap = inputInfo.getFirstPageRecordDoc().getStructureExtMap();
+            List<Map<String, String>> operative_information = (List<Map<String, String>>) firstpageStructureMap.get(Content.operative_information);
+            if (operative_information != null && operative_information.size() > 0) {
+                operations_first = operative_information.get(0).get(Content.operative_date);
+                if (!CatalogueUtil.isEmpty(operative_information.get(0).get(Content.operative_name)) || CatalogueUtil.isEmpty(operations_first)) {
+                    return;
+                }
+            }
+        }
+        if (StringUtil.isBlank(operations_first)) {
+            return;
+        }
+
+        if (!operations.contains(operations_first)) {
+            status.set("-1");
+            return;
+        }
+    }
+}

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

@@ -0,0 +1,45 @@
+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.List;
+import java.util.Map;
+
+/**
+ * @ClassName : FIRP03179
+ * @Description :出院主要诊断疾病编码未填写
+ * @Author : wsy
+ * @Date: 2020-03-16 13:31
+ */
+@Component
+public class FIRP03179 extends QCCatalogue {
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        status.set("0");
+        if (inputInfo.getFirstPageRecordDoc() != null && inputInfo.getFirstPageRecordDoc().getStructureExtMap() != null) {
+            Map<String, Object> firstpageStructureMap = inputInfo.getFirstPageRecordDoc().getStructureExtMap();
+            List<Map<String, String>> outpatientEmergencyDiag = (List) firstpageStructureMap.get(Content.dischargeDiag);
+            if (outpatientEmergencyDiag == null || outpatientEmergencyDiag.size() == 0) {
+                return;
+            }
+
+            long count = outpatientEmergencyDiag.stream().filter(diag -> {
+                boolean flag = false;
+                if (StringUtil.isNotBlank(diag.get("诊断类别"))
+                        && diag.get("诊断类别").contains("主要诊断")
+                        && StringUtil.isBlank(diag.get("诊断编码"))) {
+                    flag = true;
+                }
+                return flag;
+            }).count();
+
+            if (count > 0) {
+                status.set("-1");
+            }
+        }
+    }
+}

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

@@ -0,0 +1,44 @@
+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.List;
+import java.util.Map;
+
+/**
+ * @ClassName : FIRP03184
+ * @Description :出院其他诊断入院病情未填写
+ * @Author : wsy
+ * @Date: 2021-10-12 14:01
+ */
+@Component
+public class FIRP03184 extends QCCatalogue {
+
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        status.set("0");
+        if (inputInfo.getFirstPageRecordDoc() != null && inputInfo.getLeaveHospitalDoc() != null) {
+            Map<String, Object> firstpageStructureMap = inputInfo.getFirstPageRecordDoc().getStructureExtMap();
+            List<Map<String, String>> dischargeDiag = (List) firstpageStructureMap.get(Content.dischargeDiag);
+            if (ListUtil.isEmpty(dischargeDiag)) {
+                return;
+            }
+            for (Map<String, String> diagMap : dischargeDiag) {
+                String diagSort = diagMap.get("诊断类别");
+                String beHStatus = diagMap.get("入院情况");
+                String diagName = diagMap.get("诊断名称");
+                //若诊断类别为其他诊断,入院情况为空,提示缺陷
+                if (StringUtil.isBlank(diagSort) && diagSort.contains("其他诊断") && StringUtil.isBlank(beHStatus)) {
+                    status.set("-1");
+                    info.set(diagName);
+                    return;
+                }
+            }
+        }
+    }
+}

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

@@ -0,0 +1,78 @@
+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 : FIRP03186
+ * @Description :  出院主要诊断疾病编码填写错误
+ * @Author : wsy
+ * @Date: 2021-10-9 15:51
+ */
+@Component
+public class FIRP03186 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("诊断类别")) && map.get("诊断类别").contains("主要诊断")) {
+                icdCode = map.get("诊断编码");
+            }
+        }
+
+        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("A34", "B37.3", "C51", "C52", "C53", "C54", "C55", "C56", "C57", "C58", "C79.6", "D06", "D07.0", "D07.1", "D07.2", "D07.3",
+                    "D25", "D26", "D27", "D28", "D39", "E28", "E89.4", "F52.5", "F53", "I86.3", "L29.2", "M80.0", "M80.1", "M81.0", "M81.1", "M83.0", "N70", "N71", "N72", "N73",
+                    "N74", "N75", "N76", "N77", "N78-N98", "N99.2", "N99.3", "O00-O99", "P54.6", "Q50", "Q51", "Q52", "R87", "S31.4", "S37.4", "S37.5", "S37.6", "T19.2", "T19.3",
+                    "T83.3", "Z01.4", "Z12.4", "Z30.1", "Z30.3", "Z30.5", "Z31.1", "Z31.2", "Z32", "Z33", "Z34", "Z35", "Z36", "Z37", "Z39", "Z87.5", "Z97.5");
+        } else if (gender.contains("女")) {
+            /* 女性不合理词 */
+            noMatchWords = Lists.newArrayList("B26.0", "C60-C63", "D07.4-D07.6", "D17.6", "D29", "D40", "E29", "E89.5", "F52.4", "I86.1", "L29.1",
+                    "N40-N51", "Q53-Q55", "R86", "S31.2-S31.3", "Z12.5");
+        }
+        if (noMatchWords == null || noMatchWords.size() == 0) {
+            return;
+        }
+
+        for (String noMatchWord : noMatchWords) {
+            if (icdCode.contains(noMatchWord)) {
+                status.set("-1");
+                info.set(noMatchWord);
+                return;
+            }
+        }
+    }
+}

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

@@ -0,0 +1,61 @@
+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.model.doc.operation.OperationDiscussionDoc;
+import com.lantone.qc.pub.model.doc.operation.OperationDoc;
+import com.lantone.qc.pub.util.ListUtil;
+import com.lantone.qc.pub.util.StringUtil;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @ClassName : FIRP0521
+ * @Description : 手术级别填写错误
+ * @Author : wsy
+ * @Date: 2021-10-12 20:28
+ */
+@Component
+public class FIRP0521 extends QCCatalogue {
+
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+
+        status.set("0");
+        List<OperationDoc> operationDocs = inputInfo.getOperationDocs();
+        String operations = "";
+        String operations_first = "";
+        if (ListUtil.isNotEmpty(operationDocs)) {
+            OperationDiscussionDoc operationDiscussionDoc = operationDocs.get(0).getOperationDiscussionDoc();
+            if (operationDiscussionDoc == null) {
+                return;
+            }
+            operations = operationDiscussionDoc.getStructureMap().get(Content.operative_degree);
+        }
+        if (StringUtil.isBlank(operations)) {
+            return;
+        }
+        if (inputInfo.getFirstPageRecordDoc() != null && inputInfo.getFirstPageRecordDoc().getStructureMap() != null) {
+            Map<String, Object> firstpageStructureMap = inputInfo.getFirstPageRecordDoc().getStructureExtMap();
+            List<Map<String, String>> operative_information = (List<Map<String, String>>) firstpageStructureMap.get(Content.operative_information);
+            if (operative_information != null && operative_information.size() > 0) {
+                operations_first = operative_information.get(0).get(Content.operative_degree);
+                if (!CatalogueUtil.isEmpty(operative_information.get(0).get(Content.operative_name)) || CatalogueUtil.isEmpty(operations_first)) {
+                    return;
+                }
+            }
+        }
+        if (StringUtil.isBlank(operations_first)) {
+            return;
+        }
+
+        if (!operations.contains(operations_first)) {
+            status.set("-1");
+            return;
+        }
+    }
+}

+ 49 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/hospital/changshaxy/behospitalized/BEH0041.java

@@ -0,0 +1,49 @@
+package com.lantone.qc.kernel.catalogue.hospital.changshaxy.behospitalized;
+
+import com.lantone.qc.kernel.catalogue.QCCatalogue;
+import com.lantone.qc.pub.Content;
+import com.lantone.qc.pub.model.InputInfo;
+import com.lantone.qc.pub.model.OutputInfo;
+import com.lantone.qc.pub.util.StringUtil;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.stereotype.Component;
+
+import java.util.Map;
+
+/**
+ * @Description: 个人史未填写
+ * @author: rengb
+ * @time: 2020/3/10 14:02
+ */
+@Component
+public class BEH0041 extends QCCatalogue {
+
+    @Override
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        if (inputInfo.getBeHospitalizedDoc() == null) {
+            status.set("0");
+            return;
+        }
+        Map<String, String> structureMap = inputInfo.getBeHospitalizedDoc().getStructureMap();
+        //以台州为例,个人史细分很多结构化信息,取其一
+        if (StringUtils.isNotEmpty(structureMap.get("出生、生长史"))
+                || StringUtils.isNotEmpty(structureMap.get("疫区居留史"))
+                || StringUtils.isNotEmpty(structureMap.get("冶游史"))
+                || StringUtils.isNotEmpty(structureMap.get("工作性质"))
+                || StringUtils.isNotEmpty(structureMap.get("化学及放射性毒物接触史"))) {
+            status.set("0");
+            return;
+        }
+
+        //长沙湘雅会在现病史中说明个人史
+        if (StringUtil.isNotEmpty(structureMap.get(Content.present)) && structureMap.get(Content.present).contains("个人史")) {
+            status.set("0");
+            return;
+        }
+
+        if (StringUtil.isNotBlank(inputInfo.getBeHospitalizedDoc().getPersonalLabel().getText())) {
+            status.set("0");
+        }
+    }
+
+}

+ 51 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/hospital/changshaxy/behospitalized/BEH0069.java

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

+ 91 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/hospital/changshaxy/firstpagerecord/FIRP0161.java

@@ -0,0 +1,91 @@
+package com.lantone.qc.kernel.catalogue.hospital.changshaxy.firstpagerecord;
+
+import com.lantone.qc.kernel.catalogue.QCCatalogue;
+import com.lantone.qc.kernel.util.CatalogueUtil;
+import com.lantone.qc.kernel.util.RegularUtil;
+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 : FIRP0161
+ * @Description : 患者年龄与入院记录不一致
+ * @Author : 胡敬
+ * @Date: 2020-03-16 10:00
+ */
+@Component
+public class FIRP0161 extends QCCatalogue {
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        status.set("0");
+        if (inputInfo.getFirstPageRecordDoc() != null && inputInfo.getFirstPageRecordDoc().getStructureMap() != null
+                && inputInfo.getBeHospitalizedDoc() != null && inputInfo.getBeHospitalizedDoc().getStructureMap() != null) {
+            Map<String, String> firstpageStructureMap = inputInfo.getFirstPageRecordDoc().getStructureMap();
+            Map<String, String> beHospitalStructureMap = inputInfo.getBeHospitalizedDoc().getStructureMap();
+            String firstAdmissionAge = firstpageStructureMap.get(Content.age);
+            /* 根据病案首页新生儿出生月数和新生儿出生天数拼接年龄 */
+            String newbornAgeMonths = firstpageStructureMap.get(Content.newbornAgeMonths);
+            String newbornAgeDays = firstpageStructureMap.get(Content.newbornAgeDays);
+            String newbornAgeStr = "";
+            int newbornAge = 0;
+            if (StringUtil.isNotBlank(newbornAgeMonths) && StringUtil.isNotBlank(newbornAgeDays)) {
+                newbornAgeStr = newbornAgeMonths + newbornAgeDays;
+            }
+            if (StringUtil.isNotBlank(newbornAgeStr)) {
+                newbornAge = removalUnit(newbornAgeStr);
+            }
+            String admissionAge = beHospitalStructureMap.get(Content.age);
+            if (StringUtil.isBlank(firstAdmissionAge) || StringUtil.isBlank(admissionAge)) {
+                status.set("0");
+                return;
+            }
+            if (StringUtil.isNotBlank(admissionAge) && admissionAge.contains("岁")) {
+                admissionAge = admissionAge.substring(0, admissionAge.indexOf("岁"));
+            }
+            if (StringUtil.isNotBlank(firstAdmissionAge) && firstAdmissionAge.contains("岁")) {
+                firstAdmissionAge = firstAdmissionAge.substring(0, firstAdmissionAge.indexOf("岁"));
+            }
+            // int firstAdmissionAgeNum = removalUnit(firstAdmissionAge);
+            // int admissionAgeNum = removalUnit(admissionAge);
+            int admissionAgeNum, firstAdmissionAgeNum;
+            try {
+                admissionAgeNum = Integer.parseInt(admissionAge) + 1;
+            } catch (NumberFormatException e) {
+                return;
+            }
+            try {
+                firstAdmissionAgeNum = Integer.parseInt(firstAdmissionAge);
+            } catch (NumberFormatException e) {
+                return;
+            }
+            // 只比较年龄前的数值
+            if (admissionAgeNum != firstAdmissionAgeNum) {
+                status.set("-1");
+                return;
+            }
+            // int firstAdmissionAgeNum = removalUnit(firstAdmissionAge);
+            // int admissionAgeNum = removalUnit(admissionAge);
+            //
+            // if (firstAdmissionAgeNum != admissionAgeNum && newbornAge != admissionAgeNum) {
+            //     status.set("-1");
+            // }
+        }
+    }
+
+    private int removalUnit(String admissionAge) {
+        int age = 0;
+        if (StringUtil.isNotBlank(admissionAge) && admissionAge.contains("岁")) {
+            admissionAge = admissionAge.replaceAll("[岁天]", "");
+        }
+        // 解决邵逸夫数据,年龄后跟着身份证号码
+        admissionAge = RegularUtil.ClearBracket(admissionAge);
+        admissionAge = admissionAge.replaceAll("[^0-9]", "");
+        if (CatalogueUtil.numbersOnly(admissionAge)) {
+            age = Integer.parseInt(admissionAge);
+        }
+        return age;
+    }
+}

+ 36 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/hospital/changshaxy/firstpagerecord/FIRP0183.java

@@ -0,0 +1,36 @@
+package com.lantone.qc.kernel.catalogue.hospital.changshaxy.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.StringUtil;
+
+import java.util.Map;
+
+/**
+ * @ClassName : FIRP0183
+ * @Description : 病理诊断填写与病程记录不一致
+ * @Author : dy
+ * @Date: 2021-10-13 15:02
+ * @Component
+ */
+public class FIRP0183 extends QCCatalogue {
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        status.set("0");
+        if (inputInfo.getFirstPageRecordDoc() != null && inputInfo.getFirstPageRecordDoc().getStructureMap() != null
+                && inputInfo.getBeHospitalizedDoc() != null && inputInfo.getBeHospitalizedDoc().getStructureMap() != null) {
+            Map<String, String> firstMap = inputInfo.getFirstPageRecordDoc().getStructureMap();
+            Map<String, String> behosMap = inputInfo.getBeHospitalizedDoc().getStructureMap();
+            String s = firstMap.get(Content.pathologyDiagnose);
+            String s1 = behosMap.get(Content.pathologyDiagnose);
+            if (StringUtil.isEmpty(s) || StringUtil.isEmpty(s1)) {
+                return;
+            }
+            if (!CatalogueUtil.compareToken(s, s1)) {
+                status.set("-1");
+            }
+        }
+    }
+}

+ 31 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/hospital/changshaxy/firstpagerecord/FIRP0191.java

@@ -0,0 +1,31 @@
+package com.lantone.qc.kernel.catalogue.hospital.changshaxy.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 : FIRP0191
+ * @Description : 主要手术及操作名称未填写
+ * @Author : dy
+ * @Date: 2021-10-13 14:01
+ */
+@Component
+public class FIRP0191 extends QCCatalogue {
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        if (inputInfo.getFirstPageRecordDoc() != null) {
+            status.set("0");
+            return;
+        }
+        Map<String, String> map = inputInfo.getFirstPageRecordDoc().getStructureMap();
+        String oName = map.get(Content.operative_name);
+        if (StringUtil.isEmpty(oName)) {
+            status.set("-1");
+        }
+    }
+}

+ 30 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/hospital/changshaxy/firstpagerecord/FIRP0239.java

@@ -0,0 +1,30 @@
+package com.lantone.qc.kernel.catalogue.hospital.changshaxy.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 : FIRP0239
+ * @Description :是否有31天再住院计划未填写
+ * @Author : dy
+ * @Date: 2021-10-13 16:05
+ */
+@Component
+public class FIRP0239 extends QCCatalogue {
+    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 reHospitalization = firstpageStructureMap.get(Content.reHospitalization);
+            if (CatalogueUtil.isEmpty(reHospitalization)) {
+                status.set("-1");
+            }
+        }
+    }
+}

+ 30 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/hospital/changshaxy/firstpagerecord/FIRP02836.java

@@ -0,0 +1,30 @@
+package com.lantone.qc.kernel.catalogue.hospital.changshaxy.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 : FIRP02836
+ * @Description :出生日期未填写
+ * @Author : dy
+ * @Date: 2021-10-13 16:05
+ */
+@Component
+public class FIRP02836 extends QCCatalogue {
+    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 reHospitalization = firstpageStructureMap.get(Content.birth_date);
+            if (CatalogueUtil.isEmpty(reHospitalization)) {
+                status.set("-1");
+            }
+        }
+    }
+}

+ 33 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/hospital/changshaxy/firstpagerecord/FIRP02837.java

@@ -0,0 +1,33 @@
+package com.lantone.qc.kernel.catalogue.hospital.changshaxy.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 : FIRP02837
+ * @Description : 年龄未填写
+ * @Author : dy
+ * @Date: 2021-10-13 17:45
+ */
+@Component
+public class FIRP02837 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 age = firstpageStructureMap.get(Content.age);
+            if (StringUtil.isBlank(age)) {
+                status.set("-1");
+            }
+        }
+    }
+}

+ 45 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/hospital/changshaxy/firstpagerecord/FIRP03237.java

@@ -0,0 +1,45 @@
+package com.lantone.qc.kernel.catalogue.hospital.changshaxy.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 org.springframework.stereotype.Component;
+
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.Map;
+
+/**
+ * @ClassName : FIRP03237
+ * @Description : 首页入院时间格式填写不正确
+ * @Author : dy
+ * @Date: 2021-11-12 15:40
+ */
+@Component
+public class FIRP03237 extends QCCatalogue {
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) throws ParseException {
+        if (inputInfo.getFirstPageRecordDoc() == null) {
+            status.set("0");
+            return;
+        }
+        if (inputInfo.getFirstPageRecordDoc().getStructureMap() != null) {
+            Map<String, String> firstpageStructureMap = inputInfo.getFirstPageRecordDoc().getStructureMap();
+            String admissionTime = firstpageStructureMap.get(Content.admisTime);
+            //创建SimpleDateFormat对象实例并定义好转换格式
+            // SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+            Date date=null;
+            try {
+                date=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(admissionTime);
+                if (!admissionTime.equals("-")){
+                    status.set("-1");
+                    return;
+                }
+            }catch (Exception e) {
+                e.printStackTrace();
+            }
+        }
+    }
+
+}

+ 35 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/hospital/changshaxy/firstpagerecord/FIRP03238.java

@@ -0,0 +1,35 @@
+package com.lantone.qc.kernel.catalogue.hospital.changshaxy.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 : FIRP03238
+ * @Description : 血型填写不在值域范围内
+ * @Author : dy
+ * @Date: 2021-11-30 10:06
+ */
+@Component
+public class FIRP03238 extends QCCatalogue {
+    private List<String>Rh_list= Arrays.asList("A型","B型","O型","AB型","不详","未查");
+    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 (structureMap!=null){
+                String bloodType = structureMap.get("血型");
+                if (StringUtil.isNotBlank(bloodType) || !Rh_list.contains(bloodType) || !"-".equals(bloodType)){
+                    status.set("-1");
+                    return;
+                }
+            }
+        }
+    }
+}

+ 44 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/hospital/changshaxy/firstpagerecord/FIRP03239.java

@@ -0,0 +1,44 @@
+package com.lantone.qc.kernel.catalogue.hospital.changshaxy.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.StringUtil;
+import org.springframework.stereotype.Component;
+
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.Map;
+
+/**
+ * @ClassName : FIRP03239
+ * @Description : 首页入院时间晚于出院时间
+ * @Author : dy
+ * @Date: 2021-11-12 15:57
+ */
+@Component
+public class FIRP03239 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();
+            Map<String, String> structureMap1 = inputInfo.getFirstPageRecordDoc().getStructureMap();
+            String admissionTime = structureMap.get(Content.admisTime);
+            String dischargeTime = structureMap1.get(Content.dischargeTime);
+            //病案首页入院时间和病案首页的出院时间比较,大于出院时间则报错
+            if (StringUtil.isNotBlank(admissionTime) && StringUtil.isNotBlank(dischargeTime)){
+                status.set("0");
+            }
+            //SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+            try {
+                if (CatalogueUtil.compareDate(admissionTime,admissionTime,-1)){
+                    status.set("-1");
+                }
+            }catch (Exception e) {
+                e.printStackTrace();
+            }
+        }
+    }
+}

+ 36 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/hospital/changshaxy/firstpagerecord/FIRP03240.java

@@ -0,0 +1,36 @@
+package com.lantone.qc.kernel.catalogue.hospital.changshaxy.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 : FIRP03240
+ * @Description : 是否有31天再住院计划填写错误
+ * @Author : dy
+ * @Date: 2021-11-15 10:54
+ */
+@Component
+public class FIRP03240 extends QCCatalogue {
+    public  List<String> codeTables = Arrays.asList("有","无");
+    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 days = firstpageStructureMap.get("三十一天内再住院计划");
+            if (StringUtil.isNotBlank(days) || !days.equals("-") || codeTables.contains(days)){
+                status.set("-1");
+                return;
+            }
+        }
+    }
+}

+ 33 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/hospital/changshaxy/firstpagerecord/FIRP03241.java

@@ -0,0 +1,33 @@
+package com.lantone.qc.kernel.catalogue.hospital.changshaxy.firstpagerecord;
+
+import com.lantone.qc.kernel.catalogue.QCCatalogue;
+import com.lantone.qc.pub.model.InputInfo;
+import com.lantone.qc.pub.model.OutputInfo;
+import com.lantone.qc.pub.util.StringUtil;
+import org.springframework.stereotype.Component;
+
+import java.util.Map;
+
+/**
+ * @ClassName : FIRP03241
+ * @Description : 有出院31天再住院计划,目的未填写
+ * @Author : dy
+ * @Date: 2021-11-15 11:15
+ */
+@Component
+public class FIRP03241 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 objective = firstpageStructureMap.get("再住院目的");
+            if (StringUtil.isBlank(objective)){
+                status.set("-1");
+                return;
+            }
+        }
+    }
+}

+ 41 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/hospital/changshaxy/firstpagerecord/FIRP03242.java

@@ -0,0 +1,41 @@
+package com.lantone.qc.kernel.catalogue.hospital.changshaxy.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 : FIRP03242
+ * @Description : 有出院31天再住院计划,目的填写错误
+ * @Author : dy
+ * @Date: 2021-11-15 11:43
+ */
+@Component
+public class FIRP03242 extends QCCatalogue {
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        if (inputInfo.getFirstPageRecordDoc() == null) {
+            status.set("0");
+            return;
+        }
+        //有出院31天再住院计划,“有”时必填,目的填写“-”错误。当为否时,目的可以为“-”。
+        if (inputInfo.getFirstPageRecordDoc().getStructureMap() != null) {
+            Map<String, String> firstpageStructureMap = inputInfo.getFirstPageRecordDoc().getStructureMap();
+            String objective = firstpageStructureMap.get("再住院目的");
+            String rehospitalization = firstpageStructureMap.get(Content.reHospitalization);
+            if (StringUtil.isNotBlank(objective) && StringUtil.isNotBlank(rehospitalization)){
+                status.set("0");
+            }
+            if (rehospitalization.equals("有") && !objective.equals("-")){
+                status.set("-1");
+            }
+            if (rehospitalization.equals("否") && objective.equals("-")){
+                status.set("-1");
+            }
+        }
+    }
+}

+ 38 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/hospital/changshaxy/firstpagerecord/FIRP03245.java

@@ -0,0 +1,38 @@
+package com.lantone.qc.kernel.catalogue.hospital.changshaxy.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 : FIRP03245
+ * @Description : 药物过敏填写错误
+ * @Author : dy
+ * @Date: 2021-11-15 16:13
+ */
+@Component
+public class FIRP03245 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 medicine = firstpageStructureMap.get(Content.drugAllergy);
+            if (StringUtil.isNotBlank(medicine)) {
+                status.set("0");
+            }
+
+            //有或无,取值不能为“-”
+            if(medicine.equals("有") || medicine.equals("无")|| !medicine.equals("-")){
+                status.set("-1");
+            }
+        }
+    }
+}

+ 43 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/hospital/changshaxy/firstpagerecord/FIRP03246.java

@@ -0,0 +1,43 @@
+package com.lantone.qc.kernel.catalogue.hospital.changshaxy.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;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+/**
+ * @ClassName : FIRP03246
+ * @Description : 联系人电话填写错误
+ * @Author : dy
+ * @Date: 2021-11-15 16:26
+ */
+@Component
+public class FIRP03246 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 phone = firstpageStructureMap.get(Content.contact_phone);
+            if (StringUtil.isNotBlank(phone)) {
+                status.set("0");
+            }
+            //匹配所有手机号码
+            String regex="^1([358][0-9]|4[579]|66|7[0135678]|9[89])[0-9]{8}$";
+            Pattern pattern=Pattern.compile(regex);
+            Matcher matcher = pattern.matcher(phone);
+            if (matcher.find() || !phone.equals("-")){
+                status.set("-1");
+            }
+        }
+    }
+
+}

+ 37 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/hospital/changshaxy/firstpagerecord/FIRP03247.java

@@ -0,0 +1,37 @@
+package com.lantone.qc.kernel.catalogue.hospital.changshaxy.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 : FIRP03247
+ * @Description : 联系人地址填写错误
+ * @Author : dy
+ * @Date: 2021-11-15 17:19
+ */
+@Component
+public class FIRP03247 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 address = firstpageStructureMap.get(Content.contact_address);
+            if (StringUtil.isNotBlank(address)) {
+                status.set("0");
+            }
+            if (!address.equals("-")){
+                status.set("-1");
+            }
+        }
+    }
+
+}

+ 42 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/hospital/changshaxy/firstpagerecord/FIRP03248.java

@@ -0,0 +1,42 @@
+package com.lantone.qc.kernel.catalogue.hospital.changshaxy.firstpagerecord;
+
+import com.lantone.qc.kernel.catalogue.QCCatalogue;
+import com.lantone.qc.pub.model.InputInfo;
+import com.lantone.qc.pub.model.OutputInfo;
+import com.lantone.qc.pub.util.StringUtil;
+import org.springframework.stereotype.Component;
+
+import java.util.Map;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+/**
+ * @ClassName : FIRP03248
+ * @Description : 工作单位电话填写错误
+ * @Author : dy
+ * @Date: 2021-11-15 18:55
+ */
+@Component
+public class FIRP03248 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 workPhone = firstpageStructureMap.get("工作单位电话");
+            if (StringUtil.isBlank(workPhone)) {
+                return;
+            }
+            //匹配电话或手机号码,如果大于15位则报错
+            String regex="^((13[0-9])|(14[5|7])|(15([0-3]|[5-9]))|(18[0,5-9]))\\\\d{8}$";
+            Pattern pattern = Pattern.compile(regex);
+            Matcher matcher = pattern.matcher(workPhone);
+            //电话号码超过15位报错
+            if (matcher.find() && workPhone.length()<15){
+                status.set("-1");
+            }
+        }
+    }
+}

+ 43 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/hospital/changshaxy/firstpagerecord/FIRP03250.java

@@ -0,0 +1,43 @@
+package com.lantone.qc.kernel.catalogue.hospital.changshaxy.firstpagerecord;
+
+import com.lantone.qc.kernel.catalogue.QCCatalogue;
+import com.lantone.qc.pub.model.InputInfo;
+import com.lantone.qc.pub.model.OutputInfo;
+import com.lantone.qc.pub.util.StringUtil;
+import org.springframework.stereotype.Component;
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @ClassName : FIRP03250
+ * @Description : 联系人关系填写错误
+ * @Author : dy
+ * @Date: 2021-11-16 11:15
+ */
+@Component
+public class FIRP03250 extends QCCatalogue {
+    private List<String> person_list = Arrays.asList("本人或户主","配偶","子","女","孙子","孙女","外孙子","外孙女","父母","祖父母或外祖父母","兄弟姐妹","同事同学","其他");
+    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 contactName = firstpageStructureMap.get("联系人姓名");
+            String relationship = firstpageStructureMap.get("联系人关系");
+            String name = firstpageStructureMap.get("姓名");
+            if (StringUtil.isNotBlank(name) &&StringUtil.isNotBlank(contactName)){
+                status.set("0");
+            }
+            if (person_list.contains(relationship) && StringUtil.isNotBlank(relationship) || !relationship.equals("-")){
+                status.set("-1");
+            }
+            if (contactName.equals(name) || !relationship.equals("本人或户主")){
+                status.set("-1");
+            }
+        }
+    }
+}

+ 33 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/hospital/changshaxy/firstpagerecord/FIRP03255.java

@@ -0,0 +1,33 @@
+package com.lantone.qc.kernel.catalogue.hospital.changshaxy.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 : FIRP03255
+ * @Description : 主要手术及操作编码未填写
+ * @Author : dy
+ * @Date: 2021-11-18 14:11
+ */
+@Component
+public class FIRP03255 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 info = firstpageStructureMap.get(Content.operative_information);
+            if (StringUtil.isBlank(info)) {
+                status.set("-1");
+            }
+        }
+    }
+}

+ 38 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/hospital/changshaxy/firstpagerecord/FIRP03260.java

@@ -0,0 +1,38 @@
+package com.lantone.qc.kernel.catalogue.hospital.changshaxy.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.StringUtil;
+import org.springframework.stereotype.Component;
+
+import java.util.Map;
+
+/**
+ * @ClassName : FIRP03260
+ * @Description : 工作单位及地址填写错误
+ * @Author : dy
+ * @Date: 2021-11-19 17:14
+ */
+@Component
+public class FIRP03260 extends QCCatalogue {
+    public void start(InputInfo inputInfo, OutputInfo outputInfo){
+        status.set("0");
+        if (inputInfo.getFirstPageRecordDoc()==null){
+            return;
+        }
+        if (inputInfo.getFirstPageRecordDoc()!=null && inputInfo.getFirstPageRecordDoc().getStructureMap()!=null){
+            Map<String, String> structureMap = inputInfo.getFirstPageRecordDoc().getStructureMap();
+            String workUnit = structureMap.get(Content.work_unit);
+            String job = structureMap.get(Content.job);
+            if (StringUtil.isNotBlank(job) || "农名".contains(job) || "无业人员".contains(job) || "学生".contains(job)){
+                status.set("-1");
+            }
+            if (StringUtil.isNotBlank(workUnit) && workUnit.equals("-")){
+                status.set("-1");
+            }
+        }
+    }
+}

+ 30 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/hospital/changshaxy/firstpagerecord/FIRP03261.java

@@ -0,0 +1,30 @@
+package com.lantone.qc.kernel.catalogue.hospital.changshaxy.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 : FIRP03261
+ * @Description : 户口地址填写错误
+ * @Author : dy
+ * @Date: 2021-11-22 10:08
+ */
+@Component
+public class FIRP03261 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();
+            String householdAddress = structureMap.get(Content.household_address);
+            if (StringUtil.isNotBlank(householdAddress) && !householdAddress.equals("-")){
+                status.set("-1");
+            }
+        }
+    }
+}

+ 30 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/hospital/changshaxy/firstpagerecord/FIRP03262.java

@@ -0,0 +1,30 @@
+package com.lantone.qc.kernel.catalogue.hospital.changshaxy.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 : FIRP03262
+ * @Description : 现住址电话填写错误
+ * @Author : dy
+ * @Date: 2021-11-22 10:30
+ */
+@Component
+public class FIRP03262 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();
+            String telephone = structureMap.get(Content.current_address_phone);
+            if (StringUtil.isNotBlank(telephone) && !telephone.equals("-")){
+                status.set("-1");
+            }
+        }
+    }
+}

+ 30 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/hospital/changshaxy/firstpagerecord/FIRP03263.java

@@ -0,0 +1,30 @@
+package com.lantone.qc.kernel.catalogue.hospital.changshaxy.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 : FIRP03263
+ * @Description : 现住址填写错误
+ * @Author : dy
+ * @Date: 2021-11-22 10:41
+ */
+@Component
+public class FIRP03263 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();
+            String currentAddress = structureMap.get(Content.current_address);
+            if (StringUtil.isNotBlank(currentAddress) && !currentAddress.equals("-")){
+                status.set("-1");
+            }
+        }
+    }
+}

+ 40 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/hospital/changshaxy/firstpagerecord/FIRP03265.java

@@ -0,0 +1,40 @@
+package com.lantone.qc.kernel.catalogue.hospital.changshaxy.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 : FIRP03265
+ * @Description : 民族填写错误
+ * @Author : dy
+ * @Date: 2021-11-23 14:02
+ */
+@Component
+public class FIRP03265 extends QCCatalogue {
+    public List<String> nation_list = Arrays.asList("汉族","蒙古族","回族","藏族","维吾尔族","苗族","彝族","壮族","布依族","朝鲜族","满族","侗族","瑶族"
+    ,"白族","土家族","哈尼族","哈萨克族","傣族","黎族","傈僳族","佤族","畲族","高山族","拉祜族","水族","东乡族","纳西族","景颇族","柯尔克孜族","土族","达斡尔族","仫佬族","羌族","布朗族"
+            ,"撒拉族","毛难族","仡佬族","锡伯族","阿昌族","普米族","塔吉克族","怒族","乌孜别克族","俄罗斯族","鄂温克族","德昂族","保安族","裕固族","京族","塔塔尔族","独龙族"
+            ,"鄂伦春族","赫哲族","门巴族","珞巴族","基诺族","其他","外籍人士");
+    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();
+            String nation = structureMap.get(Content.nation);
+            if (StringUtil.isNotBlank(nation)){
+                status.set("0");
+            }
+            if (!nation.equals("-") || nation_list.size()>0 || nation_list.contains(nation)) {
+                status.set("-1");
+                return;
+            }
+        }
+    }
+}

+ 40 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/hospital/changshaxy/firstpagerecord/FIRP03266.java

@@ -0,0 +1,40 @@
+package com.lantone.qc.kernel.catalogue.hospital.changshaxy.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 : FIRP03266
+ * @Description : 籍贯填写错误
+ * @Author : dy
+ * @Date: 2021-11-22 14:38
+ */
+@Component
+public class FIRP03266 extends QCCatalogue {
+    public List<String> place_list = Arrays.asList("北京市","天津市","河北省","山西省","内蒙古","辽宁省",
+            "吉林省","黑龙江省","上海市","江苏省","浙江省","安徽省","福建省","江西省","山东省","河南省",
+            "湖北省","湖南省","广东省","广西省","海南省","四川省","重庆市","贵州省","云南省","西藏","陕西省",
+            "甘肃省","青海省","宁夏","新疆","台湾","香港特别行政区","澳门","外籍");
+    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();
+            String nativePlace = structureMap.get(Content.native_place);
+            if (StringUtil.isNotBlank(nativePlace)){
+                status.set("0");
+            }
+            if (place_list.size()>0 && place_list.contains(nativePlace)) {
+                status.set("-1");
+                return;
+            }
+        }
+    }
+}

+ 41 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/hospital/changshaxy/firstpagerecord/FIRP03267.java

@@ -0,0 +1,41 @@
+package com.lantone.qc.kernel.catalogue.hospital.changshaxy.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.model.doc.FirstPageRecordDoc;
+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 : FIRP03267
+ * @Description : 出生地填写错误
+ * @Author : dy
+ * @Date: 2021-11-22 14:38
+ */
+@Component
+public class FIRP03267 extends QCCatalogue {
+    public void start(InputInfo inputInfo, OutputInfo outputInfo){
+        status.set("0");
+        if (inputInfo.getFirstPageRecordDoc()==null) {
+            return;
+        }
+        FirstPageRecordDoc firstPageRecordDoc=new FirstPageRecordDoc();
+        if (firstPageRecordDoc.getStructureMap()!=null){
+            FirstPageRecordDoc pageRecordDoc = inputInfo.getFirstPageRecordDoc();
+            Map<String, String> structureMap = pageRecordDoc.getStructureMap();
+            if (structureMap != null) {
+                String birthPlace = structureMap.get("出生地");
+                if (StringUtil.isNotEmpty(birthPlace) || !birthPlace.equals("-")){
+                    status.set("-1");
+                    return;
+                }
+            }
+        }
+    }
+}

+ 53 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/hospital/changshaxy/firstpagerecord/FIRP03268.java

@@ -0,0 +1,53 @@
+package com.lantone.qc.kernel.catalogue.hospital.changshaxy.firstpagerecord;
+
+
+import com.lantone.qc.kernel.catalogue.QCCatalogue;
+import com.lantone.qc.pub.model.InputInfo;
+import com.lantone.qc.pub.model.OutputInfo;
+import com.lantone.qc.pub.util.StringUtil;
+import org.springframework.stereotype.Component;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @ClassName : FIRP03268
+ * @Description : 出院科别不标准
+ * @Author : dy
+ * @Date: 2021-11-15 13:35
+ */
+@Component
+public class FIRP03268 extends QCCatalogue {
+    private List<String> category_list= Arrays.asList("预防保健科","全科医疗科","内科","呼吸内科专业","消化内科专业","神经内科专业","心血管内科专业","血液内科专业"
+    ,"肾病学专业","内分泌专业","免疫学专业","变态反应专业","老年病专业","其他","外科","普通外科专业","肝脏移植项目","胰腺移植项目","小肠移植项目"
+    ,"神经外科专业","骨科专业","泌尿外科专业","肾脏移植项目","胸外科专业","肺脏移植项目","心脏大血管外科专业","心脏移植项目","烧伤科专业","整形外科专业"
+    ,"妇产科","妇科专业","产科专业","计划生育专业","优生学专业","生殖健康与不孕症专业","妇女保健科","青春期保健专业","围产期保健专业","更年期保健专业","妇女心理卫生专业"
+    ,"妇女营养专业","儿科","新生儿专业","小儿传染病专业","小儿消化专业","小儿呼吸专业","小儿心脏病专业","小儿肾病专业","小儿血液病专业","小儿神经病学专业"
+    ,"小儿内分泌专业","小儿遗传病专业","小儿免疫专业","小儿外科","小儿普通外科专业","小儿骨科专业","小儿泌尿外科专业","小儿胸心外科专业","小儿神经外科专业","儿童保健科"
+    ,"儿童生长发育专业","儿童营养专业","儿童心理卫生专业","儿童五官保健专业","儿童康复专业","眼科","耳鼻咽喉科","耳科专业","鼻科专业","咽喉科专业","口腔科","口腔内科专业"
+    ,"口腔颌面外科专业","正畸专业","口腔修复专业","口腔预防保健专业","皮肤科","皮肤病专业","性传播疾病专业","医疗美容科","精神科","精神病专业","精神卫生专业","药物依赖专业"
+    ,"精神康复专业","社区防治专业","临床心理专业","司法精神专业","传染科","肠道传染病专业","呼吸道传染病专业","肝炎专业","虫媒传染病专业","动物源性传染病专业","蠕虫病专业"
+    ,"结核病科","地方病科","肿瘤科","急诊医学科","康复医学科","运动医学科","职业病科","职业中毒专业","尘肺专业","放射病专业","物理因素损伤专业","职业健康监护专业",
+            "临终关怀科","特种医学与军事医学科","麻醉科","疼痛科","重症医学科","医学检验科","临床体液、血液专业","临床微生物学专业","临床生化检验专业","临床免疫、血清学专业",
+            "临床细胞分子遗传学专业","病理科","医学影像科","X线诊断专业","CT诊断专业","磁共振成像诊断专业","核医学专业","超声诊断专业","心电诊断专业","脑电及脑血流图诊断专业"
+    ,"神经肌肉电图专业","介入放射学专业","放射治疗专业","中医科","内科专业","外科专业","妇产科专业","儿科专业","皮肤科专业","眼科专业","耳鼻咽喉科专业","口腔科专业","肿瘤科专业"
+    ,"骨伤科专业","肛肠科专业","老年病科专业","针灸科专业","推拿科专业","康复医学专业","急诊科专业","预防保健科专业","民族医学科","维吾尔医学","藏医学","蒙医学","彝医学"
+    ,"傣医学","中西医结合科","其他业务科室");
+    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 (structureMap != null) {
+                String dischargeDepartment = structureMap.get("出院科别");
+                if (StringUtil.isNotBlank(dischargeDepartment)){
+                    status.set("0");
+                }
+                if (!dischargeDepartment.equals("-") || category_list.contains(dischargeDepartment)){
+                    status.set("-1");
+                    return;
+                }
+            }
+        }
+    }
+}
+

+ 67 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/hospital/changshaxy/firstpagerecord/FIRP03269.java

@@ -0,0 +1,67 @@
+package com.lantone.qc.kernel.catalogue.hospital.changshaxy.firstpagerecord;
+
+import com.lantone.qc.kernel.catalogue.QCCatalogue;
+import com.lantone.qc.pub.model.InputInfo;
+import com.lantone.qc.pub.model.OutputInfo;
+import com.lantone.qc.pub.util.StringUtil;
+import org.springframework.stereotype.Component;
+import rx.subjects.PublishSubject;
+
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.Map;
+/**
+ * @ClassName : FIRP03269
+ * @Description : 实际住院天数填写错误
+ * @Author : dy
+ * @Date: 2021-11-23 17:04
+ */
+@Component
+public class FIRP03269 extends QCCatalogue {
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) throws ParseException {
+        status.set("0");
+        if (inputInfo.getFirstPageRecordDoc()!=null && inputInfo.getFirstPageRecordDoc().getStructureMap()!=null){
+            Map<String, String> structureMap = inputInfo.getFirstPageRecordDoc().getStructureMap();
+            Map<String, String> structureMap1 = inputInfo.getFirstPageRecordDoc().getStructureMap();
+            Map<String, String> structureMap2 = inputInfo.getFirstPageRecordDoc().getStructureMap();
+            if (structureMap!=null && structureMap1!=null && structureMap2!=null){
+                String actual = structureMap.get("实际住院天数");
+                String dischargeTime = structureMap1.get("出院时间");
+                String admissionTime = structureMap2.get("入院时间");
+                if (StringUtil.isNotBlank(actual) || !actual.equals("-")){
+                    status.set("-1");
+                }
+                if (StringUtil.isNotBlank(admissionTime) && StringUtil.isNotBlank(dischargeTime)) {
+                    Date date = StringUtil.parseDateTime(dischargeTime);
+                    Date date1 = StringUtil.parseDateTime(admissionTime);
+                    daysBetween(date1,date);
+                    status.set("-1");
+                    return;
+                }
+            }
+
+        }
+    }
+    /**
+     * 计算两个日期之间相差的天数
+     * @param smdate 较小的时间
+     * @param bdate  较大的时间
+     * @return 相差天数
+     * @throws ParseException
+     */
+    public static int daysBetween(Date smdate, Date bdate) throws ParseException
+    {
+        SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd");
+        smdate=sdf.parse(sdf.format(smdate));
+        bdate=sdf.parse(sdf.format(bdate));
+        Calendar cal = Calendar.getInstance();
+        cal.setTime(smdate);
+        long time1 = cal.getTimeInMillis();
+        cal.setTime(bdate);
+        long time2 = cal.getTimeInMillis();
+        long between_days=(time2-time1)/(1000*3600*24);
+        return Integer.parseInt(String.valueOf(between_days));
+    }
+}

+ 32 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/hospital/changshaxy/firstpagerecord/FIRP03275.java

@@ -0,0 +1,32 @@
+package com.lantone.qc.kernel.catalogue.hospital.changshaxy.firstpagerecord;
+
+import com.lantone.qc.kernel.catalogue.QCCatalogue;
+import com.lantone.qc.pub.model.InputInfo;
+import com.lantone.qc.pub.model.OutputInfo;
+import com.lantone.qc.pub.util.StringUtil;
+import org.springframework.stereotype.Component;
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+/**
+ * @ClassName : FIRP03275
+ * @Description : 医疗付费方式未填写
+ * @Author : dy
+ * @Date: 2021-11-24 16:20
+ */
+@Component
+public class FIRP03275 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 (structureMap!=null && structureMap.size() > 0){
+                String medicalPaymentMethod = structureMap.get("医疗付费方式");
+                if (StringUtil.isBlank(medicalPaymentMethod)){
+                    status.set("-1");
+                }
+            }
+        }
+    }
+}

+ 38 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/hospital/changshaxy/firstpagerecord/FIRP03276.java

@@ -0,0 +1,38 @@
+package com.lantone.qc.kernel.catalogue.hospital.changshaxy.firstpagerecord;
+
+import com.lantone.qc.kernel.catalogue.QCCatalogue;
+import com.lantone.qc.pub.model.InputInfo;
+import com.lantone.qc.pub.model.OutputInfo;
+import com.lantone.qc.pub.util.StringUtil;
+import org.springframework.stereotype.Component;
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+/**
+ * @ClassName : FIRP03276
+ * @Description : 医疗付费方式填写错误
+ * @Author : dy
+ * @Date: 2021-11-24 16:33
+ */
+@Component
+public class FIRP03276 extends QCCatalogue {
+    private List<String> payment_Method = Arrays.asList("本市城镇职工基本医疗保险","外埠城镇职工基本医疗保险","本市城乡居民基本医疗保险","外埠城镇居民基本医疗保险",
+            "本市新型农村合作医疗","外埠新型农村合作医疗","贫困救助","商业医疗保险","全公费","全自费","其他社会保险","其他");
+    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 (structureMap!=null && structureMap.size() > 0){
+                String medicalPaymentMethod = structureMap.get("医疗付费方式");
+                if (StringUtil.isNotBlank(medicalPaymentMethod)){
+                    status.set("0");
+                }
+                if (payment_Method.contains(medicalPaymentMethod) || !"-".equals(medicalPaymentMethod)){
+                    status.set("-1");
+                    return;
+                }
+            }
+        }
+    }
+}

+ 32 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/hospital/changshaxy/firstpagerecord/FIRP03277.java

@@ -0,0 +1,32 @@
+package com.lantone.qc.kernel.catalogue.hospital.changshaxy.firstpagerecord;
+
+import com.lantone.qc.kernel.catalogue.QCCatalogue;
+import com.lantone.qc.pub.model.InputInfo;
+import com.lantone.qc.pub.model.OutputInfo;
+import com.lantone.qc.pub.model.doc.FirstPageRecordDoc;
+import com.lantone.qc.pub.util.StringUtil;
+import org.springframework.stereotype.Component;
+
+import java.util.Map;
+/**
+ * @ClassName : FIRP03277
+ * @Description : 患者姓名填写错误
+ * @Author : dy
+ * @Date: 2021-11-25 10:49
+ */
+@Component
+public class FIRP03277 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 (structureMap != null){
+               String name = structureMap.get("姓名");
+               if (StringUtil.isNotEmpty(name) || !name.equals("-")){
+                   status.set("-1");
+                   return;
+               }
+           }
+       }
+    }
+}

+ 42 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/hospital/changshaxy/firstpagerecord/FIRP03278.java

@@ -0,0 +1,42 @@
+package com.lantone.qc.kernel.catalogue.hospital.changshaxy.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 : FIRP03278
+ * @Description :职业填写错误
+ * @Author : dy
+ * @Date: 2021-11-29 10:20
+ */
+@Component
+public class FIRP03278 extends QCCatalogue {
+    private List<String>job_list= Arrays.asList("国家公务员","专业技术人员","职员","企业管理人员","工人","农民","学生","现役军人","自由职业者","个体经营者","无业人员"
+    ,"退(离)休人员","其他");
+    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 (structureMap != null){
+                String job = structureMap.get(Content.job);
+                if (StringUtil.isNotEmpty(job)){
+                    status.set("0");
+                }
+                /**
+                 * 职业填写超出值域范围
+                 */
+                if (job_list.contains(job) || !job.equals("-")){
+                    status.set("-1");
+                    return;
+                }
+            }
+        }
+    }
+}

+ 37 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/hospital/changshaxy/firstpagerecord/FIRP03279.java

@@ -0,0 +1,37 @@
+package com.lantone.qc.kernel.catalogue.hospital.changshaxy.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 : FIRP03264
+ * @Description : 婚姻状况填写错误
+ * @Author : dy
+ * @Date: 2021-11-29 10:27
+ */
+@Component
+public class FIRP03279 extends QCCatalogue {
+    public List<String> marry_list = Arrays.asList("未婚","已婚","丧偶","离婚","其他");
+    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();
+            String marry = structureMap.get(Content.marry);
+            if (StringUtil.isNotBlank(marry)){
+                status.set("0");
+            }
+            if (!marry.equals("-") || marry_list.size()>0 && marry_list.contains(marry)) {
+                status.set("-1");
+                return;
+            }
+        }
+    }
+}

+ 39 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/hospital/changshaxy/firstpagerecord/FIRP03280.java

@@ -0,0 +1,39 @@
+package com.lantone.qc.kernel.catalogue.hospital.changshaxy.firstpagerecord;
+
+import com.lantone.qc.kernel.catalogue.QCCatalogue;
+import com.lantone.qc.pub.model.InputInfo;
+import com.lantone.qc.pub.model.OutputInfo;
+import com.lantone.qc.pub.util.StringUtil;
+import org.springframework.stereotype.Component;
+
+import java.util.Map;
+/**
+ * @ClassName : FIRP03280
+ * @Description : 联系人姓名填写错误
+ * @Author : dy
+ * @Date: 2021-11-29 10:52
+ */
+@Component
+public class FIRP03280 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 contactName = firstpageStructureMap.get("联系人姓名");
+            String relationship = firstpageStructureMap.get("联系人关系");
+            String name = firstpageStructureMap.get("姓名");
+            if (StringUtil.isNotBlank(name) &&StringUtil.isNotBlank(contactName)){
+                status.set("0");
+            }
+            if (relationship.contains("本人或户主") && StringUtil.isNotBlank(relationship) || !relationship.equals("-")){
+                status.set("-1");
+            }
+            if (!contactName.equals(name)){
+                status.set("-1");
+            }
+        }
+    }
+}

+ 43 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/hospital/changshaxy/firstpagerecord/FIRP03282.java

@@ -0,0 +1,43 @@
+package com.lantone.qc.kernel.catalogue.hospital.changshaxy.firstpagerecord;
+
+import com.lantone.qc.kernel.catalogue.QCCatalogue;
+import com.lantone.qc.pub.model.InputInfo;
+import com.lantone.qc.pub.model.OutputInfo;
+import com.lantone.qc.pub.util.StringUtil;
+import org.springframework.stereotype.Component;
+
+import java.util.Map;
+/**
+ * @ClassName : FIRP03282
+ * @Description : 病理号未填写
+ * @Author : dy
+ * @Date: 2021-11-29 14:37
+ */
+@Component
+public class FIRP03282 extends QCCatalogue {
+    public void start(InputInfo inputInfo, OutputInfo outputInfo){
+        status.set("0");
+        if (inputInfo.getFirstPageRecordDoc()==null){
+            return;
+        }
+        if (inputInfo.getFirstPageRecordDoc().getStructureMap()!=null){
+            Map<String, String> structureMap = inputInfo.getFirstPageRecordDoc().getStructureMap();
+            Map<String, String> structureMap1 = inputInfo.getFirstPageRecordDoc().getStructureMap();
+            if (structureMap != null){
+                String diagnosisFee = structureMap.get("病理诊断费");
+                if (StringUtil.isEmpty(diagnosisFee) || diagnosisFee.equals(Integer.valueOf(0))){
+                    status.set("-1");
+                    return;
+                }
+            }
+            if (structureMap1!=null){
+                String diagnosis = structureMap1.get("病理诊断");
+                if (StringUtil.isEmpty(diagnosis) || diagnosis.equals("-")){
+                    status.set("-1");
+                    return;
+                }
+            }
+        }
+
+    }
+}

+ 61 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/hospital/changshaxy/leavehospital/LEA0148.java

@@ -0,0 +1,61 @@
+package com.lantone.qc.kernel.catalogue.hospital.changshaxy.leavehospital;
+
+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.LeaveHospitalDoc;
+import com.lantone.qc.pub.util.DateUtil;
+import com.lantone.qc.pub.util.StringUtil;
+import org.springframework.stereotype.Component;
+
+import java.util.Date;
+
+/**
+ * @Description: 出院记录未在患者出院前完成
+ * @author: rengb
+ * @time: 2020/3/10 13:53
+ */
+@Component
+public class LEA0148 extends QCCatalogue {
+    @Override
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        LeaveHospitalDoc leaveHospitalDoc = inputInfo.getLeaveHospitalDoc();
+        if (leaveHospitalDoc == null) {
+            status.set("0");
+            return;
+        }
+        if (inputInfo.getDeathRecordDoc() != null || inputInfo.getDeathCaseDiscussDoc() != null) {
+            status.set("0");
+            return;
+        }
+        String timeQm = leaveHospitalDoc.getStructureMap().get("签名时间");
+        String timeCy = leaveHospitalDoc.getStructureMap().get("出院时间");
+        if (StringUtil.isNotBlank(timeQm) && StringUtil.isNotBlank(timeCy)) {
+            if (!CatalogueUtil.compareTime(
+                    StringUtil.parseDateTime(timeCy),
+                    StringUtil.parseDateTime(DateUtil.nowString()),
+                    Long.valueOf(24 * 60))) {//如果出院未超过24小时,规则不判断
+                status.set("0");
+                return;
+            }
+            Date timeQmDate = StringUtil.parseDateTime(timeQm);
+            Date timeCyDate = StringUtil.parseDateTime(timeCy);
+            if (!CatalogueUtil.compareTime(timeCyDate, timeQmDate, 24 * 60L)) {
+                status.set("0");
+            }
+        }else {
+            if(StringUtil.isNotEmpty(timeCy)){
+                if (!CatalogueUtil.compareTime(
+                        StringUtil.parseDateTime(timeCy),
+                        StringUtil.parseDateTime(DateUtil.nowString()),
+                        Long.valueOf(24 * 60))) {//如果出院未超过24小时,规则不判断
+                    status.set("0");
+                    return;
+                }
+            }
+            status.set("0");
+            return;
+        }
+    }
+}

+ 111 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/hospital/changshaxy/leavehospital/LEA0149.java

@@ -0,0 +1,111 @@
+package com.lantone.qc.kernel.catalogue.hospital.changshaxy.leavehospital;
+
+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.BeHospitalizedDoc;
+import com.lantone.qc.pub.model.doc.DeathRecordDoc;
+import com.lantone.qc.pub.model.doc.LeaveHospitalDoc;
+import com.lantone.qc.pub.model.label.ChiefLabel;
+import com.lantone.qc.pub.util.StringUtil;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.stereotype.Component;
+
+import java.util.Map;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+/**
+ * @Description: 出院记录内容缺主诉
+ * @author: rengb
+ * @time: 2020/3/10 13:53
+ */
+@Component
+public class LEA0149 extends QCCatalogue {
+    @Override
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        LeaveHospitalDoc leaveHospitalDoc = inputInfo.getLeaveHospitalDoc();
+        BeHospitalizedDoc beHospitalizedDoc = inputInfo.getBeHospitalizedDoc();
+        if (leaveHospitalDoc == null || beHospitalizedDoc == null) {
+            status.set("0");
+            return;
+        }
+        DeathRecordDoc deathRecordDoc = inputInfo.getDeathRecordDoc();
+        if (deathRecordDoc != null) {
+            status.set("0");
+            return;
+        }
+        Map<String, String> lhStructureMap = leaveHospitalDoc.getStructureMap();
+        ChiefLabel chiefLabel = beHospitalizedDoc.getChiefLabel();
+        if (lhStructureMap != null && chiefLabel != null) {
+            String bhChief = CatalogueUtil.int2ChineseNum(chiefLabel.getText().replaceAll("[\\p{Punct}\\pP。-]", ""));
+            String leaveChief = lhStructureMap.get("主诉");
+            String key = getKeyByHospitalId();
+            String bhThings = lhStructureMap.get(key);
+            String reThings = lhStructureMap.get("入院原因");   //邵逸夫主诉在入院原因内
+            if (StringUtil.isNotBlank(bhThings)) {
+                bhThings = CatalogueUtil.int2ChineseNum(bhThings.replaceAll("[\\p{Punct}\\pP。-]", ""));
+                if (bhThings.contains("\n")) {
+                    bhThings = bhThings.replace("\n", "");
+                }
+            }
+            if (StringUtil.isNotBlank(reThings)) {
+                reThings = CatalogueUtil.int2ChineseNum(reThings.replaceAll("[\\p{Punct}\\pP。-]", ""));
+                if (reThings.contains("\n")) {
+                    reThings = reThings.replace("\n", "");
+                }
+            }
+
+            //如果出院小结结构化数据能取出主诉,则直接用该主诉和入院记录主诉比较
+            if (StringUtil.isNotBlank(leaveChief)) {
+                leaveChief = CatalogueUtil.int2ChineseNum(leaveChief.replaceAll("[\\p{Punct}\\pP。-]", ""));
+                if (bhChief.equals(leaveChief)) {
+                    status.set("0");
+                    return;
+                }
+            }
+            if (StringUtil.isNotBlank(bhThings) && bhThings.replace(" ", "").contains(bhChief.replace(" ", ""))) {
+                status.set("0");
+                return;
+            }
+            //邵逸夫主诉写在入院原因
+            if (StringUtil.isNotBlank(reThings) && reThings.replace(" ", "").contains(bhChief.replace(" ", ""))) {
+                status.set("0");
+                return;
+            }
+            if (StringUtils.isNotBlank(bhThings)) {
+                Pattern compile = Pattern.compile("(?<=2.).*(?=3.体格检查)");
+                Matcher matcher = compile.matcher(bhThings);
+                while (matcher.find()) {
+                    String number = matcher.group(0);
+                    if (CatalogueUtil.isEmpty(number)) {
+                        status.set("-1");
+                    }
+                }
+                //处理台州的
+                if (bhThings.contains("患者因")) {
+                    status.set("0");
+                }
+            }
+
+
+            //                    bhThings = bhThings.replaceAll("[\\p{Punct}\\pP]", "");
+            //                    if (bhThings.indexOf(bhChief) < 0) {
+            //                        status.set("-1");
+            //                    }
+        }
+    }
+
+    private String getKeyByHospitalId() {
+        switch (Content.hospital_Id) {
+            case "7":               //厦门
+                return "病史摘要";
+            case "35":               //長沙湘雅
+                return "基本信息";
+            default:
+                return "入院情况";
+        }
+    }
+}

+ 54 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/hospital/changshaxy/leavehospital/LEA02901.java

@@ -0,0 +1,54 @@
+package com.lantone.qc.kernel.catalogue.hospital.changshaxy.leavehospital;
+
+import com.google.common.collect.Lists;
+import com.lantone.qc.kernel.catalogue.QCCatalogue;
+import com.lantone.qc.kernel.util.RegularUtil;
+import com.lantone.qc.pub.model.InputInfo;
+import com.lantone.qc.pub.model.OutputInfo;
+import com.lantone.qc.pub.model.doc.DeathRecordDoc;
+import com.lantone.qc.pub.model.doc.LeaveHospitalDoc;
+import com.lantone.qc.pub.util.StringUtil;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @Description: 出院医嘱记录不规范
+ * @author: 胡敬
+ * @time: 2020/05/27 19:13
+ */
+@Component
+public class LEA02901 extends QCCatalogue {
+
+    @Override
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        status.set("0");
+        LeaveHospitalDoc leaveHospitalDoc = inputInfo.getLeaveHospitalDoc();
+        if (leaveHospitalDoc == null) {
+            return;
+        }
+        DeathRecordDoc deathRecordDoc = inputInfo.getDeathRecordDoc();
+        if (deathRecordDoc == null || deathRecordDoc.getText() == null) {
+            Map<String, String> structureMap = leaveHospitalDoc.getStructureMap();
+            String dischargeOrder = structureMap.get("出院医嘱");
+            if(StringUtils.isNotEmpty(dischargeOrder)){
+                //跟医学部任燕青确认过, 去除括号里的东西
+                dischargeOrder = RegularUtil.ClearBracket(dischargeOrder);
+                if (StringUtil.isNotBlank(dischargeOrder)) {
+                    List<String> words = Lists.newArrayList("qd","bid","tid","qid","qh","q2h","q4h","q6h","q8h",
+                            "qn","q3w","qod","biw","qw","prn","sos","ad","lib","st","stat","hs","am","po","ID","IH","IM",
+                            "IV","OD","OL","OS","OU","ivgtt","Q12H","QN","ONCE");
+                    for (String word : words) {
+                        if (dischargeOrder.contains(word.toUpperCase()) || dischargeOrder.contains(word.toLowerCase())) {
+                            status.set("-1");
+                            info.set("出院医嘱用法用量不规范");
+                            return;
+                        }
+                    }
+                }
+            }
+        }
+    }
+}

+ 68 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/hospital/changshaxy/operationdiscussion/OPE0351.java

@@ -0,0 +1,68 @@
+package com.lantone.qc.kernel.catalogue.hospital.changshaxy.operationdiscussion;
+
+import com.lantone.qc.kernel.catalogue.QCCatalogue;
+import com.lantone.qc.pub.model.InputInfo;
+import com.lantone.qc.pub.model.OutputInfo;
+import com.lantone.qc.pub.model.doc.operation.OperationDoc;
+import com.lantone.qc.pub.util.ListUtil;
+import com.lantone.qc.pub.util.StringUtil;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+
+/**
+ * @Description: 术后首次病程记录未记录患者生命体征
+ * @author: 胡敬
+ * @time: 2020/3/24 13:28
+ */
+@Component
+public class OPE0351 extends QCCatalogue {
+    @Override
+    protected void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        status.set("0");
+        //医嘱
+        //        List<DoctorAdviceDoc> doctorAdviceDocs = inputInfo.getDoctorAdviceDocs();
+        //        if (ListUtil.isEmpty(doctorAdviceDocs)) {
+        //            return;
+        //        }
+        //        boolean isOperativePatient = CatalogueUtil.isOperativePatients(doctorAdviceDocs);
+        //        boolean isOperativePatient = true;//是手术患者(暂时默认是)
+        //        if (isOperativePatient) {
+        List<OperationDoc> operationDocs = inputInfo.getOperationDocs();
+        if (operationDocs == null || operationDocs.size() == 0) {
+            status.set("0");
+            return;
+        }
+        if (ListUtil.isNotEmpty(operationDocs)) {
+            long count = operationDocs.stream().filter(operationDoc -> {
+                boolean flag = false;
+                if (operationDoc.getOperationDiscussionDoc() != null
+                        && operationDoc.getOperationDiscussionDoc().getOperationDiscussionLabel() != null
+                        && operationDoc.getOperationDiscussionDoc().getOperationDiscussionLabel().getVitals().size() == 0) {
+                    flag = true;
+                }
+                return flag;
+            }).count();
+            long matchCount = operationDocs.stream().filter(operationDoc -> {
+                boolean flag = false;
+                if (operationDoc.getOperationDiscussionDoc() != null
+                        && StringUtil.isNotBlank(operationDoc.getOperationDiscussionDoc().getText())
+                        && (operationDoc.getOperationDiscussionDoc().getText().contains("°C")
+                        || operationDoc.getOperationDiscussionDoc().getText().contains("次/分")
+                        || operationDoc.getOperationDiscussionDoc().getText().contains("mmHg")
+                        || operationDoc.getOperationDiscussionDoc().getText().contains("MMHG")
+                        || operationDoc.getOperationDiscussionDoc().getText().contains("生命体征")
+                )) {
+                    flag = true;
+                }
+                return flag;
+            }).count();
+            /* count为术后首程中没有生命体征的数量,matchCount为术后首程包含体温 呼吸 脉搏 血压 心率这些词的数量 */
+            if (count > 0 && matchCount == 0) {
+                status.set("-1");
+            }
+        }
+        //        }
+    }
+
+}

+ 173 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/hospital/changshaxy/operationdiscussion/OPE0369.java

@@ -0,0 +1,173 @@
+package com.lantone.qc.kernel.catalogue.hospital.changshaxy.operationdiscussion;
+
+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.doc.ThreeLevelWardDoc;
+import com.lantone.qc.pub.model.doc.operation.OperationDoc;
+import com.lantone.qc.pub.model.doc.operation.OperationRecordDoc;
+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.text.ParseException;
+import java.util.*;
+
+/**
+ * @Description: 手术患者缺术前主刀医师查房记录
+ * @author: WANGSY
+ * @time: 2020/11/11 11:22
+ */
+@Component
+public class OPE0369 extends QCCatalogue {
+
+    @Override
+    protected void start(InputInfo inputInfo, OutputInfo outputInfo) throws ParseException {
+        status.set("0");
+        if (outputInfo.getResult() != null) {
+            Map<String, Object> thr03090 = outputInfo.getResult().get("THR03090");
+            if (thr03090 != null && thr03090.size() > 0 && thr03090.get("status").equals("-1")) {
+                return;
+            }
+        }
+
+        MedicalRecordInfoDoc medicalRecordInfoDoc = inputInfo.getMedicalRecordInfoDoc();
+        String admisTime = "";
+        if (medicalRecordInfoDoc != null && medicalRecordInfoDoc.getStructureMap() != null) {
+            //入院日期
+            admisTime = medicalRecordInfoDoc.getStructureMap().get("behospitalDate");
+            if (CatalogueUtil.isEmpty(admisTime)) {
+                return;
+            }
+        }
+        //先判断是否有手术记录
+        List<OperationDoc> operationDocs = inputInfo.getOperationDocs();
+        if (operationDocs == null || operationDocs.size() == 0) {
+            return;
+        }
+        List<ThreeLevelWardDoc> threeLevelWardDocs = inputInfo.getThreeLevelWardDocs();
+        int operationCount = getOperationSum(operationDocs); // 获取手术记录次数
+//        long operationCount = operationDocs.stream().filter(operationDoc -> operationDoc.getOperationRecordDoc() != null).count();
+        //主刀查房次数
+        long operateCount = 0;
+        if (operationCount > 0) {
+            //存在手术记录无查房记录
+            if (ListUtil.isEmpty(threeLevelWardDocs)) {
+                status.set("-1");
+                return;
+            }
+            String operationStartDate = "";
+            List<Date> operDateList = new ArrayList<>();
+            for (OperationDoc operationDoc : operationDocs) {
+                if (operationDoc.getOperationRecordDoc() != null) {
+                    Map<String, String> operationDocStructureMap = operationDoc.getOperationRecordDoc().getStructureMap();
+                    operationStartDate = operationDocStructureMap.get("手术日期");
+                    if (StringUtil.parseDateTime(operationStartDate) == null) {
+                        continue;
+                    }
+                    if (StringUtil.isNotBlank(operationStartDate)) {
+                        if (!CatalogueUtil.compareTime(
+                                StringUtil.parseDateTime(admisTime),
+                                StringUtil.parseDateTime(operationStartDate),
+                                Long.valueOf(30))) {
+                            continue;
+                        }
+                        operDateList.add(StringUtil.parseDateTime(operationStartDate));
+                    } else {//取不到手术时间
+                        return;
+                    }
+                }
+            }
+
+            if (operDateList.size() > 1) {
+                for (int i = 0; i < operDateList.size(); i++) {
+                    if (i + 1 < operDateList.size()) {
+                        if (!CatalogueUtil.compareTime(operDateList.get(i), operDateList.get(i + 1),
+                                Long.valueOf(24 * 60))) {//如果手术记录是同一天,需有一次术前主刀查房
+                            operationCount--;
+                        }
+                    }
+                }
+            }
+
+            ThreeLevelWardDoc threeLevelWardDoc = threeLevelWardDocs.get(0);
+            List<ThreeLevelWardDoc> allDoctorWradDocs = threeLevelWardDoc.getAllDoctorWradDocs();
+            for (ThreeLevelWardDoc threeLevelWard : allDoctorWradDocs) {
+                Map<String, String> structureMap = threeLevelWard.getStructureMap();
+                String makeTitle = structureMap.get("查房标题");
+                String writTitle = structureMap.get("文书标题");
+                String recordDateStr = structureMap.get("查房日期");
+                if (operDateList.size() > 0) {
+                    for (Date date : operDateList) {
+                        if (StringUtil.isNotBlank(recordDateStr) && date != null
+                                && StringUtil.parseDateTime(recordDateStr).before(date)) {
+                            if (!CatalogueUtil.compareTime(StringUtil.parseDateTime(recordDateStr), date, Long.valueOf(24 * 60))
+                                    && (((StringUtil.isNotBlank(makeTitle) && makeTitle.contains("主刀")) || (StringUtil.isNotBlank(writTitle) && writTitle.contains("主刀")))
+                                    || ((StringUtil.isNotBlank(makeTitle) && makeTitle.contains("术前")) || (StringUtil.isNotBlank(writTitle) && writTitle.contains("术前"))))) {
+                                operateCount++;
+                            }
+                        }
+                    }
+                } else {//手术开始时间跟入院时间 小于30分钟,规则不判断
+                    return;
+                }
+            }
+        }
+
+        if (operationCount > 0 && operationCount > operateCount) {
+            status.set("-1");
+            return;
+        }
+    }
+
+
+    /**
+     * 获取手术记录次数
+     *
+     * @param operationDocs
+     * @return
+     */
+    private int getOperationSum(List<OperationDoc> operationDocs) {
+        List<Map<String, Date>> operationDateList = new ArrayList<>();
+        Map<String, Date> operationDate = null;
+        for (OperationDoc operationDoc : operationDocs) {
+            OperationRecordDoc operationRecordDoc = operationDoc.getOperationRecordDoc();
+            if (operationRecordDoc == null) {
+                continue;
+            }
+            Map<String, String> structureMap = operationRecordDoc.getStructureMap();
+            String operationStartDateStr = structureMap.get("手术日期");
+            if (StringUtil.isNotBlank(operationStartDateStr) && StringUtil.parseDateTime(operationStartDateStr) != null) {
+                Date operationStartDate = StringUtil.parseDateTime(operationStartDateStr);
+                operationStartDate = DateUtil.dateZeroClear(operationStartDate);
+                if (operationStartDate != null) {
+                    /* 放第一个手术记录的日期到operationDateList */
+                    if (operationDateList.size() == 0) {
+                        operationDate = new HashMap<>();
+                        operationDate.put("手术日期", operationStartDate);
+                        operationDateList.add(operationDate);
+                        continue;
+                    }
+                    /* 如果其中一个手术记录的开始时间到结束时间之间还包含另一个手术,就不往operationDateList里加 */
+                    boolean findInnerOperation = false;
+                    for (Map<String, Date> date : operationDateList) {
+                        Date listStartDate = DateUtil.dateZeroClear(date.get("手术日期"));
+                        if (listStartDate.equals(operationStartDate)) {
+                            findInnerOperation = true;
+                            break;
+                        }
+                    }
+                    if (!findInnerOperation) {
+                        operationDate = new HashMap<>();
+                        operationDate.put("手术日期", operationStartDate);
+                        operationDateList.add(operationDate);
+                    }
+                }
+            }
+        }
+        return operationDateList.size();
+    }
+}

+ 119 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/hospital/changshaxy/threelevelward/THR02900.java

@@ -0,0 +1,119 @@
+package com.lantone.qc.kernel.catalogue.hospital.changshaxy.threelevelward;
+
+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.ThreeLevelWardDoc;
+import com.lantone.qc.pub.model.doc.operation.OperationDoc;
+import com.lantone.qc.pub.model.doc.operation.OperationRecordDoc;
+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.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @ClassName : THR02900
+ * @Description : 术后24小时内无主刀或一助查房记录
+ * @Author : 胡敬
+ * @Date: 2020-05-27 14:23
+ */
+@Component
+public class THR02900 extends QCCatalogue {
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        status.set("0");
+        if (inputInfo.getOperationDocs().size() == 0) {
+            return;
+        }
+        List<OperationDoc> operationDocs = inputInfo.getOperationDocs();
+        List<ThreeLevelWardDoc> allDoctorWradDocs = new ArrayList<>();
+        if (inputInfo.getThreeLevelWardDocs() != null && inputInfo.getThreeLevelWardDocs().size() > 0) {
+            allDoctorWradDocs = inputInfo.getThreeLevelWardDocs().get(0).getAllDoctorWradDocs();
+        }
+        //标题
+        String allTitle = "";
+        //病情记录
+        String allPathography = "";
+        String[] split = null;
+        //一助或助手
+        String firstAssistant = "";
+        //手术结束时间
+        String opeEndTime = "";
+        for (OperationDoc operationDoc : operationDocs) {
+            OperationRecordDoc operationRecordDoc = operationDoc.getOperationRecordDoc();
+            if (operationRecordDoc == null) {
+                continue;
+            }
+            Map<String, String> structureMap = operationRecordDoc.getStructureMap();
+            firstAssistant = structureMap.get("一助");
+            opeEndTime = structureMap.get("手术日期");
+            String chiefSurgeon = structureMap.get("手术者");
+            if (StringUtil.parseDateTime(opeEndTime) == null) {
+                continue;
+            }
+            Date opeEndDate = CatalogueUtil.parseStringDate(opeEndTime);
+            if (opeEndDate == null) {
+                continue;
+            }
+            if (!CatalogueUtil.compareTime(
+                    StringUtil.parseDateTime(opeEndTime),
+                    StringUtil.parseDateTime(DateUtil.nowString()),
+                    Long.valueOf(24 * 60))) {//如果接收未超过6小时,规则不判断
+                return;
+            } else {
+                if ((StringUtil.isNotEmpty(chiefSurgeon) || StringUtil.isNotEmpty(firstAssistant)) && ListUtil.isEmpty(allDoctorWradDocs)) {
+                    status.set("-1");
+                    return;
+                }
+            }
+            if (ListUtil.isNotEmpty(allDoctorWradDocs)) {
+                for (ThreeLevelWardDoc wardDoc : allDoctorWradDocs) {
+                    Map<String, String> wardStructureMap = wardDoc.getStructureMap();
+                    String recordDateStr = wardStructureMap.get("查房日期");
+                    String recordTitle = wardStructureMap.get("查房标题");
+                    String writTitle = wardStructureMap.get("文书标题");
+                    String pathography = wardStructureMap.get("病情记录");
+                    Date recordDate = CatalogueUtil.parseStringDate(recordDateStr);
+                    if (StringUtil.isBlank(recordTitle) || StringUtil.isBlank(pathography) || recordDate == null) {
+                        continue;
+                    }
+                    if (opeEndDate.before(recordDate) && !CatalogueUtil.compareTime(opeEndDate, recordDate, 24 * 60L)) {
+                        allTitle += recordTitle;
+                        allPathography += pathography;
+                        if (StringUtil.isNotBlank(writTitle)) {
+                            allTitle += writTitle;
+                        }
+                    }
+                }
+            }
+            //查房标题中有主刀
+            if (allTitle.contains("主刀") || allTitle.contains("术后第一天") || allTitle.contains("术后第1天")) {
+                return;
+            }
+            //病情记录对比
+            if ((StringUtil.isNotBlank(chiefSurgeon) && allPathography.contains(chiefSurgeon)) || allPathography.contains("术后第一天") || allPathography.contains("术后第1天") ||
+                    (StringUtil.isNotBlank(firstAssistant) && allPathography.contains(firstAssistant))) {
+                return;
+            }
+            //查房标题对比
+            if (StringUtil.isNotBlank(chiefSurgeon) && !allTitle.contains(chiefSurgeon) &&
+                    StringUtil.isNotBlank(firstAssistant) && !allTitle.contains(firstAssistant)) {
+                status.set("-1");
+                return;
+            } else if (StringUtil.isBlank(chiefSurgeon) && StringUtil.isBlank(firstAssistant) && split.length > 1) {
+                for (int i = 0; i < split.length; i++) {
+                    if (allTitle.contains(split[i])) {
+                        return;
+                    }
+                }
+            }
+        }
+    }
+
+}

+ 88 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/hospital/changshaxy/threelevelward/THR03090.java

@@ -0,0 +1,88 @@
+package com.lantone.qc.kernel.catalogue.hospital.changshaxy.threelevelward;
+
+import com.lantone.qc.kernel.catalogue.QCCatalogue;
+import com.lantone.qc.pub.model.InputInfo;
+import com.lantone.qc.pub.model.OutputInfo;
+import com.lantone.qc.pub.model.doc.DoctorAdviceDoc;
+import com.lantone.qc.pub.model.doc.ThreeLevelWardDoc;
+import com.lantone.qc.pub.model.doc.operation.OperationDoc;
+import com.lantone.qc.pub.util.DateUtil;
+import com.lantone.qc.pub.util.StringUtil;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+
+/**
+ * @ClassName : THR03090
+ * @Description : 手术患者无术前主刀医师查房记录
+ * @Author : wsy
+ * @Date: 2021-01-11 10:39
+ */
+@Component
+public class THR03090 extends QCCatalogue {
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        status.set("0");
+        List<ThreeLevelWardDoc> threeLevelWardDocs = inputInfo.getThreeLevelWardDocs();
+        long cou = inputInfo.getOperationDocs().stream().map(OperationDoc::getOperationRecordDoc).filter(Objects::nonNull).count();
+        if (cou == 0) {
+            return;
+        }
+        if (threeLevelWardDocs.size() == 0 && cou > 0) {
+            status.set("-1");
+            return;
+        }
+        List<OperationDoc> operationDocs = inputInfo.getOperationDocs();
+        if (operationDocs == null || operationDocs.size() == 0) {
+            return;
+        }
+        String operationStartDate = "";
+        if (operationDocs.get(operationDocs.size() - 1).getOperationRecordDoc() != null) {
+            Map<String, String> operationDocStructureMap = operationDocs.get(operationDocs.size() - 1).getOperationRecordDoc().getStructureMap();
+            operationStartDate = operationDocStructureMap.get("手术日期");
+            if (StringUtil.parseDateTime(operationStartDate) == null) {
+                operationStartDate = DateUtil.nowString();
+            }
+        }
+
+        if (StringUtil.isBlank(operationStartDate) || StringUtil.parseDateTime(operationStartDate) == null) {
+            return;
+        }
+        List<ThreeLevelWardDoc> allDoctorWradDocs = threeLevelWardDocs.get(0).getAllDoctorWradDocs();
+        for (ThreeLevelWardDoc threeLevelWard : allDoctorWradDocs) {
+            Map<String, String> structureMap = threeLevelWard.getStructureMap();
+            String makeTitle = structureMap.get("查房标题");
+            String writTitle = structureMap.get("文书标题");
+            String makeDate = structureMap.get("查房日期");
+            if (StringUtil.isNotBlank(makeDate) && StringUtil.parseDateTime(makeDate).before(StringUtil.parseDateTime(operationStartDate))) {
+                if (((StringUtil.isNotBlank(makeTitle) && makeTitle.contains("主刀")) || (StringUtil.isNotBlank(writTitle) && writTitle.contains("主刀"))
+                        || ((StringUtil.isNotBlank(makeTitle) && makeTitle.contains("术前")) || (StringUtil.isNotBlank(writTitle) && writTitle.contains("术前"))))) {
+                    return;
+                }
+            }
+        }
+
+        //判断医嘱里有无手术
+        List<DoctorAdviceDoc> doctorAdviceDocs = inputInfo.getDoctorAdviceDocs();
+        if (doctorAdviceDocs.size() == 0) {
+            return;
+        }
+        for (DoctorAdviceDoc dad : doctorAdviceDocs) {
+            String name = dad.getStructureMap().get("医嘱项目名称");
+            if (name.contains("非手术") || name.contains("手术室") || (name.contains("手术") && name.contains("取消")) || (name.contains("暂停") && name.contains("手术")) || name.contains("静脉穿刺置管术") || name.startsWith("停") || name.contains("前一次")
+                    || name.contains("特殊病人手术使用一次性卫生材料") || name.contains("人免疫缺陷病毒抗体检测免费")) {
+                continue;
+            }
+            if (name.contains("手术")) {
+                status.set("-1");
+                return;
+            }
+        }
+
+        if (cou > 0) {
+            status.set("-1");
+            return;
+        }
+    }
+}

+ 143 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/hospital/changshaxy/threelevelward/THR0601.java

@@ -0,0 +1,143 @@
+package com.lantone.qc.kernel.catalogue.hospital.changshaxy.threelevelward;
+
+import com.lantone.qc.dbanaly.util.KernelConstants;
+import com.lantone.qc.dbanaly.util.SpecialStorageUtil;
+import com.lantone.qc.kernel.catalogue.QCCatalogue;
+import com.lantone.qc.kernel.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.MedicalRecordInfoDoc;
+import com.lantone.qc.pub.model.doc.ThreeLevelWardDoc;
+import com.lantone.qc.pub.model.doc.operation.OperationDoc;
+import com.lantone.qc.pub.model.doc.ward.AttendingDoctorWardDoc;
+import com.lantone.qc.pub.util.DateUtil;
+import com.lantone.qc.pub.util.SpringContextUtil;
+import com.lantone.qc.pub.util.StringUtil;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @ClassName : THR0601
+ * @Description : 整份病历无主治医师查房记录
+ * @Author : 胡敬
+ * @Date: 2020-03-25 10:21
+ */
+@Component
+public class THR0601 extends QCCatalogue {
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        status.set("0");
+
+        MedicalRecordInfoDoc medicalRecordInfoDoc = inputInfo.getMedicalRecordInfoDoc();
+        if (medicalRecordInfoDoc != null && medicalRecordInfoDoc.getStructureMap() != null) {
+            //入院日期
+            String admisTime = medicalRecordInfoDoc.getStructureMap().get("behospitalDate");
+            //出院日期
+            String dischargeTime = medicalRecordInfoDoc.getStructureMap().get("leaveHospitalDate");
+            if (CatalogueUtil.isEmpty(admisTime) || CatalogueUtil.isEmpty(dischargeTime)) {
+                return;
+            }
+            if (!CatalogueUtil.compareTime(
+                    StringUtil.parseDateTime(admisTime),
+                    StringUtil.parseDateTime(DateUtil.nowString()),
+                    Long.valueOf(48 * 60))) {//如果入院未超过48小时,规则不判断
+                return;
+            }
+            //如果住院天数小于2天则不判断该条规则
+            if (DateUtil.parseDate(dischargeTime) != null &&
+                    !CatalogueUtil.compareTime(StringUtil.parseDateTime(admisTime), StringUtil.parseDateTime(dischargeTime), (long) (48 * 60))) {
+                return;
+            } else {
+                if (inputInfo.getThreeLevelWardDocs().size() == 0) {
+                    status.set("-1");
+                    return;
+                }
+            }
+        }
+
+        if (inputInfo.getLeaveHospitalDoc() != null) {
+            Map<String, String> leaveHospitalStructureMap = inputInfo.getLeaveHospitalDoc().getStructureMap();
+            String lengthOfStay = leaveHospitalStructureMap.get("住院天数");
+            if (StringUtil.isNotBlank(lengthOfStay) && CatalogueUtil.numbersOnly(lengthOfStay)) {
+                //如果住院天数小于2天则不判断该条规则
+                if (Integer.parseInt(lengthOfStay) <= 2) {
+                    return;
+                }
+            }
+        }
+
+        /* 如果存在手术记录,判断主刀医生是否为主治医生 */
+        String operatorName = "";
+        List<OperationDoc> operationDocs = inputInfo.getOperationDocs();
+        if (operationDocs != null) {
+            for (OperationDoc operationDoc : operationDocs) {
+                if (operationDoc.getOperationRecordDoc() != null) {
+                    Map<String, String> operationDocStructureMap = operationDoc.getOperationRecordDoc().getStructureMap();
+                    if (StringUtil.isBlank(operatorName)) {
+                        operatorName = operationDocStructureMap.get("主刀医师");
+                        if (StringUtil.isBlank(operatorName) && StringUtil.isNotBlank(operationDocStructureMap.get("手术者及助手名称"))) {
+                            operatorName = operationDocStructureMap.get("手术者及助手名称").split("、")[0];
+                            if (operatorName.contains("主刀:") && operatorName.split(":").length > 1) {
+                                operatorName = operatorName.split(":")[1];
+                            }
+                        }
+                    }
+                }
+            }
+        }
+
+        if ("7".equals(Content.hospital_Id)) {
+            List<AttendingDoctorWardDoc> attendingDoctorWardDocs = inputInfo.getThreeLevelWardDocs().get(0).getAttendingDoctorWardDocs();//主治查房记录
+            if (attendingDoctorWardDocs != null && attendingDoctorWardDocs.size() > 0) {
+                return;
+            }
+        }
+        List<ThreeLevelWardDoc> allDoctorWradDocs = inputInfo.getThreeLevelWardDocs().get(0).getAllDoctorWradDocs();//查房记录
+        String title, record;
+        boolean findIndications = false;
+        for (ThreeLevelWardDoc threeLevelWardDoc : allDoctorWradDocs) {
+            Map<String, String> rescueStructureMap = threeLevelWardDoc.getStructureMap();
+            title = CatalogueUtil.subTitle(rescueStructureMap.get("查房标题"));
+            record = CatalogueUtil.subTitle(rescueStructureMap.get("病情记录"));
+            if (StringUtil.isNotBlank(title) && (title.contains(Content.attend) || title.contains("上级"))) {
+                findIndications = true;
+                break;
+            }
+            if (StringUtil.isNotBlank(record) && record.contains(Content.attend)) {
+                findIndications = true;
+                break;
+            }
+
+            if (StringUtil.isNotBlank(operatorName) && (title.contains("主刀") || record.contains("主刀"))) {
+                String operationProfessor = getCourseProfessor(operatorName);
+                if (operationProfessor.contains("主治")) {
+                    findIndications = true;
+                    break;
+                }
+            }
+
+        }
+        if (!findIndications) {
+            status.set("-1");
+        }
+    }
+
+    private String getCourseProfessor(String operatorName) {
+        String professor = "";
+        if (StringUtil.isBlank(operatorName)) {
+            return professor;
+        }
+        SpecialStorageUtil specialStorageUtil = SpringContextUtil.getBean("specialStorageUtil");
+        Map<String, Object> surgeon = specialStorageUtil.getJsonStringValue(KernelConstants.HOSPITAL_DOCTOR_MAP);
+        if (surgeon != null) {
+            Map<String, String> doctor = (Map) surgeon.get(operatorName);
+            if (doctor != null) {
+                professor = doctor.get("professor");
+            }
+
+        }
+        return professor;
+    }
+}

+ 152 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/hospital/ningbozhongyi/threelevelward/THR0588.java

@@ -0,0 +1,152 @@
+package com.lantone.qc.kernel.catalogue.hospital.ningbozhongyi.threelevelward;
+
+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.LeaveHospitalDoc;
+import com.lantone.qc.pub.model.doc.StagesSummaryDoc;
+import com.lantone.qc.pub.model.doc.ThreeLevelWardDoc;
+import com.lantone.qc.pub.model.doc.operation.OperationDiscussionDoc;
+import com.lantone.qc.pub.model.doc.operation.OperationDoc;
+import com.lantone.qc.pub.model.doc.transferrecord.TransferIntoDoc;
+import com.lantone.qc.pub.model.doc.transferrecord.TransferOutDoc;
+import com.lantone.qc.pub.model.doc.transferrecord.TransferRecordDoc;
+import com.lantone.qc.pub.util.DateUtil;
+import com.lantone.qc.pub.util.StringUtil;
+import org.springframework.stereotype.Component;
+
+import java.util.*;
+import java.util.stream.Collectors;
+
+/**
+ * @ClassName : THR0588
+ * @Description : 住院期间连续3天无病程记录
+ * @Author : 王世延
+ * @Date: 2020-09-8 14:22
+ */
+@Component
+public class THR0588 extends QCCatalogue {
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        status.set("0");
+        Date leaveDate = null;
+        if (inputInfo.getMedicalRecordInfoDoc() != null) {
+            Map<String, String> medicalRecordInfoStructureMap = inputInfo.getMedicalRecordInfoDoc().getStructureMap();
+            String leaveHospitalTime = medicalRecordInfoStructureMap.get("leaveHospitalDate");
+            leaveDate = StringUtil.parseDateTime(leaveHospitalTime);
+            if (leaveDate == null) {
+                LeaveHospitalDoc leaveHospitalDoc = inputInfo.getLeaveHospitalDoc();
+                if (leaveHospitalDoc != null) {
+                    leaveDate = StringUtil.parseDateTime(leaveHospitalDoc.getStructureMap().get("记录时间"));
+                }
+            }
+            if (leaveDate == null) {
+                leaveDate = new Date();
+            }
+        }
+        //查房记录
+        List<ThreeLevelWardDoc> threeLevelWardDocs = inputInfo.getThreeLevelWardDocs();
+        if (threeLevelWardDocs.size() == 0) {
+            return;
+        }
+        //所有查房记录的日期天
+        List<Date> dateThreeLevelDay = new ArrayList<>();
+        StringBuffer sb = new StringBuffer();
+        //所有的查房记录
+        List<ThreeLevelWardDoc> allDoctorWradDocs = threeLevelWardDocs.get(0).getAllDoctorWradDocs();
+        for (ThreeLevelWardDoc doc : allDoctorWradDocs) {
+            Date threeLevelDate = StringUtil.parseDateTime(doc.getStructureMap().get("查房日期"));
+            if (threeLevelDate == null) {
+                continue;
+            }
+            dateThreeLevelDay.add(threeLevelDate);
+        }
+        /******************************************首次病程********************************************************/
+        if ("7".equals(Content.hospital_Id)) {
+            if (inputInfo.getFirstCourseRecordDoc() != null) {
+                Map<String, String> structureMap = inputInfo.getFirstCourseRecordDoc().getStructureMap();
+                if (StringUtil.isNotBlank(structureMap.get("病历日期"))) {
+                    Date recordDate = StringUtil.parseDateTime(structureMap.get("病历日期"));
+                    dateThreeLevelDay.add(recordDate);
+                }
+            }
+        }
+        /******************************************术后首程********************************************************/
+        if (inputInfo.getOperationDocs().size() > 0) {
+            List<String> recordDateList = inputInfo.getOperationDocs().stream().map(OperationDoc::getOperationDiscussionDoc).filter(Objects::nonNull)
+                    .map(OperationDiscussionDoc::getStructureMap).filter(i -> StringUtil.isNotBlank(i.get("病历日期")))
+                    .map(i -> i.get("病历日期")).collect(Collectors.toList());
+            for (String recordDateStr : recordDateList) {
+                Date recordDate = StringUtil.parseDateTime(recordDateStr);
+                if (recordDate == null) {
+                    continue;
+                }
+                dateThreeLevelDay.add(recordDate);
+            }
+        }
+        /******************************************转入转出********************************************************/
+        if (inputInfo.getTransferRecordDocs() != null) {
+            TransferRecordDoc transferRecordDocs = inputInfo.getTransferRecordDocs();
+            List<String> intoRecordDateList = transferRecordDocs.getTransferIntoDocs()
+                    .stream().map(TransferIntoDoc::getStructureMap).filter(i -> StringUtil.isNotBlank(i.get("病历日期")))
+                    .map(i -> i.get("病历日期")).collect(Collectors.toList());
+            for (String recordDateStr : intoRecordDateList) {
+                Date recordDate = StringUtil.parseDateTime(recordDateStr);
+                if (recordDate == null) {
+                    continue;
+                }
+                dateThreeLevelDay.add(recordDate);
+            }
+            intoRecordDateList = transferRecordDocs.getTransferOutDocs()
+                    .stream().map(TransferOutDoc::getStructureMap).filter(i -> StringUtil.isNotBlank(i.get("病历日期")))
+                    .map(i -> i.get("病历日期")).collect(Collectors.toList());
+            for (String recordDateStr : intoRecordDateList) {
+                Date recordDate = StringUtil.parseDateTime(recordDateStr);
+                if (recordDate == null) {
+                    continue;
+                }
+                dateThreeLevelDay.add(recordDate);
+            }
+        }
+        /******************************************阶段小结********************************************************/
+        if (inputInfo.getStagesSummaryDocs().size() > 0) {
+            List<String> intoRecordDateList = inputInfo.getStagesSummaryDocs().stream().map(StagesSummaryDoc::getStructureMap)
+                    .filter(i -> StringUtil.isNotBlank(i.get("病历日期")))
+                    .map(i -> i.get("病历日期")).collect(Collectors.toList());
+            for (String recordDateStr : intoRecordDateList) {
+                Date recordDate = StringUtil.parseDateTime(recordDateStr);
+                if (recordDate == null) {
+                    continue;
+                }
+                dateThreeLevelDay.add(recordDate);
+            }
+        }
+        dateThreeLevelDay = dateThreeLevelDay.stream().sorted().collect(Collectors.toList());
+        int timeCha = 259200000;
+        //获取连续3天无查房记录的时间
+        for (int i = 0; i < dateThreeLevelDay.size(); i++) {
+            if (i + 1 < dateThreeLevelDay.size()) {
+                if (DateUtil.dateZeroClear(dateThreeLevelDay.get(i + 1)).getTime() - DateUtil.dateZeroClear(dateThreeLevelDay.get(i)).getTime() > timeCha &&
+                        dateThreeLevelDay.get(i + 1).before(leaveDate)) {
+                    infoAppend(sb, dateThreeLevelDay.get(i), dateThreeLevelDay.get(i + 1));
+                }
+            }
+        }
+        if (sb.toString().length() > 0) {
+            status.set("-1");
+            info.set(sb.toString().substring(0, sb.toString().length() - 1));
+        }
+    }
+
+    /**
+     * 拼接提示信息
+     *
+     * @param sb
+     * @param bfDate
+     * @param afDate
+     */
+    private void infoAppend(StringBuffer sb, Date bfDate, Date afDate) {
+        sb.append("(").append(DateUtil.formatDate(bfDate))
+                .append("->").append(DateUtil.formatDate(afDate)).append(")").append("、");
+    }
+}

+ 4 - 5
kernel/src/main/java/com/lantone/qc/kernel/catalogue/hospital/xiamen/operationdiscussion/OPE0369.java

@@ -19,7 +19,7 @@ import java.util.List;
 import java.util.Map;
 
 /**
- * @Description: 手术患者缺术前主刀医师查房记录
+ * @Description: 主刀医师术前查房未在术前24小时内完成
  * @author: WANGSY
  * @time: 2020/11/11 11:22
  */
@@ -110,11 +110,10 @@ public class OPE0369 extends QCCatalogue {
                     for (Date date : operDateList) {
                         if (StringUtil.isNotBlank(recordDateStr) && date != null
                                 && StringUtil.parseDateTime(recordDateStr).before(date)) {
-                            if (!CatalogueUtil.compareTime(StringUtil.parseDateTime(recordDateStr), date, Long.valueOf(24 * 60))
-                                    && ((makeTitle.contains("主刀") || (StringUtil.isNotBlank(writTitle) && writTitle.contains("主刀")))
-                                    || (makeTitle.contains("术前") || (StringUtil.isNotBlank(writTitle) && writTitle.contains("术前")))
+                            if (((StringUtil.isNotBlank(makeTitle) && makeTitle.contains("主刀")) || (StringUtil.isNotBlank(writTitle) && writTitle.contains("主刀")))
+                                    || ((StringUtil.isNotBlank(makeTitle) && makeTitle.contains("术前")) || (StringUtil.isNotBlank(writTitle) && writTitle.contains("术前")))
                                     || (StringUtil.isNotBlank(operatorPhysician) && makeTitle.contains(operatorPhysician))
-                            )) {
+                            ) {
                                 operateCount++;
                             }
                         }

+ 275 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/hospital/xiamen/threelevelward/THR0128.java

@@ -0,0 +1,275 @@
+package com.lantone.qc.kernel.catalogue.hospital.xiamen.threelevelward;
+
+import com.lantone.qc.dbanaly.util.KernelConstants;
+import com.lantone.qc.dbanaly.util.SpecialStorageUtil;
+import com.lantone.qc.kernel.catalogue.QCCatalogue;
+import com.lantone.qc.kernel.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.FirstCourseRecordDoc;
+import com.lantone.qc.pub.model.doc.MedicalRecordInfoDoc;
+import com.lantone.qc.pub.model.doc.ThreeLevelWardDoc;
+import com.lantone.qc.pub.model.doc.operation.OperationDoc;
+import com.lantone.qc.pub.model.doc.ward.AttendingDoctorWardDoc;
+import com.lantone.qc.pub.util.DateUtil;
+import com.lantone.qc.pub.util.StringUtil;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @ClassName : THR0128
+ * @Description : 每周无3次主治医师查房记录
+ * @Author : 胡敬
+ * @Date: 2020-03-19 16:52
+ */
+@Component
+public class THR0128 extends QCCatalogue {
+    @Autowired
+    private SpecialStorageUtil specialStorageUtil;
+
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        status.set("0");
+        MedicalRecordInfoDoc medicalRecordInfoDoc = inputInfo.getMedicalRecordInfoDoc();
+        if (medicalRecordInfoDoc != null && medicalRecordInfoDoc.getStructureMap() != null) {
+            //入院日期
+            String admisTime = medicalRecordInfoDoc.getStructureMap().get("behospitalDate");
+            //出院日期
+            String dischargeTime = medicalRecordInfoDoc.getStructureMap().get("leaveHospitalDate");
+            if (CatalogueUtil.isEmpty(admisTime)) {
+                return;
+            }
+            String presentTime = DateUtil.nowString();
+            //如果如果入院未超过7天则不判断该条规则
+            if (!CatalogueUtil.isEmpty(admisTime) && !CatalogueUtil.isEmpty(presentTime)) {
+                if (!CatalogueUtil.compareTime(StringUtil.parseDateTime(admisTime), StringUtil.parseDateTime(presentTime), (long) (7 * 24 * 60))) {
+                    return;
+                }
+            }
+            //如果住院天数小于7天则不判断该条规则
+            if (!CatalogueUtil.isEmpty(admisTime) && !CatalogueUtil.isEmpty(dischargeTime)) {
+                if (!CatalogueUtil.compareTime(StringUtil.parseDateTime(admisTime), StringUtil.parseDateTime(dischargeTime), (long) (7 * 24 * 60))) {
+                    return;
+                }
+            } else {
+                if (inputInfo.getThreeLevelWardDocs().size() == 0) {
+                    status.set("-1");
+                    return;
+                }
+            }
+
+            if (inputInfo.getBeHospitalizedDoc() != null && inputInfo.getThreeLevelWardDocs().size() > 0) {
+                if (CatalogueUtil.isEmpty(admisTime)) {
+                    return;
+                }
+                //开始时间(入院时间)
+                Date beginDate = StringUtil.parseDateTime(admisTime);
+                if (beginDate == null) {
+                    return;
+                }
+
+                ThreeLevelWardDoc threeLevelWardDoc = inputInfo.getThreeLevelWardDocs().get(0);
+                List<ThreeLevelWardDoc> allDoctorWradDocs = threeLevelWardDoc.getAllDoctorWradDocs();
+                if (allDoctorWradDocs.size() == 0) {
+                    status.set("0");
+                    return;
+                }
+                Date lastRecordDate = getLastRecordDate(allDoctorWradDocs);
+                if (lastRecordDate == null) {
+                    return;
+                }
+                int hoursPerWeek = 7 * 24 * 60;
+                String roundRecordThisWeek = "";
+                List<String> roundRecordEveryWeek = new ArrayList<>();
+                beginDate = DateUtil.dateZeroClear(beginDate);//从入院记录当天天0点开始算
+                int i = 1;
+                //长兴首次病程算一次主治查房,所以第一周只需要两次主治查房就可以
+                int rounds = 0;//主治查房次数
+                Date firstWeek = DateUtil.addDate(beginDate, 7);
+                for (AttendingDoctorWardDoc attendingDoctorWardDoc : threeLevelWardDoc.getAttendingDoctorWardDocs()) {//循环筛选主治,找出地日在第一周的个数
+                    String recordTime = attendingDoctorWardDoc.getStructureMap().get("查房日期");
+                    Date recordDate = StringUtil.parseDateTime(recordTime);
+                    if (recordDate.before(firstWeek)) {
+                        rounds = rounds + 1;
+                    }
+                }
+                if (rounds >= 2) {
+                    return;
+                }
+                String lastWardDateRange = "";
+                List<String> lastWardDateRangeList = new ArrayList<>();
+                //每周的病历记录
+                while (i >= 1) {
+                    roundRecordThisWeek = extractWardRecord(inputInfo, allDoctorWradDocs, beginDate, hoursPerWeek, lastRecordDate);
+                    if (CatalogueUtil.isEmpty(roundRecordThisWeek)) {
+                        break;
+                    }
+                    //如果6天后日期大于出院日期,跳过
+                    if (StringUtil.isBlank(dischargeTime)) {
+                        dischargeTime = presentTime;
+                    }
+                    Date sixDate = DateUtil.addDate(beginDate, 7);
+                    if (StringUtil.parseDateTime(dischargeTime).before(sixDate)) {
+                        break;
+                    }
+                    lastWardDateRange = DateUtil.formatDate(beginDate) + "    ->    " + DateUtil.formatDate(sixDate);
+                    lastWardDateRangeList.add(lastWardDateRange);
+                    roundRecordEveryWeek.add(roundRecordThisWeek);
+                    beginDate = DateUtil.addDate(beginDate, 7);
+                    i++;
+                }
+                if (roundRecordEveryWeek.size() == 0) {
+                    status.set("0");
+                    return;
+                }
+                boolean firstRecordAttendExist = findfirstRecordAttend(inputInfo);
+                List<String> resultInfos = new ArrayList<>();
+                for (int j = 0; j < roundRecordEveryWeek.size(); j++) {
+                    int indicationsNum = CatalogueUtil.appearNumber(roundRecordEveryWeek.get(j).split(","), Content.attend);
+                    //三级医师查房算一次主治查房
+                    String key = getKeyByHospitalId();
+                    int threeDoctorNum = CatalogueUtil.appearNumber(roundRecordEveryWeek.get(j).split(","), key);
+                    //北仑内分泌科(主任携主任代主治)
+                    int endocrinologyTitleNum = endocrinologyTitleNum(roundRecordEveryWeek.get(j).split(","));
+                    if (j == 0 && firstRecordAttendExist) { //如果首程中医师签名为主治医师,第一周查房记录也要加上
+                        indicationsNum += 1;
+                    }
+                    int num = 3;
+                    if ("7".equals(Content.hospital_Id)) {
+                        num = 2;
+                    }
+                    if (indicationsNum + threeDoctorNum + endocrinologyTitleNum < num) {
+                        //每周无3次主治医师查房记录
+                        status.set("-1");
+                        resultInfos.add(lastWardDateRangeList.get(j));
+                    }
+                }
+
+                if (resultInfos.size() > 0) {
+                    info.set(StringUtils.join(resultInfos.toArray(), ";"));
+                }
+            }
+        }
+    }
+
+    private String getKeyByHospitalId() {
+        switch (Content.hospital_Id) {
+            case "7":               //厦门
+                return "多学科联合";
+            default:
+                return "三级";
+        }
+    }
+
+    /**
+     * 北仑内分泌科主任主治处理
+     *
+     * @param srcText
+     * @return
+     */
+    private int endocrinologyTitleNum(String[] srcText) {
+        int count = 0;
+        switch (Content.hospital_Id) {
+            case "4":                            //北仑特殊需求
+                for (String title : srcText) {
+                    String regex = ".*主任.*主任.*主治.*";
+                    if (title.matches(regex)) {
+                        count++;
+                    }
+                }
+                return count;
+            case "7":                            //厦门特殊需求
+                for (String title : srcText) {
+                    String regex = ".*科主任.*主任.*";
+                    if (title.matches(regex)) {
+                        count++;
+                    }
+                }
+                return count;
+            default:
+                return count;
+        }
+    }
+
+    private Date getLastRecordDate(List<ThreeLevelWardDoc> allDoctorWradDocs) {
+        ThreeLevelWardDoc threeLevelWardDoc = allDoctorWradDocs.get(allDoctorWradDocs.size() - 1);
+        Map<String, String> lastWardDocStructureMap = threeLevelWardDoc.getStructureMap();
+        String wardDateStr = lastWardDocStructureMap.get("查房日期");
+        if (StringUtil.isNotBlank(wardDateStr)) {
+            return StringUtil.parseDateTime(wardDateStr);
+        }
+        return null;
+    }
+
+
+    /**
+     * 抽取duration分钟内所有查房标题
+     * 抽取一周内所有查房标题,若一周内记录少于6天,则返回""
+     *
+     * @param threeLevelWardDocs
+     * @param admisDate
+     * @param duration
+     * @return
+     */
+    private static String extractWardRecord(InputInfo inputInfo, List<ThreeLevelWardDoc> threeLevelWardDocs, Date admisDate, int duration, Date maxRecordDate) {
+        String recordTime = "", recordTitle = "", title = "";
+        List<Date> dateList = new ArrayList();
+        for (ThreeLevelWardDoc threeLevelWardDoc : threeLevelWardDocs) {
+            Map<String, String> threeLevelWardStructureMap = threeLevelWardDoc.getStructureMap();
+            recordTime = threeLevelWardStructureMap.get("查房日期");
+            title = threeLevelWardStructureMap.get("查房标题");
+            if (StringUtil.isBlank(recordTime) || StringUtil.isBlank(title)) {
+                continue;
+            }
+            Date recordDate = StringUtil.parseDateTime(recordTime);
+            if (recordDate == null) {
+                continue;
+            }
+            /* 替换查房标题中主刀/一助的职称 */
+            List<OperationDoc> operationDocs = inputInfo.getOperationDocs();
+            if (title.contains("主刀") || title.contains("术后第")) {
+                String doctorTitle = CatalogueUtil.getDoctorTitle(operationDocs, recordDate, "主刀医师");
+                title = title.replace("主刀", doctorTitle).replace("术后第", doctorTitle);
+            } else if (title.contains("一助")) {
+                String doctorTitle = CatalogueUtil.getDoctorTitle(operationDocs, recordDate, "一助");
+                title = title.replace("一助", doctorTitle);
+            }
+            if (admisDate.before(recordDate) && !CatalogueUtil.compareTime(admisDate, DateUtil.dateZeroClear(recordDate), (long) duration)) {
+                recordTitle += title + ",";
+                dateList.add(recordDate);
+            }
+        }
+        if (dateList.size() > 0) {
+            //dateList.sort(Date::compareTo);
+            if (!maxRecordDate.equals(dateList.get(dateList.size() - 1)) || CatalogueUtil.compareTime(admisDate, dateList.get(dateList.size() - 1), Long.valueOf(6 * 24 * 60))) {
+                return recordTitle;
+            }
+        }
+        return "";
+    }
+
+    private boolean findfirstRecordAttend(InputInfo inputInfo) {
+        FirstCourseRecordDoc firstCourseRecordDoc = inputInfo.getFirstCourseRecordDoc();
+        if (firstCourseRecordDoc == null) {
+            return false;
+        }
+        Map<String, Map<String, Object>> hospitalDoctorMap = specialStorageUtil.getJsonStringValue(KernelConstants.HOSPITAL_DOCTOR_MAP);
+        String doctorSign = firstCourseRecordDoc.getStructureMap().get("医师签名");
+        if (hospitalDoctorMap == null || StringUtil.isBlank(doctorSign)) {
+            return false;
+        }
+        if (hospitalDoctorMap.containsKey(doctorSign)) {
+            Object professor = hospitalDoctorMap.get(doctorSign).get("professor");
+            if (professor != null) {
+                return professor.toString().contains("主治") || professor.toString().contains("主任");
+            }
+        }
+        return false;
+    }
+}

+ 6 - 1
kernel/src/main/java/com/lantone/qc/kernel/catalogue/threelevelward/THR0130.java

@@ -36,7 +36,8 @@ public class THR0130 extends QCCatalogue {
         Map<String, String> firstAttendStructureMap = firstAttendDoc.getStructureMap();
         String admisDateStr = inputInfo.getBeHospitalizedDoc().getStructureMap().get("入院日期");
         String recordDateStr = firstAttendStructureMap.get("查房日期");
-        if (CatalogueUtil.isEmpty(admisDateStr) || CatalogueUtil.isEmpty(recordDateStr)) {
+        String content = firstAttendStructureMap.get("病情记录");
+        if (CatalogueUtil.isEmpty(admisDateStr) || CatalogueUtil.isEmpty(recordDateStr) || CatalogueUtil.isEmpty(content)) {
             status.set("0");
             return;
         }
@@ -45,6 +46,10 @@ public class THR0130 extends QCCatalogue {
             status.set("0");
             return;
         }
+        if (content.contains("病史") || content.contains("查体") || content.contains("补充")) {
+            status.set("0");
+            return;
+        }
         if (StringUtil.isNotBlank(firstAttendStructureMap.get("体检"))) {
             status.set("0");
             return;

+ 7 - 1
kernel/src/main/java/com/lantone/qc/kernel/catalogue/threelevelward/THR0135.java

@@ -35,7 +35,8 @@ public class THR0135 extends QCCatalogue {
         Map<String, String> firstDirectStructureMap = firstDirectDoc.getStructureMap();
         String admisDateStr = inputInfo.getBeHospitalizedDoc().getStructureMap().get("入院日期");
         String recordDateStr = firstDirectStructureMap.get("查房日期");
-        if (CatalogueUtil.isEmpty(admisDateStr) || CatalogueUtil.isEmpty(recordDateStr)) {
+        String content = firstDirectStructureMap.get("病情记录");
+        if (CatalogueUtil.isEmpty(admisDateStr) || CatalogueUtil.isEmpty(recordDateStr) || CatalogueUtil.isEmpty(content)) {
             status.set("0");
             return;
         }
@@ -44,6 +45,11 @@ public class THR0135 extends QCCatalogue {
             status.set("0");
             return;
         }
+        if (content.contains("病史") || content.contains("查体") || content.contains("补充")) {
+            status.set("0");
+            return;
+        }
+
         if (StringUtil.isNotBlank(firstDirectStructureMap.get("体检"))) {
             status.set("0");
             return;

+ 1 - 1
kernel/src/main/resources/bootstrap.yml

@@ -15,7 +15,7 @@ spring:
     active: local
 
 qc:
-  hospital_id: 1,2,3,4,5,6,7,8,10,13,15,20,34
+  hospital_id: 1,2,3,4,5,6,7,8,10,13,15,20,34,36
 
 logging:          # 日志
   config: classpath:logback-spring.xml

+ 84 - 0
kernel/src/main/resources/cache/36/concept_clinic_bodypart_properties.dict

@@ -0,0 +1,84 @@
+sjwPlFuzwYtdGy/Xru8l0w==
+sjwPlFuzwYuOwjk+wlafMb496h/s94Lp
+GaEOqMDeIR/A3JPjaU/OYQ==
+KUZ84E/l6BtIxYdpVp2d2udw4JKVz6fxOAPHyqzXUMY=
+ClvKDL868eyBa0I3oBBXTiLG5UIUjigm
+cpVuhYfN0VLL15lmAanTHLudBba0KZdGSmARnfpRl/s=
+tgLfZiBNXVfe46uqWooJfQ==
++elokrz+5ZZ4nftSAgjXeP9VC/9mRBPm
+u18AKL/dfo8=
+FXYCcRyAS3o=
+1y8RNUzpzDDA3JPjaU/OYQ==
+GDAzhKkwugqOwjk+wlafMb496h/s94Lp
+vVsbjXwCHtKFIWuMj59JFg==
+S00FGSMpzFYRJHHOrCiJIw==
+LQ4RQ5c6TvEfVJH7s8MZNQ==
+KkqtLy22gBtRq6Y4vkNXyQ==
+FpNKk6eB+A78k09Y7waUfQ==
+55LO8f+DGuqsZzaaPHDG7A==
+anCWsr9KEAcfVJH7s8MZNQ==
+Ms4itbwo4woHjnX6dZF4Ew==
+eE2lKBuqkGwbZW204O8pbL496h/s94Lp
+KPTiLOQlvfcHjnX6dZF4Ew==
+EHYxrOGlbsJINCuQrfA+Qw==
+IoIoNIGjGAkfVJH7s8MZNQ==
+TkKCqeWSukdcNzQgT7Qg/y/95Ux1UGf/
+5sS2G/r6ssUfVJH7s8MZNQ==
+Fz6WuGDyOlM=
+6BJE0DCYV4PN7oAmfhVFQqHIcEkBIHl+SmARnfpRl/s=
+ClvKDL868ewfVJH7s8MZNQ==
+IoIoNIGjGAmt+3FIqYSLwA==
+qjVzhjIuUT4fVJH7s8MZNQ==
+fAvCqq32iRGYkjXG21GhdA==
+Qz54IR1t0pxhD8mu55a07QB9XVjkemQO
+VDAaAfFpalOc8iRXg5Txmg==
+v2wP8zYN7yUfVJH7s8MZNQ==
+2O+0+BuTK7hnAFNeF32DwQ==
+LRQ8TiPskP8=
+MHWWVpSYUhZp84i3DCFu/g==
+4a+BNcRWzuwuxVbFLjJEww==
+yWJqJiL6qWQskpnR2QjFRA==
+LkBZ8uh2sivD7O64F4fyYD26Q3FauFTq
+vU9OSQNfzsdHGRV53JQHXTZxIOEr6XT/
+Z0A2kuK86msFZwSJa38bOw==
+qglFhT75KVY=
+J47wTSKVIotrynAbi7Nl7g==
+PSCtbA3GBCLqcUHlnbz5ig==
+pGzYL5VYctXxzUrAtKDMFg==
+J47wTSKVIotWP8N6Zu8teQ==
+hnOhzeqPs7c=
+FpNKk6eB+A60ivUVDCQonmb0NA6xAPvZ
+6eB67p+u3VA=
+38rBhrBd2ZA=
+WlxWJO1bvWM=
+/UTzDiOxLWpNfh/SNay22g==
+PLBt3Oha1AAOSE8k2YZYMw==
+cA6kPjEpsoKKXDwNc4sbZv9VC/9mRBPm
+ubvY7WEHsf0HjnX6dZF4Ew==
+NI9su0Z8kvY=
+z5dpaPXQysM+03JbZpPE8K74oEbqwDfN
+e7OvqkV6Qx5DhU/YuJZA4A==
+vnSKQ0o1HZO5fhcvExqbXw==
+5j32mrEC41Q=
+teXiWF5i95089VmH6nOntT26Q3FauFTq
+C5DNXPfJ3MsXUKrj9yaJVQ==
+aBDrcQGdFjgXTO+Ia0kzAA==
+EyuDTtt1Nh1c5OTNuAf37Q==
+0NhZqdATkZ4=
+1IKx7GtShHg=
+h/OwYNYyciw=
+kGg6y+QB2f8=
+et0S9LyTiS4MhEBuylTk2g==
+goFZ0v8zcPc=
+cA6kPjEpsoJc5OTNuAf37Q==
+BZNVMNz30Z00iPLsFnfW9Q==
+FUNtEl6WjOUfVJH7s8MZNQ==
+1boew8BvzsDzIpTnzy5Qnw==
+/CIzubCbNzzkzFf+CBlT64JiFWxfW6DV
+teXiWF5i953EeSAoaVSW+wBBqlZ1ciHqSmARnfpRl/s=
+CTNjqF5g7EIfVJH7s8MZNQ==
+OOQuqjL/h5M16D9aZjbrRw==
+ZfWBQ/To1p1p84i3DCFu/g==
+Q449MTqnm/c=
+xmHl5DY7FyM=
+hV3gMCbT8x+fXEA0j/uq7Q==

File diff suppressed because it is too large
+ 25358 - 0
kernel/src/main/resources/cache/36/concept_diag_properties.dict


File diff suppressed because it is too large
+ 25358 - 0
kernel/src/main/resources/cache/36/hospital_diag_info.dict


File diff suppressed because it is too large
+ 3123 - 0
kernel/src/main/resources/cache/36/hospital_doctor_info.dict


+ 10 - 10
trans/src/main/java/com/lantone/qc/trans/beilun/BeiLunThreeLevelWardDocTrans.java

@@ -239,11 +239,11 @@ public class BeiLunThreeLevelWardDocTrans extends ModelDocTrans {
      * @return
      */
     private boolean findDirector(String content) {
-        String director = "";
-        if (content.indexOf(",") != -1) {
-            director = content.substring(0, content.indexOf(","));
-        }
-        return director.contains("主任");
+//        String director = "";
+//        if (content.indexOf(",") != -1) {
+//            director = content.substring(0, content.indexOf(","));
+//        }
+        return content.contains("主任");
     }
 
     /**
@@ -253,11 +253,11 @@ public class BeiLunThreeLevelWardDocTrans extends ModelDocTrans {
      * @return
      */
     private boolean findAttend(String content) {
-        String director = "";
-        if (content.indexOf(",") != -1) {
-            director = content.substring(0, content.indexOf(","));
-        }
-        return director.contains("主治");
+//        String director = "";
+//        if (content.indexOf(",") != -1) {
+//            director = content.substring(0, content.indexOf(","));
+//        }
+        return content.contains("主治");
     }
 
     private String subTitle(String srcText) {

+ 9 - 10
trans/src/main/java/com/lantone/qc/trans/changshaxy/util/comsis/XyCommonAnalysisUtil.java

@@ -500,10 +500,10 @@ public class XyCommonAnalysisUtil {
     public static void extractWardInfo(String recTitle, String htmlText, Map<String, String> structureMap) {
         if (StringUtil.isNotBlank(htmlText)) {
             htmlText = htmlText.replaceAll("[   \n]", " ").replace("第1页", "")
-                    .replace("\n", " ").replace("&nbsp","");
+                    .replace("\n", " ").replace("&nbsp", "");
             String date = extractDate(htmlText);
             if (date != null) {
-                String dateTime =date.replace(","," ");
+                String dateTime = date.replace(",", " ");
                 structureMap.put("病历日期", dateTime);
                 htmlText = htmlText.replace(date, "").trim();
             }
@@ -515,10 +515,10 @@ public class XyCommonAnalysisUtil {
             } else {
                 structureMap.put("病历标题", recTitle);
                 structureMap.put("文书标题", title);
-                if (titleContent.size() > 2) {
-                    titleContent.remove(0);
-                    titleContent.remove(0);
-                }
+//                if (titleContent.size() > 2) {
+                titleContent.remove(0);
+//                    titleContent.remove(0);
+//                }
             }
             StringBuffer sb = new StringBuffer();
             for (String text : titleContent) {
@@ -536,18 +536,17 @@ public class XyCommonAnalysisUtil {
                 String info = structureMap.get("病情记录");
                 if (info.contains("医师签名")) {
                     structureMap.put("医师签名", info.substring(info.indexOf("医师签名") + "医生签名".length(), info.length()));
-                   //解决病情记录包括医师签名
+                    //解决病情记录包括医师签名
                     Integer index = info.indexOf("医师签名");
                     structureMap.put("病情记录", info.substring(0, index));
                     structureMap.put("记录医生", "");
                     //解决医师签名里包含上级医师签名
-                    if (structureMap.get("医师签名").contains("上级医师签名")){
-                        structureMap.put("医师签名",structureMap.get("医师签名").substring(0,structureMap.get("医师签名").indexOf("上级医师签名")));
+                    if (structureMap.get("医师签名").contains("上级医师签名")) {
+                        structureMap.put("医师签名", structureMap.get("医师签名").substring(0, structureMap.get("医师签名").indexOf("上级医师签名")));
                     }
                 }
 
 
-
             }
         }
     }

+ 8 - 2
trans/src/main/java/com/lantone/qc/trans/ningbozhenhai/ThreeLevelWardDocTrans.java

@@ -60,8 +60,14 @@ public class ThreeLevelWardDocTrans extends ModelDocTrans {
         if (contentMap.get("isParsed") != null && "1".equals(contentMap.get("isParsed").toString())) {
             structureMap = (Map) FastJsonUtils.getJsonToMap(content);
         } else {
-            String recTitle = contentMap.get("recTitle").toString();
-            String recTypeId = contentMap.get("recTypeId").toString();
+            String recTitle = "";
+            String recTypeId = "";
+            if (contentMap.containsKey("recTitle") && StringUtil.isNotBlank(contentMap.get("recTitle").toString())) {
+                recTitle = contentMap.get("recTitle").toString();
+            }
+            if (contentMap.containsKey("recTypeId") && StringUtil.isNotBlank(contentMap.get("recTypeId").toString())) {
+                recTypeId = contentMap.get("recTypeId").toString();
+            }
             HtmlAnalysis ningBoZhongYiHtmlAnalysis = new ThreeLevelWardHtmlAnalysis();
             Map<String, String> sourceMap = ningBoZhongYiHtmlAnalysis.analysis(content, recTitle, recTypeId);
             if (MapUtils.isNotEmpty(sourceMap)) {

+ 7 - 5
trans/src/main/java/com/lantone/qc/trans/ningbozhenhai/util/BeHospitalizedHtmlAnalysis.java

@@ -67,13 +67,15 @@ public class BeHospitalizedHtmlAnalysis implements HtmlAnalysis {
         }
 //
 
-        if (map.get("性别").equals("女")) {
-            if (map.get("婚育史").contains("月经史")) {
-                map.put("月经史", map.get("婚育史").substring(map.get("婚育史").indexOf("月经史") + 4));
-                map.put("婚育史", map.get("婚育史").substring(0, map.get("婚育史").indexOf("月经史")));
+        if (map.get("性别") != null && map.get("性别").equals("女")) {
+            if (StringUtil.isNotBlank(map.get("婚育史"))) {
+                if (map.get("婚育史").contains("月经史")) {
+                    map.put("月经史", map.get("婚育史").substring(map.get("婚育史").indexOf("月经史") + 4));
+                    map.put("婚育史", map.get("婚育史").substring(0, map.get("婚育史").indexOf("月经史")));
+                }
             }
         }
-        if (map.get("性别").equals("男")) {
+        if (map.get("性别") != null && map.get("性别").equals("男")) {
             if (StringUtil.isNotBlank(map.get("月经史"))) {
                 map.put("婚育史", map.get("月经史"));
             }

+ 3 - 1
trans/src/main/java/com/lantone/qc/trans/ningbozhenhai/util/CriticallyIllNoticeHtmlAnalysis.java

@@ -54,7 +54,9 @@ public class CriticallyIllNoticeHtmlAnalysis implements HtmlAnalysis {
                 CommonAnalysisUtil.html2StructureMap(titles, htmlContent, structureMap);
             }
             structureMap.put("患者签名", structureMap.get("患者签名").replace("患者签名", ""));
-            structureMap.put("法定监护人/被授权人签名", structureMap.get("法定监护人/被授权人签名").replace("患方签名", ""));
+            if (StringUtil.isNotBlank(structureMap.get("法定监护人/被授权人签名"))) {
+                structureMap.put("法定监护人/被授权人签名", structureMap.get("法定监护人/被授权人签名").replace("患方签名", ""));
+            }
             CommonAnalysisUtil.processTypeRight(structureMap, "3.目前病情评估");
             CommonAnalysisUtil.processType(structureMap, "6.患方知情选择");
             CommonAnalysisUtil.processType(structureMap, "指印");

+ 9 - 7
trans/src/main/java/com/lantone/qc/trans/ningbozhenhai/util/DifficultCaseDiscussHtmlAnalysis.java

@@ -34,7 +34,9 @@ public class DifficultCaseDiscussHtmlAnalysis implements HtmlAnalysis {
             String recTypeId = args[2];
             Document doc = Jsoup.parse(html);
             HtmlAnalysisUtil.tableStyle1InsertMap(doc.getElementById("table1"), structureMap);
-            doc.selectFirst("body").child(0).getElementById("table1").remove();
+            if (doc.selectFirst("body").child(0).getElementById("table1") != null) {
+                doc.selectFirst("body").child(0).getElementById("table1").remove();
+            }
             String htmlContent = HtmlAnalysisUtil.blockDivToStr(doc.selectFirst("body").child(0), true);
             if (StringUtil.isNotBlank(htmlContent)) {
                 htmlContent = htmlContent.replaceAll("[   ]", " ").replace("第一页", "").replace("发言记录(包括病史简要、讨论意见及结论):", "");
@@ -46,23 +48,23 @@ public class DifficultCaseDiscussHtmlAnalysis implements HtmlAnalysis {
                 String date = CommonAnalysisUtil.extractDate(structureMap.get("住院号"));
                 if (StringUtil.isNotBlank(date)) {
                     structureMap.put("时间", date);
-                    CommonAnalysisUtil.repKey(structureMap,"住院号","\n");
+                    CommonAnalysisUtil.repKey(structureMap, "住院号", "\n");
                 }
             }
             if (structureMap.containsKey("记录者(签名)")) {
-                structureMap.put("记录医生", structureMap.get("记录者(签名)").replace(" ",""));
+                structureMap.put("记录医生", structureMap.get("记录者(签名)").replace(" ", ""));
             }
             if (structureMap.containsKey("科主任(签名)")) {
                 String date1 = CommonAnalysisUtil.NBZYExtractDate(structureMap.get("科主任(签名)").replace(" ", ""));
                 if (StringUtil.isNotBlank(date1)) {
-                    structureMap.put("科主任签名", structureMap.get("科主任(签名)").replace(" ","").replace(date1, ""));
-                }else{
-                    structureMap.put("科主任签名", structureMap.get("科主任(签名)").replace(" ","").replace("年月日", ""));
+                    structureMap.put("科主任签名", structureMap.get("科主任(签名)").replace(" ", "").replace(date1, ""));
+                } else {
+                    structureMap.put("科主任签名", structureMap.get("科主任(签名)").replace(" ", "").replace("年月日", ""));
                 }
             }
             HtmlAnalysisUtil.insertModuleId(modeId, recTypeId, structureMap);
         } catch (Exception e) {
-            log.error(e.getMessage(), e);
+            log.error(e.getMessage(), e + "html=" + args[0]);
         }
         return structureMap;
     }

+ 11 - 3
trans/src/main/java/com/lantone/qc/trans/ningbozhenhai/util/LeaveHospitalHtmlAnalysis.java

@@ -34,7 +34,9 @@ public class LeaveHospitalHtmlAnalysis implements HtmlAnalysis {
             String recTypeId = args[2];
             Document doc = Jsoup.parse(html);
             HtmlAnalysisUtil.tableStyle1InsertMap(doc.getElementById("table1"), structureMap);
-            doc.selectFirst("body").child(0).getElementById("table1").remove();
+            if (doc.selectFirst("body").child(0).getElementById("table1") != null) {
+                doc.selectFirst("body").child(0).getElementById("table1").remove();
+            }
             String htmlContent = HtmlAnalysisUtil.blockDivToStr(doc.selectFirst("body").child(0), true);
             if (StringUtil.isNotBlank(htmlContent)) {
                 htmlContent = htmlContent.replace("患者如有需要,可于出院十日后(工作日),携带(身份证、社保卡、户口簿)等有效身份证到病案室(茗\n" +
@@ -44,7 +46,13 @@ public class LeaveHospitalHtmlAnalysis implements HtmlAnalysis {
                                 "三楼)复印住院病历资料。如委托他人办理,需携带委托人(患者)及被委托人有效身份证明前来办理。", "")
                         .replace("特殊检查资料号", "特殊检查资料号:");
                 List<String> sortTitles = CommonAnalysisUtil.sortTitles(titles, htmlContent);
-                CommonAnalysisUtil.cutByTitles(htmlContent, sortTitles, 0, structureMap);
+
+                try {
+                    CommonAnalysisUtil.cutByTitles(htmlContent, sortTitles, 0, structureMap);
+                } catch (Exception e) {
+                    e.printStackTrace();
+                    log.error("报错html :" + htmlContent);
+                }
             }
             if (StringUtil.isNotBlank(CommonAnalysisUtil.extractDate(structureMap.get("出院日期")))) {
                 structureMap.put("住院天数", structureMap.get("出院日期").replace(CommonAnalysisUtil.extractDate(structureMap.get("出院日期")), ""));
@@ -66,7 +74,7 @@ public class LeaveHospitalHtmlAnalysis implements HtmlAnalysis {
             }
             HtmlAnalysisUtil.insertModuleId(modeId, recTypeId, structureMap);
         } catch (Exception e) {
-            log.error(e.getMessage(), e);
+            log.error(e.getMessage(), e + "html=" + args[0]);
         }
         return structureMap;
     }

+ 22 - 6
trans/src/main/java/com/lantone/qc/trans/ningbozhenhai/util/OperationRecordHtmlAnalysis.java

@@ -2,6 +2,7 @@ package com.lantone.qc.trans.ningbozhenhai.util;
 
 import com.google.common.collect.Lists;
 import com.google.common.collect.Maps;
+import com.lantone.qc.pub.util.StringUtil;
 import com.lantone.qc.trans.comsis.CommonAnalysisUtil;
 import lombok.extern.slf4j.Slf4j;
 import org.jsoup.Jsoup;
@@ -44,7 +45,7 @@ public class OperationRecordHtmlAnalysis implements HtmlAnalysis {
                 .replace("(包括体位、切口处理经过,病灶所见及手术步骤等):", "");
         List<String> titles = Lists.newArrayList(
                 "姓名", "病区", "科室", "床号", "床位", "住院号", "手术开始时间", "手术结束时间", "术前诊断", "术 前 诊  断",
-                "手术名称", "手 术 名  称", "术中诊断", "术(中)后诊断", "手术人员", "手术主刀医师", "手 术 主 刀 医 师", "一 助", "二 助", "麻醉方式",
+                "手术名称", "手 术 名  称", "术中诊断", "术(中)后诊断", "手术人员", "手术主刀医师", "手 术 主 刀 医 师", "麻醉方式",
                 "麻 醉 方  式", "麻醉人员", "麻 醉 医  师", "手术风险评估(可选)", "NNIS分级", "手术类别(可选)", "手术标本", "冰冻切片结果",
                 "术中并发症", "术中失血量", "手术经过", "手术经过及处理(包括患者的体位、切口处理、病灶所见及手术步骤等)", "记录者签字", "主刀签字", "主刀医师签名",
                 "记录日期", "日期", "时间"
@@ -55,13 +56,28 @@ public class OperationRecordHtmlAnalysis implements HtmlAnalysis {
         CommonAnalysisUtil.processTypeRight(map, "手术类别(可选)");
         CommonAnalysisUtil.processType(map, "手术标本");
         CommonAnalysisUtil.processType(map, "术中并发症");
-        map.put("NNIS分级", map.get("NNIS分级").replace("-", ""));
-        if (map.containsKey("时间")) {
-            map.put("日期", map.get("记录日期") + map.get("时间"));
+        if (StringUtil.isNotBlank(map.get("NNIS分级"))) {
+            map.put("NNIS分级", map.get("NNIS分级").replace("-", ""));
         }
-        if (map.containsKey("手术主刀医师")) {
-            map.put("手术人员", "手术主刀医师:" + map.get("手术主刀医师") + " 一助:" + map.get("一助") + " 二助:" + map.get("二助"));
+        if (map.containsKey("记录日期") && StringUtil.isNotBlank(map.get("记录日期"))) {
+            StringBuffer sb = new StringBuffer();
+            sb.append(map.get("记录日期"));
+            if (map.containsKey("时间") && StringUtil.isNotBlank(map.get("时间"))) {
+                sb.append(map.get("时间"));
+            }
+            map.put("日期", sb.toString());
         }
+        /*if (map.containsKey("手术主刀医师") && StringUtil.isNotBlank(map.get("手术主刀医师"))) {
+            StringBuffer sb1 = new StringBuffer();
+            sb1.append("手术主刀医师:" + map.get("手术主刀医师"));
+            if (map.containsKey("一助") && StringUtil.isNotBlank(map.get("一助"))) {
+                sb1.append(" 一助:" + map.get("一助"));
+            }
+            if (map.containsKey("二助") && StringUtil.isNotBlank(map.get("二助"))) {
+                sb1.append(" 二助:" + map.get("二助"));
+            }
+            map.put("手术人员", sb1.toString());
+        }*/
     }
 
 }

+ 11 - 4
trans/src/main/java/com/lantone/qc/trans/ningbozhenhai/util/ThreeLevelWardHtmlAnalysis.java

@@ -31,14 +31,21 @@ public class ThreeLevelWardHtmlAnalysis implements HtmlAnalysis {
             String recTitle = args[1];
             String recTypeId = args[2];
             Document doc = Jsoup.parse(html);
-            Element bigDivElement = doc.selectFirst("body").child(0);
-            if (bigDivElement.childNodeSize() == 1) {
-                bigDivElement = bigDivElement.child(0);
+            String htmlText;
+            if (doc.selectFirst("body").childNodeSize() > 0) {
+                Element bigDivElement = doc.selectFirst("body").child(0);
+                if (bigDivElement.childNodeSize() == 1) {
+                    bigDivElement = bigDivElement.child(0);
+                }
+                htmlText = HtmlAnalysisUtil.blockDivToStr(bigDivElement, true);
+            }else{
+                htmlText = doc.text();
             }
+
             /*if (bigDivElement.selectFirst("hr") != null) {
                 bigDivElement.selectFirst("hr").previousElementSiblings().remove();
             }*/
-            String htmlText = HtmlAnalysisUtil.blockDivToStr(bigDivElement, true);
+
             /*htmlText = htmlText.replace("注意:上级医师查房主要记 录:患者病情、诊断、鉴别诊断、当前治疗措施和疗效的分析及下一步诊疗意见等,能反应上级医 师的水平。", "")
                     .replace("提醒:有创诊疗操作记录内容包括操作名称、时间、步骤、结果及患者的一般情况,记录操作过 程是否顺利,有无不良反应,术后注意事项,操作医师签名、记录时间等。 手术室完成的、治疗性质的及全麻下完成的有创诊疗操作参照手术管理。(包括介入治疗、胃肠镜 下肿瘤切除/粘膜下肿瘤剥除等)", "");*/
             CommonAnalysisUtil.extractWardInfo(recTitle, htmlText, structureMap);

+ 13 - 2
trans/src/main/java/com/lantone/qc/trans/xiamen/XiamenThreeLevelWardDocTrans.java

@@ -187,7 +187,7 @@ public class XiamenThreeLevelWardDocTrans extends ModelDocTrans {
                 title = title.replace("一助", doctorTitle);
             }
             if ((StringUtils.isNotEmpty(subTitle(title)) && subTitle(title).contains("主治"))
-                    || findAttend(content) || title.contains("多学科联合") || endocrinologyTitle(title)) {
+                    || findAttend(content) || title.contains("多学科联合") || endocrinologyTitle(title) || xiamenTitle(title)) {
                 attendingDoctorWardDoc = new AttendingDoctorWardDoc();
                 attendingDoctorWardDoc.setStructureMap(structureMap);
                 attendingDoctorWardDoc.setPageData((Map) structureMap);
@@ -204,7 +204,7 @@ public class XiamenThreeLevelWardDocTrans extends ModelDocTrans {
                 writTitle = writTitle.replace("一助", doctorTitle);
             }
             if ((StringUtils.isNotEmpty(subTitle(writTitle)) && subTitle(writTitle).contains("主治"))
-                    || findAttend(content) || writTitle.contains("多学科联合") || endocrinologyTitle(writTitle)) {
+                    || findAttend(content) || writTitle.contains("多学科联合") || endocrinologyTitle(writTitle) || xiamenTitle(title)) {
                 attendingDoctorWardDoc = new AttendingDoctorWardDoc();
                 attendingDoctorWardDoc.setStructureMap(structureMap);
                 attendingDoctorWardDoc.setPageData((Map) structureMap);
@@ -224,6 +224,17 @@ public class XiamenThreeLevelWardDocTrans extends ModelDocTrans {
         return title.matches(regex);
     }
 
+    /**
+     * 厦门科主任+主任查房处理
+     *
+     * @param title
+     * @return
+     */
+    private boolean xiamenTitle(String title) {
+        String regex = ".*科主任.*主任.*";
+        return title.matches(regex);
+    }
+
     /**
      * 共同照护讨论记录中找主任查房
      *

+ 38 - 0
trans/src/main/java/com/lantone/qc/trans/yuhangsy/AnesthesiaRecordDocTrans.java

@@ -0,0 +1,38 @@
+package com.lantone.qc.trans.yuhangsy;
+
+import com.alibaba.fastjson.JSONObject;
+import com.google.common.collect.Lists;
+import com.lantone.qc.pub.model.doc.AnesthesiaRecordDoc;
+import com.lantone.qc.pub.model.vo.MedrecVo;
+import com.lantone.qc.trans.ModelDocTrans;
+import lombok.extern.slf4j.Slf4j;
+
+import java.util.List;
+
+/**
+ * @ClassName: AnesthesiaRecordDocTrans
+ * @Description: 手麻记录解析
+ * @Author songxl
+ * @Date 2021/3/19
+ * @Version 1.0
+ */
+@Slf4j
+public class AnesthesiaRecordDocTrans extends ModelDocTrans {
+    @Override
+    public List<AnesthesiaRecordDoc> extract(MedrecVo medrecVo) {
+        List<AnesthesiaRecordDoc> anesList = Lists.newArrayList();
+        try {
+            //1.获取mrqc medrecVo content数据
+            List<String> anesthesiaList = (List<String>)medrecVo.getContent().get("content");
+            //2.装载到AnesthesiaRecordDoc
+            anesthesiaList.forEach(anesthesiaStr->{
+                AnesthesiaRecordDoc anesthesiaTemp =JSONObject.parseObject
+                        (anesthesiaStr,AnesthesiaRecordDoc.class);
+                anesList.add(anesthesiaTemp);
+            });
+        } catch (Exception e) {
+            log.error(e.getMessage(), e);
+        }
+        return anesList;
+    }
+}

+ 52 - 0
trans/src/main/java/com/lantone/qc/trans/yuhangsy/YuhangsyADLGradeDocTrans.java

@@ -0,0 +1,52 @@
+package com.lantone.qc.trans.yuhangsy;
+
+import com.lantone.qc.pub.model.doc.ADLGradeDoc;
+import com.lantone.qc.pub.model.vo.MedrecVo;
+import com.lantone.qc.pub.util.FastJsonUtils;
+import com.lantone.qc.trans.ModelDocTrans;
+import com.lantone.qc.trans.comsis.ModelDocGenerate;
+import com.lantone.qc.trans.yuhangsy.util.YuhangsyADLGradeHtmlAnalysis;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.collections.MapUtils;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @ClassName: yhsyADLGradeDocTrans
+ * @Description: ADL评分
+ * @Author songxl
+ * @Date 2021/3/9
+ * @Version 1.0
+ */
+@Slf4j
+public class YuhangsyADLGradeDocTrans extends ModelDocTrans {
+    @Override
+    public ADLGradeDoc extract(MedrecVo medrecVo) {
+        ADLGradeDoc adlGradeDoc = null;
+        try {
+            Map<String, Object> contentMap = ((List<Map>) medrecVo.getContent().get("content")).get(0);
+            String content = contentMap.get("xmlText").toString();
+            Map<String, String> structureMap = null;
+            if (contentMap.get("isParsed") != null && "1".equals(contentMap.get("isParsed").toString())) {
+                structureMap = (Map) FastJsonUtils.getJsonToMap(content);
+            } else {
+                String recTitle = contentMap.get("recTitle").toString();
+                String recTypeId = contentMap.get("recTypeId").toString();
+                YuhangsyADLGradeHtmlAnalysis adlGradeHtmlAnalysis = new YuhangsyADLGradeHtmlAnalysis();
+                Map<String, String> sourceMap = adlGradeHtmlAnalysis.analysis(content, recTitle, recTypeId);
+                if (MapUtils.isNotEmpty(sourceMap)) {
+                    structureMap.putAll(sourceMap);
+                }
+            }
+            if (MapUtils.isNotEmpty(structureMap)) {
+                              ModelDocGenerate.beHospitalizedDocGen(structureMap);
+                adlGradeDoc = ModelDocGenerate.adlGradeDocGen(structureMap);
+                adlGradeDoc.setPageData((Map) structureMap);
+            }
+        } catch (Exception e) {
+            log.error(e.getMessage(), e);
+        }
+        return adlGradeDoc;
+    }
+}

+ 75 - 0
trans/src/main/java/com/lantone/qc/trans/yuhangsy/YuhangsyBeHospitalizedDocTrans.java

@@ -0,0 +1,75 @@
+package com.lantone.qc.trans.yuhangsy;
+
+import com.google.common.collect.Lists;
+import com.lantone.qc.pub.model.doc.BeHospitalizedDoc;
+import com.lantone.qc.pub.model.vo.MedrecVo;
+import com.lantone.qc.pub.util.FastJsonUtils;
+import com.lantone.qc.trans.ModelDocTrans;
+import com.lantone.qc.trans.comsis.ModelDocGenerate;
+import com.lantone.qc.trans.comsis.OrdinaryAssistant;
+import com.lantone.qc.trans.yuhangsy.util.YuhangsyBeHospitalizedHtmlAnalysis;
+import com.lantone.qc.trans.yuhangsy.util.YuhangsyHtmlAnalysis;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.collections.MapUtils;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @Description: 入院记录文档生成
+ * @author: rengb
+ * @time: 2020/3/5 15:47
+ */
+@Slf4j
+public class YuhangsyBeHospitalizedDocTrans extends ModelDocTrans {
+
+    @Override
+    public BeHospitalizedDoc extract(MedrecVo medrecVo) {
+        BeHospitalizedDoc beHospitalizedDoc = null;
+        try {
+            Map<String, Object> contentMap = ((List<Map>) medrecVo.getContent().get("content")).get(0);
+            String content = contentMap.get("xmlText").toString();
+            Map<String, String> structureMap = null;
+            if (contentMap.get("isParsed") != null && "1".equals(contentMap.get("isParsed").toString())) {
+                structureMap = (Map) FastJsonUtils.getJsonToMap(content);
+            } else {
+                String recTitle = contentMap.get("recTitle").toString();
+                String recTypeId = contentMap.get("recTypeId").toString();
+                YuhangsyHtmlAnalysis yhsyHtmlAnalysis = new YuhangsyBeHospitalizedHtmlAnalysis();
+                Map<String, String> sourceMap = yhsyHtmlAnalysis.analysis(content, recTitle, recTypeId);
+                if (MapUtils.isNotEmpty(sourceMap)) {
+                    structureMap = OrdinaryAssistant.mapKeyContrast(sourceMap, keyContrasts);
+                    structureMap.put("记录编号", contentMap.get("recId").toString());
+                    structureMap.put("病历号", contentMap.get("behospitalCode") == null ? null : contentMap.get("behospitalCode").toString());
+                    //初步诊断特殊处理
+                    if (structureMap.containsKey("初步诊断")) {
+                        String initDiag = structureMap.get("初步诊断");
+                        if (initDiag.contains("<img")) {
+                            initDiag = initDiag.split("<img")[0];
+                            structureMap.put("初步诊断", initDiag);
+                        }
+                    }
+                }
+            }
+            if (MapUtils.isNotEmpty(structureMap)) {
+                beHospitalizedDoc = ModelDocGenerate.beHospitalizedDocGen(structureMap);
+                beHospitalizedDoc.setPageData((Map) structureMap);
+            }
+        } catch (Exception e) {
+            log.error(e.getMessage(), e);
+        }
+        return beHospitalizedDoc;
+    }
+
+    private List<String> keyContrasts = Lists.newArrayList(
+            "供史者=病史陈述者",
+//            "记录日期=病史采集时间",
+            "时间=记录时间",
+            "医师签名=记录医生",
+            "产科专科检查一般状况=专科检查",
+            "补充及专科情况体温=专科检查",
+            "实验室检查=辅助检查",
+            "民族\\宗教=民族"
+    );
+
+}

+ 72 - 0
trans/src/main/java/com/lantone/qc/trans/yuhangsy/YuhangsyClinicBloodEffectDocTrans.java

@@ -0,0 +1,72 @@
+package com.lantone.qc.trans.yuhangsy;
+
+import com.google.common.collect.Lists;
+import com.lantone.qc.pub.model.doc.ClinicBloodEffectDoc;
+import com.lantone.qc.pub.model.vo.MedrecVo;
+import com.lantone.qc.pub.util.FastJsonUtils;
+import com.lantone.qc.trans.ModelDocTrans;
+import com.lantone.qc.trans.comsis.ModelDocGenerate;
+import com.lantone.qc.trans.comsis.OrdinaryAssistant;
+import com.lantone.qc.trans.yuhangsy.util.YuhangsyClinicBloodEffectHtmlAnalysis;
+import com.lantone.qc.trans.yuhangsy.util.YuhangsyHtmlAnalysis;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.collections.MapUtils;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author 王宇
+ * @create 2020-04-30 12:39
+ * @desc 输血后效果评价
+ **/
+@Slf4j
+public class YuhangsyClinicBloodEffectDocTrans extends ModelDocTrans {
+
+    @Override
+    public List<ClinicBloodEffectDoc> extract(MedrecVo medrecVo) {
+        List<ClinicBloodEffectDoc> retList = Lists.newArrayList();
+        List<Map<String, Object>> contentMaps = (List) medrecVo.getContent().get("content");
+        contentMaps.forEach(contentMap -> {
+            try {
+                ClinicBloodEffectDoc clinicBloodEffectDoc = getClinicalBloodDoc(contentMap);
+                if (clinicBloodEffectDoc != null) {
+                    retList.add(clinicBloodEffectDoc);
+                }
+            } catch (Exception e) {
+                log.error(e.getMessage(), e);
+            }
+        });
+        return retList;
+    }
+
+    private ClinicBloodEffectDoc getClinicalBloodDoc(Map<String, Object> contentMap) {
+        String content = contentMap.get("xmlText").toString();
+        Map<String, String> structureMap = null;
+        if (contentMap.get("isParsed") != null && "1".equals(contentMap.get("isParsed").toString())) {
+            structureMap = (Map) FastJsonUtils.getJsonToMap(content);
+        } else {
+            String recTitle = contentMap.get("recTitle").toString();
+            String recTypeId = contentMap.get("recTypeId").toString();
+            YuhangsyHtmlAnalysis yhsyHtmlAnalysis = new YuhangsyClinicBloodEffectHtmlAnalysis();
+            Map<String, String> sourceMap = yhsyHtmlAnalysis.analysis(content, recTitle, recTypeId);
+            if (MapUtils.isNotEmpty(sourceMap)) {
+                structureMap = OrdinaryAssistant.mapKeyContrast(sourceMap, keyContrasts);
+                structureMap.put("记录编号", contentMap.get("recId").toString());
+                structureMap.put("病历号", contentMap.get("behospitalCode") == null ? null : contentMap.get("behospitalCode").toString());
+            }
+        }
+        if (MapUtils.isNotEmpty(structureMap)) {
+            ClinicBloodEffectDoc clinicBloodEffectDoc = ModelDocGenerate.clinicBloodEffectDoc(structureMap);
+            clinicBloodEffectDoc.setPageData((Map) structureMap);
+            return clinicBloodEffectDoc;
+        } else {
+            return null;
+        }
+    }
+
+    private List<String> keyContrasts = Lists.newArrayList(
+            "病情记录=病历内容"
+    );
+
+}

+ 76 - 0
trans/src/main/java/com/lantone/qc/trans/yuhangsy/YuhangsyClinicalBloodDocTrans.java

@@ -0,0 +1,76 @@
+package com.lantone.qc.trans.yuhangsy;
+
+import com.google.common.collect.Lists;
+import com.lantone.qc.pub.model.doc.ClinicalBloodDoc;
+import com.lantone.qc.pub.model.vo.MedrecVo;
+import com.lantone.qc.pub.util.FastJsonUtils;
+import com.lantone.qc.trans.ModelDocTrans;
+import com.lantone.qc.trans.comsis.CommonAnalysisUtil;
+import com.lantone.qc.trans.comsis.ModelDocGenerate;
+import com.lantone.qc.trans.comsis.OrdinaryAssistant;
+import com.lantone.qc.trans.yuhangsy.util.YuhangsyClinicalBloodHtmlAnalysis;
+import com.lantone.qc.trans.yuhangsy.util.YuhangsyHtmlAnalysis;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.collections.MapUtils;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @Description: 输血/血制品病程记录文档生成
+ * @author: rengb
+ * @time: 2020/3/17 13:21
+ */
+@Slf4j
+public class YuhangsyClinicalBloodDocTrans extends ModelDocTrans {
+
+    @Override
+    public List<ClinicalBloodDoc> extract(MedrecVo medrecVo) {
+        List<ClinicalBloodDoc> retList = Lists.newArrayList();
+        List<Map<String, Object>> contentMaps = (List) medrecVo.getContent().get("content");
+        contentMaps.forEach(contentMap -> {
+            try {
+                ClinicalBloodDoc clinicalBloodDoc = getClinicalBloodDoc(contentMap);
+                if (clinicalBloodDoc != null) {
+                    retList.add(clinicalBloodDoc);
+                }
+            } catch (Exception e) {
+                log.error(e.getMessage(), e);
+            }
+        });
+        return retList;
+    }
+
+    private ClinicalBloodDoc getClinicalBloodDoc(Map<String, Object> contentMap) {
+        String content = contentMap.get("xmlText").toString();
+        Map<String, String> structureMap = null;
+        if (contentMap.get("isParsed") != null && "1".equals(contentMap.get("isParsed").toString())) {
+            structureMap = (Map) FastJsonUtils.getJsonToMap(content);
+        } else {
+            String recTitle = contentMap.get("recTitle").toString();
+            String recTypeId = contentMap.get("recTypeId").toString();
+            YuhangsyHtmlAnalysis yhsyHtmlAnalysis = new YuhangsyClinicalBloodHtmlAnalysis();
+            Map<String, String> sourceMap = yhsyHtmlAnalysis.analysis(content, recTitle, recTypeId);
+            if (MapUtils.isNotEmpty(sourceMap)) {
+                structureMap = OrdinaryAssistant.mapKeyContrast(sourceMap, keyContrasts);
+                structureMap.put("记录编号", contentMap.get("recId").toString());
+                structureMap.put("病历号", contentMap.get("behospitalCode") == null ? null : contentMap.get("behospitalCode").toString());
+            }
+        }
+        if (MapUtils.isNotEmpty(structureMap)) {
+            ClinicalBloodDoc clinicalBloodDoc = ModelDocGenerate.clinicalBloodDocGen(structureMap);
+            clinicalBloodDoc.setText(CommonAnalysisUtil.html2String(content));
+            clinicalBloodDoc.setPageData((Map) structureMap);
+            return clinicalBloodDoc;
+        } else {
+            return null;
+        }
+    }
+
+    private List<String> keyContrasts = Lists.newArrayList(
+            "输注成分=输注种类、血型、数量",
+            "输血过程=输注过程",
+            "病情记录=病历内容"
+    );
+
+}

+ 275 - 0
trans/src/main/java/com/lantone/qc/trans/yuhangsy/YuhangsyConsultationDocTrans.java

@@ -0,0 +1,275 @@
+package com.lantone.qc.trans.yuhangsy;
+
+import com.google.common.collect.Lists;
+import com.google.common.collect.Maps;
+import com.google.common.collect.Sets;
+import com.lantone.qc.pub.model.doc.consultation.ConsultationApplicationDoc;
+import com.lantone.qc.pub.model.doc.consultation.ConsultationDoc;
+import com.lantone.qc.pub.model.doc.consultation.ConsultationRecordDoc;
+import com.lantone.qc.pub.model.doc.consultation.ConsultationResultsDoc;
+import com.lantone.qc.pub.model.vo.MedrecVo;
+import com.lantone.qc.pub.util.FastJsonUtils;
+import com.lantone.qc.pub.util.ListUtil;
+import com.lantone.qc.pub.util.StringUtil;
+import com.lantone.qc.trans.ModelDocTrans;
+import com.lantone.qc.trans.comsis.ModelDocGenerate;
+import com.lantone.qc.trans.comsis.OrdinaryAssistant;
+import com.lantone.qc.trans.yuhangsy.util.YuhangsyConsultationHtmlAnalysis;
+import com.lantone.qc.trans.yuhangsy.util.YuhangsyConsultationRecordHtmlAnalysis;
+import com.lantone.qc.trans.yuhangsy.util.YuhangsyHtmlAnalysis;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.collections.MapUtils;
+
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * @Description: 会诊文档生成
+ * @author: rengb
+ * @time: 2020/3/17 13:22
+ */
+@Slf4j
+public class YuhangsyConsultationDocTrans extends ModelDocTrans {
+
+    @Override
+    public List<ConsultationDoc> extract(MedrecVo medrecVo) {
+        List<ConsultationDoc> retList = Lists.newArrayList();
+
+        Map<String, List<Object>> contentMap = (Map) medrecVo.getContent().get("content");
+        if (contentMap == null) {
+            return retList;
+        }
+
+        Map<String, ConsultationRecordDoc> consultationRecordDocMap = getConsultationRecordDocMap((List) contentMap.get("会诊记录"));
+        Map<String, ConsultationResultsDoc> consultationResultsDocMap = getConsultationResultsDocMap((List) contentMap.get("会诊结果单"));
+        Map<String, ConsultationApplicationDoc> consultationApplicationDocMap = getConsultationApplicationDocMap((List) contentMap.get("会诊申请单"));
+
+        Set<String> consultationNameSet = Sets.newHashSet();
+        consultationNameSet.addAll(consultationRecordDocMap.keySet());
+        consultationNameSet.addAll(consultationResultsDocMap.keySet());
+        consultationNameSet.addAll(consultationApplicationDocMap.keySet());
+
+        consultationNameSet.forEach(consultationName -> {
+            ConsultationDoc consultationDoc = new ConsultationDoc();
+            consultationDoc.setConsultationName(consultationName);
+            consultationDoc.setConsultationRecordDoc(consultationRecordDocMap.get(consultationName));
+            consultationDoc.setConsultationResultsDoc(consultationResultsDocMap.get(consultationName));
+            consultationDoc.setConsultationApplicationDoc(consultationApplicationDocMap.get(consultationName));
+            retList.add(consultationDoc);
+        });
+
+        return retList;
+    }
+
+
+    /**************************************************会诊记录*********************************************************/
+    private Map<String, ConsultationRecordDoc> getConsultationRecordDocMap(List<Map<String, Object>> contentMaps) {
+        Map<String, ConsultationRecordDoc> retMap = Maps.newHashMap();
+        if (ListUtil.isEmpty(contentMaps)) {
+            return retMap;
+        }
+        int index = 1;
+        String consultationName = null;
+        for (Map<String, Object> contentMap : contentMaps) {
+            if (contentMap.get("xmlText") == null || StringUtil.isBlank(contentMap.get("xmlText").toString())) {
+                continue;
+            }
+            try {
+                ConsultationRecordDoc consultationRecordDoc = getConsultationRecordDoc(contentMap);
+                if (consultationRecordDoc != null) {
+                    consultationName = index + "";
+                    consultationRecordDoc.setConsultationName(consultationName);
+                    retMap.put(consultationName, consultationRecordDoc);
+                    index++;
+                }
+            } catch (Exception e) {
+                log.error(e.getMessage(), e);
+            }
+        }
+        return retMap;
+    }
+
+    private ConsultationRecordDoc getConsultationRecordDoc(Map<String, Object> contentMap) {
+        String content = contentMap.get("xmlText").toString();
+        Map<String, String> structureMap = null;
+        if (contentMap.get("isParsed") != null && "1".equals(contentMap.get("isParsed").toString())) {
+            structureMap = (Map) FastJsonUtils.getJsonToMap(content);
+        } else {
+            String recTitle = contentMap.get("recTitle").toString();
+            String recTypeId = contentMap.get("recTypeId").toString();
+            YuhangsyHtmlAnalysis yhsyHtmlAnalysis = new YuhangsyConsultationRecordHtmlAnalysis();
+            Map<String, String> sourceMap = yhsyHtmlAnalysis.analysis(content, recTitle, recTypeId);
+            if (MapUtils.isNotEmpty(sourceMap)) {
+                structureMap = OrdinaryAssistant.mapKeyContrast(sourceMap, consultationRecord_keyContrasts);
+                structureMap.put("记录编号", contentMap.get("recId").toString());
+                structureMap.put("病历号", contentMap.get("behospitalCode") == null ? null : contentMap.get("behospitalCode").toString());
+            }
+        }
+        if (MapUtils.isNotEmpty(structureMap)) {
+            ConsultationRecordDoc consultationRecordDoc = ModelDocGenerate.consultationRecordDocGen(structureMap);
+            consultationRecordDoc.setPageData((Map) structureMap);
+            return consultationRecordDoc;
+        } else {
+            return null;
+        }
+    }
+
+    private List<String> consultationRecord_keyContrasts = Lists.newArrayList(
+            "会诊原因=会诊目的",
+            "医师会诊意见=会诊意见"
+    );
+
+
+    /**************************************************会诊结果单*******************************************************/
+    private Map<String, ConsultationResultsDoc> getConsultationResultsDocMap(List<Map<String, Object>> contentMaps) {
+        Map<String, ConsultationResultsDoc> retMap = Maps.newHashMap();
+        if (ListUtil.isEmpty(contentMaps)) {
+            return retMap;
+        }
+        int index = 1;
+        String consultationName = null;
+        for (Map<String, Object> contentMap : contentMaps) {
+            if (contentMap.get("xmlText") == null || StringUtil.isBlank(contentMap.get("xmlText").toString())) {
+                continue;
+            }
+            try {
+                ConsultationResultsDoc consultationResultsDoc = getConsultationResultsDoc(contentMap);
+                if (consultationResultsDoc != null) {
+                    consultationName = index + "";
+                    consultationResultsDoc.setConsultationName(consultationName);
+                    retMap.put(consultationName, consultationResultsDoc);
+                    index++;
+                }
+            } catch (Exception e) {
+                log.error(e.getMessage(), e);
+            }
+        }
+        return retMap;
+    }
+
+    private ConsultationResultsDoc getConsultationResultsDoc(Map<String, Object> contentMap) {
+        String content = contentMap.get("xmlText").toString();
+        Map<String, String> structureMap = null;
+        if (contentMap.get("isParsed") != null && "1".equals(contentMap.get("isParsed").toString())) {
+            structureMap = (Map) FastJsonUtils.getJsonToMap(content);
+        } else {
+            String recTitle = contentMap.get("recTitle").toString();
+            String recTypeId = contentMap.get("recTypeId").toString();
+            YuhangsyHtmlAnalysis yhsyHtmlAnalysis = new YuhangsyConsultationHtmlAnalysis();
+            Map<String, String> sourceMap = yhsyHtmlAnalysis.analysis(content, recTitle, recTypeId);
+            if (MapUtils.isNotEmpty(sourceMap)) {
+                structureMap = OrdinaryAssistant.mapKeyContrast(sourceMap, consultationResults_pageDataTitles);
+                structureMap.put("记录编号", contentMap.get("recId").toString());
+                structureMap.put("病历号", contentMap.get("behospitalCode") == null ? null : contentMap.get("behospitalCode").toString());
+            }
+        }
+        if (StringUtil.isNotBlank(structureMap.get("会诊科室"))) {
+            structureMap.put("会诊科室", structureMap.get("会诊科室").replaceAll("XXXX", "").trim());
+        }
+        if (MapUtils.isNotEmpty(structureMap)) {
+            ConsultationResultsDoc consultationResultsDoc = ModelDocGenerate.consultationResultsDocGen(structureMap);
+            consultationResultsDoc.setPageData((Map) structureMap);
+            return consultationResultsDoc;
+        } else {
+            return null;
+        }
+    }
+
+    private List<String> consultationResults_pageDataTitles = Lists.newArrayList(
+            "科室=科别",
+            "专业=科别",
+            "申请会诊科别=申请科室",
+            "申请时间=申请日期",
+            "会诊日期=申请日期",
+            //"会诊诊断=当前诊断",
+            "患者病情及诊疗经过、申请会诊的理由及目的=会诊目的",
+            "病情摘要=会诊目的",
+            "出生年月=出生日期",
+            "床位=床号",
+            "外来专家意见=会诊意见",
+            "由受邀医生填写,本次会诊是否必要=由受邀医生填写本次会诊是否必要",
+            "单位=会诊医师所在医疗机构名称",
+            "记录医师"
+    );
+
+
+    /**************************************************会诊申请单*******************************************************/
+    private Map<String, ConsultationApplicationDoc> getConsultationApplicationDocMap(List<Map<String, Object>> contentMaps) {
+        Map<String, ConsultationApplicationDoc> retMap = Maps.newHashMap();
+        if (ListUtil.isEmpty(contentMaps)) {
+            return retMap;
+        }
+        int index = 1;
+        String consultationName = null;
+        for (Map<String, Object> contentMap : contentMaps) {
+            if (contentMap.get("xmlText") == null || StringUtil.isBlank(contentMap.get("xmlText").toString())) {
+                continue;
+            }
+            consultationName = index + "";
+            ConsultationApplicationDoc consultationApplicationDoc = getConsultationApplicationDoc(contentMap);
+            consultationApplicationDoc.setConsultationName(consultationName);
+            retMap.put(consultationName, consultationApplicationDoc);
+            index++;
+        }
+        return retMap;
+    }
+
+    private ConsultationApplicationDoc getConsultationApplicationDoc(Map<String, Object> contentMap) {
+        String content = contentMap.get("xmlText").toString();
+        Map<String, String> structureMap = null;
+        if (contentMap.get("isParsed") != null && "1".equals(contentMap.get("isParsed").toString())) {
+            structureMap = (Map) FastJsonUtils.getJsonToMap(content);
+        } else {
+            String recTitle = contentMap.get("recTitle").toString();
+            String recTypeId = contentMap.get("recTypeId").toString();
+            YuhangsyHtmlAnalysis yhsyHtmlAnalysis = new YuhangsyConsultationHtmlAnalysis();
+            Map<String, String> sourceMap = yhsyHtmlAnalysis.analysis(content, recTitle, recTypeId);
+            structureMap = OrdinaryAssistant.mapKeyContrast(sourceMap, consultationApplication_keyContrasts);
+            structureMap.put("记录编号", contentMap.get("recId").toString());
+            structureMap.put("病历号", contentMap.get("behospitalCode") == null ? null : contentMap.get("behospitalCode").toString());
+        }
+
+        ConsultationApplicationDoc consultationApplicationDoc = ModelDocGenerate.consultationApplicationDocGen(structureMap);
+        consultationApplicationDoc.setText(content);
+        consultationApplicationDoc.setPageData((Map) structureMap);
+
+        return consultationApplicationDoc;
+    }
+
+    private List<String> consultationApplication_sourceTitles = Lists.newArrayList(
+            "姓名",
+            "性别",
+            "病区",
+            "床号",
+            "病案号",
+            "简要病情及诊疗",
+            "申请理由目的",
+            "受邀科室",
+            "会诊分类",
+            "会诊时间",
+            "会诊地点",
+            "签名"
+    );
+
+    private List<String> consultationApplication_keyContrasts = Lists.newArrayList(
+            "++++姓名=姓名",
+            "申请时间=申请日期",
+            "性别=性别",
+            "++++病区=病区",
+            "床号=",
+            "++++病案号=病案号",
+            "新会诊-简要病情及诊疗=简要病情及诊疗",
+            "新会诊-申请理由目的=会诊目的",
+            "新会诊-受邀科室=受邀科室",
+            "新会诊-会诊分类=会诊分类",
+            "新会诊-会诊时间=会诊时间",
+            "新会诊-会诊地点=会诊地点",
+            "新会诊-接待医生=会诊医师",
+            "新会诊-会诊意见=会诊意见",
+            "新会诊-会诊科室=会诊科室",
+            "签名++++=签名",
+            "++++会诊医师=会诊医师"
+    );
+
+}

+ 36 - 0
trans/src/main/java/com/lantone/qc/trans/yuhangsy/YuhangsyCrisisInfoDocTrans.java

@@ -0,0 +1,36 @@
+package com.lantone.qc.trans.yuhangsy;
+
+import com.google.common.collect.Lists;
+import com.lantone.qc.pub.model.doc.CrisisInfoDoc;
+import com.lantone.qc.pub.model.vo.MedrecVo;
+import com.lantone.qc.pub.util.FastJsonUtils;
+import com.lantone.qc.trans.ModelDocTrans;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @Description: 危急值结构化信息
+ * @author: rengb
+ * @time: 2020/3/19 19:41
+ */
+public class YuhangsyCrisisInfoDocTrans extends ModelDocTrans {
+
+    @Override
+    public List<CrisisInfoDoc> extract(MedrecVo medrecVo) {
+        List<CrisisInfoDoc> retList = Lists.newArrayList();
+        List<String> contents = (List) medrecVo.getContent().get("content");
+        contents.forEach(content -> {
+            retList.add(getCrisisInfoDoc((Map) FastJsonUtils.getJsonToMap(content)));
+        });
+        return retList;
+    }
+
+    private CrisisInfoDoc getCrisisInfoDoc(Map<String, String> content) {
+        CrisisInfoDoc crisisInfoDoc = new CrisisInfoDoc();
+        crisisInfoDoc.setStructureMap(content);
+        crisisInfoDoc.setPageData((Map) content);
+        return crisisInfoDoc;
+    }
+
+}

+ 74 - 0
trans/src/main/java/com/lantone/qc/trans/yuhangsy/YuhangsyCrisisValueReportDocTrans.java

@@ -0,0 +1,74 @@
+package com.lantone.qc.trans.yuhangsy;
+
+import com.google.common.collect.Lists;
+import com.lantone.qc.pub.model.doc.CrisisValueReportDoc;
+import com.lantone.qc.pub.model.vo.MedrecVo;
+import com.lantone.qc.pub.util.FastJsonUtils;
+import com.lantone.qc.trans.ModelDocTrans;
+import com.lantone.qc.trans.comsis.ModelDocGenerate;
+import com.lantone.qc.trans.comsis.OrdinaryAssistant;
+import com.lantone.qc.trans.yuhangsy.util.YuhangsyCrisisValueReportHtmlAnalysis;
+import com.lantone.qc.trans.yuhangsy.util.YuhangsyHtmlAnalysis;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.collections.MapUtils;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @Description: 危急值记录文档生成
+ * @author: rengb
+ * @time: 2020/3/19 19:41
+ */
+@Slf4j
+public class YuhangsyCrisisValueReportDocTrans extends ModelDocTrans {
+
+    @Override
+    public List<CrisisValueReportDoc> extract(MedrecVo medrecVo) {
+        List<CrisisValueReportDoc> retList = Lists.newArrayList();
+        List<Map<String, Object>> contentMaps = (List) medrecVo.getContent().get("content");
+        contentMaps.forEach(contentMap -> {
+            try {
+                CrisisValueReportDoc crisisValueReportDoc = getCrisisValueReportDoc(contentMap);
+                if (crisisValueReportDoc != null) {
+                    retList.add(crisisValueReportDoc);
+                }
+            } catch (Exception e) {
+                log.error(e.getMessage(), e);
+            }
+        });
+        return retList;
+    }
+
+    private CrisisValueReportDoc getCrisisValueReportDoc(Map<String, Object> contentMap) {
+        String content = contentMap.get("xmlText").toString();
+        Map<String, String> structureMap = null;
+        if (contentMap.get("isParsed") != null && "1".equals(contentMap.get("isParsed").toString())) {
+            structureMap = (Map) FastJsonUtils.getJsonToMap(content);
+        } else {
+            String recTitle = contentMap.get("recTitle").toString();
+            String recTypeId = contentMap.get("recTypeId").toString();
+            YuhangsyHtmlAnalysis yhsyHtmlAnalysis = new YuhangsyCrisisValueReportHtmlAnalysis();
+            Map<String, String> sourceMap = yhsyHtmlAnalysis.analysis(content, recTitle, recTypeId);
+            if (MapUtils.isNotEmpty(sourceMap)) {
+                structureMap = OrdinaryAssistant.mapKeyContrast(sourceMap, keyContrasts);
+                structureMap.put("记录编号", contentMap.get("recId").toString());
+                structureMap.put("病历号", contentMap.get("behospitalCode") == null ? null : contentMap.get("behospitalCode").toString());
+            }
+        }
+        if (MapUtils.isNotEmpty(structureMap)) {
+            CrisisValueReportDoc crisisValueReportDoc = ModelDocGenerate.crisisValueReportDocGen(structureMap);
+            crisisValueReportDoc.setPageData((Map) structureMap);
+            return crisisValueReportDoc;
+        } else {
+            return null;
+        }
+    }
+
+    private List<String> keyContrasts = Lists.newArrayList(
+            "病历标题=标题",
+            "记录医师=医师签名",
+            "病情记录=病历内容"
+    );
+
+}

+ 77 - 0
trans/src/main/java/com/lantone/qc/trans/yuhangsy/YuhangsyCriticallyIllNoticeDocTrans.java

@@ -0,0 +1,77 @@
+package com.lantone.qc.trans.yuhangsy;
+
+import com.google.common.collect.Lists;
+import com.lantone.qc.pub.model.doc.CriticallyIllNoticeDoc;
+import com.lantone.qc.pub.model.vo.MedrecVo;
+import com.lantone.qc.pub.util.FastJsonUtils;
+import com.lantone.qc.trans.ModelDocTrans;
+import com.lantone.qc.trans.comsis.CommonAnalysisUtil;
+import com.lantone.qc.trans.comsis.ModelDocGenerate;
+import com.lantone.qc.trans.comsis.OrdinaryAssistant;
+import com.lantone.qc.trans.yuhangsy.util.YuhangsyCriticallyIllNoticeHtmlAnalysis;
+import com.lantone.qc.trans.yuhangsy.util.YuhangsyHtmlAnalysis;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.collections.MapUtils;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @Description: 病危通知书文档生成
+ * @author: rengb
+ * @time: 2020/3/19 19:41
+ */
+@Slf4j
+public class YuhangsyCriticallyIllNoticeDocTrans extends ModelDocTrans {
+
+    @Override
+    public List<CriticallyIllNoticeDoc> extract(MedrecVo medrecVo) {
+        List<CriticallyIllNoticeDoc> retList = Lists.newArrayList();
+        List<Map<String, Object>> contentMaps = (List) medrecVo.getContent().get("content");
+        contentMaps.forEach(contentMap -> {
+            try {
+                CriticallyIllNoticeDoc criticallyIllNoticeDoc = getCriticallyIllNoticeDoc(contentMap);
+                if (criticallyIllNoticeDoc != null) {
+                    retList.add(criticallyIllNoticeDoc);
+                }
+            } catch (Exception e) {
+                log.error(e.getMessage(), e);
+            }
+        });
+        return retList;
+    }
+
+    private CriticallyIllNoticeDoc getCriticallyIllNoticeDoc(Map<String, Object> contentMap) {
+        String content = contentMap.get("xmlText").toString();
+        Map<String, String> structureMap = null;
+        if (contentMap.get("isParsed") != null && "1".equals(contentMap.get("isParsed").toString())) {
+            structureMap = (Map) FastJsonUtils.getJsonToMap(content);
+        } else {
+            String recTitle = contentMap.get("recTitle").toString();
+            String recTypeId = contentMap.get("recTypeId").toString();
+            YuhangsyHtmlAnalysis yhsyHtmlAnalysis = new YuhangsyCriticallyIllNoticeHtmlAnalysis();
+            Map<String, String> sourceMap = yhsyHtmlAnalysis.analysis(content, recTitle, recTypeId);
+            if (MapUtils.isNotEmpty(sourceMap)) {
+                structureMap = OrdinaryAssistant.mapKeyContrast(sourceMap, keyContrasts);
+                structureMap.put("记录编号", contentMap.get("recId").toString());
+                structureMap.put("病历号", contentMap.get("behospitalCode") == null ? null : contentMap.get("behospitalCode").toString());
+            }
+        }
+        if (MapUtils.isNotEmpty(structureMap)) {
+            CriticallyIllNoticeDoc criticallyIllNoticeDoc = ModelDocGenerate.criticallyIllNoticeDocGen(structureMap);
+            criticallyIllNoticeDoc.setText(CommonAnalysisUtil.html2String(content));
+            criticallyIllNoticeDoc.setPageData((Map) structureMap);
+            return criticallyIllNoticeDoc;
+        } else {
+            return null;
+        }
+    }
+
+    private List<String> keyContrasts = Lists.newArrayList(
+            "患者姓名=姓名",
+            "现在我院=科别",
+            "医护人员签名签名日期=医生签名时间",
+            "目前诊断为=当前诊断"
+    );
+
+}

+ 68 - 0
trans/src/main/java/com/lantone/qc/trans/yuhangsy/YuhangsyDeathCaseDiscussDocTrans.java

@@ -0,0 +1,68 @@
+package com.lantone.qc.trans.yuhangsy;
+
+import com.google.common.collect.Lists;
+import com.lantone.qc.pub.model.doc.DeathCaseDiscussDoc;
+import com.lantone.qc.pub.model.vo.MedrecVo;
+import com.lantone.qc.pub.util.FastJsonUtils;
+import com.lantone.qc.trans.ModelDocTrans;
+import com.lantone.qc.trans.comsis.ModelDocGenerate;
+import com.lantone.qc.trans.comsis.OrdinaryAssistant;
+import com.lantone.qc.trans.yuhangsy.util.YuhangsyDeathCaseDiscussHtmlAnalysis;
+import com.lantone.qc.trans.yuhangsy.util.YuhangsyHtmlAnalysis;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.collections.MapUtils;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @Description: 死亡病例讨论记录文档生成
+ * @author: rengb
+ * @time: 2020/3/17 13:22
+ */
+@Slf4j
+public class YuhangsyDeathCaseDiscussDocTrans extends ModelDocTrans {
+
+    @Override
+    public DeathCaseDiscussDoc extract(MedrecVo medrecVo) {
+        DeathCaseDiscussDoc deathCaseDiscussDoc = null;
+        try {
+            Map<String, Object> contentMap = ((List<Map>) medrecVo.getContent().get("content")).get(0);
+            String content = contentMap.get("xmlText").toString();
+            Map<String, String> structureMap = null;
+            if (contentMap.get("isParsed") != null && "1".equals(contentMap.get("isParsed").toString())) {
+                structureMap = (Map) FastJsonUtils.getJsonToMap(content);
+            } else {
+                String recTitle = contentMap.get("recTitle").toString();
+                String recTypeId = contentMap.get("recTypeId").toString();
+                YuhangsyHtmlAnalysis yhsyHtmlAnalysis = new YuhangsyDeathCaseDiscussHtmlAnalysis();
+                Map<String, String> sourceMap = yhsyHtmlAnalysis.analysis(content, recTitle, recTypeId);
+                if (MapUtils.isNotEmpty(sourceMap)) {
+                    structureMap = OrdinaryAssistant.mapKeyContrast(sourceMap, keyContrasts);
+                    structureMap.put("记录编号", contentMap.get("recId").toString());
+                    structureMap.put("病历号", contentMap.get("behospitalCode") == null ? null : contentMap.get("behospitalCode").toString());
+                }
+            }
+            if (MapUtils.isNotEmpty(structureMap)) {
+                deathCaseDiscussDoc = ModelDocGenerate.deathCaseDiscussDocGen(structureMap);
+                deathCaseDiscussDoc.setPageData((Map) structureMap);
+            }
+        } catch (Exception e) {
+            log.error(e.getMessage(), e);
+        }
+        return deathCaseDiscussDoc;
+    }
+
+    private List<String> keyContrasts = Lists.newArrayList(
+            "患者姓名=姓名",
+            "病情摘要=病史简介",
+            "讨论日期=讨论时间",
+            "死亡主持人签名=主持人",
+            "参加讨论人员(注明职称、职务)=参加人员",
+            "讨论意见(对诊断、治疗、抢救的意见,死亡原因分析及经验教训等的记录)=讨论内容",
+            "记录者签名=记录医生",
+            "记录者签名日期=记录时间",
+            "总结=主持人小结"
+    );
+
+}

+ 67 - 0
trans/src/main/java/com/lantone/qc/trans/yuhangsy/YuhangsyDeathRecordDocTrans.java

@@ -0,0 +1,67 @@
+package com.lantone.qc.trans.yuhangsy;
+
+import com.google.common.collect.Lists;
+import com.lantone.qc.pub.model.doc.DeathRecordDoc;
+import com.lantone.qc.pub.model.vo.MedrecVo;
+import com.lantone.qc.pub.util.FastJsonUtils;
+import com.lantone.qc.trans.ModelDocTrans;
+import com.lantone.qc.trans.comsis.CommonAnalysisUtil;
+import com.lantone.qc.trans.comsis.ModelDocGenerate;
+import com.lantone.qc.trans.comsis.OrdinaryAssistant;
+import com.lantone.qc.trans.yuhangsy.util.YuhangsyDeathRecordHtmlAnalysis;
+import com.lantone.qc.trans.yuhangsy.util.YuhangsyHtmlAnalysis;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.collections.MapUtils;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @Description: 死亡记录文档生成
+ * @author: rengb
+ * @time: 2020/3/17 13:23
+ */
+@Slf4j
+public class YuhangsyDeathRecordDocTrans extends ModelDocTrans {
+
+    @Override
+    public DeathRecordDoc extract(MedrecVo medrecVo) {
+        DeathRecordDoc deathRecordDoc = null;
+        try {
+            Map<String, Object> contentMap = ((List<Map>) medrecVo.getContent().get("content")).get(0);
+            String content = contentMap.get("xmlText").toString();
+            Map<String, String> structureMap = null;
+            if (contentMap.get("isParsed") != null && "1".equals(contentMap.get("isParsed").toString())) {
+                structureMap = (Map) FastJsonUtils.getJsonToMap(content);
+            } else {
+                String recTitle = contentMap.get("recTitle").toString();
+                String recTypeId = contentMap.get("recTypeId").toString();
+                YuhangsyHtmlAnalysis yhsyHtmlAnalysis = new YuhangsyDeathRecordHtmlAnalysis();
+                Map<String, String> sourceMap = yhsyHtmlAnalysis.analysis(content, recTitle, recTypeId);
+                if (MapUtils.isNotEmpty(sourceMap)) {
+                    structureMap = OrdinaryAssistant.mapKeyContrast(sourceMap, keyContrasts);
+                    structureMap.put("记录编号", contentMap.get("recId").toString());
+                    structureMap.put("病历号", contentMap.get("behospitalCode") == null ? null : contentMap.get("behospitalCode").toString());
+                }
+            }
+            if (MapUtils.isNotEmpty(structureMap)) {
+                deathRecordDoc = ModelDocGenerate.deathRecordDocGen(structureMap);
+                deathRecordDoc.setText(CommonAnalysisUtil.html2String(content));
+                deathRecordDoc.setPageData((Map) structureMap);
+            }
+        } catch (Exception e) {
+            log.error(e.getMessage(), e);
+        }
+        return deathRecordDoc;
+    }
+
+    private List<String> keyContrasts = Lists.newArrayList(
+            "入院时情况(简要病史、阳性体征、有关实验室及器械检查结果)=入院情况",
+            "住院经过及抢救经过=诊疗经过",
+            "尸体病理解剖情况=尸检",
+            "实验室检查=医技检查",
+            "实验室检查=医技检查",
+            "记录医师=记录医生"
+    );
+
+}

+ 90 - 0
trans/src/main/java/com/lantone/qc/trans/yuhangsy/YuhangsyDifficultCaseDiscussDocTrans.java

@@ -0,0 +1,90 @@
+package com.lantone.qc.trans.yuhangsy;
+
+import com.google.common.collect.Lists;
+import com.lantone.qc.pub.model.doc.DifficultCaseDiscussDoc;
+import com.lantone.qc.pub.model.vo.MedrecVo;
+import com.lantone.qc.pub.util.FastJsonUtils;
+import com.lantone.qc.trans.ModelDocTrans;
+import com.lantone.qc.trans.comsis.ModelDocGenerate;
+import com.lantone.qc.trans.comsis.OrdinaryAssistant;
+import com.lantone.qc.trans.yuhangsy.util.YuhangsyDifficultCaseDiscussHtmlAnalysis;
+import com.lantone.qc.trans.yuhangsy.util.YuhangsyHtmlAnalysis;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.collections.MapUtils;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @Description: 疑难病例讨论记录文档生成
+ * @author: rengb
+ * @time: 2020/3/17 13:23
+ */
+@Slf4j
+public class YuhangsyDifficultCaseDiscussDocTrans extends ModelDocTrans {
+
+    @Override
+    public List<DifficultCaseDiscussDoc> extract(MedrecVo medrecVo) {
+        List<DifficultCaseDiscussDoc> retList = Lists.newArrayList();
+        List<Map<String, Object>> contentMaps = (List) medrecVo.getContent().get("content");
+        contentMaps.forEach(contentMap -> {
+            try {
+                DifficultCaseDiscussDoc difficultCaseDiscussDoc = getDifficultCaseDiscussDoc(contentMap);
+                if (difficultCaseDiscussDoc != null) {
+                    retList.add(difficultCaseDiscussDoc);
+                }
+            } catch (Exception e) {
+                log.error(e.getMessage(), e);
+            }
+        });
+        return retList;
+    }
+
+    private DifficultCaseDiscussDoc getDifficultCaseDiscussDoc(Map<String, Object> contentMap) {
+        String content = contentMap.get("xmlText").toString();
+        Map<String, String> structureMap = null;
+        if (contentMap.get("isParsed") != null && "1".equals(contentMap.get("isParsed").toString())) {
+            structureMap = (Map) FastJsonUtils.getJsonToMap(content);
+        } else {
+            String recTitle = contentMap.get("recTitle").toString();
+            String recTypeId = contentMap.get("recTypeId").toString();
+            YuhangsyHtmlAnalysis yhsyHtmlAnalysis = new YuhangsyDifficultCaseDiscussHtmlAnalysis();
+            Map<String, String> sourceMap = yhsyHtmlAnalysis.analysis(content, recTitle, recTypeId);
+            if (!sourceMap.containsKey("具体讨论意见") && sourceMap.containsKey("参加人员")) {
+                String participant = sourceMap.get("参加人员");
+                if (participant.contains("医师汇报病史")) {
+                    String parCrew = "";
+                    //参加人员
+                    if (participant.indexOf("医师汇报病史") > 2) {
+                        parCrew = participant.substring(0, participant.indexOf("医师汇报病史") - 2);
+                    }
+                    //具体讨论意见
+                    String SpeDiscussion = participant.substring(Math.max(0, participant.indexOf("医师汇报病史") - 2));
+                    sourceMap.put("参加人员", parCrew);
+                    sourceMap.put("具体讨论意见", SpeDiscussion);
+                }
+            }
+
+
+            if (MapUtils.isNotEmpty(sourceMap)) {
+                structureMap = OrdinaryAssistant.mapKeyContrast(sourceMap, keyContrasts);
+                structureMap.put("记录编号", contentMap.get("recId").toString());
+                structureMap.put("病历号", contentMap.get("behospitalCode") == null ? null : contentMap.get("behospitalCode").toString());
+            }
+        }
+        if (MapUtils.isNotEmpty(structureMap)) {
+            DifficultCaseDiscussDoc difficultCaseDiscussDoc = ModelDocGenerate.difficultCaseDiscussDocGen(structureMap);
+            difficultCaseDiscussDoc.setPageData((Map) structureMap);
+            return difficultCaseDiscussDoc;
+        } else {
+            return null;
+        }
+    }
+
+    private List<String> keyContrasts = Lists.newArrayList(
+            "病历记录时间=记录时间",
+            "记录医师=记录医生签名",
+            "病程内容=汇报病史"
+    );
+
+}

+ 331 - 0
trans/src/main/java/com/lantone/qc/trans/yuhangsy/YuhangsyDocTrans.java

@@ -0,0 +1,331 @@
+package com.lantone.qc.trans.yuhangsy;
+
+import com.google.common.collect.Lists;
+import com.lantone.qc.pub.model.InputInfo;
+import com.lantone.qc.pub.model.vo.MedrecVo;
+import com.lantone.qc.pub.model.vo.QueryVo;
+import com.lantone.qc.pub.util.ListUtil;
+import com.lantone.qc.trans.DocTrans;
+import com.lantone.qc.trans.comsis.OrdinaryAssistant;
+import lombok.extern.slf4j.Slf4j;
+
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+/**
+ * @ClassName : yhsyDocTrans
+ * @Description :
+ * @Author : 楼辉荣
+ * @Date: 2020-03-03 19:47
+ */
+@Slf4j
+public class YuhangsyDocTrans extends DocTrans {
+
+    @Override
+    protected InputInfo extract(QueryVo queryVo) {
+        InputInfo inputInfo = new InputInfo();
+        for (MedrecVo i : queryVo.getMedrec()) {
+            if (i.getTitle() != null) {
+                if (i.getTitle().equals("会诊")) {
+                    YuhangsyConsultationDocTrans consultationDocTrans = new YuhangsyConsultationDocTrans();
+                    inputInfo.setConsultationDocs(consultationDocTrans.extract(i));
+                }
+                if (i.getTitle().equals("手术")) {
+                    YuhangsyOperationDocTrans operationDocTrans = new YuhangsyOperationDocTrans();
+                    inputInfo.setOperationDocs(operationDocTrans.extract(i));
+                }
+                if (i.getTitle().equals("转科")) {
+                    YuhangsyTransferRecordDocTrans transferRecordDocTrans = new YuhangsyTransferRecordDocTrans();
+                    inputInfo.setTransferRecordDocs(transferRecordDocTrans.extract(i));
+                }
+                if (i.getTitle().equals("入院记录")) {
+                    YuhangsyBeHospitalizedDocTrans beHospitalizedDocTrans = new YuhangsyBeHospitalizedDocTrans();
+                    inputInfo.setBeHospitalizedDoc(beHospitalizedDocTrans.extract(i));
+                }
+                if (i.getTitle().equals("输血/血制品病程记录")) {
+                    YuhangsyClinicalBloodDocTrans clinicalBloodDocTrans = new YuhangsyClinicalBloodDocTrans();
+                    inputInfo.setClinicalBloodDocs(clinicalBloodDocTrans.extract(i));
+                }
+                if (i.getTitle().equals("输血后效果评价")) {
+                    YuhangsyClinicBloodEffectDocTrans clinicBloodEffectDocTrans = new YuhangsyClinicBloodEffectDocTrans();
+                    inputInfo.setClinicBloodEffectDocs(clinicBloodEffectDocTrans.extract(i));
+                }
+                if (i.getTitle().equals("危急值记录")) {
+                    YuhangsyCrisisValueReportDocTrans crisisValueReportDocTrans = new YuhangsyCrisisValueReportDocTrans();
+                    inputInfo.setCrisisValueReportDocs(crisisValueReportDocTrans.extract(i));
+                }
+                if (i.getTitle().equals("危急值")) {
+                    YuhangsyCrisisInfoDocTrans crisisInfoDocTrans = new YuhangsyCrisisInfoDocTrans();
+                    inputInfo.setCrisisInfoDocs(crisisInfoDocTrans.extract(i));
+                }
+                if (i.getTitle().equals("病危通知书")) {
+                    YuhangsyCriticallyIllNoticeDocTrans criticallyIllNoticeDocTrans = new YuhangsyCriticallyIllNoticeDocTrans();
+                    inputInfo.setCriticallyIllNoticeDocs(criticallyIllNoticeDocTrans.extract(i));
+                }
+                if (i.getTitle().equals("死亡病例讨论记录")) {
+                    YuhangsyDeathCaseDiscussDocTrans deathCaseDiscussDocTrans = new YuhangsyDeathCaseDiscussDocTrans();
+                    inputInfo.setDeathCaseDiscussDoc(deathCaseDiscussDocTrans.extract(i));
+                }
+                if (i.getTitle().equals("死亡记录")) {
+                    YuhangsyDeathRecordDocTrans deathRecordDocTrans = new YuhangsyDeathRecordDocTrans();
+                    inputInfo.setDeathRecordDoc(deathRecordDocTrans.extract(i));
+                }
+                if (i.getTitle().equals("疑难病例讨论记录")) {
+                    YuhangsyDifficultCaseDiscussDocTrans difficultCaseDiscussDocTrans = new YuhangsyDifficultCaseDiscussDocTrans();
+                    inputInfo.setDifficultCaseDiscussDocs(difficultCaseDiscussDocTrans.extract(i));
+                }
+                if (i.getTitle().equals("医嘱信息")) {
+                    YuhangsyDoctorAdviceDocTrans doctorAdviceDocTrans = new YuhangsyDoctorAdviceDocTrans();
+                    inputInfo.setDoctorAdviceDocs(doctorAdviceDocTrans.extract(i));
+                }
+                if (i.getTitle().equals("值班交接制度")) {
+                    YuhangsyDutyShiftSystemDocTrans dutyShiftSystemDocTrans = new YuhangsyDutyShiftSystemDocTrans();
+                    inputInfo.setDutyShiftSystemDocs(dutyShiftSystemDocTrans.extract(i));
+                }
+                if (i.getTitle().equals("首次病程录")) {
+                    YuhangsyFirstCourseRecordDocTrans firstCourseRecordDocTrans = new YuhangsyFirstCourseRecordDocTrans();
+                    inputInfo.setFirstCourseRecordDoc(firstCourseRecordDocTrans.extract(i));
+                }
+                if (i.getTitle().equals("病案首页")) {
+                    YuhangsyFirstPageRecordDocTrans firstPageRecordDocTrans = new YuhangsyFirstPageRecordDocTrans();
+                    inputInfo.setFirstPageRecordDoc(firstPageRecordDocTrans.extract(i));
+                }
+                if (i.getTitle().equals("出院小结")) {
+                    YuhangsyLeaveHospitalDocTrans leaveHospitalDocTrans = new YuhangsyLeaveHospitalDocTrans();
+                    inputInfo.setLeaveHospitalDoc(leaveHospitalDocTrans.extract(i));
+                }
+                if (i.getTitle().equals("抢救记录")) {
+                    YuhangsyRescueDocTrans rescueDocTrans = new YuhangsyRescueDocTrans();
+                    inputInfo.setRescueDocs(rescueDocTrans.extract(i));
+                }
+                if (i.getTitle().equals("阶段小结")) {
+                    YuhangsyStagesSummaryDocTrans stagesSummaryDocTrans = new YuhangsyStagesSummaryDocTrans();
+                    inputInfo.setStagesSummaryDocs(stagesSummaryDocTrans.extract(i));
+                }
+                if (i.getTitle().equals("查房记录")) {
+                    YuhangsyThreeLevelWardDocTrans threeLevelWardDocTrans = new YuhangsyThreeLevelWardDocTrans();
+                    threeLevelWardDocTrans.setOperationDocs(inputInfo.getOperationDocs());
+                    inputInfo.setThreeLevelWardDocs(threeLevelWardDocTrans.extract(i));
+                }
+                if (i.getTitle().equals("住院病历信息")) {
+                    YuhangsyMedicalRecordInfoDocTrans medicalRecordInfoDocTrans = new YuhangsyMedicalRecordInfoDocTrans();
+                    inputInfo.setMedicalRecordInfoDoc(medicalRecordInfoDocTrans.extract(i));
+                }
+                if (i.getTitle().equals("化验")) {
+                    YuhangsyLisDocTrans lisDocTrans = new YuhangsyLisDocTrans();
+                    inputInfo.setLisDocs(lisDocTrans.extract(i));
+                }
+                if (i.getTitle().equals("辅检")) {
+                    YuhangsyPacsDocTrans pacsDocTrans = new YuhangsyPacsDocTrans();
+                    inputInfo.setPacsDocs(pacsDocTrans.extract(i));
+                }
+                if (i.getTitle().equals("门诊")) {
+                    YuhangsyOutDepDocTrans outDepDocTrans = new YuhangsyOutDepDocTrans();
+                    inputInfo.setBeHospitalizedDoc(outDepDocTrans.extract(i));
+                }
+                if (i.getTitle().equals("知情同意书")) {
+                    YuhangsyInformedConsentDocTrans informedConsentDocTrans = new YuhangsyInformedConsentDocTrans();
+                    inputInfo.setInformedConsentDoc(informedConsentDocTrans.extract(i));
+                }
+                if (i.getTitle().equals("有创操作")) {
+                    YuhangsyInvasiveOperationDocTrans invasiveOperationDocTrans = new YuhangsyInvasiveOperationDocTrans();
+                    inputInfo.setInvasiveOperationDocs(invasiveOperationDocTrans.extract(i));
+                }
+                /*******************************VTE评分 trans解析*****************************************/
+                if (i.getTitle().equals("VTE评分")) {
+                    YuhangsyVTEGradeDocTrans vteGradeDocTrans = new YuhangsyVTEGradeDocTrans();
+                    inputInfo.setVteGradeDoc(vteGradeDocTrans.extract(i));
+                }
+                /*******************************ADL评分 trans解析*****************************************/
+                if (i.getTitle().equals("ADL评分")) {
+                    YuhangsyADLGradeDocTrans adlGradeDocTrans = new YuhangsyADLGradeDocTrans();
+                    inputInfo.setAdlGradeDoc(adlGradeDocTrans.extract(i));
+                }
+                /*******************************手麻记录 trans解析*****************************************/
+                if (i.getTitle().equals("手麻记录")) {
+                    AnesthesiaRecordDocTrans anesthesiaRecordDocTrans= new AnesthesiaRecordDocTrans();
+                    inputInfo.setAnesthesiaRecordDocs(anesthesiaRecordDocTrans.extract(i));
+                }
+                /*******************************VTE评分 trans解析*****************************************/
+                if (i.getTitle().equals("VTE评分")) {
+                    YuhangsyVTEGradeDocTrans vteGradeDocTrans = new YuhangsyVTEGradeDocTrans();
+                    inputInfo.setVteGradeDoc(vteGradeDocTrans.extract(i));
+                }
+                /*******************************ADL评分 trans解析*****************************************/
+                if (i.getTitle().equals("ADL评分")) {
+                    YuhangsyADLGradeDocTrans adlGradeDocTrans = new YuhangsyADLGradeDocTrans();
+                    inputInfo.setAdlGradeDoc(adlGradeDocTrans.extract(i));
+                }
+                /*******************************手麻记录 trans解析*****************************************/
+                if (i.getTitle().equals("手麻记录")) {
+                    AnesthesiaRecordDocTrans anesthesiaRecordDocTrans= new AnesthesiaRecordDocTrans();
+                    inputInfo.setAnesthesiaRecordDocs(anesthesiaRecordDocTrans.extract(i));
+                }
+            }
+        }
+        pageDataHandle(inputInfo);
+        return inputInfo;
+    }
+
+    private void pageDataHandle(InputInfo inputInfo) {
+        if (inputInfo.getBeHospitalizedDoc() != null) {
+            inputInfo.getPageData().put("入院记录", Lists.newArrayList(inputInfo.getBeHospitalizedDoc().getPageData()));
+        }
+        if (inputInfo.getDeathCaseDiscussDoc() != null) {
+            inputInfo.getPageData().put("死亡病例讨论记录", Lists.newArrayList(inputInfo.getDeathCaseDiscussDoc().getPageData()));
+        }
+        if (inputInfo.getDeathRecordDoc() != null) {
+            inputInfo.getPageData().put("死亡记录", Lists.newArrayList(inputInfo.getDeathRecordDoc().getPageData()));
+        }
+        if (inputInfo.getFirstCourseRecordDoc() != null) {
+            inputInfo.getPageData().put("首次病程录", Lists.newArrayList(inputInfo.getFirstCourseRecordDoc().getPageData()));
+        }
+        if (inputInfo.getLeaveHospitalDoc() != null) {
+            inputInfo.getPageData().put("出院小结", Lists.newArrayList(inputInfo.getLeaveHospitalDoc().getPageData()));
+        }
+        if (inputInfo.getFirstPageRecordDoc() != null) {
+            inputInfo.getPageData().put("病案首页", Lists.newArrayList(inputInfo.getFirstPageRecordDoc().getPageData()));
+        }
+
+        if (ListUtil.isNotEmpty(inputInfo.getClinicalBloodDocs())) {
+            inputInfo.getPageData().put("输血/血制品病程记录", inputInfo.getClinicalBloodDocs().stream().map(i -> i.getPageData()).collect(Collectors.toList()));
+//            inputInfo.setClinicalBloodDocs(inputInfo.getClinicalBloodDocs().stream().filter(i -> StringUtil.isNotBlank(i.getText()) && !i.getText().contains("输白蛋白")).collect(Collectors.toList()));
+        }
+//        if (inputInfo.getInformedConsentDoc() != null) {
+//            inputInfo.getPageData().put("知情同意书", Lists.newArrayList(inputInfo.getInformedConsentDoc().getPageData()));
+//        }
+        if (ListUtil.isNotEmpty(inputInfo.getInformedConsentDoc())) {
+            inputInfo.getPageData().put("知情同意书", inputInfo.getInformedConsentDoc().stream().map(i -> i.getPageData()).collect(Collectors.toList()));
+        }
+        if (ListUtil.isNotEmpty(inputInfo.getClinicBloodEffectDocs())) {
+            inputInfo.getPageData().put(
+                    "输血后效果评价",
+                    inputInfo.getClinicBloodEffectDocs()
+                            .stream()
+                            .map(i -> i.getPageData())
+                            .sorted((map1, map2) -> OrdinaryAssistant.pageDataTimeSort(map1, map2, "记录时间", "yyyy-MM-dd HH:mm"))
+                            .collect(Collectors.toList()));
+        }
+        if (ListUtil.isNotEmpty(inputInfo.getCrisisValueReportDocs())) {
+            inputInfo.getPageData().put("危急值记录", inputInfo.getCrisisValueReportDocs().stream().map(i -> i.getPageData()).collect(Collectors.toList()));
+        }
+        if (ListUtil.isNotEmpty(inputInfo.getCriticallyIllNoticeDocs())) {
+            inputInfo.getPageData().put("病危通知书", inputInfo.getCriticallyIllNoticeDocs().stream().map(i -> i.getPageData()).collect(Collectors.toList()));
+        }
+        if (ListUtil.isNotEmpty(inputInfo.getDifficultCaseDiscussDocs())) {
+            inputInfo.getPageData().put("疑难病例讨论记录", inputInfo.getDifficultCaseDiscussDocs().stream().map(i -> i.getPageData()).collect(Collectors.toList()));
+        }
+        if (ListUtil.isNotEmpty(inputInfo.getDutyShiftSystemDocs())) {
+            inputInfo.getPageData().put("值班交接制度", inputInfo.getDutyShiftSystemDocs().stream().map(i -> i.getPageData()).collect(Collectors.toList()));
+        }
+        if (ListUtil.isNotEmpty(inputInfo.getRescueDocs())) {
+            inputInfo.getPageData().put("抢救记录", inputInfo.getRescueDocs().stream().map(i -> i.getPageData()).collect(Collectors.toList()));
+        }
+        if (ListUtil.isNotEmpty(inputInfo.getStagesSummaryDocs())) {
+            inputInfo.getPageData().put("阶段小结", inputInfo.getStagesSummaryDocs().stream().map(i -> i.getPageData()).collect(Collectors.toList()));
+        }
+        if (ListUtil.isNotEmpty(inputInfo.getThreeLevelWardDocs())) {
+            inputInfo.getPageData().put("查房记录", inputInfo.getThreeLevelWardDocs().get(0).getAllDoctorWradDocs().stream().map(i -> i.getPageData()).collect(Collectors.toList()));
+        }
+        if (ListUtil.isNotEmpty(inputInfo.getConsultationDocs())) {
+            List<Map<String, Object>> crPd = inputInfo.getConsultationDocs()
+                    .stream()
+                    .filter(consultationDoc -> consultationDoc != null && consultationDoc.getConsultationRecordDoc() != null)
+                    .map(consultationDoc -> consultationDoc.getConsultationRecordDoc().getPageData())
+                    .collect(Collectors.toList());
+            if (ListUtil.isNotEmpty(crPd)) {
+                inputInfo.getPageData().put("会诊记录", crPd);
+            }
+
+            List<Map<String, Object>> caPd = inputInfo.getConsultationDocs()
+                    .stream()
+                    .filter(consultationDoc -> consultationDoc != null && consultationDoc.getConsultationApplicationDoc() != null)
+                    .map(consultationDoc -> consultationDoc.getConsultationApplicationDoc().getPageData())
+                    .collect(Collectors.toList());
+            if (ListUtil.isNotEmpty(caPd)) {
+                inputInfo.getPageData().put("会诊申请单", caPd);
+            }
+
+            List<Map<String, Object>> ctPd = inputInfo.getConsultationDocs()
+                    .stream()
+                    .filter(consultationDoc -> consultationDoc != null && consultationDoc.getConsultationResultsDoc() != null)
+                    .map(consultationDoc -> consultationDoc.getConsultationResultsDoc().getPageData())
+                    .collect(Collectors.toList());
+            if (ListUtil.isNotEmpty(ctPd)) {
+                inputInfo.getPageData().put("会诊结果单", ctPd);
+            }
+        }
+        if (ListUtil.isNotEmpty(inputInfo.getOperationDocs())) {
+            List<Map<String, Object>> odPageDataList = inputInfo.getOperationDocs()
+                    .stream()
+                    .filter(operationDoc -> operationDoc != null && operationDoc.getOperationDiscussionDoc() != null)
+                    .map(operationDoc -> operationDoc.getOperationDiscussionDoc().getPageData())
+                    .collect(Collectors.toList());
+            if (ListUtil.isNotEmpty(odPageDataList)) {
+                inputInfo.getPageData().put("术后首次病程及谈话记录", odPageDataList);
+            }
+
+            List<Map<String, Object>> orPageDataList = inputInfo.getOperationDocs()
+                    .stream()
+                    .filter(operationDoc -> operationDoc != null && operationDoc.getOperationRecordDoc() != null)
+                    .map(operationDoc -> operationDoc.getOperationRecordDoc().getPageData())
+                    .collect(Collectors.toList());
+            if (ListUtil.isNotEmpty(orPageDataList)) {
+                inputInfo.getPageData().put("手术记录", orPageDataList);
+            }
+
+            List<Map<String, Object>> InformedDataList = inputInfo.getOperationDocs()
+                    .stream()
+                    .filter(operationDoc -> operationDoc != null && operationDoc.getOperationInformedConsentDoc() != null)
+                    .map(operationDoc -> operationDoc.getOperationInformedConsentDoc().getPageData())
+                    .collect(Collectors.toList());
+            if (ListUtil.isNotEmpty(InformedDataList)) {
+                inputInfo.getPageData().put("手术知情同意书", InformedDataList);
+            }
+
+            List<Map<String, Object>> pdPageDataList = inputInfo.getOperationDocs()
+                    .stream()
+                    .filter(operationDoc -> operationDoc != null && operationDoc.getPreoperativeDiscussionDoc() != null)
+                    .map(operationDoc -> operationDoc.getPreoperativeDiscussionDoc().getPageData())
+                    .collect(Collectors.toList());
+            if (ListUtil.isNotEmpty(pdPageDataList)) {
+                inputInfo.getPageData().put("术前讨论、术前小结", pdPageDataList);
+            }
+        }
+        if (inputInfo.getTransferRecordDocs() != null) {
+            if (ListUtil.isNotEmpty(inputInfo.getTransferRecordDocs().getTransferIntoDocs())) {
+                inputInfo.getPageData().put(
+                        "转入记录",
+                        inputInfo.getTransferRecordDocs().getTransferIntoDocs()
+                                .stream()
+                                .filter(i -> i != null)
+                                .map(i -> i.getPageData())
+                                .collect(Collectors.toList())
+                );
+            }
+
+            if (ListUtil.isNotEmpty(inputInfo.getTransferRecordDocs().getTransferOutDocs())) {
+                inputInfo.getPageData().put(
+                        "转出记录",
+                        inputInfo.getTransferRecordDocs().getTransferOutDocs()
+                                .stream()
+                                .filter(i -> i != null)
+                                .map(i -> i.getPageData())
+                                .collect(Collectors.toList())
+                );
+            }
+        }
+
+        if (ListUtil.isNotEmpty(inputInfo.getInvasiveOperationDocs())) {
+            inputInfo.getPageData().put(
+                    "有创操作",
+                    inputInfo.getInvasiveOperationDocs()
+                            .stream()
+                            .filter(i -> i != null)
+                            .map(i -> i.getPageData())
+                            .collect(Collectors.toList())
+            );
+        }
+    }
+}

+ 36 - 0
trans/src/main/java/com/lantone/qc/trans/yuhangsy/YuhangsyDoctorAdviceDocTrans.java

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

+ 72 - 0
trans/src/main/java/com/lantone/qc/trans/yuhangsy/YuhangsyDutyShiftSystemDocTrans.java

@@ -0,0 +1,72 @@
+package com.lantone.qc.trans.yuhangsy;
+
+import com.google.common.collect.Lists;
+import com.lantone.qc.pub.model.doc.DutyShiftSystemDoc;
+import com.lantone.qc.pub.model.vo.MedrecVo;
+import com.lantone.qc.pub.util.FastJsonUtils;
+import com.lantone.qc.trans.ModelDocTrans;
+import com.lantone.qc.trans.comsis.ModelDocGenerate;
+import com.lantone.qc.trans.comsis.OrdinaryAssistant;
+import com.lantone.qc.trans.yuhangsy.util.YuhangsyDutyShiftSystemHtmlAnalysis;
+import com.lantone.qc.trans.yuhangsy.util.YuhangsyHtmlAnalysis;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.collections.MapUtils;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @Description: 值班交接制度文档生成
+ * @author: rengb
+ * @time: 2020/3/17 13:24
+ */
+@Slf4j
+public class YuhangsyDutyShiftSystemDocTrans extends ModelDocTrans {
+
+    @Override
+    public List<DutyShiftSystemDoc> extract(MedrecVo medrecVo) {
+        List<DutyShiftSystemDoc> retList = Lists.newArrayList();
+        List<Map<String, Object>> contentMaps = (List) medrecVo.getContent().get("content");
+        contentMaps.forEach(contentMap -> {
+            try {
+                DutyShiftSystemDoc dutyShiftSystemDoc = getDutyShiftSystemDoc(contentMap);
+                if (dutyShiftSystemDoc != null) {
+                    retList.add(dutyShiftSystemDoc);
+                }
+            } catch (Exception e) {
+                log.error(e.getMessage(), e);
+            }
+        });
+        return retList;
+    }
+
+    private DutyShiftSystemDoc getDutyShiftSystemDoc(Map<String, Object> contentMap) {
+        String content = contentMap.get("xmlText").toString();
+        Map<String, String> structureMap = null;
+        if (contentMap.get("isParsed") != null && "1".equals(contentMap.get("isParsed").toString())) {
+            structureMap = (Map) FastJsonUtils.getJsonToMap(content);
+        } else {
+            String recTitle = contentMap.get("recTitle").toString();
+            String recTypeId = contentMap.get("recTypeId").toString();
+            YuhangsyHtmlAnalysis yhsyHtmlAnalysis = new YuhangsyDutyShiftSystemHtmlAnalysis();
+            Map<String, String> sourceMap = yhsyHtmlAnalysis.analysis(content, recTitle, recTypeId);
+            if (MapUtils.isNotEmpty(sourceMap)) {
+                structureMap = OrdinaryAssistant.mapKeyContrast(sourceMap, keyContrasts);
+                structureMap.put("记录编号", contentMap.get("recId").toString());
+                structureMap.put("病历号", contentMap.get("behospitalCode") == null ? null : contentMap.get("behospitalCode").toString());
+            }
+        }
+        if (MapUtils.isNotEmpty(structureMap)) {
+            DutyShiftSystemDoc dutyShiftSystemDoc = ModelDocGenerate.dutyShiftSystemDocGen(structureMap);
+            dutyShiftSystemDoc.setPageData((Map) structureMap);
+            return dutyShiftSystemDoc;
+        } else {
+            return null;
+        }
+    }
+
+    private List<String> keyContrasts = Lists.newArrayList(
+
+    );
+
+}

+ 83 - 0
trans/src/main/java/com/lantone/qc/trans/yuhangsy/YuhangsyFirstCourseRecordDocTrans.java

@@ -0,0 +1,83 @@
+package com.lantone.qc.trans.yuhangsy;
+
+import com.google.common.collect.Lists;
+import com.google.common.collect.Maps;
+import com.lantone.qc.pub.model.doc.FirstCourseRecordDoc;
+import com.lantone.qc.pub.model.vo.MedrecVo;
+import com.lantone.qc.pub.util.FastJsonUtils;
+import com.lantone.qc.pub.util.StringUtil;
+import com.lantone.qc.trans.ModelDocTrans;
+import com.lantone.qc.trans.comsis.CommonAnalysisUtil;
+import com.lantone.qc.trans.comsis.ModelDocGenerate;
+import com.lantone.qc.trans.comsis.OrdinaryAssistant;
+import com.lantone.qc.trans.yuhangsy.util.YuhangsyFirstCourseRecordHtmlAnalysis;
+import com.lantone.qc.trans.yuhangsy.util.YuhangsyHtmlAnalysis;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.collections.MapUtils;
+
+import java.util.List;
+import java.util.Map;
+
+import static com.lantone.qc.trans.comsis.ModelDocGenerate.structureMapJoin;
+
+/**
+ * @Description: 首次病程录文档生成
+ * @author: rengb
+ * @time: 2020/3/17 13:25
+ */
+@Slf4j
+public class YuhangsyFirstCourseRecordDocTrans extends ModelDocTrans {
+
+    @Override
+    public FirstCourseRecordDoc extract(MedrecVo medrecVo) {
+        FirstCourseRecordDoc firstCourseRecordDoc = null;
+        try {
+            Map<String, Object> contentMap = ((List<Map>) medrecVo.getContent().get("content")).get(0);
+            String content = contentMap.get("xmlText").toString();
+            Map<String, String> structureMap = null;
+            if (contentMap.get("isParsed") != null && "1".equals(contentMap.get("isParsed").toString())) {
+                structureMap = (Map) FastJsonUtils.getJsonToMap(content);
+            } else {
+                String recTitle = contentMap.get("recTitle").toString();
+                String recTypeId = contentMap.get("recTypeId").toString();
+                YuhangsyHtmlAnalysis yhsyHtmlAnalysis = new YuhangsyFirstCourseRecordHtmlAnalysis();
+                Map<String, String> sourceMap = yhsyHtmlAnalysis.analysis(content, recTitle, recTypeId);
+                if (MapUtils.isNotEmpty(sourceMap)) {
+                    sourceMap = removeSerialNumber(sourceMap);
+                    structureMap = OrdinaryAssistant.mapKeyContrast(sourceMap, keyContrasts);
+                    structureMap.put("记录编号", contentMap.get("recId").toString());
+                    structureMap.put("病历号", contentMap.get("behospitalCode") == null ? null : contentMap.get("behospitalCode").toString());
+                    structureMap.put("标题", recTitle);
+                }
+            }
+            if (StringUtil.isNotBlank(structureMap.get("医生签名"))) {
+                structureMap.put("医生签名", structureMap.get("医生签名").replaceAll("医生签名", ""));
+            }
+            if (MapUtils.isNotEmpty(structureMap)) {
+                firstCourseRecordDoc = ModelDocGenerate.firstCourseRecordDocGen(structureMap);
+                firstCourseRecordDoc.setText(CommonAnalysisUtil.html2String(content));
+                firstCourseRecordDoc.setPageData((Map) structureMap);
+                List<String> keys = Lists.newArrayList("需求评估", "预期目标", "诊疗计划", "治疗监测计划");
+                String treatPlanJoin = structureMapJoin(structureMap, keys);
+                firstCourseRecordDoc.getTreatPlanLabel().setAiText(treatPlanJoin);
+            }
+        } catch (Exception e) {
+            log.error(e.getMessage(), e);
+        }
+        return firstCourseRecordDoc;
+    }
+
+    private Map<String, String> removeSerialNumber(Map<String, String> sourceMap) {
+        Map<String, String> structureMap = Maps.newLinkedHashMap();
+        sourceMap.forEach((key, value) -> structureMap.put(key.replaceAll("[一二三四五六()().123456]", ""), value));
+        return structureMap;
+    }
+
+    private List<String>    keyContrasts = Lists.newArrayList(
+            "病历记录标题=标题",
+            "病历记录时间=病历日期",
+            "记录医师=记录医生",
+            "病历特点=病例特点"
+    );
+
+}

+ 54 - 0
trans/src/main/java/com/lantone/qc/trans/yuhangsy/YuhangsyFirstPageRecordDocTrans.java

@@ -0,0 +1,54 @@
+package com.lantone.qc.trans.yuhangsy;
+
+import com.google.common.collect.Maps;
+import com.lantone.qc.dbanaly.util.ModuleMappingUtil;
+import com.lantone.qc.pub.Content;
+import com.lantone.qc.pub.model.doc.FirstPageRecordDoc;
+import com.lantone.qc.pub.model.vo.MedrecVo;
+import com.lantone.qc.pub.util.FastJsonUtils;
+import com.lantone.qc.trans.ModelDocTrans;
+
+import java.util.Map;
+
+/**
+ * @Description: 病案首页文档生成
+ * @author: 胡敬
+ * @time: 2020/3/16 17:47
+ */
+public class YuhangsyFirstPageRecordDocTrans extends ModelDocTrans {
+
+    @Override
+    public FirstPageRecordDoc extract(MedrecVo medrecVo) {
+        Map<String, String> content = (Map) medrecVo.getContent();
+        FirstPageRecordDoc firstPageRecordDoc = new FirstPageRecordDoc();
+        firstPageRecordDoc.setStructureMap(content);
+
+        Map<String, Object> structureExtMap = Maps.newHashMap();
+        structureExtMap.putAll(content);
+        structureExtMap.put(Content.diagnose_cts, FastJsonUtils.getJsonToBean(content.get(Content.diagnose_cts), Object.class));
+        //        structureExtMap.put(Content.outpatientEmergencyDiag, FastJsonUtils.getJsonToBean(content.get(Content.outpatientEmergencyDiag), Object.class));
+        structureExtMap.put(Content.operative_information, FastJsonUtils.getJsonToBean(content.get(Content.operative_information), Object.class));
+        structureExtMap.put(Content.dischargeDiag, FastJsonUtils.getJsonToBean(content.get(Content.dischargeDiag), Object.class));
+        //        structureExtMap.put(Content.pathologyDiagnose, FastJsonUtils.getJsonToBean(content.get(Content.pathologyDiagnose), Object.class));
+        firstPageRecordDoc.setStructureExtMap(structureExtMap);
+        //病案首页出院诊断页面信息只保留主要诊断和其他诊断
+        /*List<Map<String, String>> list = (List<Map<String, String>>) FastJsonUtils.getJsonToBean(content.get(Content.dischargeDiag), Object.class);
+        if (ListUtil.isNotEmpty(list)) {
+            Iterator<Map<String, String>> iterator = list.iterator();
+            Map<String, String> map = new HashMap<>();
+            while (iterator.hasNext()) {
+                map = new HashMap<>();
+                map = iterator.next();
+                if (!((map.get("诊断类别") != null && map.get("诊断类别").equals("主要诊断"))
+                        || (map.get("诊断类别") != null && map.get("诊断类别").equals("其他诊断")))) {
+                    iterator.remove();
+                }
+            }
+            medrecVo.getContent().put("出院诊断", list.toString());
+        }*/
+        medrecVo.getContent().put("mode_id", ModuleMappingUtil.getStandardModuleId("6"));
+        firstPageRecordDoc.setPageData(medrecVo.getContent());
+        return firstPageRecordDoc;
+    }
+
+}

+ 90 - 0
trans/src/main/java/com/lantone/qc/trans/yuhangsy/YuhangsyInformedConsentDocTrans.java

@@ -0,0 +1,90 @@
+package com.lantone.qc.trans.yuhangsy;
+
+import com.google.common.collect.Lists;
+import com.lantone.qc.pub.model.doc.InformedConsentDoc;
+import com.lantone.qc.pub.model.vo.MedrecVo;
+import com.lantone.qc.pub.util.FastJsonUtils;
+import com.lantone.qc.pub.util.ListUtil;
+import com.lantone.qc.pub.util.StringUtil;
+import com.lantone.qc.trans.ModelDocTrans;
+import com.lantone.qc.trans.comsis.CommonAnalysisUtil;
+import com.lantone.qc.trans.comsis.ModelDocGenerate;
+import com.lantone.qc.trans.comsis.OrdinaryAssistant;
+import com.lantone.qc.trans.yuhangsy.util.YuhangsyHtmlAnalysis;
+import com.lantone.qc.trans.yuhangsy.util.YuhangsyInformedHtmlAnalysis;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.collections.MapUtils;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @Description: 知情同意书
+ * @author: cy
+ * @time: 2021/4/18 17:48
+ */
+@Slf4j
+public class YuhangsyInformedConsentDocTrans extends ModelDocTrans {
+    @Override
+    public List<InformedConsentDoc> extract(MedrecVo medrecVo) {
+        List<InformedConsentDoc> retList = Lists.newArrayList();
+        Map<String, List<String>> contentMap = (Map) medrecVo.getContent().get("content");
+        if (contentMap == null) {
+            return retList;
+        }
+        for (Map.Entry<String, List<String>> entry : contentMap.entrySet()) {
+            InformedConsentDoc informedConsentDoc = getInformedConsentDoc((List) entry.getValue());
+            retList.add(informedConsentDoc);
+        }
+        return retList;
+
+    }
+
+    private InformedConsentDoc getInformedConsentDoc(List<Map<String, Object>> contentMaps) {
+        InformedConsentDoc informedConsentDoc = new InformedConsentDoc();
+        if (ListUtil.isEmpty(contentMaps)) {
+            return informedConsentDoc;
+        }
+        for (Map<String, Object> contentMap : contentMaps) {
+            if (contentMap.get("xmlText") == null || StringUtil.isBlank(contentMap.get("xmlText").toString())) {
+                continue;
+            }
+            try {
+                String content = contentMap.get("xmlText").toString();
+                Map<String, String> structureMap = null;
+                if (contentMap.get("isParsed") != null && "1".equals(contentMap.get("isParsed").toString())) {
+                    structureMap = (Map) FastJsonUtils.getJsonToMap(content);
+                } else {
+                    String recTitle = contentMap.get("recTitle").toString();
+                    String recTypeId = contentMap.get("recTypeId").toString();
+                    YuhangsyHtmlAnalysis yhsyHtmlAnalysis = new YuhangsyInformedHtmlAnalysis();
+                    Map<String, String> sourceMap = yhsyHtmlAnalysis.analysis(content, recTitle, recTypeId);
+                    if (MapUtils.isNotEmpty(sourceMap)) {
+                        structureMap = OrdinaryAssistant.mapKeyContrast(sourceMap, keyContrasts);
+                        structureMap.put("记录编号", contentMap.get("recId").toString());
+                        structureMap.put("标题", recTitle);
+                        structureMap.put("病历号", contentMap.get("behospitalCode") == null ? null : contentMap.get("behospitalCode").toString());
+                    }
+                }
+                if (MapUtils.isNotEmpty(structureMap)) {
+                    informedConsentDoc = ModelDocGenerate.informedConsentDocGen(structureMap);
+                    informedConsentDoc.setText(CommonAnalysisUtil.html2String(content));
+                    informedConsentDoc.setPageData((Map) structureMap);
+                }
+            } catch (Exception e) {
+                log.error(e.getMessage(), e);
+            }
+        }
+        return informedConsentDoc;
+    }
+
+
+    private List<String> keyContrasts = Lists.newArrayList(
+            "患者签名=患方签名",
+            "患方手写意见=患方签名",
+            "患方手写意见患方签名=患方签名",
+            "患方或受托代理人签名=患方或受托代理人签名",
+            "代理人签名=被授权人签名",
+            "被授权人签名=被授权人签名"
+    );
+}

+ 75 - 0
trans/src/main/java/com/lantone/qc/trans/yuhangsy/YuhangsyInvasiveOperationDocTrans.java

@@ -0,0 +1,75 @@
+package com.lantone.qc.trans.yuhangsy;
+
+import com.google.common.collect.Lists;
+import com.lantone.qc.pub.model.doc.InvasiveOperationDoc;
+import com.lantone.qc.pub.model.vo.MedrecVo;
+import com.lantone.qc.pub.util.FastJsonUtils;
+import com.lantone.qc.pub.util.StringUtil;
+import com.lantone.qc.trans.ModelDocTrans;
+import com.lantone.qc.trans.yuhangsy.util.YuhangsyHtmlAnalysis;
+import com.lantone.qc.trans.yuhangsy.util.YuhangsyInvasiveOperationHtmlAnalysis;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.collections.MapUtils;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @Description: 有创操作
+ * @author: cy
+ * @time: 2021/8/27 16:12
+ */
+@Slf4j
+public class YuhangsyInvasiveOperationDocTrans extends ModelDocTrans {
+    @Override
+    public List<InvasiveOperationDoc> extract(MedrecVo medrecVo) {
+        List<InvasiveOperationDoc> retList = Lists.newArrayList();
+        List<Map<String, Object>> contentMaps = (List) medrecVo.getContent().get("content");
+        contentMaps.forEach(contentMap -> {
+            retList.add(getInvasiveOperationDoc(contentMap));
+        });
+        return retList;
+
+    }
+
+    private InvasiveOperationDoc getInvasiveOperationDoc(Map<String, Object> contentMap) {
+        InvasiveOperationDoc invasiveOperationDoc = new InvasiveOperationDoc();
+        if (MapUtils.isEmpty(contentMap)) {
+            return invasiveOperationDoc;
+        }
+        if(contentMap.get("htmlText") == null && contentMap.get("xmlText") != null){
+            contentMap.put("xmlText",contentMap.get("xmlText"));
+        }
+            if (contentMap.get("xmlText") == null || StringUtil.isBlank(contentMap.get("xmlText").toString())) {
+                return invasiveOperationDoc;
+            }
+            try {
+                String content = contentMap.get("xmlText").toString();
+                Map<String, String> structureMap = null;
+                if (contentMap.get("isParsed") != null && "1".equals(contentMap.get("isParsed").toString())) {
+                    structureMap = (Map) FastJsonUtils.getJsonToMap(content);
+                } else {
+                    String recTitle = contentMap.get("recTitle").toString();
+                    String recTypeId = contentMap.get("recTypeId").toString();
+                    YuhangsyHtmlAnalysis yhsyHtmlAnalysis = new YuhangsyInvasiveOperationHtmlAnalysis();
+                    Map<String, String> sourceMap = yhsyHtmlAnalysis.analysis(content, recTitle, recTypeId);
+                    if (MapUtils.isNotEmpty(sourceMap)) {
+                        structureMap.put("记录编号", contentMap.get("recId").toString());
+                        structureMap.put("标题", recTitle);
+                        structureMap.put("病历号", contentMap.get("behospitalCode") == null ? null : contentMap.get("behospitalCode").toString());
+                    }
+                }
+                if (MapUtils.isNotEmpty(structureMap)) {
+                    invasiveOperationDoc.setStructureMap(structureMap);
+                    invasiveOperationDoc.setPageData((Map) structureMap);
+                }
+            } catch (Exception e) {
+                log.error(e.getMessage(), e);
+            }
+
+        return invasiveOperationDoc;
+    }
+
+
+
+}

+ 75 - 0
trans/src/main/java/com/lantone/qc/trans/yuhangsy/YuhangsyLeaveHospitalDocTrans.java

@@ -0,0 +1,75 @@
+package com.lantone.qc.trans.yuhangsy;
+
+import com.google.common.collect.Lists;
+import com.lantone.qc.pub.model.doc.LeaveHospitalDoc;
+import com.lantone.qc.pub.model.label.LeaveHospitalDoctorAdviceLabel;
+import com.lantone.qc.pub.model.vo.MedrecVo;
+import com.lantone.qc.pub.util.FastJsonUtils;
+import com.lantone.qc.trans.ModelDocTrans;
+import com.lantone.qc.trans.comsis.CommonAnalysisUtil;
+import com.lantone.qc.trans.comsis.ModelDocGenerate;
+import com.lantone.qc.trans.comsis.OrdinaryAssistant;
+import com.lantone.qc.trans.yuhangsy.util.YuhangsyHtmlAnalysis;
+import com.lantone.qc.trans.yuhangsy.util.YuhangsyLeaveHospitalHtmlAnalysis;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.collections.MapUtils;
+import org.apache.commons.lang3.StringUtils;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @Description: 出院小结文档生成
+ * @author: rengb
+ * @time: 2020/3/17 13:25
+ */
+@Slf4j
+public class YuhangsyLeaveHospitalDocTrans extends ModelDocTrans {
+
+    @Override
+    public LeaveHospitalDoc extract(MedrecVo medrecVo) {
+        LeaveHospitalDoc leaveHospitalDoc = null;
+        try {
+            Map<String, Object> contentMap = ((List<Map>) medrecVo.getContent().get("content")).get(0);
+            String content = contentMap.get("xmlText").toString();
+            Map<String, String> structureMap = null;
+            if (contentMap.get("isParsed") != null && "1".equals(contentMap.get("isParsed").toString())) {
+                structureMap = (Map) FastJsonUtils.getJsonToMap(content);
+            } else {
+                String recTitle = contentMap.get("recTitle").toString();
+                String recTypeId = contentMap.get("recTypeId").toString();
+                YuhangsyHtmlAnalysis yhsyHtmlAnalysis = new YuhangsyLeaveHospitalHtmlAnalysis();
+                Map<String, String> sourceMap = yhsyHtmlAnalysis.analysis(content, recTitle, recTypeId);
+                if (MapUtils.isNotEmpty(sourceMap)) {
+                    structureMap = OrdinaryAssistant.mapKeyContrast(sourceMap, keyContrasts);
+                    structureMap.put("记录编号", contentMap.get("recId").toString());
+                    structureMap.put("病历号", contentMap.get("behospitalCode") == null ? null : contentMap.get("behospitalCode").toString());
+                }
+            }
+            if (MapUtils.isNotEmpty(structureMap)) {
+                leaveHospitalDoc = ModelDocGenerate.leaveHospitalDocGen(structureMap);
+                if (StringUtils.isNotEmpty(structureMap.get("出院医嘱"))) {
+                    LeaveHospitalDoctorAdviceLabel leaveHospitalDoctorAdviceLabel = new LeaveHospitalDoctorAdviceLabel();
+                    leaveHospitalDoctorAdviceLabel.setText(structureMap.get("出院医嘱"));
+                    leaveHospitalDoctorAdviceLabel.setAiText(structureMap.get("出院医嘱"));
+                    leaveHospitalDoc.setLeaveHospitalDoctorAdviceLabel(leaveHospitalDoctorAdviceLabel);
+                }
+                leaveHospitalDoc.setText(CommonAnalysisUtil.html2String(content));
+                leaveHospitalDoc.setPageData((Map) structureMap);
+            }
+        } catch (Exception e) {
+            log.error(e.getMessage(), e);
+        }
+        return leaveHospitalDoc;
+    }
+
+    private List<String> keyContrasts = Lists.newArrayList(
+            "入院时间=入院日期",
+            "出院时间=出院日期",
+            "入院情况=病史摘要",
+            "住院经过=诊治经过",
+            "签名时间=时间",
+            "入院查体=主要实验室检查及器械检验结果"
+    );
+
+}

+ 36 - 0
trans/src/main/java/com/lantone/qc/trans/yuhangsy/YuhangsyLisDocTrans.java

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

+ 26 - 0
trans/src/main/java/com/lantone/qc/trans/yuhangsy/YuhangsyMedicalRecordInfoDocTrans.java

@@ -0,0 +1,26 @@
+package com.lantone.qc.trans.yuhangsy;
+
+import com.lantone.qc.pub.model.doc.MedicalRecordInfoDoc;
+import com.lantone.qc.pub.model.vo.MedrecVo;
+import com.lantone.qc.trans.ModelDocTrans;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @Description: 住院病历信息
+ * @author: 胡敬
+ * @time: 2020/6/3 15:45
+ */
+public class YuhangsyMedicalRecordInfoDocTrans extends ModelDocTrans {
+
+    @Override
+    public MedicalRecordInfoDoc extract(MedrecVo medrecVo) {
+        Map<String, String> content = (Map) ((List) medrecVo.getContent().get("content")).get(0);
+        MedicalRecordInfoDoc medicalRecordInfoDoc = new MedicalRecordInfoDoc();
+        medicalRecordInfoDoc.setStructureMap(content);
+        medicalRecordInfoDoc.setPageData(medrecVo.getContent());
+        return medicalRecordInfoDoc;
+    }
+
+}

+ 457 - 0
trans/src/main/java/com/lantone/qc/trans/yuhangsy/YuhangsyOperationDocTrans.java

@@ -0,0 +1,457 @@
+package com.lantone.qc.trans.yuhangsy;
+
+import com.google.common.collect.Lists;
+import com.google.common.collect.Maps;
+import com.google.common.collect.Sets;
+import com.lantone.qc.pub.model.doc.operation.*;
+import com.lantone.qc.pub.model.vo.MedrecVo;
+import com.lantone.qc.pub.util.FastJsonUtils;
+import com.lantone.qc.pub.util.ListUtil;
+import com.lantone.qc.pub.util.StringUtil;
+import com.lantone.qc.trans.ModelDocTrans;
+import com.lantone.qc.trans.comsis.CommonAnalysisUtil;
+import com.lantone.qc.trans.comsis.ModelDocGenerate;
+import com.lantone.qc.trans.comsis.OrdinaryAssistant;
+import com.lantone.qc.trans.yuhangsy.util.*;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.collections.MapUtils;
+import org.jsoup.Jsoup;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * @Description: 手术文档生成
+ * @author: rengb
+ * @time: 2020/3/20 17:11
+ */
+@Slf4j
+public class YuhangsyOperationDocTrans extends ModelDocTrans {
+
+    @Override
+    public List<OperationDoc> extract(MedrecVo medrecVo) {
+        List<OperationDoc> retList = Lists.newArrayList();
+
+        Map<String, List<String>> contentMap = (Map) medrecVo.getContent().get("content");
+        if (contentMap == null) {
+            return retList;
+        }
+
+        Map<String, OperationDiscussionDoc> operationDiscussionDocMap = getOperationDiscussionDocMap((List) contentMap.get("术后首次病程及谈话记录"));
+        Map<String, OperationRecordDoc> operationRecordDocMap = getOperationRecordDocMap((List) contentMap.get("手术记录"));
+        Map<String, PreoperativeDiscussionDoc> preoperativeDiscussionDocMap = getPreoperativeDiscussionDocMap((List) contentMap.get("术前讨论、术前小结"));
+        Map<String, OperationInformedConsentDoc> operationInformedConsentDocMap = getOperationInformedConsentDocMap((List) contentMap.get("手术知情同意书"));
+        Map<String, OperationSafetyChecklistDoc> operationSafetyChecklistDocMap = getOperationSafetyChecklistDocMap((List) contentMap.get("手术安全核查表"));
+
+        Set<String> operationNameSet = Sets.newHashSet();
+        operationNameSet.addAll(operationDiscussionDocMap.keySet());
+        operationNameSet.addAll(operationRecordDocMap.keySet());
+        operationNameSet.addAll(preoperativeDiscussionDocMap.keySet());
+        operationNameSet.addAll(operationInformedConsentDocMap.keySet());
+
+        operationNameSet.forEach(operationName -> {
+            OperationDoc operationDoc = new OperationDoc();
+            operationDoc.setOperationName(operationName);
+            operationDoc.setOperationDiscussionDoc(operationDiscussionDocMap.get(operationName));
+            operationDoc.setOperationRecordDoc(operationRecordDocMap.get(operationName));
+            operationDoc.setPreoperativeDiscussionDoc(preoperativeDiscussionDocMap.get(operationName));
+            operationDoc.setOperationInformedConsentDoc(operationInformedConsentDocMap.get(operationName));
+            operationDoc.setOperationSafetyChecklistDoc(operationSafetyChecklistDocMap.get(operationName));
+            retList.add(operationDoc);
+        });
+
+        return retList;
+    }
+
+
+    /*******************************************术后首次病程及谈话记录***************************************************/
+    private Map<String, OperationDiscussionDoc> getOperationDiscussionDocMap(List<Map<String, Object>> contentMaps) {
+        Map<String, OperationDiscussionDoc> retMap = Maps.newHashMap();
+        if (ListUtil.isEmpty(contentMaps)) {
+            return retMap;
+        }
+        int index = 1;
+        String operationName = null;
+        for (Map<String, Object> contentMap : contentMaps) {
+            if (contentMap.get("xmlText") == null || StringUtil.isBlank(contentMap.get("xmlText").toString())) {
+                continue;
+            }
+            try {
+                OperationDiscussionDoc operationDiscussionDoc = getOperationDiscussionDoc(contentMap);
+                if (operationDiscussionDoc != null) {
+                    operationName = index + "";
+                    operationDiscussionDoc.setOperationName(operationName);
+                    retMap.put(operationName, operationDiscussionDoc);
+                    index++;
+                }
+            } catch (Exception e) {
+                log.error(e.getMessage(), e);
+            }
+        }
+        return retMap;
+    }
+
+    private OperationDiscussionDoc getOperationDiscussionDoc(Map<String, Object> contentMap) {
+        String content = contentMap.get("xmlText").toString();
+        Map<String, String> structureMap = null;
+        OperationDiscussionDoc operationDiscussionDoc = new OperationDiscussionDoc();
+        if (contentMap.get("isParsed") != null && "1".equals(contentMap.get("isParsed").toString())) {
+            structureMap = (Map) FastJsonUtils.getJsonToMap(content);
+            if (MapUtils.isNotEmpty(structureMap)) {
+                operationDiscussionDoc = ModelDocGenerate.operationDiscussionDocGen(structureMap);
+                operationDiscussionDoc.setText(content);
+                operationDiscussionDoc.setPageData((Map) structureMap);
+                return operationDiscussionDoc;
+            } else {
+                return null;
+            }
+        } else {
+            String recTitle = contentMap.get("recTitle").toString();
+            String recTypeId = contentMap.get("recTypeId").toString();
+            YuhangsyHtmlAnalysis yhsyHtmlAnalysis = new YuhangsyOperationHtmlAnalysis();
+            Map<String, String> sourceMap = yhsyHtmlAnalysis.analysis(content, recTitle, recTypeId);
+            if (MapUtils.isNotEmpty(sourceMap)) {
+                structureMap = OrdinaryAssistant.mapKeyContrast(sourceMap, operationDiscussion_keyContrasts);
+                structureMap.put("记录编号", contentMap.get("recId").toString());
+                structureMap.put("病历号", contentMap.get("behospitalCode") == null ? null : contentMap.get("behospitalCode").toString());
+            }
+            if (MapUtils.isNotEmpty(structureMap)) {
+                operationDiscussionDoc = ModelDocGenerate.operationDiscussionDocGen(structureMap);
+                String text = YuhangsyHtmlAnalysisUtil.blockDivToStr(Jsoup.parse(content).selectFirst("body").child(0), true);
+                operationDiscussionDoc.setText(text);
+                operationDiscussionDoc.setPageData((Map) structureMap);
+                return operationDiscussionDoc;
+            } else {
+                return null;
+            }
+        }
+    }
+
+    private List<String> operationDiscussion_keyContrasts = Lists.newArrayList(
+            "病历日期=病历日期",
+            "病历标题=标题",
+            "病情记录=术后注意事项",
+            "记录医生=记录医生"
+    );
+
+
+    /**********************************************手术记录*************************************************************/
+    private Map<String, OperationRecordDoc> getOperationRecordDocMap(List<Map<String, Object>> contentMaps) {
+        Map<String, OperationRecordDoc> retMap = Maps.newHashMap();
+        if (ListUtil.isEmpty(contentMaps)) {
+            return retMap;
+        }
+        int index = 1;
+        String operationName = null;
+        for (Map<String, Object> contentMap : contentMaps) {
+            if (contentMap.get("xmlText") == null || StringUtil.isBlank(contentMap.get("xmlText").toString())) {
+                continue;
+            }
+            try {
+                OperationRecordDoc operationRecordDoc = getOperationRecordDoc(contentMap);
+                if (operationRecordDoc != null) {
+                    operationName = index + "";
+                    operationRecordDoc.setOperationName(operationName);
+                    retMap.put(operationName, operationRecordDoc);
+                    index++;
+                }
+            } catch (Exception e) {
+                log.error(e.getMessage(), e);
+            }
+        }
+        return retMap;
+    }
+
+    private OperationRecordDoc getOperationRecordDoc(Map<String, Object> contentMap) {
+        String content = contentMap.get("xmlText").toString();
+        Map<String, String> structureMap = null;
+        if (contentMap.get("isParsed") != null && "1".equals(contentMap.get("isParsed").toString())) {
+            structureMap = (Map) FastJsonUtils.getJsonToMap(content);
+        } else {
+            String recTitle = contentMap.get("recTitle").toString();
+            String recTypeId = contentMap.get("recTypeId").toString();
+            YuhangsyHtmlAnalysis yhsyHtmlAnalysis = new YuhangsyOperationRecordHtmlAnalysis();
+            Map<String, String> sourceMap = yhsyHtmlAnalysis.analysis(content, recTitle, recTypeId);
+            //含有手术情况知情书时间特殊处理
+            if (sourceMap.containsKey("时间") && sourceMap.get("时间").contains("宁波市北仑区人民医院")) {
+                sourceMap.put("时间", sourceMap.get("时间").substring(0, sourceMap.get("时间").indexOf("宁波市北仑区人民医院")));
+            }
+            if (MapUtils.isNotEmpty(sourceMap)) {
+                structureMap = OrdinaryAssistant.mapKeyContrast(sourceMap, operationRecord_keyContrasts);
+                structureMap.put("记录编号", contentMap.get("recId").toString());
+                structureMap.put("病历号", contentMap.get("behospitalCode") == null ? null : contentMap.get("behospitalCode").toString());
+            }
+            List<String> titles = Lists.newArrayList("手术开始时间", "手术结束时间");
+            for (String title : titles) {
+                eliminateDate(structureMap, title);
+            }
+            if (structureMap.containsKey("麻醉人员")) {
+                structureMap.put("麻醉人员", structureMap.get("麻醉人员").replace("\n", "").replaceAll("麻醉人员签名", ""));
+            }
+            if (structureMap.containsKey("接生者")) {
+                structureMap.put("接生者", structureMap.get("接生者").replace("\n", "").replaceAll("接生者签名", ""));
+            }
+        }
+        if (MapUtils.isNotEmpty(structureMap)) {
+            OperationRecordDoc operationRecordDoc = ModelDocGenerate.operationRecordDocGen(structureMap);
+            operationRecordDoc.setPageData((Map) structureMap);
+            return operationRecordDoc;
+        } else {
+            return null;
+        }
+    }
+
+    private List<String> operationRecord_keyContrasts = Lists.newArrayList(
+            "手术开始时间=开始时间",
+            "术中诊断=术中后诊断",
+//            "麻醉医师=麻醉者",
+//            "麻醉方式=麻醉方法",
+            "记录医师=记录医生",
+            "记录医师签名时间=记录时间",
+            "手术过程=手术经过及处理"
+    );
+
+
+    /**********************************************术前讨论、术前小结****************************************************/
+    private Map<String, PreoperativeDiscussionDoc> getPreoperativeDiscussionDocMap(List<Map<String, Object>> contentMaps) {
+        Map<String, PreoperativeDiscussionDoc> retMap = Maps.newHashMap();
+        if (ListUtil.isEmpty(contentMaps)) {
+            return retMap;
+        }
+        int index = 1;
+        String operationName = null;
+        for (Map<String, Object> contentMap : contentMaps) {
+            if (contentMap.get("xmlText") == null || StringUtil.isBlank(contentMap.get("xmlText").toString())) {
+                continue;
+            }
+            try {
+                PreoperativeDiscussionDoc preoperativeDiscussionDoc = getPreoperativeDiscussionDoc(contentMap);
+                if (preoperativeDiscussionDoc != null) {
+                    operationName = index + "";
+                    preoperativeDiscussionDoc.setOperationName(operationName);
+                    retMap.put(operationName, preoperativeDiscussionDoc);
+                    index++;
+                }
+            } catch (Exception e) {
+                log.error(e.getMessage(), e);
+            }
+        }
+        return retMap;
+    }
+
+    private PreoperativeDiscussionDoc getPreoperativeDiscussionDoc(Map<String, Object> contentMap) {
+        String content = contentMap.get("xmlText").toString();
+        Map<String, String> structureMap = null;
+        if (contentMap.get("isParsed") != null && "1".equals(contentMap.get("isParsed").toString())) {
+            structureMap = (Map) FastJsonUtils.getJsonToMap(content);
+        } else {
+            String recTitle = contentMap.get("recTitle").toString();
+            String recTypeId = contentMap.get("recTypeId").toString();
+            YuhangsyHtmlAnalysis yhsyHtmlAnalysis = new YuhangsyPreoperativeHtmlAnalysis();
+            Map<String, String> sourceMap = yhsyHtmlAnalysis.analysis(content, recTitle, recTypeId);
+            if (MapUtils.isNotEmpty(sourceMap)) {
+                if (StringUtil.isNotBlank(sourceMap.get("文书标题")) && sourceMap.get("文书标题").equals("术前小结")) {
+                    structureMap = OrdinaryAssistant.mapKeyContrast(sourceMap, preoperativeDiscussion_keyContrasts2);
+                } else {
+                    structureMap = OrdinaryAssistant.mapKeyContrast(sourceMap, preoperativeDiscussion_keyContrasts);
+                }
+
+
+                structureMap.put("记录编号", contentMap.get("recId").toString());
+                structureMap.put("病历号", contentMap.get("behospitalCode") == null ? null : contentMap.get("behospitalCode").toString());
+            }
+        }
+        List<String> titles = Lists.newArrayList("讨论时间", "手术指征", "注意事项", "术前诊断", "医生签名", "风险及防范措施", "可替代方案", "术前准备", "参加人员");
+        if (structureMap.containsKey("简要病情")) {
+            String value = structureMap.get("简要病情").replaceAll("医师姓名", "").replaceAll("简要病情描述", "");
+            structureMap.put("简要病情", value);
+        }
+        if (structureMap.containsKey("可替代的方案")) {
+            String value = structureMap.get("可替代的方案").replaceAll("可替代方案", "");
+            structureMap.put("可替代的方案", value);
+        }
+        if (structureMap.containsKey("拟施麻醉方式")) {
+            String value = structureMap.get("拟施麻醉方式").replaceAll("麻醉方式", "");
+            structureMap.put("拟施麻醉方式", value);
+        }
+        if (structureMap.containsKey("其他术前相关情况")) {
+            String value = structureMap.get("其他术前相关情况").replaceAll("术者术前查看患者的相关情况", "");
+            structureMap.put("其他术前相关情况", value);
+        }
+        if (structureMap.containsKey("手术指征与禁忌")) {
+            String value = structureMap.get("手术指征与禁忌").replaceAll("手术指征与禁忌征", "");
+            structureMap.put("手术指征与禁忌", value);
+        }
+        for (String title : titles) {
+            eliminateDate(structureMap, title);
+        }
+        if (MapUtils.isNotEmpty(structureMap)) {
+            PreoperativeDiscussionDoc preoperativeDiscussionDoc = ModelDocGenerate.preoperativeDiscussionDocGen(structureMap);
+            preoperativeDiscussionDoc.setPageData((Map) structureMap);
+            return preoperativeDiscussionDoc;
+        } else {
+            return null;
+        }
+    }
+
+    private void eliminateDate(Map<String, String> structureMap, String text) {
+        if (structureMap.containsKey(text)) {
+            String value = structureMap.get(text).replaceAll(text, "");
+            structureMap.put(text, value);
+        }
+    }
+
+    private List<String> preoperativeDiscussion_keyContrasts = Lists.newArrayList(
+            "讨论时间=文书时间",
+            "讨论方式=病历内容",
+            "主刀医生签名=记录医生"
+    );
+    private List<String> preoperativeDiscussion_keyContrasts2 = Lists.newArrayList(
+            "病史摘要=病历内容",
+            "医生签名=记录医生",
+            "日期=文书时间"
+
+    );
+
+    /**********************************************手术知情同意书****************************************************/
+    private Map<String, OperationInformedConsentDoc> getOperationInformedConsentDocMap(List<Map<String, Object>> contentMaps) {
+        Map<String, OperationInformedConsentDoc> retMap = Maps.newHashMap();
+        if (ListUtil.isEmpty(contentMaps)) {
+            return retMap;
+        }
+        int index = 1;
+        String operationName = null;
+        for (Map<String, Object> contentMap : contentMaps) {
+            if (contentMap.get("xmlText") == null || StringUtil.isBlank(contentMap.get("xmlText").toString())) {
+                continue;
+            }
+            operationName = index + "";
+            OperationInformedConsentDoc operationInformedConsentDoc = getOperationInformedConsentDoc(contentMap);
+            operationInformedConsentDoc.setOperationName(operationName);
+            retMap.put(operationName, operationInformedConsentDoc);
+            index++;
+        }
+        return retMap;
+    }
+
+    private OperationInformedConsentDoc getOperationInformedConsentDoc(Map<String, Object> contentMap) {
+        String modeId = "16";
+        Map<String, String> structureMap = new HashMap<>();
+        String content = contentMap.get("xmlText").toString();
+        OperationInformedConsentDoc operationInformedConsentDoc = new OperationInformedConsentDoc();
+        String recTitle = contentMap.get("recTitle").toString();
+        String recTypeId = contentMap.get("recTypeId").toString();
+        YuhangsyHtmlAnalysis yhsyHtmlAnalysis = new YuhangsyOperationInformedHtmlAnalysis();
+        Map<String, String> sourceMap = yhsyHtmlAnalysis.analysis(content, recTitle, recTypeId);
+        if (MapUtils.isNotEmpty(sourceMap)) {
+            structureMap = OrdinaryAssistant.mapKeyContrast(sourceMap, keyContrasts);
+            structureMap.put("病历标题", contentMap.get("recTitle").toString());
+            structureMap.put("记录编号", contentMap.get("recId").toString());
+            structureMap.put("病历号", contentMap.get("behospitalCode") == null ? null : contentMap.get("behospitalCode").toString());
+            operationInformedConsentDoc = ModelDocGenerate.operationInformedDocGen(structureMap);
+            operationInformedConsentDoc.setText(CommonAnalysisUtil.html2String(content));
+            operationInformedConsentDoc.setPageData((Map) structureMap);
+        }
+
+        return operationInformedConsentDoc;
+    }
+
+    private List<String> keyContrasts = Lists.newArrayList(
+            "术种使用的植入性材料或高值耗材及风险=使用植入性材料"
+    );
+
+    private List<String> operationInformedConsent_sourceTitles = Lists.newArrayList(
+            "姓名",
+            "性别",
+            "病区",
+            "床号",
+            "病案号",
+            "手术医生",
+            "目前诊断",
+            "手术名称",
+            "手术指征",
+            "风险及并发症",
+            "保守治疗",
+            "其他手术",
+            "签名",
+            "签名时间"
+    );
+
+    private List<String> operationInformedConsent_keyContrasts = Lists.newArrayList(
+            "姓名++++患者姓名=姓名",
+            "性别=",
+            "病区++++病区名称=病区",
+            "床号=",
+            "病案号++++住院号=病案号",
+            "手术医生=",
+            "目前诊断=",
+            "手术名称=",
+            "手术指征=",
+            "风险及并发症=",
+            "++++保守治疗=保守治疗",
+            "++++其他手术=其他手术",
+            "签名++++=签名",
+            "签名时间=签名时间"
+    );
+
+    /**********************************************手术安全核查表****************************************************/
+    private Map<String, OperationSafetyChecklistDoc> getOperationSafetyChecklistDocMap(List<Map<String, Object>> contentMaps) {
+        Map<String, OperationSafetyChecklistDoc> retMap = Maps.newHashMap();
+        if (ListUtil.isEmpty(contentMaps)) {
+            return retMap;
+        }
+        int index = 1;
+        String operationName = null;
+        for (Map<String, Object> contentMap : contentMaps) {
+            if (contentMap.get("xmlText") == null || StringUtil.isBlank(contentMap.get("xmlText").toString())) {
+                continue;
+            }
+            operationName = index + "";
+            OperationSafetyChecklistDoc operationSafetyChecklistDoc = getOperationSafetyChecklistDoc(contentMap);
+            operationSafetyChecklistDoc.setOperationName(operationName);
+            retMap.put(operationName, operationSafetyChecklistDoc);
+            index++;
+        }
+        return retMap;
+    }
+
+    private OperationSafetyChecklistDoc getOperationSafetyChecklistDoc(Map<String, Object> contentMap) {
+        String modeId = "21";
+//        String content = contentMap.get("xmlText").toString();
+//        Map<String, String> xmlNodeValueMap = CxXmlUtil.firstLevelNodeValue(content);
+//        xmlNodeValueMap.put("mode_id=" + contentMap.get("modeId").toString(), "");
+//        xmlNodeValueMap.put("rec_title=" + contentMap.get("recTitle").toString(), "");
+//        Map<String, String> structureMap = OrdinaryAssistant.mapKeyContrast(xmlNodeValueMap, operationSafetyChecklist_keyContrasts, modeId);
+//
+//        String text = CxXmlUtil.getXmlText(content);
+//        Map<String, String> cutWordMap = Preproc.getCutWordMap(true, operationSafetyChecklist_sourceTitles, text);
+//        cutWordMap.putAll(structureMap);
+
+//        OperationSafetyChecklistDoc operationSafetyChecklistDoc = ModelDocGenerate.operationSafetyChecklistDocGen(cutWordMap);
+        OperationSafetyChecklistDoc operationSafetyChecklistDoc = new OperationSafetyChecklistDoc();
+//        operationSafetyChecklistDoc.setText(text);
+//        operationSafetyChecklistDoc.setPageData((Map) cutWordMap);
+
+        return operationSafetyChecklistDoc;
+    }
+
+    private List<String> operationSafetyChecklist_sourceTitles = Lists.newArrayList(
+            "姓名",
+            "性别",
+            "病区",
+            "床号",
+            "病案号",
+            "签名"
+    );
+
+    private List<String> operationSafetyChecklist_keyContrasts = Lists.newArrayList(
+            "姓名++++患者姓名=姓名",
+            "性别",
+            "病区",
+            "床号",
+            "病案号++++住院号=病案号",
+            "签名++++=签名"
+    );
+}

+ 40 - 0
trans/src/main/java/com/lantone/qc/trans/yuhangsy/YuhangsyOutDepDocTrans.java

@@ -0,0 +1,40 @@
+package com.lantone.qc.trans.yuhangsy;
+
+import com.lantone.qc.pub.model.doc.BeHospitalizedDoc;
+import com.lantone.qc.pub.model.label.ChiefLabel;
+import com.lantone.qc.pub.model.label.PastLabel;
+import com.lantone.qc.pub.model.label.PresentLabel;
+import com.lantone.qc.pub.model.vo.MedrecVo;
+import com.lantone.qc.trans.ModelDocTrans;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @Description: 门诊入院记录文档生成
+ * @author: rengb
+ * @time: 2020/3/19 19:41
+ */
+public class YuhangsyOutDepDocTrans extends ModelDocTrans {
+
+    @Override
+    public BeHospitalizedDoc extract(MedrecVo medrecVo) {
+        BeHospitalizedDoc beHospitalizedDoc = new BeHospitalizedDoc();
+        Map<String, String> structureMap = ((List<Map>) medrecVo.getContent().get("content")).get(0);
+
+        ChiefLabel chiefLabel = new ChiefLabel();
+        chiefLabel.setText(structureMap.get("主诉"));
+        beHospitalizedDoc.setChiefLabel(chiefLabel);
+
+        PresentLabel presentLabel = new PresentLabel();
+        presentLabel.setText(structureMap.get("现病史"));
+        beHospitalizedDoc.setPresentLabel(presentLabel);
+
+        PastLabel pastLabel = new PastLabel();
+        pastLabel.setText(structureMap.get("既往史"));
+        beHospitalizedDoc.setPastLabel(pastLabel);
+
+        return beHospitalizedDoc;
+    }
+
+}

+ 36 - 0
trans/src/main/java/com/lantone/qc/trans/yuhangsy/YuhangsyPacsDocTrans.java

@@ -0,0 +1,36 @@
+package com.lantone.qc.trans.yuhangsy;
+
+import com.google.common.collect.Lists;
+import com.lantone.qc.pub.model.doc.PacsDoc;
+import com.lantone.qc.pub.model.vo.MedrecVo;
+import com.lantone.qc.pub.util.FastJsonUtils;
+import com.lantone.qc.trans.ModelDocTrans;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @Description: 辅检信息文档生成
+ * @author: zh
+ * @time: 2021/4/7 15:41
+ */
+public class YuhangsyPacsDocTrans extends ModelDocTrans {
+
+    @Override
+    public List<PacsDoc> extract(MedrecVo medrecVo) {
+        List<PacsDoc> retList = Lists.newArrayList();
+        List<String> contents = (List) medrecVo.getContent().get("content");
+        contents.forEach(content -> {
+            retList.add(getDoctorAdviceDoc((Map) FastJsonUtils.getJsonToMap(content)));
+        });
+        return retList;
+    }
+
+    private PacsDoc getDoctorAdviceDoc(Map<String, String> content) {
+        PacsDoc doctorAdviceDoc = new PacsDoc();
+        doctorAdviceDoc.setStructureMap(content);
+        doctorAdviceDoc.setPageData((Map) content);
+        return doctorAdviceDoc;
+    }
+
+}

+ 0 - 0
trans/src/main/java/com/lantone/qc/trans/yuhangsy/YuhangsyRescueDocTrans.java


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