浏览代码

Merge branch 'master' of http://192.168.2.236:10080/louhr/qc

louhr 5 年之前
父节点
当前提交
15a4bda93f
共有 41 个文件被更改,包括 568 次插入366 次删除
  1. 11 5
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0004.java
  2. 20 1
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/clinicalblood/CLI0299.java
  3. 2 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/clinicalblood/CLI0306.java
  4. 2 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/clinicalblood/CLI0308.java
  5. 3 2
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP0157.java
  6. 1 1
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP0158.java
  7. 5 1
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP0161.java
  8. 3 3
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP0162.java
  9. 2 2
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP0163.java
  10. 1 1
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP0166.java
  11. 1 1
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP0168.java
  12. 2 1
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP0256.java
  13. 9 4
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP0273.java
  14. 5 2
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP0274.java
  15. 5 3
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/threelevelward/THR0130.java
  16. 4 3
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/threelevelward/THR0131.java
  17. 4 3
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/threelevelward/THR0132.java
  18. 4 3
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/threelevelward/THR0133.java
  19. 4 3
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/threelevelward/THR0134.java
  20. 4 8
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/threelevelward/THR0135.java
  21. 4 3
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/threelevelward/THR0136.java
  22. 4 3
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/threelevelward/THR0137.java
  23. 4 3
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/threelevelward/THR0138.java
  24. 4 3
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/threelevelward/THR0139.java
  25. 17 7
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/threelevelward/THR0140.java
  26. 3 3
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/threelevelward/THR0429.java
  27. 3 3
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/threelevelward/THR0430.java
  28. 3 3
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/threelevelward/THR0431.java
  29. 3 3
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/threelevelward/THR0432.java
  30. 3 3
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/threelevelward/THR0433.java
  31. 3 2
      public/src/main/java/com/lantone/qc/pub/Content.java
  32. 1 0
      public/src/main/java/com/lantone/qc/pub/model/doc/operation/OperationDoc.java
  33. 16 0
      public/src/main/java/com/lantone/qc/pub/model/doc/operation/OperationInformedConsentDoc.java
  34. 17 0
      public/src/main/java/com/lantone/qc/pub/model/keys/TextTypeStandardKeys.java
  35. 1 23
      trans/src/main/java/com/lantone/qc/trans/changx/ChangxConsultationDocTrans.java
  36. 158 150
      trans/src/main/java/com/lantone/qc/trans/changx/ChangxDocTrans.java
  37. 163 89
      trans/src/main/java/com/lantone/qc/trans/changx/ChangxOperationDocTrans.java
  38. 1 21
      trans/src/main/java/com/lantone/qc/trans/changx/ChangxThreeLevelWardDocTrans.java
  39. 23 0
      trans/src/main/java/com/lantone/qc/trans/changx/util/CxXmlUtil.java
  40. 13 0
      trans/src/main/java/com/lantone/qc/trans/comsis/ModelDocGenerate.java
  41. 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;
+                    }
+                }
             }
         }
 

+ 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");
             }
         }

+ 5 - 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,7 +26,10 @@ 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)) {
+            if (StringUtil.isNotBlank(admissionAge) && admissionAge.contains("岁")) {
+                admissionAge = admissionAge.replace("岁", "");
+            }
+            if (!CatalogueUtil.compareToken(firstAdmissionAge, admissionAge)) {
                 status.set("-1");
             }
         }

+ 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/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/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");
             }
         }

+ 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) {

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

@@ -21,16 +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())){
+        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())

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

@@ -21,16 +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())){
+        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())

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

@@ -20,16 +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())){
+        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;

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

@@ -20,16 +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())){
+        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;

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

@@ -20,16 +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())){
+        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;

+ 3 - 2
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 = "现住址";

+ 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(
             "记录医生"
     );

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

@@ -35,6 +35,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 +70,24 @@ 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;
+    }
+
 }

+ 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);
+    }
+
 }