Forráskód Böngészése

Merge remote-tracking branch 'origin/master'

wangyu 5 éve
szülő
commit
f8edb7a4d9
63 módosított fájl, 1055 hozzáadás és 497 törlés
  1. 11 5
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0004.java
  2. 15 3
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0015.java
  3. 20 1
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/clinicalblood/CLI0299.java
  4. 2 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/clinicalblood/CLI0306.java
  5. 2 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/clinicalblood/CLI0308.java
  6. 3 2
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP0157.java
  7. 1 1
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP0158.java
  8. 11 1
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP0161.java
  9. 3 3
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP0162.java
  10. 2 2
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP0163.java
  11. 1 1
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP0166.java
  12. 1 1
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP0167.java
  13. 1 1
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP0168.java
  14. 2 1
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP0184.java
  15. 1 1
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP0220.java
  16. 1 1
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP0225.java
  17. 5 12
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP0247.java
  18. 5 12
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP0249.java
  19. 2 1
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP0256.java
  20. 9 4
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP0273.java
  21. 5 2
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP0274.java
  22. 15 8
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/leavehospital/LEA0149.java
  23. 10 6
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/leavehospital/LEA0154.java
  24. 9 6
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/leavehospital/LEA0155.java
  25. 10 7
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/leavehospital/LEA0156.java
  26. 5 3
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/threelevelward/THR0130.java
  27. 4 3
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/threelevelward/THR0131.java
  28. 4 3
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/threelevelward/THR0132.java
  29. 4 3
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/threelevelward/THR0133.java
  30. 4 3
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/threelevelward/THR0134.java
  31. 4 8
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/threelevelward/THR0135.java
  32. 4 3
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/threelevelward/THR0136.java
  33. 4 3
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/threelevelward/THR0137.java
  34. 4 3
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/threelevelward/THR0138.java
  35. 4 3
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/threelevelward/THR0139.java
  36. 17 7
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/threelevelward/THR0140.java
  37. 6 2
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/threelevelward/THR0429.java
  38. 6 2
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/threelevelward/THR0430.java
  39. 6 2
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/threelevelward/THR0431.java
  40. 6 2
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/threelevelward/THR0432.java
  41. 6 2
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/threelevelward/THR0433.java
  42. 2 1
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/threelevelward/THR0435.java
  43. 2 1
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/threelevelward/THR0436.java
  44. 19 8
      kernel/src/main/java/com/lantone/qc/kernel/structure/ai/FirstCourseRecordAI.java
  45. 28 7
      kernel/src/main/java/com/lantone/qc/kernel/structure/ai/ThreeLevelWardAI.java
  46. 8 9
      kernel/src/main/java/com/lantone/qc/kernel/structure/ai/process/EntityProcessThreeLevelWard.java
  47. 35 10
      kernel/src/main/java/com/lantone/qc/kernel/util/ModelDataUtil.java
  48. 24 2
      kernel/src/main/java/com/lantone/qc/kernel/web/controller/QCTestController.java
  49. 13 14
      kernel/src/test/java/com/lantone/qc/kernel/DataTest.java
  50. 20 0
      kernel/src/test/java/com/lantone/qc/kernel/Doctor.java
  51. 73 25
      kernel/src/test/java/com/lantone/qc/kernel/TaizDataImportApiTest.java
  52. 5 3
      public/src/main/java/com/lantone/qc/pub/Content.java
  53. 1 0
      public/src/main/java/com/lantone/qc/pub/model/doc/operation/OperationDoc.java
  54. 16 0
      public/src/main/java/com/lantone/qc/pub/model/doc/operation/OperationInformedConsentDoc.java
  55. 17 0
      public/src/main/java/com/lantone/qc/pub/model/keys/TextTypeStandardKeys.java
  56. 1 23
      trans/src/main/java/com/lantone/qc/trans/changx/ChangxConsultationDocTrans.java
  57. 158 150
      trans/src/main/java/com/lantone/qc/trans/changx/ChangxDocTrans.java
  58. 163 89
      trans/src/main/java/com/lantone/qc/trans/changx/ChangxOperationDocTrans.java
  59. 1 21
      trans/src/main/java/com/lantone/qc/trans/changx/ChangxThreeLevelWardDocTrans.java
  60. 36 0
      trans/src/main/java/com/lantone/qc/trans/changx/util/CxXmlUtil.java
  61. 153 0
      trans/src/main/java/com/lantone/qc/trans/changx/util/CxXmlUtilTemp.java
  62. 13 0
      trans/src/main/java/com/lantone/qc/trans/comsis/ModelDocGenerate.java
  63. 32 0
      trans/src/main/java/com/lantone/qc/trans/comsis/Preproc.java

+ 11 - 5
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0004.java

@@ -4,6 +4,7 @@ import com.lantone.qc.kernel.catalogue.QCCatalogue;
 import com.lantone.qc.kernel.util.CatalogueUtil;
 import com.lantone.qc.pub.model.InputInfo;
 import com.lantone.qc.pub.model.OutputInfo;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.stereotype.Component;
 
 import java.util.Collection;
@@ -25,11 +26,16 @@ public class BEH0004 extends QCCatalogue {
 
         status.set("0");
         Map<String, String> structureMap = inputInfo.getBeHospitalizedDoc().getStructureMap();
-        Collection<String> values = structureMap.values();
-        for (String value:values) {
-            if(CatalogueUtil.isEmpty(value)){
-                status.set("-1");
-                break;
+        if(structureMap != null){
+            String basePassage = structureMap.get("个人基本信息");
+            if(StringUtils.isNotEmpty(basePassage)){
+                String[] baseFilds = basePassage.split(",");
+                for (String fild:baseFilds) {
+                    if(StringUtils.isBlank(structureMap.get(fild))){
+                        status.set("-1");
+                        break;
+                    }
+                }
             }
         }
 

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

@@ -1,12 +1,16 @@
 package com.lantone.qc.kernel.catalogue.behospitalized;
 
 import com.lantone.qc.kernel.catalogue.QCCatalogue;
+import com.lantone.qc.kernel.util.KernelConstants;
+import com.lantone.qc.kernel.util.RedisUtil;
 import com.lantone.qc.pub.model.InputInfo;
 import com.lantone.qc.pub.model.OutputInfo;
 import com.lantone.qc.pub.model.entity.BodyPart;
 import com.lantone.qc.pub.model.entity.Cause;
 import com.lantone.qc.pub.model.entity.Clinical;
+import com.lantone.qc.pub.model.entity.Lis;
 import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
 import java.util.ArrayList;
@@ -21,14 +25,22 @@ import java.util.List;
  */
 @Component
 public class BEH0015 extends QCCatalogue {
+    @Autowired
+    private RedisUtil redisUtil;
     public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        status.set("0");
+        List<String> clinicalList = (List<String>) redisUtil.getJsonStringValue(KernelConstants.CONCEPT_CLINIC_BODYPART_PROPERTIES_LIST);
         List<Clinical> clinicals = inputInfo.getBeHospitalizedDoc().getPresentLabel().getClinicals();
         if(clinicals.size()>0){
             Clinical clinical = clinicals.get(0);
-            BodyPart bodyPart = clinical.getBodyPart();
-            if(bodyPart == null){
-                info.set(clinical.getName());
+            if(clinicalList.contains(clinical.getName())){
+                BodyPart bodyPart = clinical.getBodyPart();
+                if(bodyPart == null){
+                    status.set("-1");
+                    info.set(clinical.getName());
+                }
             }
+
         }
     }
 }

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

@@ -3,18 +3,37 @@ package com.lantone.qc.kernel.catalogue.clinicalblood;
 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.ClinicalBloodDoc;
+import com.lantone.qc.pub.model.doc.DoctorAdviceDoc;
+import com.lantone.qc.pub.model.doc.RescueDoc;
 import org.springframework.stereotype.Component;
 
+import java.util.List;
 import java.util.Map;
 
 /**
  * @ClassName : CLI0001
- * @Description : 无输血/血制品病程记录
+ * @Description : 无输血/血制品病程记录     和医嘱比较
  * @Author : 楼辉荣
  * @Date: 2020-03-06 17:28
  */
 @Component
 public class CLI0299 extends QCCatalogue {
     public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        status.set("0");
+        List<DoctorAdviceDoc> doctorAdviceDocs = inputInfo.getDoctorAdviceDocs();
+        List<ClinicalBloodDoc> clinicalBloodDocs = inputInfo.getClinicalBloodDocs();
+        if(doctorAdviceDocs.size()>0){
+            st:
+            for (DoctorAdviceDoc doc:doctorAdviceDocs) {
+                Map<String, String> structureMap = doc.getStructureMap();
+                if(structureMap.get("医嘱项目名称").contains("输血") && structureMap.get("医嘱处方类型").contains("治疗")){
+                    if(clinicalBloodDocs == null && clinicalBloodDocs.size() ==0){
+                        status.set("-1");
+                        break st;
+                    }
+                }
+            }
+        }
     }
 }

+ 2 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/clinicalblood/CLI0306.java

@@ -37,6 +37,8 @@ public class CLI0306 extends QCCatalogue {
 
                 }
             }
+        }else {
+            status.set("0");
         }
 
     }

+ 2 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/clinicalblood/CLI0308.java

@@ -29,6 +29,8 @@ public class CLI0308 extends QCCatalogue {
                     break;
                 }
             }
+        }else {
+            status.set("0");
         }
 
     }

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

@@ -19,11 +19,12 @@ import java.util.Map;
 @Component
 public class FIRP0157 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 name = firstpageStructureMap.get(Content.name);
-            if (!CatalogueUtil.isEmpty(name)){
-                status.set("0");
+            if (CatalogueUtil.isEmpty(name)){
+                status.set("-1");
             }
         }
     }

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

@@ -25,7 +25,7 @@ public class FIRP0158 extends QCCatalogue {
             Map<String, String> beHospitalStructureMap = inputInfo.getBeHospitalizedDoc().getStructureMap();
             String firstAdmissionName = firstpageStructureMap.get(Content.name);
             String admissionName = beHospitalStructureMap.get(Content.name);
-            if (!CatalogueUtil.compareToken(firstAdmissionName,admissionName)) {
+            if (!CatalogueUtil.compareToken(firstAdmissionName, admissionName)) {
                 status.set("-1");
             }
         }

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

@@ -5,6 +5,7 @@ import com.lantone.qc.kernel.util.CatalogueUtil;
 import com.lantone.qc.pub.Content;
 import com.lantone.qc.pub.model.InputInfo;
 import com.lantone.qc.pub.model.OutputInfo;
+import com.lantone.qc.pub.util.StringUtil;
 import org.springframework.stereotype.Component;
 
 import java.util.Map;
@@ -25,9 +26,18 @@ public class FIRP0161 extends QCCatalogue {
             Map<String, String> beHospitalStructureMap = inputInfo.getBeHospitalizedDoc().getStructureMap();
             String firstAdmissionAge = firstpageStructureMap.get(Content.age);
             String admissionAge = beHospitalStructureMap.get(Content.age);
-            if (!CatalogueUtil.compareToken(firstAdmissionAge,admissionAge)) {
+            firstAdmissionAge = removalUnit(firstAdmissionAge);
+            admissionAge = removalUnit(admissionAge);
+            if (!CatalogueUtil.compareToken(firstAdmissionAge, admissionAge)) {
                 status.set("-1");
             }
         }
     }
+
+    private String removalUnit(String admissionAge) {
+        if (StringUtil.isNotBlank(admissionAge) && admissionAge.contains("岁")) {
+            admissionAge = admissionAge.replace("岁", "");
+        }
+        return admissionAge;
+    }
 }

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

@@ -21,10 +21,10 @@ public class FIRP0162 extends QCCatalogue {
         status.set("0");
         if (inputInfo.getFirstPageRecordDoc() != null && inputInfo.getFirstPageRecordDoc().getStructureMap() != null) {
             Map<String, String> firstpageStructureMap = inputInfo.getFirstPageRecordDoc().getStructureMap();
-            String idcardInfo = firstpageStructureMap.get(Content.idcardInfo);
-            if (!CatalogueUtil.isEmpty(idcardInfo)) {
+            String idNumber = firstpageStructureMap.get(Content.idNumber);
+            if (!CatalogueUtil.isEmpty(idNumber)) {
                 String regex = "\\d{15}|\\d{17}[\\dxX]";
-                if (!idcardInfo.matches(regex)) {
+                if (!idNumber.matches(regex)) {
                     status.set("-1");
                 }
             }

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

@@ -20,8 +20,8 @@ public class FIRP0163 extends QCCatalogue {
     public void start(InputInfo inputInfo, OutputInfo outputInfo) {
         if (inputInfo.getFirstPageRecordDoc() != null && inputInfo.getFirstPageRecordDoc().getStructureMap() != null) {
             Map<String, String> firstpageStructureMap = inputInfo.getFirstPageRecordDoc().getStructureMap();
-            String idcardInfo = firstpageStructureMap.get(Content.idcardInfo);
-            if (!CatalogueUtil.isEmpty(idcardInfo)){
+            String idNumber = firstpageStructureMap.get(Content.idNumber);
+            if (!CatalogueUtil.isEmpty(idNumber)) {
                 status.set("0");
             }
         }

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

@@ -25,7 +25,7 @@ public class FIRP0166 extends QCCatalogue {
             Map<String, String> beHospitalStructureMap = inputInfo.getBeHospitalizedDoc().getStructureMap();
             String firstAdmissionMarry = firstpageStructureMap.get(Content.marry);
             String admissionMarry = beHospitalStructureMap.get(Content.marry);
-            if (!CatalogueUtil.compareToken(firstAdmissionMarry,admissionMarry)) {
+            if (!CatalogueUtil.compareToken(firstAdmissionMarry, admissionMarry)) {
                 status.set("-1");
             }
         }

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

@@ -23,7 +23,7 @@ public class FIRP0167 extends QCCatalogue {
             Map<String, String> firstpageStructureMap = inputInfo.getFirstPageRecordDoc().getStructureMap();
             String name = firstpageStructureMap.get(Content.name);
             String contactName = firstpageStructureMap.get(Content.contactName);
-            if (CatalogueUtil.compareToken(name,contactName)) {
+            if (CatalogueUtil.compareToken(name, contactName)) {
                 status.set("-1");
             }
         }

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

@@ -21,7 +21,7 @@ public class FIRP0168 extends QCCatalogue {
         if (inputInfo.getFirstPageRecordDoc() != null && inputInfo.getFirstPageRecordDoc().getStructureMap() != null) {
             Map<String, String> firstpageStructureMap = inputInfo.getFirstPageRecordDoc().getStructureMap();
             String admitPath = firstpageStructureMap.get(Content.admitPath);
-            if (!CatalogueUtil.isEmpty(admitPath)){
+            if (!CatalogueUtil.isEmpty(admitPath)) {
                 status.set("0");
             }
         }

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

@@ -21,7 +21,8 @@ public class FIRP0184 extends QCCatalogue {
         if (inputInfo.getFirstPageRecordDoc() != null && inputInfo.getFirstPageRecordDoc().getStructureMap() != null) {
             Map<String, String> firstpageStructureMap = inputInfo.getFirstPageRecordDoc().getStructureMap();
             String drugAllergy = firstpageStructureMap.get(Content.drugAllergy);
-            if (!CatalogueUtil.isEmpty(drugAllergy)){
+            String allergyDrug = firstpageStructureMap.get(Content.drugAllergy);
+            if (!CatalogueUtil.isEmpty(drugAllergy) && !CatalogueUtil.isEmpty(allergyDrug)) {
                 status.set("0");
             }
         }

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

@@ -24,7 +24,7 @@ public class FIRP0220 extends QCCatalogue {
             Map<String, String> beHospitalStructureMap = inputInfo.getBeHospitalizedDoc().getStructureMap();
             String firstAdmissionDate = firstpageStructureMap.get(Content.admisTime);
             String admissionDate = beHospitalStructureMap.get(Content.admisDate);
-            if (CatalogueUtil.equalsDate(firstAdmissionDate, admissionDate, "yyyy-MM-ddH")) {
+            if (CatalogueUtil.equalsDate(firstAdmissionDate, admissionDate, "yyyy-MM-ddHH")) {
                 status.set("0");
             }
         }

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

@@ -24,7 +24,7 @@ public class FIRP0225 extends QCCatalogue {
             Map<String, String> leaveHospitalStructureMap = inputInfo.getLeaveHospitalDoc().getStructureMap();
             String firstDischargeTime = firstpageStructureMap.get(Content.dischargeTime);//病案首页出院时间
             String dischargeTime = leaveHospitalStructureMap.get(Content.dischargeTime);//出院小结出院时间
-            if (CatalogueUtil.equalsDate(firstDischargeTime, dischargeTime, "yyyy-MM-ddH")) {
+            if (CatalogueUtil.equalsDate(firstDischargeTime, dischargeTime, "yyyy-MM-ddHH")) {
                 status.set("0");
             }
         }

+ 5 - 12
kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP0247.java

@@ -5,6 +5,7 @@ import com.lantone.qc.kernel.util.CatalogueUtil;
 import com.lantone.qc.pub.Content;
 import com.lantone.qc.pub.model.InputInfo;
 import com.lantone.qc.pub.model.OutputInfo;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.stereotype.Component;
 
 import java.util.Map;
@@ -20,21 +21,13 @@ import java.util.regex.Pattern;
 @Component
 public class FIRP0247 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 name = firstpageStructureMap.get(Content.rescue_condition);
-            if (!CatalogueUtil.isEmpty(name)){
-                Pattern compile = Pattern.compile("(?<=抢救).*(?=次)");
-                Matcher matcher = compile.matcher(name);
-                while (matcher.find()){
-                    try{
-                        status.set("0");
-                    }catch (Exception e){
-                        e.printStackTrace();
-                    }
+            if(firstpageStructureMap != null){
+                if(StringUtils.isEmpty(firstpageStructureMap.get("病人抢救次数"))){
+                    status.set("-1");
                 }
-
-
             }
         }
     }

+ 5 - 12
kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP0249.java

@@ -5,6 +5,7 @@ import com.lantone.qc.kernel.util.CatalogueUtil;
 import com.lantone.qc.pub.Content;
 import com.lantone.qc.pub.model.InputInfo;
 import com.lantone.qc.pub.model.OutputInfo;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.stereotype.Component;
 
 import java.util.Map;
@@ -20,21 +21,13 @@ import java.util.regex.Pattern;
 @Component
 public class FIRP0249 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 name = firstpageStructureMap.get(Content.rescue_condition);
-            if (!CatalogueUtil.isEmpty(name)){
-                Pattern compile = Pattern.compile("(?<=成功).*(?=次)");
-                Matcher matcher = compile.matcher(name);
-                while (matcher.find()){
-                    try{
-                        status.set("0");
-                    }catch (Exception e){
-                        e.printStackTrace();
-                    }
+            if(firstpageStructureMap != null){
+                if(StringUtils.isEmpty(firstpageStructureMap.get("病人抢救成功次数"))){
+                    status.set("-1");
                 }
-
-
             }
         }
     }

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

@@ -45,7 +45,8 @@ public class FIRP0256 extends QCCatalogue {
             List<OutcomeCure> outcomeCures = new ArrayList<>();//转归情况-治愈
             List<PositiveFinding> positiveFindings = new ArrayList<>();//阳性表现
             for (ThreeLevelWardDoc threeLevelWardDoc : threeLevelWardDocs) {
-                if (!threeLevelWardDoc.getThreeLevelWardLabel().getTitle().contains("最后一次")) {
+                if (threeLevelWardDoc.getThreeLevelWardLabel() == null
+                        || !threeLevelWardDoc.getThreeLevelWardLabel().getTitle().contains("最后一次")) {
                     continue;
                 }
                 ThreeLevelWardLabel threeLevelWardLabel = threeLevelWardDoc.getThreeLevelWardLabel();

+ 9 - 4
kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP0273.java

@@ -1,10 +1,10 @@
 package com.lantone.qc.kernel.catalogue.firstpagerecord;
 
 import com.lantone.qc.kernel.catalogue.QCCatalogue;
-import com.lantone.qc.kernel.util.CatalogueUtil;
 import com.lantone.qc.pub.Content;
 import com.lantone.qc.pub.model.InputInfo;
 import com.lantone.qc.pub.model.OutputInfo;
+import com.lantone.qc.pub.util.StringUtil;
 import org.springframework.stereotype.Component;
 
 import java.util.Map;
@@ -18,12 +18,17 @@ import java.util.Map;
 @Component
 public class FIRP0273 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 newbornAge = firstpageStructureMap.get(Content.newbornAge);
-            if (!CatalogueUtil.isEmpty(newbornAge) && Integer.parseInt(newbornAge) <= 28){
+            String infantAgeMonths = firstpageStructureMap.get(Content.newbornAgeMonths);
+            String infantAgeDays = firstpageStructureMap.get(Content.newbornAgeDays);
+            if (StringUtil.isNotBlank(infantAgeMonths) && Integer.parseInt(infantAgeMonths) > 0) {
+                status.set("-1");
+            }
+            if (StringUtil.isNotBlank(infantAgeDays) && Integer.parseInt(infantAgeDays) > 28) {
                 //新生儿年龄单位为天,小于28天算通过
-                status.set("0");
+                status.set("-1");
             }
         }
     }

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

@@ -22,8 +22,11 @@ public class FIRP0274 extends QCCatalogue {
         if (inputInfo.getFirstPageRecordDoc() != null && inputInfo.getFirstPageRecordDoc().getStructureMap() != null) {
             Map<String, String> firstpageStructureMap = inputInfo.getFirstPageRecordDoc().getStructureMap();
             String age = firstpageStructureMap.get(Content.age);
-            String newbornAge = firstpageStructureMap.get(Content.newbornAge);
-            if (CatalogueUtil.isEmpty(age) && CatalogueUtil.isEmpty(newbornAge)) {
+            String infantAgeMonths = firstpageStructureMap.get(Content.newbornAgeMonths);
+            String infantAgeDays = firstpageStructureMap.get(Content.newbornAgeDays);
+            if (CatalogueUtil.isEmpty(age)
+                    && CatalogueUtil.isEmpty(infantAgeMonths)
+                    && CatalogueUtil.isEmpty(infantAgeDays)) {
                 status.set("-1");
             }
         }

+ 15 - 8
kernel/src/main/java/com/lantone/qc/kernel/catalogue/leavehospital/LEA0149.java

@@ -3,11 +3,15 @@ package com.lantone.qc.kernel.catalogue.leavehospital;
 import com.lantone.qc.kernel.catalogue.QCCatalogue;
 import com.lantone.qc.pub.model.InputInfo;
 import com.lantone.qc.pub.model.OutputInfo;
+import com.lantone.qc.pub.model.doc.BeHospitalizedDoc;
+import com.lantone.qc.pub.model.doc.LeaveHospitalDoc;
 import com.lantone.qc.pub.model.entity.Chief;
 import com.lantone.qc.pub.model.entity.General;
+import com.lantone.qc.pub.model.label.ChiefLabel;
 import com.lantone.qc.pub.model.label.LeaveHospitalLabel;
 import com.lantone.qc.pub.util.ListUtil;
 import com.lantone.qc.pub.util.StringUtil;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.stereotype.Component;
 
 import java.util.List;
@@ -24,15 +28,18 @@ public class LEA0149 extends QCCatalogue {
     @Override
     public void start(InputInfo inputInfo, OutputInfo outputInfo) {
         status.set("0");
-        try {
-            Map<String, String> lhStructureMap = inputInfo.getLeaveHospitalDoc().getStructureMap();
-            String bhChief = inputInfo.getBeHospitalizedDoc().getChiefLabel().getText();
-            String bhThings = lhStructureMap.get("入院情况");
-            if(bhThings.indexOf(bhChief)<0){
-                status.set("-1");
+        LeaveHospitalDoc leaveHospitalDoc = inputInfo.getLeaveHospitalDoc();
+        BeHospitalizedDoc beHospitalizedDoc = inputInfo.getBeHospitalizedDoc();
+        if(leaveHospitalDoc != null && beHospitalizedDoc != null){
+            Map<String, String> lhStructureMap = leaveHospitalDoc.getStructureMap();
+            ChiefLabel chiefLabel = beHospitalizedDoc.getChiefLabel();
+            if(lhStructureMap != null && chiefLabel != null){
+                String bhChief = chiefLabel.getText();
+                String bhThings = lhStructureMap.get("入院情况");
+                if(bhThings.indexOf(bhChief)<0){
+                    status.set("-1");
+                }
             }
-        }catch (Exception e){
-            e.printStackTrace();
         }
     }
 }

+ 10 - 6
kernel/src/main/java/com/lantone/qc/kernel/catalogue/leavehospital/LEA0154.java

@@ -3,13 +3,16 @@ package com.lantone.qc.kernel.catalogue.leavehospital;
 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.LeaveHospitalDoc;
 import com.lantone.qc.pub.model.entity.Diag;
+import com.lantone.qc.pub.model.label.DiagLabel;
 import com.lantone.qc.pub.util.ListUtil;
 import com.lantone.qc.pub.util.StringUtil;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.stereotype.Component;
 
 import java.util.List;
+import java.util.Map;
 
 /**
  * @Description: 出院记录内容缺出院(死亡)诊断
@@ -22,13 +25,14 @@ public class LEA0154 extends QCCatalogue {
     @Override
     public void start(InputInfo inputInfo, OutputInfo outputInfo) {
         status.set("0");
-        try{
-            String text = inputInfo.getLeaveHospitalDoc().getLeaveDiagLabel().getText();
-            if(StringUtils.isBlank(text)){
-                status.set("-1");
+        LeaveHospitalDoc leaveHospitalDoc = inputInfo.getLeaveHospitalDoc();
+        if(leaveHospitalDoc != null){
+            DiagLabel leaveDiagLabel = leaveHospitalDoc.getLeaveDiagLabel();
+            if(leaveDiagLabel != null){
+                if(StringUtils.isBlank(leaveDiagLabel.getText())){
+                    status.set("-1");
+                }
             }
-        }catch (Exception e){
-            e.printStackTrace();
         }
     }
 }

+ 9 - 6
kernel/src/main/java/com/lantone/qc/kernel/catalogue/leavehospital/LEA0155.java

@@ -4,6 +4,7 @@ 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.model.entity.DoctorAdvice;
 import com.lantone.qc.pub.model.label.LeaveHospitalLabel;
 import com.lantone.qc.pub.util.ListUtil;
@@ -12,6 +13,7 @@ import org.apache.commons.lang3.StringUtils;
 import org.springframework.stereotype.Component;
 
 import java.util.List;
+import java.util.Map;
 
 /**
  * @Description: 出院记录内容缺出院医嘱
@@ -24,13 +26,14 @@ public class LEA0155 extends QCCatalogue {
     @Override
     public void start(InputInfo inputInfo, OutputInfo outputInfo) {
         status.set("0");
-        try {
-            String leaveAdvice = inputInfo.getLeaveHospitalDoc().getStructureMap().get("出院医嘱");
-            if(StringUtils.isBlank(leaveAdvice)){
-                status.set("-1");
+        LeaveHospitalDoc leaveHospitalDoc = inputInfo.getLeaveHospitalDoc();
+        if(leaveHospitalDoc != null){
+            Map<String, String> structureMap = leaveHospitalDoc.getStructureMap();
+            if(structureMap != null){
+                if(StringUtils.isBlank(structureMap.get("出院医嘱"))){
+                    status.set("-1");
+                }
             }
-        }catch (Exception e){
-            e.printStackTrace();
         }
     }
 }

+ 10 - 7
kernel/src/main/java/com/lantone/qc/kernel/catalogue/leavehospital/LEA0156.java

@@ -3,6 +3,7 @@ package com.lantone.qc.kernel.catalogue.leavehospital;
 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.LeaveHospitalDoc;
 import com.lantone.qc.pub.model.entity.Notes;
 import com.lantone.qc.pub.model.label.LeaveHospitalLabel;
 import com.lantone.qc.pub.util.ListUtil;
@@ -11,6 +12,7 @@ import org.apache.commons.lang3.StringUtils;
 import org.springframework.stereotype.Component;
 
 import java.util.List;
+import java.util.Map;
 
 /**
  * @Description: 出院记录内容缺出院注意事项
@@ -23,13 +25,14 @@ public class LEA0156 extends QCCatalogue {
     @Override
     public void start(InputInfo inputInfo, OutputInfo outputInfo) {
         status.set("0");
-        try {
-            String healthyEducation = inputInfo.getLeaveHospitalDoc().getStructureMap().get("健康教育");
-            if(StringUtils.isBlank(healthyEducation)){
-                status.set("-1");
+        LeaveHospitalDoc leaveHospitalDoc = inputInfo.getLeaveHospitalDoc();
+        if(leaveHospitalDoc != null){
+            Map<String, String> structureMap = leaveHospitalDoc.getStructureMap();
+            if(structureMap != null){
+                if(StringUtils.isBlank(structureMap.get("健康教育"))){
+                    status.set("-1");
+                }
             }
-        }catch (Exception e){
-            e.printStackTrace();
-        }
         }
     }
+}

+ 5 - 3
kernel/src/main/java/com/lantone/qc/kernel/catalogue/threelevelward/THR0130.java

@@ -24,11 +24,13 @@ public class THR0130 extends QCCatalogue {
         if (inputInfo.getThreeLevelWardDocs().size() > 0) {
             List<ThreeLevelWardDoc> threeLevelWardDocs = inputInfo.getThreeLevelWardDocs();
             for (ThreeLevelWardDoc threeLevelWardDoc : threeLevelWardDocs) {
-                if (StringUtil.isBlank(threeLevelWardDoc.getThreeLevelWardLabel().getTitle())
-                        || !Content.indications.equals(threeLevelWardDoc.getThreeLevelWardLabel().getTitle())) {
+                ThreeLevelWardLabel threeLevelWardLabel = threeLevelWardDoc.getThreeLevelWardLabel();
+                if (threeLevelWardLabel == null
+                        || StringUtil.isBlank(threeLevelWardLabel.getTitle())
+                        || !Content.indications.equals(threeLevelWardLabel.getTitle())) {
                     continue;
                 }
-                ThreeLevelWardLabel threeLevelWardLabel = threeLevelWardDoc.getThreeLevelWardLabel();
+
                 if (threeLevelWardLabel.getClinicals().size() == 0 && threeLevelWardLabel.getSigns().size() == 0) {
                     status.set("-1");
                     return;

+ 4 - 3
kernel/src/main/java/com/lantone/qc/kernel/catalogue/threelevelward/THR0131.java

@@ -24,11 +24,12 @@ public class THR0131 extends QCCatalogue {
         if (inputInfo.getThreeLevelWardDocs().size() > 0) {
             List<ThreeLevelWardDoc> threeLevelWardDocs = inputInfo.getThreeLevelWardDocs();
             for (ThreeLevelWardDoc threeLevelWardDoc : threeLevelWardDocs) {
-                if (StringUtil.isBlank(threeLevelWardDoc.getThreeLevelWardLabel().getTitle())
-                        || !Content.indications.equals(threeLevelWardDoc.getThreeLevelWardLabel().getTitle())) {
+                ThreeLevelWardLabel threeLevelWardLabel = threeLevelWardDoc.getThreeLevelWardLabel();
+                if (threeLevelWardLabel == null
+                        || StringUtil.isBlank(threeLevelWardLabel.getTitle())
+                        || !Content.indications.equals(threeLevelWardLabel.getTitle())) {
                     continue;
                 }
-                ThreeLevelWardLabel threeLevelWardLabel = threeLevelWardDoc.getThreeLevelWardLabel();
                 if (threeLevelWardLabel.getDiffDiag().size() == 0 && StringUtil.isBlank(threeLevelWardLabel.getDiffDiagText())) {
                     status.set("-1");
                     return;

+ 4 - 3
kernel/src/main/java/com/lantone/qc/kernel/catalogue/threelevelward/THR0132.java

@@ -24,11 +24,12 @@ public class THR0132 extends QCCatalogue {
         if (inputInfo.getThreeLevelWardDocs().size() > 0) {
             List<ThreeLevelWardDoc> threeLevelWardDocs = inputInfo.getThreeLevelWardDocs();
             for (ThreeLevelWardDoc threeLevelWardDoc : threeLevelWardDocs) {
-                if (StringUtil.isBlank(threeLevelWardDoc.getThreeLevelWardLabel().getTitle())
-                        || !Content.indications.equals(threeLevelWardDoc.getThreeLevelWardLabel().getTitle())) {
+                ThreeLevelWardLabel threeLevelWardLabel = threeLevelWardDoc.getThreeLevelWardLabel();
+                if (threeLevelWardLabel == null
+                        || StringUtil.isBlank(threeLevelWardLabel.getTitle())
+                        || !Content.indications.equals(threeLevelWardLabel.getTitle())) {
                     continue;
                 }
-                ThreeLevelWardLabel threeLevelWardLabel = threeLevelWardDoc.getThreeLevelWardLabel();
                 if (threeLevelWardLabel.getDiags().size() == 0
                         || StringUtil.isNotBlank(threeLevelWardLabel.getDiagBasisText()) && threeLevelWardLabel.getDiagBasisText().length() < 30
                         || threeLevelWardLabel.getDiffDiag().size() == 0 && StringUtil.isBlank(threeLevelWardLabel.getDiffDiagText())

+ 4 - 3
kernel/src/main/java/com/lantone/qc/kernel/catalogue/threelevelward/THR0133.java

@@ -24,11 +24,12 @@ public class THR0133 extends QCCatalogue {
         if (inputInfo.getThreeLevelWardDocs().size() > 0) {
             List<ThreeLevelWardDoc> threeLevelWardDocs = inputInfo.getThreeLevelWardDocs();
             for (ThreeLevelWardDoc threeLevelWardDoc : threeLevelWardDocs) {
-                if (StringUtil.isBlank(threeLevelWardDoc.getThreeLevelWardLabel().getTitle())
-                        || !Content.indications.equals(threeLevelWardDoc.getThreeLevelWardLabel().getTitle())) {
+                ThreeLevelWardLabel threeLevelWardLabel = threeLevelWardDoc.getThreeLevelWardLabel();
+                if (threeLevelWardLabel == null
+                        || StringUtil.isBlank(threeLevelWardLabel.getTitle())
+                        || !Content.indications.equals(threeLevelWardLabel.getTitle())) {
                     continue;
                 }
-                ThreeLevelWardLabel threeLevelWardLabel = threeLevelWardDoc.getThreeLevelWardLabel();
                 if (threeLevelWardLabel.getTreatmentPlans().size() == 0) {
                     status.set("-1");
                     return;

+ 4 - 3
kernel/src/main/java/com/lantone/qc/kernel/catalogue/threelevelward/THR0134.java

@@ -24,11 +24,12 @@ public class THR0134 extends QCCatalogue {
         if (inputInfo.getThreeLevelWardDocs().size() > 0) {
             List<ThreeLevelWardDoc> threeLevelWardDocs = inputInfo.getThreeLevelWardDocs();
             for (ThreeLevelWardDoc threeLevelWardDoc : threeLevelWardDocs) {
-                if (StringUtil.isBlank(threeLevelWardDoc.getThreeLevelWardLabel().getTitle())
-                        || !Content.indications.equals(threeLevelWardDoc.getThreeLevelWardLabel().getTitle())) {
+                ThreeLevelWardLabel threeLevelWardLabel = threeLevelWardDoc.getThreeLevelWardLabel();
+                if (threeLevelWardLabel == null
+                        || StringUtil.isBlank(threeLevelWardLabel.getTitle())
+                        || !Content.indications.equals(threeLevelWardLabel.getTitle())) {
                     continue;
                 }
-                ThreeLevelWardLabel threeLevelWardLabel = threeLevelWardDoc.getThreeLevelWardLabel();
                 if (threeLevelWardLabel.getDiags().size() == 0) {
                     status.set("-1");
                     return;

+ 4 - 8
kernel/src/main/java/com/lantone/qc/kernel/catalogue/threelevelward/THR0135.java

@@ -1,7 +1,6 @@
 package com.lantone.qc.kernel.catalogue.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;
@@ -10,11 +9,7 @@ import com.lantone.qc.pub.model.label.ThreeLevelWardLabel;
 import com.lantone.qc.pub.util.StringUtil;
 import org.springframework.stereotype.Component;
 
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 
 /**
  * @ClassName : THR0135
@@ -29,11 +24,12 @@ public class THR0135 extends QCCatalogue {
         if (inputInfo.getThreeLevelWardDocs().size() > 0) {
             List<ThreeLevelWardDoc> threeLevelWardDocs = inputInfo.getThreeLevelWardDocs();
             for (ThreeLevelWardDoc threeLevelWardDoc : threeLevelWardDocs) {
-                if (StringUtil.isBlank(threeLevelWardDoc.getThreeLevelWardLabel().getTitle())
-                        || !Content.director.equals(threeLevelWardDoc.getThreeLevelWardLabel().getTitle())) {
+                ThreeLevelWardLabel threeLevelWardLabel = threeLevelWardDoc.getThreeLevelWardLabel();
+                if (threeLevelWardLabel == null
+                        || StringUtil.isBlank(threeLevelWardLabel.getTitle())
+                        || !Content.director.equals(threeLevelWardLabel.getTitle())) {
                     continue;
                 }
-                ThreeLevelWardLabel threeLevelWardLabel = threeLevelWardDoc.getThreeLevelWardLabel();
                 if (threeLevelWardLabel.getClinicals().size() == 0 && threeLevelWardLabel.getSigns().size() == 0) {
                     status.set("-1");
                     return;

+ 4 - 3
kernel/src/main/java/com/lantone/qc/kernel/catalogue/threelevelward/THR0136.java

@@ -24,11 +24,12 @@ public class THR0136 extends QCCatalogue {
         if (inputInfo.getThreeLevelWardDocs().size() > 0) {
             List<ThreeLevelWardDoc> threeLevelWardDocs = inputInfo.getThreeLevelWardDocs();
             for (ThreeLevelWardDoc threeLevelWardDoc : threeLevelWardDocs) {
-                if (StringUtil.isBlank(threeLevelWardDoc.getThreeLevelWardLabel().getTitle())
-                        || !Content.director.equals(threeLevelWardDoc.getThreeLevelWardLabel().getTitle())) {
+                ThreeLevelWardLabel threeLevelWardLabel = threeLevelWardDoc.getThreeLevelWardLabel();
+                if (threeLevelWardLabel == null
+                        || StringUtil.isBlank(threeLevelWardLabel.getTitle())
+                        || !Content.director.equals(threeLevelWardLabel.getTitle())) {
                     continue;
                 }
-                ThreeLevelWardLabel threeLevelWardLabel = threeLevelWardDoc.getThreeLevelWardLabel();
                 if (threeLevelWardLabel.getDiffDiag().size() == 0 && StringUtil.isBlank(threeLevelWardLabel.getDiffDiagText())) {
                     status.set("-1");
                     return;

+ 4 - 3
kernel/src/main/java/com/lantone/qc/kernel/catalogue/threelevelward/THR0137.java

@@ -24,11 +24,12 @@ public class THR0137 extends QCCatalogue {
         if (inputInfo.getThreeLevelWardDocs().size() > 0) {
             List<ThreeLevelWardDoc> threeLevelWardDocs = inputInfo.getThreeLevelWardDocs();
             for (ThreeLevelWardDoc threeLevelWardDoc : threeLevelWardDocs) {
-                if (StringUtil.isBlank(threeLevelWardDoc.getThreeLevelWardLabel().getTitle())
-                        || !Content.director.equals(threeLevelWardDoc.getThreeLevelWardLabel().getTitle())) {
+                ThreeLevelWardLabel threeLevelWardLabel = threeLevelWardDoc.getThreeLevelWardLabel();
+                if (threeLevelWardLabel == null
+                        || StringUtil.isBlank(threeLevelWardLabel.getTitle())
+                        || !Content.director.equals(threeLevelWardLabel.getTitle())) {
                     continue;
                 }
-                ThreeLevelWardLabel threeLevelWardLabel = threeLevelWardDoc.getThreeLevelWardLabel();
                 if (threeLevelWardLabel.getDiags().size() == 0
                         || StringUtil.isNotBlank(threeLevelWardLabel.getDiagBasisText()) && threeLevelWardLabel.getDiagBasisText().length() < 30
                         || threeLevelWardLabel.getDiffDiag().size() == 0 && StringUtil.isBlank(threeLevelWardLabel.getDiffDiagText())

+ 4 - 3
kernel/src/main/java/com/lantone/qc/kernel/catalogue/threelevelward/THR0138.java

@@ -24,11 +24,12 @@ public class THR0138 extends QCCatalogue {
         if (inputInfo.getThreeLevelWardDocs().size() > 0) {
             List<ThreeLevelWardDoc> threeLevelWardDocs = inputInfo.getThreeLevelWardDocs();
             for (ThreeLevelWardDoc threeLevelWardDoc : threeLevelWardDocs) {
-                if (StringUtil.isBlank(threeLevelWardDoc.getThreeLevelWardLabel().getTitle())
-                        || !Content.director.equals(threeLevelWardDoc.getThreeLevelWardLabel().getTitle())) {
+                ThreeLevelWardLabel threeLevelWardLabel = threeLevelWardDoc.getThreeLevelWardLabel();
+                if (threeLevelWardLabel == null
+                        || StringUtil.isBlank(threeLevelWardLabel.getTitle())
+                        || !Content.director.equals(threeLevelWardLabel.getTitle())) {
                     continue;
                 }
-                ThreeLevelWardLabel threeLevelWardLabel = threeLevelWardDoc.getThreeLevelWardLabel();
                 if (threeLevelWardLabel.getTreatmentPlans().size() == 0) {
                     status.set("-1");
                     return;

+ 4 - 3
kernel/src/main/java/com/lantone/qc/kernel/catalogue/threelevelward/THR0139.java

@@ -24,11 +24,12 @@ public class THR0139 extends QCCatalogue {
         if (inputInfo.getThreeLevelWardDocs().size() > 0) {
             List<ThreeLevelWardDoc> threeLevelWardDocs = inputInfo.getThreeLevelWardDocs();
             for (ThreeLevelWardDoc threeLevelWardDoc : threeLevelWardDocs) {
-                if (StringUtil.isBlank(threeLevelWardDoc.getThreeLevelWardLabel().getTitle())
-                        || !Content.director.equals(threeLevelWardDoc.getThreeLevelWardLabel().getTitle())) {
+                ThreeLevelWardLabel threeLevelWardLabel = threeLevelWardDoc.getThreeLevelWardLabel();
+                if (threeLevelWardLabel == null
+                        || StringUtil.isBlank(threeLevelWardLabel.getTitle())
+                        || !Content.director.equals(threeLevelWardLabel.getTitle())) {
                     continue;
                 }
-                ThreeLevelWardLabel threeLevelWardLabel = threeLevelWardDoc.getThreeLevelWardLabel();
                 if (threeLevelWardLabel.getDiags().size() == 0) {
                     status.set("-1");
                     return;

+ 17 - 7
kernel/src/main/java/com/lantone/qc/kernel/catalogue/threelevelward/THR0140.java

@@ -6,6 +6,7 @@ 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.util.ListUtil;
 import com.lantone.qc.pub.util.StringUtil;
 import org.springframework.stereotype.Component;
 
@@ -14,7 +15,7 @@ import java.util.Map;
 
 /**
  * @ClassName : THR0140
- * @Description : 危重患者、疑难患者、抢救患者查房记录无主任医师/科主任签名
+ * @Description : 查房记录无医师签名
  * @Author : 胡敬
  * @Date: 2020-03-19 19:20
  */
@@ -22,15 +23,24 @@ import java.util.Map;
 public class THR0140 extends QCCatalogue {
     public void start(InputInfo inputInfo, OutputInfo outputInfo) {
         status.set("0");
-        if (inputInfo.getThreeLevelWardDocs().size() == 0) {
+        List<ThreeLevelWardDoc> threeLevelWardDocs = inputInfo.getThreeLevelWardDocs();
+        if (ListUtil.isEmpty(threeLevelWardDocs)) {
             return;
         }
-        if (inputInfo.getDifficultCaseDiscussDocs().size() > 0) {
-            processSign(inputInfo, "疑难患者");
-        }
-        if (inputInfo.getRescueDocs().size() > 0) {
-            processSign(inputInfo, "抢救患者");
+        for (ThreeLevelWardDoc threeLevelWardDoc : threeLevelWardDocs) {
+            Map<String, String> threeLevelWardDocStructureMap = threeLevelWardDoc.getStructureMap();
+            String recordDoctor = threeLevelWardDocStructureMap.get("记录医师");
+            if (CatalogueUtil.isEmpty(recordDoctor)) {
+                status.set("-1");
+                break;
+            }
         }
+//        if (inputInfo.getDifficultCaseDiscussDocs().size() > 0) {
+//            processSign(inputInfo, "疑难患者");
+//        }
+//        if (inputInfo.getRescueDocs().size() > 0) {
+//            processSign(inputInfo, "抢救患者");
+//        }
     }
 
     private void processSign(InputInfo inputInfo, String message) {

+ 6 - 2
kernel/src/main/java/com/lantone/qc/kernel/catalogue/threelevelward/THR0429.java

@@ -5,6 +5,7 @@ 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.label.ThreeLevelWardLabel;
+import com.lantone.qc.pub.util.ListUtil;
 import com.lantone.qc.pub.util.StringUtil;
 import org.springframework.stereotype.Component;
 
@@ -20,13 +21,16 @@ import java.util.List;
 public class THR0429 extends QCCatalogue {
     public void start(InputInfo inputInfo, OutputInfo outputInfo) {
         status.set("0");
+        if (ListUtil.isEmpty(inputInfo.getDifficultCaseDiscussDocs())) {
+            return;
+        }
         if (inputInfo.getThreeLevelWardDocs().size() > 0) {
             List<ThreeLevelWardDoc> threeLevelWardDocs = inputInfo.getThreeLevelWardDocs();
             for (ThreeLevelWardDoc threeLevelWardDoc : threeLevelWardDocs) {
-                if (threeLevelWardDoc.getThreeLevelWardLabel().getSerious() != 2) {
+                ThreeLevelWardLabel threeLevelWardLabel = threeLevelWardDoc.getThreeLevelWardLabel();
+                if (threeLevelWardLabel == null || threeLevelWardLabel.getSerious() != 2) {
                     continue;
                 }
-                ThreeLevelWardLabel threeLevelWardLabel = threeLevelWardDoc.getThreeLevelWardLabel();
                 if (threeLevelWardLabel.getDiags().size() == 0
                         || StringUtil.isNotBlank(threeLevelWardLabel.getDiagBasisText()) && threeLevelWardLabel.getDiagBasisText().length() < 30
                         || threeLevelWardLabel.getDiffDiag().size() == 0 && StringUtil.isBlank(threeLevelWardLabel.getDiffDiagText())

+ 6 - 2
kernel/src/main/java/com/lantone/qc/kernel/catalogue/threelevelward/THR0430.java

@@ -5,6 +5,7 @@ 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.label.ThreeLevelWardLabel;
+import com.lantone.qc.pub.util.ListUtil;
 import com.lantone.qc.pub.util.StringUtil;
 import org.springframework.stereotype.Component;
 
@@ -20,13 +21,16 @@ import java.util.List;
 public class THR0430 extends QCCatalogue {
     public void start(InputInfo inputInfo, OutputInfo outputInfo) {
         status.set("0");
+        if (ListUtil.isEmpty(inputInfo.getRescueDocs())) {
+            return;
+        }
         if (inputInfo.getThreeLevelWardDocs().size() > 0) {
             List<ThreeLevelWardDoc> threeLevelWardDocs = inputInfo.getThreeLevelWardDocs();
             for (ThreeLevelWardDoc threeLevelWardDoc : threeLevelWardDocs) {
-                if (threeLevelWardDoc.getThreeLevelWardLabel().getSerious() != 3) {
+                ThreeLevelWardLabel threeLevelWardLabel = threeLevelWardDoc.getThreeLevelWardLabel();
+                if (threeLevelWardLabel == null || threeLevelWardLabel.getSerious() != 3) {
                     continue;
                 }
-                ThreeLevelWardLabel threeLevelWardLabel = threeLevelWardDoc.getThreeLevelWardLabel();
                 if (threeLevelWardLabel.getDiags().size() == 0
                         || StringUtil.isNotBlank(threeLevelWardLabel.getDiagBasisText()) && threeLevelWardLabel.getDiagBasisText().length() < 30
                         || threeLevelWardLabel.getDiffDiag().size() == 0 && StringUtil.isBlank(threeLevelWardLabel.getDiffDiagText())

+ 6 - 2
kernel/src/main/java/com/lantone/qc/kernel/catalogue/threelevelward/THR0431.java

@@ -5,6 +5,7 @@ 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.label.ThreeLevelWardLabel;
+import com.lantone.qc.pub.util.ListUtil;
 import org.springframework.stereotype.Component;
 
 import java.util.List;
@@ -19,13 +20,16 @@ import java.util.List;
 public class THR0431 extends QCCatalogue {
     public void start(InputInfo inputInfo, OutputInfo outputInfo) {
         status.set("0");
+        if (ListUtil.isEmpty(inputInfo.getSeriouslyIllNoticeDocs())) {
+            return;
+        }
         if (inputInfo.getThreeLevelWardDocs().size() > 0) {
             List<ThreeLevelWardDoc> threeLevelWardDocs = inputInfo.getThreeLevelWardDocs();
             for (ThreeLevelWardDoc threeLevelWardDoc : threeLevelWardDocs) {
-                if (threeLevelWardDoc.getThreeLevelWardLabel().getSerious() != 1) {
+                ThreeLevelWardLabel threeLevelWardLabel = threeLevelWardDoc.getThreeLevelWardLabel();
+                if (threeLevelWardLabel == null || threeLevelWardLabel.getSerious() != 1) {
                     continue;
                 }
-                ThreeLevelWardLabel threeLevelWardLabel = threeLevelWardDoc.getThreeLevelWardLabel();
                 if (threeLevelWardLabel.getTreatmentPlans().size() == 0) {
                     status.set("-1");
                     return;

+ 6 - 2
kernel/src/main/java/com/lantone/qc/kernel/catalogue/threelevelward/THR0432.java

@@ -5,6 +5,7 @@ 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.label.ThreeLevelWardLabel;
+import com.lantone.qc.pub.util.ListUtil;
 import org.springframework.stereotype.Component;
 
 import java.util.List;
@@ -19,13 +20,16 @@ import java.util.List;
 public class THR0432 extends QCCatalogue {
     public void start(InputInfo inputInfo, OutputInfo outputInfo) {
         status.set("0");
+        if (ListUtil.isEmpty(inputInfo.getDifficultCaseDiscussDocs())) {
+            return;
+        }
         if (inputInfo.getThreeLevelWardDocs().size() > 0) {
             List<ThreeLevelWardDoc> threeLevelWardDocs = inputInfo.getThreeLevelWardDocs();
             for (ThreeLevelWardDoc threeLevelWardDoc : threeLevelWardDocs) {
-                if (threeLevelWardDoc.getThreeLevelWardLabel().getSerious() != 2) {
+                ThreeLevelWardLabel threeLevelWardLabel = threeLevelWardDoc.getThreeLevelWardLabel();
+                if (threeLevelWardLabel == null || threeLevelWardLabel.getSerious() != 2) {
                     continue;
                 }
-                ThreeLevelWardLabel threeLevelWardLabel = threeLevelWardDoc.getThreeLevelWardLabel();
                 if (threeLevelWardLabel.getTreatmentPlans().size() == 0) {
                     status.set("-1");
                     return;

+ 6 - 2
kernel/src/main/java/com/lantone/qc/kernel/catalogue/threelevelward/THR0433.java

@@ -5,6 +5,7 @@ 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.label.ThreeLevelWardLabel;
+import com.lantone.qc.pub.util.ListUtil;
 import org.springframework.stereotype.Component;
 
 import java.util.List;
@@ -19,13 +20,16 @@ import java.util.List;
 public class THR0433 extends QCCatalogue {
     public void start(InputInfo inputInfo, OutputInfo outputInfo) {
         status.set("0");
+        if (ListUtil.isEmpty(inputInfo.getRescueDocs())) {
+            return;
+        }
         if (inputInfo.getThreeLevelWardDocs().size() > 0) {
             List<ThreeLevelWardDoc> threeLevelWardDocs = inputInfo.getThreeLevelWardDocs();
             for (ThreeLevelWardDoc threeLevelWardDoc : threeLevelWardDocs) {
-                if (threeLevelWardDoc.getThreeLevelWardLabel().getSerious() != 3) {
+                ThreeLevelWardLabel threeLevelWardLabel = threeLevelWardDoc.getThreeLevelWardLabel();
+                if (threeLevelWardLabel == null || threeLevelWardLabel.getSerious() != 3) {
                     continue;
                 }
-                ThreeLevelWardLabel threeLevelWardLabel = threeLevelWardDoc.getThreeLevelWardLabel();
                 if (threeLevelWardLabel.getTreatmentPlans().size() == 0) {
                     status.set("-1");
                     return;

+ 2 - 1
kernel/src/main/java/com/lantone/qc/kernel/catalogue/threelevelward/THR0435.java

@@ -7,6 +7,7 @@ import com.lantone.qc.pub.model.InputInfo;
 import com.lantone.qc.pub.model.OutputInfo;
 import com.lantone.qc.pub.model.doc.DifficultCaseDiscussDoc;
 import com.lantone.qc.pub.model.doc.ThreeLevelWardDoc;
+import com.lantone.qc.pub.util.ListUtil;
 import com.lantone.qc.pub.util.StringUtil;
 import org.springframework.stereotype.Component;
 
@@ -27,7 +28,7 @@ import java.util.TreeMap;
 public class THR0435 extends QCCatalogue {
     public void start(InputInfo inputInfo, OutputInfo outputInfo) {
         status.set("0");
-        if (inputInfo.getDifficultCaseDiscussDocs().size() == 0 || inputInfo.getThreeLevelWardDocs().size() == 0) {
+        if (ListUtil.isEmpty(inputInfo.getDifficultCaseDiscussDocs()) || ListUtil.isEmpty(inputInfo.getThreeLevelWardDocs())) {
             return;
         }
         List<DifficultCaseDiscussDoc> difficultCaseDiscussDocs = inputInfo.getDifficultCaseDiscussDocs(); //疑难病例讨论记录

+ 2 - 1
kernel/src/main/java/com/lantone/qc/kernel/catalogue/threelevelward/THR0436.java

@@ -7,6 +7,7 @@ import com.lantone.qc.pub.model.InputInfo;
 import com.lantone.qc.pub.model.OutputInfo;
 import com.lantone.qc.pub.model.doc.RescueDoc;
 import com.lantone.qc.pub.model.doc.ThreeLevelWardDoc;
+import com.lantone.qc.pub.util.ListUtil;
 import com.lantone.qc.pub.util.StringUtil;
 import org.springframework.stereotype.Component;
 
@@ -27,7 +28,7 @@ import java.util.TreeMap;
 public class THR0436 extends QCCatalogue {
     public void start(InputInfo inputInfo, OutputInfo outputInfo) {
         status.set("0");
-        if (inputInfo.getRescueDocs().size() == 0 || inputInfo.getThreeLevelWardDocs().size() == 0) {
+        if (ListUtil.isEmpty(inputInfo.getRescueDocs()) || ListUtil.isEmpty(inputInfo.getThreeLevelWardDocs())) {
             return;
         }
         List<RescueDoc> rescueDocs = inputInfo.getRescueDocs(); //抢救记录

+ 19 - 8
kernel/src/main/java/com/lantone/qc/kernel/structure/ai/FirstCourseRecordAI.java

@@ -11,7 +11,8 @@ import com.lantone.qc.pub.Content;
 import com.lantone.qc.pub.model.InputInfo;
 import com.lantone.qc.pub.model.doc.FirstCourseRecordDoc;
 import com.lantone.qc.pub.model.entity.Diag;
-import com.lantone.qc.pub.model.label.*;
+import com.lantone.qc.pub.model.label.PresentLabel;
+import com.lantone.qc.pub.model.label.TreatPlanLabel;
 import com.lantone.qc.pub.util.StringUtil;
 import org.apache.commons.lang3.StringUtils;
 
@@ -51,18 +52,28 @@ public class FirstCourseRecordAI extends ModelAI {
 
             //病历特点与现病史比较相似度
             if (inputInfo.getBeHospitalizedDoc() != null && StringUtil.isNotBlank(inputInfo.getBeHospitalizedDoc().getPresentLabel().getText())) {
-                putContent(similarContent, firstCourseRecordDoc.getCaseCharacteristicLabel().getText(),inputInfo.getBeHospitalizedDoc().getPresentLabel().getText());
+                putContent(similarContent, firstCourseRecordDoc.getCaseCharacteristicLabel().getText(), inputInfo.getBeHospitalizedDoc().getPresentLabel().getText());
             }
 
             JSONObject midData = loadAI(crfContent, crfServiceClient);//crf返回数据
-            putCaseCharacteristicCrfData(midData.getJSONObject(Content.case_feature), inputInfo);//处理病历特点
-            putInitialDiagCrfData(midData.getJSONObject(Content.initial_diag), inputInfo);//处理初步诊断
-            putDiagnosisCrfData(midData.getJSONObject(Content.diag_basis), inputInfo);//处理诊断依据
-            putDifferentialDiagCrfData(midData.getJSONObject(Content.differential_diag_basis), inputInfo);//处理鉴别诊断
-            putTreatPlanCrfData(midData.getJSONObject(Content.treat_plan), inputInfo);//处理诊疗计划
+            if (midData.containsKey(Content.case_feature)) {
+                putCaseCharacteristicCrfData(midData.getJSONObject(Content.case_feature), inputInfo);//处理病历特点
+            }
+            if (midData.containsKey(Content.initial_diag)) {
+                putInitialDiagCrfData(midData.getJSONObject(Content.initial_diag), inputInfo);//处理初步诊断
+            }
+            if (midData.containsKey(Content.diag_basis)) {
+                putDiagnosisCrfData(midData.getJSONObject(Content.diag_basis), inputInfo);//处理诊断依据
+            }
+            if (midData.containsKey(Content.differential_diag_basis)) {
+                putDifferentialDiagCrfData(midData.getJSONObject(Content.differential_diag_basis), inputInfo);//处理鉴别诊断
+            }
+            if (midData.containsKey(Content.treat_plan)) {
+                putTreatPlanCrfData(midData.getJSONObject(Content.treat_plan), inputInfo);//处理诊疗计划
+            }
 
             double likeRate = loadSimilarAI(similarContent, similarityServiceClient);
-            putCaseCharacteristicSimilarData(likeRate,inputInfo);//存放与现病史文本相似度
+            putCaseCharacteristicSimilarData(likeRate, inputInfo);//存放与现病史文本相似度
         }
     }
 

+ 28 - 7
kernel/src/main/java/com/lantone/qc/kernel/structure/ai/ThreeLevelWardAI.java

@@ -56,7 +56,7 @@ public class ThreeLevelWardAI extends ModelAI {
         Map<String, String> lastCourseRecord = getLastCourseRecord(threeLevelWardDocs);
         if (lastCourseRecord != null && lastCourseRecord.containsKey("病情记录")) {
             //主任医师最后一次查房记录
-            putContent(crfContent, medicalTextType.get(1), lastCourseRecord.get("病情记录"), "最后一次" + Content.director);
+            putContent(crfContent, medicalTextType.get(1), lastCourseRecord.get("病情记录"), Content.director + "最后一次");
         }
 
         List<Map<String, String>> directorDifficultRecord = new ArrayList<>();
@@ -86,7 +86,10 @@ public class ThreeLevelWardAI extends ModelAI {
         if (midData.get(Content.director) != null) {
             putWardRoundCrfData(midData.getJSONObject(Content.director), inputInfo, Content.director, 0);//查房记录
         }
-        putWardRoundCrfData(midData.getJSONObject("最后一次" + Content.director), inputInfo, "最后一次" + Content.director, 0);//最后一次查房记录
+        //主任医师最后一次查房记录模型输出
+        if (midData.get(Content.director + "最后一次") != null) {
+            putWardRoundCrfData(midData.getJSONObject(Content.director + "最后一次"), inputInfo, Content.director + "最后一次", 0);//最后一次查房记录
+        }
         //疑难患者副高及以上查房记录模型输出
         if (inputInfo.getDifficultCaseDiscussDocs().size() > 0 && ListUtil.isNotEmpty(directorDifficultRecord)) {
             for (int i = 0; i < directorDifficultRecord.size(); i++) {
@@ -108,6 +111,19 @@ public class ThreeLevelWardAI extends ModelAI {
 
     }
 
+    protected void putContent(JSONArray crfContent, String medicalTextType, String text, String sign) {
+        String move_text = CatalogueUtil.removeSpecialChar(text);
+        if (StringUtil.isEmpty(move_text)) {
+            return;
+        }
+        JSONObject detailContent = new JSONObject();
+        detailContent.put("medical_text_type", medicalTextType);
+        detailContent.put("content", move_text);
+        detailContent.put("detail_title", sign);
+        detailContent.put("originalText", text);
+        crfContent.add(detailContent);
+    }
+
     /**
      * 处理查房记录
      *
@@ -116,15 +132,20 @@ public class ThreeLevelWardAI extends ModelAI {
      */
     public void putWardRoundCrfData(JSONObject jsonObject, InputInfo inputInfo, String detailTitle, int serious) {
         JSONObject aiOut = loadEntity(jsonObject, entityRelationObject, outputs, content);
+        String originalText = jsonObject.getString("originalText");
         //使用现病史结构来处理病历特点
         EntityProcessThreeLevelWard entityProcessThreeLevelWard = new EntityProcessThreeLevelWard();
         ThreeLevelWardLabel threeLevelWardLabel = entityProcessThreeLevelWard.extractEntity(aiOut);
         threeLevelWardLabel.setTitle(detailTitle);
         threeLevelWardLabel.setSerious(serious);
-        ThreeLevelWardDoc threeLevelWardDoc = new ThreeLevelWardDoc();
-        threeLevelWardDoc.setThreeLevelWardLabel(threeLevelWardLabel);
-        //临床表现
-        inputInfo.getThreeLevelWardDocs().add(threeLevelWardDoc);
+        List<ThreeLevelWardDoc> threeLevelWardDocs = inputInfo.getThreeLevelWardDocs();
+        for (ThreeLevelWardDoc threeLevelWardDoc : threeLevelWardDocs) {
+            String text = threeLevelWardDoc.getText();
+            if (StringUtil.isNotBlank(text) && StringUtil.isNotBlank(originalText) && text.equals(originalText)) {
+                threeLevelWardDoc.setThreeLevelWardLabel(threeLevelWardLabel);
+                break;
+            }
+        }
     }
 
     /**
@@ -303,7 +324,7 @@ public class ThreeLevelWardAI extends ModelAI {
             dateRecord.put(recordDate, rescueStructureMap);
         }
         List<Map<String, String>> dateRecordList = new ArrayList<>(dateRecord.values());
-        if (ListUtil.isEmpty(dateRecordList)){
+        if (ListUtil.isEmpty(dateRecordList)) {
             return null;
         }
         return dateRecordList.get(0);

+ 8 - 9
kernel/src/main/java/com/lantone/qc/kernel/structure/ai/process/EntityProcessThreeLevelWard.java

@@ -65,9 +65,8 @@ public class EntityProcessThreeLevelWard extends EntityProcess {
             //补充诊断/初步诊断/修正诊断
             addDiag(threeLevelWardLabel, diffDiagSplit, diagLemmas);
             //添加鉴别诊断
-            List<Lemma> dieaseLemmas = createEntityTree(aiOut, EntityEnum.DIEASE.toString());
             List<Diag> diags = new ArrayList<>();
-            for (Lemma dieaseLemma : dieaseLemmas) {
+            for (Lemma dieaseLemma : diagLemmas) {
                 if (Integer.parseInt(dieaseLemma.getPosition()) < Integer.parseInt(diffDiagSplit[0])
                         || Integer.parseInt(dieaseLemma.getPosition()) > Integer.parseInt(diffDiagSplit[diffDiagSplit.length - 1])) {
                     continue;
@@ -173,25 +172,25 @@ public class EntityProcessThreeLevelWard extends EntityProcess {
         String subContentIndex = "", title = "";
         for (int i = 0; i < lemmaList.size(); i++) {
             lemma = lemmaList.get(i);
-            if (!titleList.contains(lemma.getProperty()) && i != lemmaList.size() - 1) {
+            if (!titleList.contains(lemma.getProperty())) {
                 continue;
             }
             if (i != lemmaList.size() - 1) {
                 if (start == 0) {
                     start = Integer.parseInt(lemma.getPosition());
-                    title = lemma.getText();//截取的这一段文本的标题
+                    title = lemma.getProperty();//截取的这一段文本的标题
                 } else {
                     //subContent = content.substring(start + title.length(), Integer.parseInt(lemma.getPosition()));
-                    subContentIndex = start + title.length() + "," + Integer.parseInt(lemma.getPosition());
+                    subContentIndex = start + lemma.getText().length() + 1 + "," + Integer.parseInt(lemma.getPosition());
                     putSubContent(titleText, title, subContentIndex);
                     start = Integer.parseInt(lemma.getPosition());
-                    title = lemma.getText();//截取的这一段文本的标题
+                    title = lemma.getProperty();//截取的这一段文本的标题
                 }
             } else {
                 //如果是最后一个Lemma,文本就从start开始取,取到结束
                 //subContent = content.substring((start + lemma.getText().length()));
                 int lastIndex = content.length() - 1;
-                subContentIndex = start + title.length() + "," + lastIndex;
+                subContentIndex = start + lemma.getText().length() + "," + lastIndex;
                 putSubContent(titleText, title, subContentIndex);
             }
         }
@@ -220,7 +219,7 @@ public class EntityProcessThreeLevelWard extends EntityProcess {
         List<Clinical> clinicals = new ArrayList<>();
         for (Lemma lemma : clinicalLemmas) {
             if (Integer.parseInt(lemma.getPosition()) > Integer.parseInt(indexArray[0])
-                    || Integer.parseInt(lemma.getPosition()) < Integer.parseInt(indexArray[indexArray.length - 1])) {
+                    && Integer.parseInt(lemma.getPosition()) < Integer.parseInt(indexArray[indexArray.length - 1])) {
                 continue;
             }
             Clinical clinical = new Clinical();
@@ -245,7 +244,7 @@ public class EntityProcessThreeLevelWard extends EntityProcess {
         List<Diag> diags = new ArrayList<>();
         for (Lemma lemma : diagLemmas) {
             if (Integer.parseInt(lemma.getPosition()) > Integer.parseInt(indexArray[0])
-                    || Integer.parseInt(lemma.getPosition()) < Integer.parseInt(indexArray[indexArray.length - 1])) {
+                    && Integer.parseInt(lemma.getPosition()) < Integer.parseInt(indexArray[indexArray.length - 1])) {
                 continue;
             }
             Diag diag = new Diag();

+ 35 - 10
kernel/src/main/java/com/lantone/qc/kernel/util/ModelDataUtil.java

@@ -13,6 +13,7 @@ import com.lantone.qc.pub.model.doc.operation.OperationDoc;
 import com.lantone.qc.pub.model.vo.QueryVo;
 import com.lantone.qc.pub.util.ListUtil;
 import com.lantone.qc.pub.util.PropertiesUtil;
+import com.lantone.qc.pub.util.StringUtil;
 import com.lantone.qc.trans.TransDispatch;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -43,7 +44,7 @@ public class ModelDataUtil {
         firstCourseRecord(inputInfo, changxDocs, "首次病程录");
         operationDiscussion(inputInfo, changxDocs, "术后首次病程及谈话记录文档");
         threeLevelWard(inputInfo, changxDocs, "三级查房记录");
-        leaveHospital(inputInfo, changxDocs, "出院小结");
+        //        leaveHospital(inputInfo, changxDocs, "出院小结");
         insertDB(caseNumber, changxDocs);
     }
 
@@ -54,13 +55,9 @@ public class ModelDataUtil {
                 propertiesUtil.getProperty("mysql.test.url"));
         Connection connect = null;
         PreparedStatement pst = null;
-        String sql = "TRUNCATE qc_model_input_info";
+        String sql = "INSERT INTO qc_model_input_info(case_number,title,sub_title,text) VALUES(?,?,?,?)";
         try {
             connect = mysqlJdbc.connect();
-            pst = connect.prepareStatement(sql);
-            pst.execute();
-
-            sql = "INSERT INTO qc_model_input_info(case_number,title,sub_title,text) VALUES(?,?,?,?)";
             connect.setAutoCommit(false);
             pst = connect.prepareStatement(sql);
             for (Map.Entry<String, Map<String, String>> changxDoc : changxDocs.entrySet()) {
@@ -73,7 +70,7 @@ public class ModelDataUtil {
                     pst.setString(4, doc.getValue());
                     pst.addBatch();
                     i++;
-                    if ((i != 0 && i % 1000 == 0) || i == changxDoc.getValue().size() - 1) {
+                    if ((i != 0 && i % 1000 == 0) || i == changxDoc.getValue().size()) {
                         pst.executeBatch();
                         connect.commit();
                         pst.clearBatch();
@@ -92,6 +89,31 @@ public class ModelDataUtil {
         }
     }
 
+    public void truncateDB(String dbName) {
+        PropertiesUtil propertiesUtil = new PropertiesUtil("kernel.properties");
+        MysqlJdbc mysqlJdbc = new MysqlJdbc(propertiesUtil.getProperty("mysql.test.user"),
+                propertiesUtil.getProperty("mysql.test.password"),
+                propertiesUtil.getProperty("mysql.test.url"));
+        Connection connect = null;
+        PreparedStatement pst = null;
+        String sql = "TRUNCATE " + dbName;
+        try {
+            connect = mysqlJdbc.connect();
+            pst = connect.prepareStatement(sql);
+            pst.execute();
+            logger.info(dbName + "表已清空");
+        } catch (Exception e) {
+            System.out.println(e.getMessage());
+        } finally {
+            try {
+                pst.close();
+                connect.close();
+            } catch (SQLException e) {
+                e.printStackTrace();
+            }
+        }
+    }
+
     /**
      * 入院记录
      *
@@ -217,9 +239,12 @@ public class ModelDataUtil {
         if (firstWardRecord.get(Content.director) != null) {
             putDoc(changxDoc, Content.director + "首次查房记录", firstWardRecord.get(Content.director).get("病情记录"));
         }
+
         Map<String, String> lastCourseRecord = threeLevelWardAI.getLastCourseRecord(threeLevelWardDocs);
-        //主任医师最后一次查房记录
-        putDoc(changxDoc, Content.director + "末次查房记录", lastCourseRecord.get("病情记录"));
+        if (lastCourseRecord != null && lastCourseRecord.containsKey("病情记录")) {
+            //主任医师最后一次查房记录
+            putDoc(changxDoc, Content.director + "末次查房记录", lastCourseRecord.get("病情记录"));
+        }
 
         List<Map<String, String>> directorDifficultRecord = new ArrayList<>();
         //疑难患者副高及以上查房记录
@@ -260,7 +285,7 @@ public class ModelDataUtil {
     }
 
     private void putDoc(Map<String, String> changxDoc, String title, String content) {
-        if (CatalogueUtil.isEmpty(content)) {
+        if (StringUtil.isEmpty(content)) {
             return;
         }
         if (title.contains("、")) {

+ 24 - 2
kernel/src/main/java/com/lantone/qc/kernel/web/controller/QCTestController.java

@@ -3,7 +3,6 @@ package com.lantone.qc.kernel.web.controller;
 import com.google.common.collect.Lists;
 import com.lantone.qc.kernel.analysis.QCAnalysis;
 import com.lantone.qc.kernel.util.CacheFileManager;
-import com.lantone.qc.kernel.util.ModelDataUtil;
 import com.lantone.qc.kernel.util.KernelConstants;
 import com.lantone.qc.pub.jdbc.MysqlJdbc;
 import com.lantone.qc.pub.model.OutputInfo;
@@ -16,7 +15,9 @@ import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.*;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
 
 import java.sql.Connection;
 import java.sql.ResultSet;
@@ -64,6 +65,7 @@ public class QCTestController {
 
         List<Map<String, Object>> updates = new ArrayList<>();
         List<Map<String, Object>> wheres = new ArrayList<>();
+//        modelDataUtil.truncateDB("qc_model_input_info");//清空表
         for (Map.Entry<String, QueryVo> entry : queryVoMap.entrySet()) {
             System.out.println("患者就诊号:" + entry.getKey() + "..........");
 //            modelDataUtil.executor(entry.getKey(), entry.getValue());//AI所需模块数据存入DB
@@ -97,6 +99,26 @@ public class QCTestController {
         return response;
     }
 
+
+    @ApiOperation(value = "质控单个病历测试,无需token信息", notes = "")
+    @PostMapping("qc_test_single")
+    public Response<OutputInfo> qc_test_single(String cid, String caseNumber, String hospitalId) {
+        Response response = new Response();
+        if (StringUtils.isEmpty(hospitalId)) {
+            response.setData("未填写医院流水号(hospitalId)......");
+        }
+        if (StringUtils.isEmpty(cid)) {
+            response.setData("未填写医院缩写(cid)......");
+        }
+        //key = 患者就诊号
+        Map<String, QueryVo> queryVoMap = createQueryVo(cid, hospitalId, caseNumber);
+        //key = 患者就诊号
+        OutputInfo outputInfo = qCAnalysis.anlysis(queryVoMap.get(caseNumber));
+        response.setData(outputInfo);
+        return response.success();
+    }
+
+
     public Map<String, QueryVo> createQueryVo(String cid, String hospitalId, String caseNumber) {
         PropertiesUtil propertiesUtil = new PropertiesUtil("kernel.properties");
         MysqlJdbc mysqlJdbc = new MysqlJdbc(propertiesUtil.getProperty("mysql.test.user"),

+ 13 - 14
kernel/src/test/java/com/lantone/qc/kernel/DataTest.java

@@ -6,10 +6,7 @@ import com.alibaba.fastjson.JSONObject;
 import com.lantone.qc.pub.util.PropertiesUtil;
 
 import java.sql.*;
-import java.util.HashMap;
-import java.util.LinkedHashMap;
-import java.util.Map;
-import java.util.Properties;
+import java.util.*;
 
 /**
  * @ClassName : DataTest
@@ -22,11 +19,11 @@ public class DataTest {
 
     }
 
-    public static Map<String, String> loadHomePage(String patientId) {
+    public static List<Map<String, String>> loadHomePage(String tableName, String patientId) {
         Connection conn = null;
         Statement stmt = null;
         ResultSet rs = null;
-        Map<String, String> js = null;
+        List<Map<String, String>> resultList = null;
         try {
             PropertiesUtil propertiesUtil = new PropertiesUtil("kernel.properties");
             Class.forName(propertiesUtil.getProperty("oracle.test.driver"));
@@ -46,7 +43,7 @@ public class DataTest {
             stmt = conn.createStatement();
 
             DatabaseMetaData dmd = conn.getMetaData();
-            ResultSet dmdRs = dmd.getColumns(null, null, "BR_RECHOME", null);
+            ResultSet dmdRs = dmd.getColumns(null, null, tableName, null);
 
             Map<String, String> colMap = new LinkedHashMap<>();
             while(dmdRs.next()){
@@ -54,8 +51,8 @@ public class DataTest {
             }
             dmdRs.close();
 
-            rs = stmt.executeQuery("select * from br_rechome where brzyid = '" + patientId + "'");
-            js = resultSetToJson(rs, colMap);
+            rs = stmt.executeQuery("select * from " + tableName + " where brzyid = '" + patientId + "'");
+            resultList = resultSetToJson(rs, colMap);
         } catch (SQLException ex) {
             ex.printStackTrace();
         } catch (Exception e) {
@@ -78,24 +75,26 @@ public class DataTest {
                 e.printStackTrace();
             }
         }
-        return js;
+        return resultList;
     }
 
-    public static Map<String, String> resultSetToJson(ResultSet rs, Map<String, String> map) throws SQLException, JSONException {
+    public static List<Map<String, String>> resultSetToJson(ResultSet rs, Map<String, String> map) throws SQLException, JSONException {
         // 获取列数
         ResultSetMetaData metaData = (ResultSetMetaData) rs.getMetaData();
         int columnCount = metaData.getColumnCount();
-        // 遍历ResultSet中的每条数据
-        Map<String, String> result = new LinkedHashMap<>();
+        List<Map<String, String>> resultList = new ArrayList<>();
         while (rs.next()) {
+            // 遍历ResultSet中的每条数据
+            Map<String, String> result = new LinkedHashMap<>();
             // 遍历每一列
             for (int i = 1; i <= columnCount; i++) {
                 String columnName = metaData.getColumnLabel(i);
                 String value = rs.getString(columnName) == null ? "" : rs.getString(columnName);
                 result.put(map.get(columnName), value);
             }
+            resultList.add(result);
         }
-        return result;
+        return resultList;
     }
 
 }

+ 20 - 0
kernel/src/test/java/com/lantone/qc/kernel/Doctor.java

@@ -0,0 +1,20 @@
+package com.lantone.qc.kernel;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @ClassName : Doctor
+ * @Description :
+ * @Author : 楼辉荣
+ * @Date: 2020-04-04 13:17
+ */
+@Getter
+@Setter
+public class Doctor {
+    private String doctorId;
+    private String doctorName;
+    private String deptId;
+    private String deptName;
+    private String professor;
+}

+ 73 - 25
kernel/src/test/java/com/lantone/qc/kernel/TaizDataImportApiTest.java

@@ -1,19 +1,19 @@
 package com.lantone.qc.kernel;
 
-import com.alibaba.fastjson.JSONArray;
-import com.alibaba.fastjson.JSONObject;
-import com.google.gson.JsonObject;
 import com.lantone.qc.pub.jdbc.MysqlJdbc;
 import com.lantone.qc.pub.util.FastJsonUtils;
 import com.lantone.qc.pub.util.PropertiesUtil;
 import com.lantone.qc.trans.changx.util.CxXmlUtil;
+import com.lantone.qc.trans.changx.util.CxXmlUtilTemp;
 import com.lantone.qc.trans.taizhou.util.TzXmlUtil;
-import com.lantone.qc.trans.util.http.HttpApi;
 import org.apache.commons.lang3.StringUtils;
 
 import java.io.ByteArrayOutputStream;
 import java.io.InputStream;
-import java.sql.*;
+import java.sql.Connection;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.sql.Statement;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
@@ -41,10 +41,12 @@ public class TaizDataImportApiTest {
         //长兴患者信息
         if (cid.equals("changx")) {
             test.insertPatient(test.loadOraclePatients("BR_INPATIENTINFO_CX"));
+            test.insertDoctor(test.loadOracleDoctorInfos("GI_USERINFO", "HI_DEPTINFO"));
         }
         //台州患者信息
         if (cid.equals("taizhou")) {
             test.insertPatient(test.loadOraclePatients("BR_INPATIENTINFO_TZ20200330"));
+            test.insertDoctor(test.loadOracleDoctorInfos("GI_USERINFO", "HI_DEPTINFO"));
         }
         //病人流水号获取    病历号--->id
         Map<String, String> patientMap = test.loadPatients(hospitalId);
@@ -64,13 +66,27 @@ public class TaizDataImportApiTest {
         initMysqlJdbc().insert(list, "qc_cases_number_copy", new String[]{"hospital_id", "case_number"});
     }
 
+    private void insertDoctor(List<Doctor> doctors) {
+        List<Map<String, Object>> list = new ArrayList<>();
+        for (Doctor doctor : doctors) {
+            Map<String, Object> doctorMap = new HashMap<>();
+            doctorMap.put("doctor_id", doctor.getDoctorId());
+            doctorMap.put("doctor_name", doctor.getDoctorName());
+            doctorMap.put("dept_id", doctor.getDeptId());
+            doctorMap.put("dept_name", doctor.getDeptName());
+            doctorMap.put("professor", doctor.getProfessor());
+            list.add(doctorMap);
+        }
+        initMysqlJdbc().insert(list, "qc_doctor_info", new String[]{"doctor_id", "doctor_name", "dept_id", "dept_name", "professor"});
+    }
+
     private void insertPatientText(Map<String, String> patientMap, Map<String, String> modelMap) {
         List<Map<String, Object>> list = new ArrayList<>();
 
         for (Map.Entry<String, String> entry : patientMap.entrySet()) {
             List<PatientText> patientTexts = new ArrayList<>();
             //病人的病案首页内容
-            Map<String, String> homePageMap = DataTest.loadHomePage(entry.getKey());
+            List<Map<String, String>> homePageMap = DataTest.loadHomePage("BR_RECHOME_CX", entry.getKey());
             if (homePageMap == null || homePageMap.isEmpty()) { //没病案首页直接不导入
                 deletePatient.add(entry.getKey()); //没病案首页的患者也要删除
                 continue;
@@ -81,13 +97,12 @@ public class TaizDataImportApiTest {
             firstPageTextMap.put("hospital_id", hospitalId);
             firstPageTextMap.put("mode_id", 6);
             firstPageTextMap.put("origin_mode", "病案首页");
-            firstPageTextMap.put("origin_text", FastJsonUtils.getBeanToJson(homePageMap));
+            firstPageTextMap.put("origin_text", FastJsonUtils.getBeanToJson(homePageMap.get(0)));
             String pagetext = "";
-            for (Map.Entry<String, String> e : homePageMap.entrySet()) {
+            for (Map.Entry<String, String> e : homePageMap.get(0).entrySet()) {
                 pagetext = pagetext + "【" + e.getKey() + "】:" + e.getValue().toString() + "\n";
             }
             firstPageTextMap.put("text", pagetext);
-
             if ("changx".equals(cid)) {
                 patientTexts = loadChangxOraclePatientTexts(entry.getKey());
             }
@@ -99,13 +114,30 @@ public class TaizDataImportApiTest {
             }
             //数据完整后才放入病案首页
             list.add(firstPageTextMap);
+
+            //病人医嘱信息
+            List<Map<String, String>> docAdviceMap = DataTest.loadHomePage("BR_DOCTADVICE_CX", entry.getKey());
+            for (Map<String, String> docMap : docAdviceMap) {
+                Map<String, Object> docAdviceTextMap = new HashMap<>();
+                docAdviceTextMap.put("case_number", entry.getKey());
+                docAdviceTextMap.put("case_number_id", patientMap.get(entry.getKey()));
+                docAdviceTextMap.put("hospital_id", hospitalId);
+                docAdviceTextMap.put("mode_id", 8);
+                docAdviceTextMap.put("origin_mode", "医嘱信息");
+                docAdviceTextMap.put("origin_text", FastJsonUtils.getBeanToJson(docMap));
+                pagetext = "";
+                for (Map.Entry<String, String> e : docMap.entrySet()) {
+                    pagetext = pagetext + "【" + e.getKey() + "】:" + e.getValue().toString() + "\n";
+                }
+                docAdviceTextMap.put("text", pagetext);
+                list.add(docAdviceTextMap);
+            }
+            //病人其他文书信息
             for (PatientText patientText : patientTexts) {
-//System.out.println(patientText.getBrzyid() + "  " + patientText.getBljlmc());
                 Map<String, Object> patientTextMap = new HashMap<>();
                 patientTextMap.put("case_number", patientText.getBrzyid());
                 patientTextMap.put("case_number_id", patientMap.get(patientText.getBrzyid()));
                 patientTextMap.put("hospital_id", hospitalId);
-//System.out.println("******" + patientText.getBljlmc() + "**" + caseMap.get(patientText.getBljlmc()));
                 patientTextMap.put("mode_id", modelMap.get(caseMap.get(patientText.getBljlmc())));
                 patientTextMap.put("origin_mode", patientText.getBljlmc());
                 if (patientTextMap.get("mode_id") == null) {
@@ -116,7 +148,7 @@ public class TaizDataImportApiTest {
                 String text = "";
                 Map<String, String> textMap = new HashMap<>();
                 if ("changx".equals(cid)) {
-                    textMap = CxXmlUtil.firstLevelNodeValue(patientText.getBljlnr(), caseMap.get(patientText.getBljlmc()));
+                    textMap = CxXmlUtilTemp.beHospitalizedXmlToMap(patientText.getBljlnr(), caseMap.get(patientText.getBljlmc()));
                 }
                 if ("taizhou".equals(cid)) {
                     textMap = TzXmlUtil.getXmlToMapForTZ(patientText.getBljlnr());
@@ -187,6 +219,35 @@ public class TaizDataImportApiTest {
         return patients;
     }
 
+    private List<Doctor> loadOracleDoctorInfos(String tableUser, String tableDept) {
+        MysqlJdbc mysqlJdbc = initOracleJdbc();
+        Connection conn = mysqlJdbc.connect();
+        Statement st = null;
+        ResultSet rs = null;
+        List<Doctor> doctors = new ArrayList<>();
+        try {
+            st = conn.createStatement();
+            String sql = "select u.yhrydm, u.yhrymc, u.yhryzc, dept.zzksid, dept.zzksmc from " + tableDept + " dept, " + tableUser + " u where u.zzksid = dept.zzksid";
+            rs = st.executeQuery(sql);
+            while (rs.next()) {
+                Doctor doctor = new Doctor();
+                doctor.setDoctorId(rs.getString(1));
+                doctor.setDoctorName(rs.getString(2));
+                doctor.setProfessor(rs.getString(3));
+                doctor.setDeptId(rs.getString(4));
+                doctor.setDeptName(rs.getString(5));
+                doctors.add(doctor);
+            }
+        } catch (SQLException sqle) {
+            sqle.printStackTrace();
+        } catch (Exception e) {
+            e.printStackTrace();
+        } finally {
+            mysqlJdbc.close(rs, st, conn);
+        }
+        return doctors;
+    }
+
     private List<PatientText> loadTaizhouOraclePatientTexts(String brzyid) {
         MysqlJdbc mysqlJdbc = initOracleJdbc();
         Connection conn = mysqlJdbc.connect();
@@ -259,19 +320,6 @@ public class TaizDataImportApiTest {
                 patientText.setBljlmc(r2);
                 patientText.setBljlnr(decompressed);
                 patientTexts.add(patientText);
-
-//                String[] decos = decompressed.split("<\\?");
-//                for (String s : decos) {
-//                    if (StringUtils.isEmpty(s)) continue;
-//                    PatientText patientText = new PatientText();
-//                    patientText.setBrzyid(r1);
-//                    patientText.setBljlmc(r2);
-//
-//                    s = "<?" + s;
-//                    s = CxXmlUtil.cutXml(s);
-//                    patientText.setBljlnr(s);
-//                    patientTexts.add(patientText);
-//                }
             }
         } catch (SQLException sqle) {
             sqle.printStackTrace();

+ 5 - 3
public/src/main/java/com/lantone/qc/pub/Content.java

@@ -128,13 +128,14 @@ public class Content {
     public static final String age = "年龄";
     public static final String nationality = "国籍";
     public static final String birth_date = "出生日期";
-    public static final String newbornAge = "不足1周岁年龄";
+    public static final String newbornAgeMonths = "新生儿年龄月数";
+    public static final String newbornAgeDays = "新生儿年龄天数";
     public static final String newbornWeight = "新生儿出生体重";
     public static final String newbornAdmisWeight = "新生儿入院体重";
     public static final String birth_address = "出生地";
     public static final String native_place = "籍贯";
     public static final String nation = "民族";
-    public static final String idcardInfo = "身份证号";
+    public static final String idNumber = "身份证号";
     public static final String job = "职业";
     public static final String marry = "婚姻";
     public static final String current_address = "现住址";
@@ -179,7 +180,7 @@ public class Content {
     public static final String outHouse = "出院病房";
     public static final String actualStay = "实际住院天数";//病案首页用
     public static final String drugAllergy = "药物过敏";
-    public static final String allergy_drug = "过敏药物";
+    public static final String allergyDrug = "过敏药物";
     public static final String deadAutopsy = "死亡患者尸检";
     public static final String bloodType="血型";
     public static final String rhFactor="Rh";
@@ -260,6 +261,7 @@ public class Content {
             "yyyy年M月d日H时mm分",
             "yyyy年M月d日HH时m分",
             "yyyy年M月d日H时m分",
+            "yyyy-MM-ddHH:mm:ss",
             "yyyy-MM-ddHH:mm",
             "yyyy-MM-ddHH:m",
             "yyyy-MM-ddH:mm",

+ 1 - 0
public/src/main/java/com/lantone/qc/pub/model/doc/operation/OperationDoc.java

@@ -16,5 +16,6 @@ public class OperationDoc {
     private OperationDiscussionDoc operationDiscussionDoc;
     private OperationRecordDoc operationRecordDoc;
     private PreoperativeDiscussionDoc preoperativeDiscussionDoc;
+    private OperationInformedConsentDoc operationInformedConsentDoc;
 
 }

+ 16 - 0
public/src/main/java/com/lantone/qc/pub/model/doc/operation/OperationInformedConsentDoc.java

@@ -0,0 +1,16 @@
+package com.lantone.qc.pub.model.doc.operation;
+
+import com.lantone.qc.pub.model.doc.ModelDoc;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description: 手术知情同意书文档
+ * @author: rengb
+ * @time: 2020/4/4 14:26
+ */
+@Getter
+@Setter
+public class OperationInformedConsentDoc extends ModelDoc {
+    private String operationName;
+}

+ 17 - 0
public/src/main/java/com/lantone/qc/pub/model/keys/TextTypeStandardKeys.java

@@ -92,6 +92,23 @@ public class TextTypeStandardKeys {
             "可能意外和防范措施",
             "拟行术式"
     );
+    //手术-手术知情同意书的标准key
+    public static final List<String> operationInformedConsent = Lists.newArrayList(
+            "姓名",
+            "性别",
+            "病区",
+            "床号",
+            "病案号",
+            "手术医生",
+            "目前诊断",
+            "手术名称",
+            "手术指征",
+            "风险及并发症",
+            "保守治疗",
+            "其他手术",
+            "签名",
+            "签名时间"
+    );
 
 
     //转科记录-转入的标准key

+ 1 - 23
trans/src/main/java/com/lantone/qc/trans/changx/ChangxConsultationDocTrans.java

@@ -85,7 +85,7 @@ public class ChangxConsultationDocTrans extends ModelDocTrans {
         if (StringUtil.isBlank(text)) {
             text = CxXmlUtil.getTextByNodePath(content, "//DocObjContent/Region");
         }
-        Map<String, String> cutWordMap = getCutWordMap(text);
+        Map<String, String> cutWordMap = Preproc.getCutWordMap(true, consultationRecord_sourceTitles, text);
         Map<String, String> xmlNodeValueMap = CxXmlUtil.firstLevelNodeValue("//DocObjContent//Region", content);
         cutWordMap.putAll(xmlNodeValueMap);
         Map<String, String> structureMap = OrdinaryAssistant.mapKeyContrast(cutWordMap, consultationRecord_keyContrasts);
@@ -98,28 +98,6 @@ public class ChangxConsultationDocTrans extends ModelDocTrans {
         return consultationRecordDoc;
     }
 
-    private Map<String, String> getCutWordMap(String content) {
-        if (StringUtil.isBlank(content)) {
-            return Maps.newHashMap();
-        }
-        List<String> targetTitles = Lists.newArrayList();
-        consultationRecord_sourceTitles.forEach(sourceTitle -> {
-            String targetTitle = "";
-            for (int index = 0; index < sourceTitle.length(); index++) {
-                if (index == sourceTitle.length() - 1) {
-                    targetTitle += sourceTitle.substring(index, index + 1);
-                } else {
-                    targetTitle += sourceTitle.substring(index, index + 1) + "[\\s\\p{Zs}]*";
-                }
-            }
-            targetTitles.add(targetTitle);
-        });
-        if (ListUtil.isEmpty(targetTitles)) {
-            return Maps.newHashMap();
-        }
-        return Preproc.extract_doc_pub(true, targetTitles, content);
-    }
-
     private List<String> consultationRecord_sourceTitles = Lists.newArrayList();
 
     private List<String> consultationRecord_keyContrasts = Lists.newArrayList(

+ 158 - 150
trans/src/main/java/com/lantone/qc/trans/changx/ChangxDocTrans.java

@@ -21,54 +21,54 @@ public class ChangxDocTrans extends DocTrans {
     protected InputInfo extract(QueryVo queryVo) {
         InputInfo inputInfo = new InputInfo();
         for (MedrecVo i : queryVo.getMedrec()) {
-//            if (i.getTitle().equals("会诊")) {
-//                ChangxConsultationDocTrans consultationDocTrans = new ChangxConsultationDocTrans();
-//                inputInfo.setConsultationDocs(consultationDocTrans.extract(i));
-//            }
-//            if (i.getTitle().equals("手术")) {
-//                ChangxOperationDocTrans operationDocTrans = new ChangxOperationDocTrans();
-//                inputInfo.setOperationDocs(operationDocTrans.extract(i));
-//            }
-//            if (i.getTitle().equals("转科记录")) {
-//                ChangxTransferRecordDocTrans transferRecordDocTrans = new ChangxTransferRecordDocTrans();
-//                inputInfo.setTransferRecordDocs(transferRecordDocTrans.extract(i));
-//            }
+            //            if (i.getTitle().equals("会诊")) {
+            //                ChangxConsultationDocTrans consultationDocTrans = new ChangxConsultationDocTrans();
+            //                inputInfo.setConsultationDocs(consultationDocTrans.extract(i));
+            //            }
+            //            if (i.getTitle().equals("手术")) {
+            //                ChangxOperationDocTrans operationDocTrans = new ChangxOperationDocTrans();
+            //                inputInfo.setOperationDocs(operationDocTrans.extract(i));
+            //            }
+            //            if (i.getTitle().equals("转科记录")) {
+            //                ChangxTransferRecordDocTrans transferRecordDocTrans = new ChangxTransferRecordDocTrans();
+            //                inputInfo.setTransferRecordDocs(transferRecordDocTrans.extract(i));
+            //            }
             if (i.getTitle().equals("入院记录")) {
                 ChangxBeHospitalizedDocTrans beHospitalizedDocTrans = new ChangxBeHospitalizedDocTrans();
                 inputInfo.setBeHospitalizedDoc(beHospitalizedDocTrans.extract(i));
             }
-//            if (i.getTitle().equals("输血/血制品病程记录")) {
-//                ChangxClinicalBloodDocTrans clinicalBloodDocTrans = new ChangxClinicalBloodDocTrans();
-//                inputInfo.setClinicalBloodDocs(clinicalBloodDocTrans.extract(i));
-//            }
-//            if (i.getTitle().equals("危急值记录")) {
-//                ChangxCrisisValueReportDocTrans crisisValueReportDocTrans = new ChangxCrisisValueReportDocTrans();
-//                inputInfo.setCrisisValueReportDocs(crisisValueReportDocTrans.extract(i));
-//            }
-//            if (i.getTitle().equals("病危通知书")) {
-//                ChangxCriticallyIllNoticeDocTrans criticallyIllNoticeDocTrans = new ChangxCriticallyIllNoticeDocTrans();
-//                inputInfo.setCriticallyIllNoticeDocs(criticallyIllNoticeDocTrans.extract(i));
-//            }
-//            if (i.getTitle().equals("死亡病例讨论记录")) {
-//                ChangxDeathCaseDiscussDocTrans deathCaseDiscussDocTrans = new ChangxDeathCaseDiscussDocTrans();
-//                inputInfo.setDeathCaseDiscussDoc(deathCaseDiscussDocTrans.extract(i));
-//            }
-//            if (i.getTitle().equals("死亡记录")) {
-//                ChangxDeathRecordDocTrans deathRecordDocTrans = new ChangxDeathRecordDocTrans();
-//                inputInfo.setDeathRecordDoc(deathRecordDocTrans.extract(i));
-//            }
-//            if (i.getTitle().equals("疑难病例讨论记录")) {
-//                ChangxDifficultCaseDiscussDocTrans difficultCaseDiscussDocTrans = new ChangxDifficultCaseDiscussDocTrans();
-//                inputInfo.setDifficultCaseDiscussDocs(difficultCaseDiscussDocTrans.extract(i));
-//            }
-//            if (i.getTitle().equals("医嘱信息")) {
-//                ChangxDoctorAdviceDocTrans doctorAdviceDocTrans = new ChangxDoctorAdviceDocTrans();
-//                inputInfo.setDoctorAdviceDocs(doctorAdviceDocTrans.extract(i));
-//            }
-//            if (i.getTitle().equals("值班交接制度")) {
-//                ChangxDutyShiftSystemDocTrans dutyShiftSystemDocTrans = new ChangxDutyShiftSystemDocTrans();
-//                inputInfo.setDutyShiftSystemDocs(dutyShiftSystemDocTrans.extract(i));
-//            }
+            //            if (i.getTitle().equals("输血/血制品病程记录")) {
+            //                ChangxClinicalBloodDocTrans clinicalBloodDocTrans = new ChangxClinicalBloodDocTrans();
+            //                inputInfo.setClinicalBloodDocs(clinicalBloodDocTrans.extract(i));
+            //            }
+            //            if (i.getTitle().equals("危急值记录")) {
+            //                ChangxCrisisValueReportDocTrans crisisValueReportDocTrans = new ChangxCrisisValueReportDocTrans();
+            //                inputInfo.setCrisisValueReportDocs(crisisValueReportDocTrans.extract(i));
+            //            }
+            //            if (i.getTitle().equals("病危通知书")) {
+            //                ChangxCriticallyIllNoticeDocTrans criticallyIllNoticeDocTrans = new ChangxCriticallyIllNoticeDocTrans();
+            //                inputInfo.setCriticallyIllNoticeDocs(criticallyIllNoticeDocTrans.extract(i));
+            //            }
+            //            if (i.getTitle().equals("死亡病例讨论记录")) {
+            //                ChangxDeathCaseDiscussDocTrans deathCaseDiscussDocTrans = new ChangxDeathCaseDiscussDocTrans();
+            //                inputInfo.setDeathCaseDiscussDoc(deathCaseDiscussDocTrans.extract(i));
+            //            }
+            //            if (i.getTitle().equals("死亡记录")) {
+            //                ChangxDeathRecordDocTrans deathRecordDocTrans = new ChangxDeathRecordDocTrans();
+            //                inputInfo.setDeathRecordDoc(deathRecordDocTrans.extract(i));
+            //            }
+            //            if (i.getTitle().equals("疑难病例讨论记录")) {
+            //                ChangxDifficultCaseDiscussDocTrans difficultCaseDiscussDocTrans = new ChangxDifficultCaseDiscussDocTrans();
+            //                inputInfo.setDifficultCaseDiscussDocs(difficultCaseDiscussDocTrans.extract(i));
+            //            }
+            //            if (i.getTitle().equals("医嘱信息")) {
+            //                ChangxDoctorAdviceDocTrans doctorAdviceDocTrans = new ChangxDoctorAdviceDocTrans();
+            //                inputInfo.setDoctorAdviceDocs(doctorAdviceDocTrans.extract(i));
+            //            }
+            //            if (i.getTitle().equals("值班交接制度")) {
+            //                ChangxDutyShiftSystemDocTrans dutyShiftSystemDocTrans = new ChangxDutyShiftSystemDocTrans();
+            //                inputInfo.setDutyShiftSystemDocs(dutyShiftSystemDocTrans.extract(i));
+            //            }
             if (i.getTitle().equals("首次病程录")) {
                 ChangxFirstCourseRecordDocTrans firstCourseRecordDocTrans = new ChangxFirstCourseRecordDocTrans();
                 inputInfo.setFirstCourseRecordDoc(firstCourseRecordDocTrans.extract(i));
@@ -81,22 +81,22 @@ public class ChangxDocTrans extends DocTrans {
                 ChangxLeaveHospitalDocTrans leaveHospitalDocTrans = new ChangxLeaveHospitalDocTrans();
                 inputInfo.setLeaveHospitalDoc(leaveHospitalDocTrans.extract(i));
             }
-//            if (i.getTitle().equals("分级护理制度")) {
-//                ChangxNursingSystemDocTrans nursingSystemDocTrans = new ChangxNursingSystemDocTrans();
-//                inputInfo.setNursingSystemDoc(nursingSystemDocTrans.extract(i));
-//            }
-//            if (i.getTitle().equals("抢救记录")) {
-//                ChangxRescueDocTrans rescueDocTrans = new ChangxRescueDocTrans();
-//                inputInfo.setRescueDocs(rescueDocTrans.extract(i));
-//            }
-//            if (i.getTitle().equals("病重通知书")) {
-//                ChangxSeriouslyIllNoticeDocTrans seriouslyIllNoticeDocTrans = new ChangxSeriouslyIllNoticeDocTrans();
-//                inputInfo.setSeriouslyIllNoticeDocs(seriouslyIllNoticeDocTrans.extract(i));
-//            }
-//            if (i.getTitle().equals("阶段小结")) {
-//                ChangxStagesSummaryDocTrans stagesSummaryDocTrans = new ChangxStagesSummaryDocTrans();
-//                inputInfo.setStagesSummaryDocs(stagesSummaryDocTrans.extract(i));
-//            }
+            //            if (i.getTitle().equals("分级护理制度")) {
+            //                ChangxNursingSystemDocTrans nursingSystemDocTrans = new ChangxNursingSystemDocTrans();
+            //                inputInfo.setNursingSystemDoc(nursingSystemDocTrans.extract(i));
+            //            }
+            //            if (i.getTitle().equals("抢救记录")) {
+            //                ChangxRescueDocTrans rescueDocTrans = new ChangxRescueDocTrans();
+            //                inputInfo.setRescueDocs(rescueDocTrans.extract(i));
+            //            }
+            //            if (i.getTitle().equals("病重通知书")) {
+            //                ChangxSeriouslyIllNoticeDocTrans seriouslyIllNoticeDocTrans = new ChangxSeriouslyIllNoticeDocTrans();
+            //                inputInfo.setSeriouslyIllNoticeDocs(seriouslyIllNoticeDocTrans.extract(i));
+            //            }
+            //            if (i.getTitle().equals("阶段小结")) {
+            //                ChangxStagesSummaryDocTrans stagesSummaryDocTrans = new ChangxStagesSummaryDocTrans();
+            //                inputInfo.setStagesSummaryDocs(stagesSummaryDocTrans.extract(i));
+            //            }
             if (i.getTitle().equals("查房记录")) {
                 ChangxThreeLevelWardDocTrans threeLevelWardDocTrans = new ChangxThreeLevelWardDocTrans();
                 inputInfo.setThreeLevelWardDocs(threeLevelWardDocTrans.extract(i));
@@ -110,108 +110,116 @@ public class ChangxDocTrans extends DocTrans {
         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.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.getNursingSystemDoc() != null) {
-//            inputInfo.getPageData().put("分级护理制度", Lists.newArrayList(inputInfo.getNursingSystemDoc().getPageData()));
-//        }
+        //        if (inputInfo.getNursingSystemDoc() != null) {
+        //            inputInfo.getPageData().put("分级护理制度", Lists.newArrayList(inputInfo.getNursingSystemDoc().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()));
-//        }
-//        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.getDoctorAdviceDocs())) {
-//            inputInfo.getPageData().put("医嘱信息", inputInfo.getDoctorAdviceDocs().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.getSeriouslyIllNoticeDocs())) {
-//            inputInfo.getPageData().put("病重通知书", inputInfo.getSeriouslyIllNoticeDocs().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.getClinicalBloodDocs())) {
+        //            inputInfo.getPageData().put("输血/血制品病程记录", inputInfo.getClinicalBloodDocs().stream().map(i -> i.getPageData()).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.getDoctorAdviceDocs())) {
+        //            inputInfo.getPageData().put("医嘱信息", inputInfo.getDoctorAdviceDocs().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.getSeriouslyIllNoticeDocs())) {
+        //            inputInfo.getPageData().put("病重通知书", inputInfo.getSeriouslyIllNoticeDocs().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().stream().map(i -> i.getPageData()).collect(Collectors.toList()));
         }
-//
-//        if (ListUtil.isNotEmpty(inputInfo.getConsultationDocs())) {
-//            inputInfo.getPageData().put(
-//                    "会诊记录",
-//                    inputInfo.getConsultationDocs()
-//                            .stream()
-//                            .filter(consultationDoc -> consultationDoc != null && consultationDoc.getConsultationRecordDoc() != null)
-//                            .map(consultationDoc -> consultationDoc.getConsultationRecordDoc().getPageData())
-//                            .collect(Collectors.toList())
-//            );
-//            inputInfo.getPageData().put(
-//                    "会诊申请单",
-//                    inputInfo.getConsultationDocs()
-//                            .stream()
-//                            .filter(consultationDoc -> consultationDoc != null && consultationDoc.getConsultationApplicationDoc() != null)
-//                            .map(consultationDoc -> consultationDoc.getConsultationApplicationDoc().getPageData())
-//                            .collect(Collectors.toList())
-//            );
-//            inputInfo.getPageData().put(
-//                    "会诊结果单",
-//                    inputInfo.getConsultationDocs()
-//                            .stream()
-//                            .filter(consultationDoc -> consultationDoc != null && consultationDoc.getConsultationResultsDoc() != null)
-//                            .map(consultationDoc -> consultationDoc.getConsultationResultsDoc().getPageData())
-//                            .collect(Collectors.toList())
-//            );
-//        }
-//        if (ListUtil.isNotEmpty(inputInfo.getOperationDocs())) {
-//            inputInfo.getPageData().put(
-//                    "术后首次病程及谈话记录",
-//                    inputInfo.getOperationDocs()
-//                            .stream()
-//                            .filter(operationDoc -> operationDoc != null && operationDoc.getOperationDiscussionDoc() != null)
-//                            .map(operationDoc -> operationDoc.getOperationDiscussionDoc().getPageData())
-//                            .collect(Collectors.toList())
-//            );
-//            inputInfo.getPageData().put(
-//                    "手术记录",
-//                    inputInfo.getOperationDocs()
-//                            .stream()
-//                            .filter(operationDoc -> operationDoc != null && operationDoc.getOperationRecordDoc() != null)
-//                            .map(operationDoc -> operationDoc.getOperationRecordDoc().getPageData())
-//                            .collect(Collectors.toList())
-//            );
-//            inputInfo.getPageData().put(
-//                    "术前讨论、术前小结",
-//                    inputInfo.getOperationDocs()
-//                            .stream()
-//                            .filter(operationDoc -> operationDoc != null && operationDoc.getPreoperativeDiscussionDoc() != null)
-//                            .map(operationDoc -> operationDoc.getPreoperativeDiscussionDoc().getPageData())
-//                            .collect(Collectors.toList())
-//            );
-//        }
+
+        if (ListUtil.isNotEmpty(inputInfo.getConsultationDocs())) {
+            inputInfo.getPageData().put(
+                    "会诊记录",
+                    inputInfo.getConsultationDocs()
+                            .stream()
+                            .filter(consultationDoc -> consultationDoc != null && consultationDoc.getConsultationRecordDoc() != null)
+                            .map(consultationDoc -> consultationDoc.getConsultationRecordDoc().getPageData())
+                            .collect(Collectors.toList())
+            );
+            inputInfo.getPageData().put(
+                    "会诊申请单",
+                    inputInfo.getConsultationDocs()
+                            .stream()
+                            .filter(consultationDoc -> consultationDoc != null && consultationDoc.getConsultationApplicationDoc() != null)
+                            .map(consultationDoc -> consultationDoc.getConsultationApplicationDoc().getPageData())
+                            .collect(Collectors.toList())
+            );
+            inputInfo.getPageData().put(
+                    "会诊结果单",
+                    inputInfo.getConsultationDocs()
+                            .stream()
+                            .filter(consultationDoc -> consultationDoc != null && consultationDoc.getConsultationResultsDoc() != null)
+                            .map(consultationDoc -> consultationDoc.getConsultationResultsDoc().getPageData())
+                            .collect(Collectors.toList())
+            );
+        }
+        if (ListUtil.isNotEmpty(inputInfo.getOperationDocs())) {
+            inputInfo.getPageData().put(
+                    "术后首次病程及谈话记录",
+                    inputInfo.getOperationDocs()
+                            .stream()
+                            .filter(operationDoc -> operationDoc != null && operationDoc.getOperationDiscussionDoc() != null)
+                            .map(operationDoc -> operationDoc.getOperationDiscussionDoc().getPageData())
+                            .collect(Collectors.toList())
+            );
+            inputInfo.getPageData().put(
+                    "手术记录",
+                    inputInfo.getOperationDocs()
+                            .stream()
+                            .filter(operationDoc -> operationDoc != null && operationDoc.getOperationRecordDoc() != null)
+                            .map(operationDoc -> operationDoc.getOperationRecordDoc().getPageData())
+                            .collect(Collectors.toList())
+            );
+            inputInfo.getPageData().put(
+                    "术前讨论、术前小结",
+                    inputInfo.getOperationDocs()
+                            .stream()
+                            .filter(operationDoc -> operationDoc != null && operationDoc.getPreoperativeDiscussionDoc() != null)
+                            .map(operationDoc -> operationDoc.getPreoperativeDiscussionDoc().getPageData())
+                            .collect(Collectors.toList())
+            );
+            inputInfo.getPageData().put(
+                    "手术知情同意书",
+                    inputInfo.getOperationDocs()
+                            .stream()
+                            .filter(operationDoc -> operationDoc != null && operationDoc.getOperationInformedConsentDoc() != null)
+                            .map(operationDoc -> operationDoc.getOperationInformedConsentDoc().getPageData())
+                            .collect(Collectors.toList())
+            );
+        }
     }
 
 }

+ 163 - 89
trans/src/main/java/com/lantone/qc/trans/changx/ChangxOperationDocTrans.java

@@ -5,6 +5,7 @@ import com.google.common.collect.Maps;
 import com.google.common.collect.Sets;
 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.operation.OperationInformedConsentDoc;
 import com.lantone.qc.pub.model.doc.operation.OperationRecordDoc;
 import com.lantone.qc.pub.model.doc.operation.PreoperativeDiscussionDoc;
 import com.lantone.qc.pub.model.vo.MedrecVo;
@@ -39,11 +40,13 @@ public class ChangxOperationDocTrans extends ModelDocTrans {
         Map<String, OperationDiscussionDoc> operationDiscussionDocMap = getOperationDiscussionDocMap(contentMap.get("术后首次病程及谈话记录"));
         Map<String, OperationRecordDoc> operationRecordDocMap = getOperationRecordDocMap(contentMap.get("手术记录"));
         Map<String, PreoperativeDiscussionDoc> preoperativeDiscussionDocMap = getPreoperativeDiscussionDocMap(contentMap.get("术前讨论、术前小结"));
+        Map<String, OperationInformedConsentDoc> operationInformedConsentDocMap = getOperationInformedConsentDocMap(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();
@@ -51,6 +54,7 @@ public class ChangxOperationDocTrans extends ModelDocTrans {
             operationDoc.setOperationDiscussionDoc(operationDiscussionDocMap.get(operationName));
             operationDoc.setOperationRecordDoc(operationRecordDocMap.get(operationName));
             operationDoc.setPreoperativeDiscussionDoc(preoperativeDiscussionDocMap.get(operationName));
+            operationDoc.setOperationInformedConsentDoc(operationInformedConsentDocMap.get(operationName));
             retList.add(operationDoc);
         });
 
@@ -80,46 +84,30 @@ public class ChangxOperationDocTrans extends ModelDocTrans {
     }
 
     private OperationDiscussionDoc getOperationDiscussionDoc(String content) {
-        Map<String, String> pageData = Preproc.extract_doc_pub(true, operationDiscussion_pageDataTitles, content);
-        pageData.put("病程记录内容",
-                pageData.get("病程记录内容")
-                        .replace(pageData.get("病程记录时间"), "")
-                        .replace(pageData.get("病程记录名称"), "")
-        );
-
-        List<String> targetTitles = Lists.newArrayList();
-        operationDiscussion_sourceTitles.forEach(sourceTitle -> {
-            String targetTitle = "";
-            for (int index = 0; index < sourceTitle.length(); index++) {
-                if (index == sourceTitle.length() - 1) {
-                    targetTitle += sourceTitle.substring(index, index + 1);
-                } else {
-                    targetTitle += sourceTitle.substring(index, index + 1) + "[\\s\\p{Zs}]*";
-                }
-            }
-            targetTitles.add(targetTitle);
-        });
+        Map<String, String> xmlNodeValueMap = CxXmlUtil.firstLevelNodeValue("//DocObjContent/Region", content);
+        Map<String, String> structureMap = OrdinaryAssistant.mapKeyContrast(xmlNodeValueMap, operationDiscussion_keyContrasts);
+        if (StringUtil.isNotBlank(structureMap.get("手术开始时间"))) {
+            structureMap.put("手术时间", structureMap.get("手术开始时间"));
+        }
+        if (StringUtil.isNotBlank(structureMap.get("签名"))) {
+            structureMap.put("记录医师", structureMap.get("签名"));
+        }
 
-        Map<String, String> sourceMap = Preproc.extract_doc_pub(true, targetTitles, content);
-        sourceMap.put("记录时间", sourceMap.get("病程记录时间"));
+        String text = CxXmlUtil.getTextByNodePath(content, "//DocObjContent/Region/Content_Text");
+        if (StringUtil.isBlank(text)) {
+            text = CxXmlUtil.getTextByNodePath(content, "//DocObjContent/Region");
+        }
+        Map<String, String> cutWordMap = Preproc.getCutWordMap(true, operationDiscussion_sourceTitles, text);
+        cutWordMap.putAll(structureMap);
 
-        OperationDiscussionDoc operationDiscussionDoc = ModelDocGenerate.operationDiscussionDocGen(sourceMap);
-        operationDiscussionDoc.setText(content);
-        operationDiscussionDoc.setPageData((Map) pageData);
+        OperationDiscussionDoc operationDiscussionDoc = ModelDocGenerate.operationDiscussionDocGen(cutWordMap);
+        operationDiscussionDoc.setText(text);
+        operationDiscussionDoc.setPageData((Map) xmlNodeValueMap);
 
         return operationDiscussionDoc;
     }
 
-    private List<String> operationDiscussion_pageDataTitles = Lists.newArrayList(
-            "病程记录时间",
-            "病程记录名称",
-            "病程记录内容",
-            "记录医师"
-    );
     private List<String> operationDiscussion_sourceTitles = Lists.newArrayList(
-            "病程记录时间",
-            "病程记录名称",
-            "病程记录内容",
             "记录医师",
             "记录时间",
             "手术时间",
@@ -138,6 +126,23 @@ public class ChangxOperationDocTrans extends ModelDocTrans {
             "代理人签名时间"
     );
 
+    private List<String> operationDiscussion_keyContrasts = Lists.newArrayList(
+            "记录日期=记录时间",
+            "手术开始时间=",
+            "手术结束时间=",
+            "麻醉方式=",
+            "手术方式=",
+            "术中诊断++++初步诊断=术中诊断",
+            "手术经过=手术简要经过",
+            "患者术后情况=",
+            "术后处理措施=",
+            "术后并发症及预防措施=术后可能出现的并发症及预防措施",
+            "术后注意事项=",
+            "患者签名=",
+            "签名时间=代理人签名时间",
+            "签字++++患者授权的其他代理人签字=被授权人/代理人签名"
+    );
+
 
     /**********************************************手术记录*************************************************************/
     private Map<String, OperationRecordDoc> getOperationRecordDocMap(List<String> contents) {
@@ -161,46 +166,27 @@ public class ChangxOperationDocTrans extends ModelDocTrans {
     }
 
     private OperationRecordDoc getOperationRecordDoc(String content) {
-        Map<String, String> pageData = Preproc.extract_doc_pub(true, operationRecord_pageDataTitles, content);
-        pageData.put("病程记录内容",
-                pageData.get("病程记录内容")
-                        .replace(pageData.get("病程记录时间"), "")
-                        .replace(pageData.get("病程记录名称"), "")
-        );
-
-        List<String> targetTitles = Lists.newArrayList();
-        operationRecord_sourceTitles.forEach(sourceTitle -> {
-            String targetTitle = "";
-            for (int index = 0; index < sourceTitle.length(); index++) {
-                if (index == sourceTitle.length() - 1) {
-                    targetTitle += sourceTitle.substring(index, index + 1);
-                } else {
-                    targetTitle += sourceTitle.substring(index, index + 1) + "[\\s\\p{Zs}]*";
-                }
-            }
-            targetTitles.add(targetTitle);
-        });
+        Map<String, String> xmlNodeValueMap = CxXmlUtil.firstLevelNodeValue("//DocObjContent", content);
+        Map<String, String> structureMap = OrdinaryAssistant.mapKeyContrast(xmlNodeValueMap, operationRecord_keyContrasts);
+        if (StringUtil.isNotBlank(structureMap.get("签名"))) {
+            structureMap.put("记录医师", structureMap.get("签名"));
+        }
 
-        Map<String, String> sourceMap = Preproc.extract_doc_pub(true, targetTitles, content);
-        sourceMap.put("记录时间", sourceMap.get("病程记录时间"));
+        String text = CxXmlUtil.getTextByNodePath(content, "//DocObjContent/Content_Text");
+        if (StringUtil.isBlank(text)) {
+            text = CxXmlUtil.getTextByNodePath(content, "//DocObjContent");
+        }
+        Map<String, String> cutWordMap = Preproc.getCutWordMap(true, operationRecord_sourceTitles, text);
+        cutWordMap.putAll(structureMap);
 
-        OperationRecordDoc operationRecordDoc = ModelDocGenerate.operationRecordDocGen(sourceMap);
-        operationRecordDoc.setText(content);
-        operationRecordDoc.setPageData((Map) pageData);
+        OperationRecordDoc operationRecordDoc = ModelDocGenerate.operationRecordDocGen(cutWordMap);
+        operationRecordDoc.setText(text);
+        operationRecordDoc.setPageData((Map) xmlNodeValueMap);
 
         return operationRecordDoc;
     }
 
-    private List<String> operationRecord_pageDataTitles = Lists.newArrayList(
-            "病程记录时间",
-            "病程记录名称",
-            "病程记录内容",
-            "记录医师"
-    );
     private List<String> operationRecord_sourceTitles = Lists.newArrayList(
-            "病程记录时间",
-            "病程记录名称",
-            "病程记录内容",
             "记录医师",
             "记录时间",
             "手术名称",
@@ -210,6 +196,42 @@ public class ChangxOperationDocTrans extends ModelDocTrans {
             "手术经过"
     );
 
+    private List<String> operationRecord_keyContrasts = Lists.newArrayList(
+            "姓名++++患者姓名=",
+            "性别=",
+            "病区++++病区名称=",
+            "床号=",
+            "病案号++++住院号=",
+            "手术开始时间=",
+            "手术结束时间=",
+            "术前诊断=",
+            "手术名称=",
+            "术后诊断=",
+            "主刀医师=",
+            "一助=",
+            "二助=",
+            "器械护士=",
+            "麻醉方式=",
+            "麻醉医生=",
+            "清洁程度=",
+            "ASA分级++++麻醉ASA分级=",
+            "手术持续时间=",
+            "风险评估分值=",
+            "++++浅层组织手术=",
+            "++++深层组织手术=",
+            "++++器官手术=",
+            "++++空隙手术=",
+            "++++术中送检无=",
+            "++++术中送检有=",
+            "冰冻切片结果=",
+            "++++并发症无=",
+            "++++并发症有=",
+            "手术并发症=",
+            "失血量=",
+            "手术经过=",
+            "记录时间="
+    );
+
 
     /**********************************************术前讨论、术前小结****************************************************/
     private Map<String, PreoperativeDiscussionDoc> getPreoperativeDiscussionDocMap(List<String> contents) {
@@ -252,7 +274,7 @@ public class ChangxOperationDocTrans extends ModelDocTrans {
         if (StringUtil.isBlank(text)) {
             text = CxXmlUtil.getTextByNodePath(content, "//DocObjContent/Region");
         }
-        Map<String, String> cutWordMap = getCutWordMap(text);
+        Map<String, String> cutWordMap = Preproc.getCutWordMap(true, preoperativeDiscussion_sourceTitles, text);
         cutWordMap.putAll(structureMap);
 
         PreoperativeDiscussionDoc preoperativeDiscussionDoc = ModelDocGenerate.preoperativeDiscussionDocGen(cutWordMap);
@@ -262,28 +284,6 @@ public class ChangxOperationDocTrans extends ModelDocTrans {
         return preoperativeDiscussionDoc;
     }
 
-    private Map<String, String> getCutWordMap(String content) {
-        if (StringUtil.isBlank(content)) {
-            return Maps.newHashMap();
-        }
-        List<String> targetTitles = Lists.newArrayList();
-        preoperativeDiscussion_sourceTitles.forEach(sourceTitle -> {
-            String targetTitle = "";
-            for (int index = 0; index < sourceTitle.length(); index++) {
-                if (index == sourceTitle.length() - 1) {
-                    targetTitle += sourceTitle.substring(index, index + 1);
-                } else {
-                    targetTitle += sourceTitle.substring(index, index + 1) + "[\\s\\p{Zs}]*";
-                }
-            }
-            targetTitles.add(targetTitle);
-        });
-        if (ListUtil.isEmpty(targetTitles)) {
-            return Maps.newHashMap();
-        }
-        return Preproc.extract_doc_pub(true, targetTitles, content);
-    }
-
     private List<String> preoperativeDiscussion_sourceTitles = Lists.newArrayList(
             "记录医师",
             "记录时间",
@@ -319,4 +319,78 @@ public class ChangxOperationDocTrans extends ModelDocTrans {
             "术后注意事项="
     );
 
+
+    /**********************************************手术知情同意书****************************************************/
+    private Map<String, OperationInformedConsentDoc> getOperationInformedConsentDocMap(List<String> contents) {
+        Map<String, OperationInformedConsentDoc> retMap = Maps.newHashMap();
+        if (ListUtil.isEmpty(contents)) {
+            return retMap;
+        }
+        int index = 1;
+        String operationName = null;
+        for (String content : contents) {
+            if (StringUtil.isBlank(content)) {
+                continue;
+            }
+            operationName = index + "";
+            OperationInformedConsentDoc operationInformedConsentDoc = getOperationInformedConsentDoc(content);
+            operationInformedConsentDoc.setOperationName(operationName);
+            retMap.put(operationName, operationInformedConsentDoc);
+            index++;
+        }
+        return retMap;
+    }
+
+    private OperationInformedConsentDoc getOperationInformedConsentDoc(String content) {
+        Map<String, String> xmlNodeValueMap = CxXmlUtil.firstLevelNodeValue("//DocObjContent", content);
+        Map<String, String> structureMap = OrdinaryAssistant.mapKeyContrast(xmlNodeValueMap, operationInformedConsent_keyContrasts);
+
+        String text = CxXmlUtil.getTextByNodePath(content, "//DocObjContent/Content_Text");
+        if (StringUtil.isBlank(text)) {
+            text = CxXmlUtil.getTextByNodePath(content, "//DocObjContent");
+        }
+        Map<String, String> cutWordMap = Preproc.getCutWordMap(true, operationInformedConsent_sourceTitles, text);
+        cutWordMap.putAll(structureMap);
+
+        OperationInformedConsentDoc operationInformedConsentDoc = ModelDocGenerate.operationInformedConsentDocGen(cutWordMap);
+        operationInformedConsentDoc.setText(text);
+        operationInformedConsentDoc.setPageData((Map) xmlNodeValueMap);
+
+        return operationInformedConsentDoc;
+    }
+
+    private List<String> operationInformedConsent_sourceTitles = Lists.newArrayList(
+            "姓名",
+            "性别",
+            "病区",
+            "床号",
+            "病案号",
+            "手术医生",
+            "目前诊断",
+            "手术名称",
+            "手术指征",
+            "风险及并发症",
+            "保守治疗",
+            "其他手术",
+            "签名",
+            "签名时间"
+    );
+
+    private List<String> operationInformedConsent_keyContrasts = Lists.newArrayList(
+            "姓名++++患者姓名=姓名",
+            "性别=",
+            "病区++++病区名称=病区",
+            "床号=",
+            "病案号++++住院号=病案号",
+            "手术医生=",
+            "目前诊断=",
+            "手术名称=",
+            "手术指征=",
+            "风险及并发症=",
+            "++++保守治疗=保守治疗",
+            "++++其他手术=其他手术",
+            "签名++++=签名",
+            "签名时间=签名时间"
+    );
+
 }

+ 1 - 21
trans/src/main/java/com/lantone/qc/trans/changx/ChangxThreeLevelWardDocTrans.java

@@ -1,7 +1,6 @@
 package com.lantone.qc.trans.changx;
 
 import com.google.common.collect.Lists;
-import com.google.common.collect.Maps;
 import com.lantone.qc.pub.model.doc.ThreeLevelWardDoc;
 import com.lantone.qc.pub.model.vo.MedrecVo;
 import com.lantone.qc.pub.util.StringUtil;
@@ -36,7 +35,7 @@ public class ChangxThreeLevelWardDocTrans extends ModelDocTrans {
         if (StringUtil.isBlank(text)) {
             text = CxXmlUtil.getTextByNodePath(content, "//DocObjContent/Region");
         }
-        Map<String, String> cutWordMap = getCutWordMap(text);
+        Map<String, String> cutWordMap = Preproc.getCutWordMap(true, sourceTitles, text);
         Map<String, String> xmlNodeValueMap = CxXmlUtil.firstLevelNodeValue("//DocObjContent//Region", content);
         cutWordMap.putAll(xmlNodeValueMap);
         Map<String, String> structureMap = OrdinaryAssistant.mapKeyContrast(cutWordMap, keyContrasts);
@@ -55,25 +54,6 @@ public class ChangxThreeLevelWardDocTrans extends ModelDocTrans {
         return threeLevelWardDoc;
     }
 
-    private Map<String, String> getCutWordMap(String content) {
-        if (StringUtil.isBlank(content)) {
-            return Maps.newHashMap();
-        }
-        List<String> targetTitles = Lists.newArrayList();
-        sourceTitles.forEach(sourceTitle -> {
-            String targetTitle = "";
-            for (int index = 0; index < sourceTitle.length(); index++) {
-                if (index == sourceTitle.length() - 1) {
-                    targetTitle += sourceTitle.substring(index, index + 1);
-                } else {
-                    targetTitle += sourceTitle.substring(index, index + 1) + "[\\s\\p{Zs}]*";
-                }
-            }
-            targetTitles.add(targetTitle);
-        });
-        return Preproc.extract_doc_pub(true, targetTitles, content);
-    }
-
     private List<String> sourceTitles = Lists.newArrayList(
             "记录医生"
     );

+ 36 - 0
trans/src/main/java/com/lantone/qc/trans/changx/util/CxXmlUtil.java

@@ -1,6 +1,7 @@
 package com.lantone.qc.trans.changx.util;
 
 import com.google.common.collect.Maps;
+import com.lantone.qc.pub.util.FileUtil;
 import com.lantone.qc.pub.util.StringUtil;
 import org.dom4j.Document;
 import org.dom4j.DocumentHelper;
@@ -35,6 +36,9 @@ public class CxXmlUtil {
                 } else {
                     key = (StringUtil.isBlank(helpTip) ? "" : helpTip) + "++++" + (StringUtil.isBlank(controlName) ? "" : controlName);
                 }
+                if (!keyAvailability(key)) {
+                    continue;
+                }
                 contentTextElement = sonElement.element("Content_Text");
                 if (contentTextElement == null) {
                     contentText = sonElement.getStringValue().trim();
@@ -67,4 +71,36 @@ public class CxXmlUtil {
         return content;
     }
 
+    /**
+     * 判断key是否可用
+     *
+     * @param key
+     * @return
+     */
+    public static boolean keyAvailability(String key) {
+        boolean flag = true;
+        String[] regexs = {
+                "\\d*[+]+\\d*"
+        };
+        for (String regex : regexs) {
+            if (key.matches(regex)) {
+                flag = false;
+                break;
+            }
+        }
+        return flag;
+    }
+
+
+    public static void main(String[] args) {
+        try {
+            String context = FileUtil.fileRead("C:\\Users\\dell\\Desktop\\调试\\test1.txt");
+            Map<String, String> sourceMap = CxXmlUtil.firstLevelNodeValue("//DocObjContent/Region", context);
+            for (String key : sourceMap.keySet()) {
+                System.out.println("\"" + key + "=\",");
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
 }

+ 153 - 0
trans/src/main/java/com/lantone/qc/trans/changx/util/CxXmlUtilTemp.java

@@ -0,0 +1,153 @@
+package com.lantone.qc.trans.changx.util;
+
+import com.google.common.collect.Maps;
+import com.lantone.qc.pub.util.FileUtil;
+import com.lantone.qc.pub.util.StringUtil;
+import org.apache.commons.lang3.StringUtils;
+import org.dom4j.Document;
+import org.dom4j.DocumentHelper;
+import org.dom4j.Element;
+
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @Description: xml解析工具
+ * @author: rengb
+ * @time: 2020/3/28 14:23
+ */
+public class CxXmlUtilTemp {
+
+    public static String cutXml(String xml) {
+        try {
+            Document doc = DocumentHelper.parseText(xml);
+            return doc.getRootElement().element("DocObjContent").asXML();
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return null;
+    }
+
+    public static Map<String, String> beHospitalizedXmlToMap(String xml) {
+        return beHospitalizedXmlToMap(xml, "");
+    }
+
+    public static Map<String, String> beHospitalizedXmlToMap(String xml, String modelName) {
+        Map<String, String> retMap = Maps.newLinkedHashMap();
+        try {
+            String helpTip, contentText;
+            Element contentTextElement;
+            Document doc = DocumentHelper.parseText(xml);
+            Element rootElement = doc.getRootElement().element("DocObjContent");
+
+            if (modelName.equals("首次病程录") || modelName.equals("查房记录") || modelName.equals("会诊记录") || modelName.equals("输血记录")
+                    || modelName.equals("术前讨论小结") || modelName.equals("阶段小结") || modelName.equals("术后首次谈话及病程录")
+                    || modelName.equals("转出记录") || modelName.equals("输血后效果评价") || modelName.equals("输血后效果评价") || modelName.equals("危急值记录")) {
+                if (rootElement.element("Region") != null && rootElement.element("Region").element("Content_Text") != null) {
+                    retMap.put("内容", rootElement.element("Region").element("Content_Text").getText());
+                    return retMap;
+                }
+            }
+
+            List<Element> sectionElements = rootElement.elements("Section");
+            Map<String, String> sectionMap = Maps.newLinkedHashMap();
+            for (Element sectionElement : sectionElements) {
+                helpTip = sectionElement.attributeValue("HelpTip");
+                if (StringUtil.isBlank(helpTip)) {
+                    continue;
+                }
+                contentTextElement = sectionElement.element("Content_Text");
+                if (contentTextElement == null) {
+                    contentText = sectionElement.getStringValue().trim();
+                } else {
+                    contentText = contentTextElement.getTextTrim();
+                }
+                sectionMap.put(helpTip, contentText);
+            }
+
+            List<Element> newCtrlElements = rootElement.elements("NewCtrl");
+            Map<String, String> newCtrlMap = Maps.newLinkedHashMap();
+            for (Element newCtrlElement : newCtrlElements) {
+                helpTip = newCtrlElement.attributeValue("HelpTip");
+                if (StringUtil.isBlank(helpTip)) {
+                    continue;
+                }
+                contentTextElement = newCtrlElement.element("Content_Text");
+                if (contentTextElement == null) {
+                    contentText = newCtrlElement.getStringValue().trim();
+                } else {
+                    contentText = contentTextElement.getTextTrim();
+                }
+                newCtrlMap.put(helpTip, contentText);
+            }
+            retMap.putAll(newCtrlMap);
+            retMap.putAll(sectionMap);
+
+
+//            retMap.put("姓名", newCtrlMap.get("姓名"));
+//            retMap.put("性别", newCtrlMap.get("性别"));
+//            retMap.put("年龄", newCtrlMap.get("年龄"));
+//            retMap.put("民族", newCtrlMap.get("民族"));
+//            retMap.put("职业", newCtrlMap.get("职业"));
+//            retMap.put("出生地", newCtrlMap.get("出生地"));
+//            retMap.put("婚姻", newCtrlMap.get("婚姻状况"));
+//            retMap.put("联系地址", "");
+//            retMap.put("病史陈述者", newCtrlMap.get("供史者"));
+//            retMap.put("出生日期", newCtrlMap.get("出生日期"));
+//            retMap.put("户口地址", newCtrlMap.get("户口地址"));
+//            retMap.put("电话", newCtrlMap.get("联系电话"));
+//            retMap.put("入院日期", newCtrlMap.get("入院日期"));
+//            retMap.put("记录日期", newCtrlMap.get("记录日期"));
+//            retMap.put("辅助检查", newCtrlMap.get("辅助检查"));
+//            retMap.put("初步诊断", newCtrlMap.get("初步诊断"));
+//            retMap.put("修正诊断", newCtrlMap.get("修正诊断"));
+//            retMap.put("补充诊断", newCtrlMap.get("补充诊断"));
+//            retMap.put("主诉", newCtrlMap.get("主诉"));
+//            retMap.put("现病史", newCtrlMap.get("现病史"));
+//
+//            retMap.put("既往史", sectionMap.get("既往史"));
+//            retMap.put("个人史", sectionMap.get("个人史"));
+//            retMap.put("婚育史", sectionMap.get("婚育史:"));
+//            retMap.put("月经史", sectionMap.get("月经史"));
+//            retMap.put("家族史", sectionMap.get("家族史"));
+//            retMap.put("专科体格检查", sectionMap.get("体格检查"));
+//
+//            String tgjc = sectionMap.get("一般情况") + "。"
+//                    + sectionMap.get("皮肤情况") + "。"
+//                    + newCtrlMap.get("淋巴") + "。"
+//                    + sectionMap.get("头部检查") + "。"
+//                    + sectionMap.get("颈部") + "。"
+//                    + sectionMap.get("胸部检查") + "。"
+//                    + sectionMap.get("肺部检查") + "。"
+//                    + sectionMap.get("心脏检查") + "。"
+//                    + newCtrlMap.get("血管") + "。"
+//                    + sectionMap.get("腹部检查") + "。"
+//                    + newCtrlMap.get("外生殖器") + "。"
+//                    + newCtrlMap.get("直肠肛门") + "。"
+//                    + sectionMap.get("四肢脊柱检查") + "。"
+//                    + sectionMap.get("神经系统检查") + "。"
+//                    + newCtrlMap.get("其他说明") + "。";
+//            retMap.put("体格检查", tgjc);
+        } catch (Exception e) {
+        }
+        return retMap;
+    }
+
+    public static Map<String, String> firstLevelNodeValue(String a, String x) {
+        return null;
+    }
+
+    public static String getTextByNodePath(String a, String x) {
+        return null;
+    }
+
+    public static void main(String[] args) {
+        String msg = FileUtil.fileRead("C:\\Users\\RGB\\Desktop\\调试\\入院记录.txt");
+        Map<String, String> map = beHospitalizedXmlToMap(msg);
+        map.keySet().forEach(key -> {
+            System.out.println(key + "---" + map.get(key));
+        });
+    }
+
+}

+ 13 - 0
trans/src/main/java/com/lantone/qc/trans/comsis/ModelDocGenerate.java

@@ -20,6 +20,7 @@ import com.lantone.qc.pub.model.doc.consultation.ConsultationApplicationDoc;
 import com.lantone.qc.pub.model.doc.consultation.ConsultationRecordDoc;
 import com.lantone.qc.pub.model.doc.consultation.ConsultationResultsDoc;
 import com.lantone.qc.pub.model.doc.operation.OperationDiscussionDoc;
+import com.lantone.qc.pub.model.doc.operation.OperationInformedConsentDoc;
 import com.lantone.qc.pub.model.doc.operation.OperationRecordDoc;
 import com.lantone.qc.pub.model.doc.operation.PreoperativeDiscussionDoc;
 import com.lantone.qc.pub.model.doc.transferrecord.TransferIntoDoc;
@@ -122,6 +123,18 @@ public class ModelDocGenerate {
         return preoperativeDiscussionDoc;
     }
 
+    /**
+     * 手术-手术知情同意书文档
+     *
+     * @param structureMap
+     * @return
+     */
+    public static OperationInformedConsentDoc operationInformedConsentDocGen(Map<String, String> structureMap) {
+        OperationInformedConsentDoc operationInformedConsentDoc = new OperationInformedConsentDoc();
+        operationInformedConsentDoc.setStructureMap(structureMap);
+        return operationInformedConsentDoc;
+    }
+
     /**
      * 转科记录-转入
      *

+ 32 - 0
trans/src/main/java/com/lantone/qc/trans/comsis/Preproc.java

@@ -1,6 +1,8 @@
 package com.lantone.qc.trans.comsis;
 
+import com.google.common.collect.Lists;
 import com.google.common.collect.Maps;
+import com.lantone.qc.pub.util.ListUtil;
 import com.lantone.qc.pub.util.StringUtil;
 
 import java.util.HashMap;
@@ -110,4 +112,34 @@ public class Preproc {
         return sectionsNew;
     }
 
+    /**
+     * key特殊处理然后切词,除了首次病程,其他模块可用
+     *
+     * @param isProgress
+     * @param content
+     * @param sourceTitles
+     * @return
+     */
+    public static Map<String, String> getCutWordMap(boolean isProgress, List<String> sourceTitles, String content) {
+        if (StringUtil.isBlank(content)) {
+            return Maps.newHashMap();
+        }
+        List<String> targetTitles = Lists.newArrayList();
+        sourceTitles.forEach(sourceTitle -> {
+            String targetTitle = "";
+            for (int index = 0; index < sourceTitle.length(); index++) {
+                if (index == sourceTitle.length() - 1) {
+                    targetTitle += sourceTitle.substring(index, index + 1);
+                } else {
+                    targetTitle += sourceTitle.substring(index, index + 1) + "[\\s\\p{Zs}]*";
+                }
+            }
+            targetTitles.add(targetTitle);
+        });
+        if (ListUtil.isEmpty(targetTitles)) {
+            return Maps.newHashMap();
+        }
+        return extract_doc_pub(isProgress, targetTitles, content);
+    }
+
 }