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

Merge branch 'hb/beilun' into hb/beilun_20210816

# Conflicts:
#	kernel/src/main/java/com/lantone/qc/kernel/catalogue/operationdiscussion/OPE03119.java
zhanghang 3 éve
szülő
commit
6cc7b5d02f
16 módosított fájl, 524 hozzáadás és 139 törlés
  1. 16 5
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/clinicalblood/CLI0301.java
  2. 48 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/medicalwriting/MEDI03169.java
  3. 48 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/medicalwriting/MEDI03170.java
  4. 5 5
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/operationdiscussion/OPE03111.java
  5. 29 39
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/operationdiscussion/OPE03119.java
  6. 4 4
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/threelevelward/THR03114.java
  7. 56 44
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/threelevelward/THR03115.java
  8. 5 5
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/threelevelward/THR03116.java
  9. 5 5
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/threelevelward/THR03117.java
  10. 33 10
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/threelevelward/THR03120.java
  11. 6 6
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/threelevelward/THR03121.java
  12. 38 14
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/threelevelward/THR03123.java
  13. 5 2
      public/src/main/java/com/lantone/qc/pub/Content.java
  14. 92 0
      trans/src/main/java/com/lantone/qc/trans/ningbozhongyi/NingBoZhongYiInformedConsentDocTrans.java
  15. 10 0
      trans/src/main/java/com/lantone/qc/trans/ningbozhongyi/NingbozhongyiDocTrans.java
  16. 124 0
      trans/src/main/java/com/lantone/qc/trans/ningbozhongyi/util/NingBoZhongYiInformedHtmlAnalysis.java

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

@@ -32,6 +32,17 @@ public class CLI0301 extends QCCatalogue {
         if(ListUtil.isNotEmpty(clinicalBloodDocs)){
             flag=true;
         }
+        //血费
+        FirstPageRecordDoc firstPageRecordDoc = inputInfo.getFirstPageRecordDoc();
+        if(firstPageRecordDoc!=null&&firstPageRecordDoc.getStructureMap()!=null){
+            String bloodFee = firstPageRecordDoc.getStructureMap().get("血费");
+            if(StringUtil.isNotEmpty(bloodFee) && !bloodFee.equals("0")){
+                double blood = Double.parseDouble(bloodFee);
+                if(blood > 0){
+                    flag=true;
+                }
+            }
+        }
         //医嘱
         if(ListUtil.isNotEmpty(doctorAdviceDocs)){
             for (DoctorAdviceDoc doctorAdviceDoc : doctorAdviceDocs) {
@@ -91,11 +102,11 @@ public class CLI0301 extends QCCatalogue {
         str = str.replaceAll("\\}", "\\\\}");
         str = str.replaceAll("\\|", "\\\\|");
         str = str.replaceAll("\\/", "\\\\/");
-        String rex1="[\\s\\S]*(?=输)[\\s\\S]{0,5}(?=血)[\\s\\S]*";
-        String rex2="[\\s\\S]*(?=输)[\\s\\S]{0,5}(?=红细胞)[\\s\\S]*";
-        String rex3="[\\s\\S]*(?=输)[\\s\\S]{0,5}(?=血小板)[\\s\\S]*";
-        String rex4="[\\s\\S]*(?=输)[\\s\\S]{0,5}(?=血浆)[\\s\\S]*";
-        String rex5="[\\s\\S]*(?=输)[\\s\\S]{0,5}(?=冷沉淀因子)[\\s\\S]*";
+        String rex1="[\\s\\S]*(?=输)[^,;,;。]{0,6}(?=血)[\\s\\S]*";
+        String rex2="[\\s\\S]*(?=输)[^,;,;。]{0,6}(?=红细胞)[\\s\\S]*";
+        String rex3="[\\s\\S]*(?=输)[^,;,;。]{0,6}(?=血小板)[\\s\\S]*";
+        String rex4="[\\s\\S]*(?=输)[^,;,;。]{0,6}(?=血浆)[\\s\\S]*";
+        String rex5="[\\s\\S]*(?=输)[^,;,;。]{0,6}(?=冷沉淀因子)[\\s\\S]*";
         if( str.matches(rex1)|| str.matches(rex2) || str.matches(rex3)|| str.matches(rex4)|| str.matches(rex5)){
             return true;
         }

+ 48 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/medicalwriting/MEDI03169.java

@@ -0,0 +1,48 @@
+package com.lantone.qc.kernel.catalogue.medicalwriting;
+
+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.InformedConsentDoc;
+import com.lantone.qc.pub.util.ListUtil;
+import com.lantone.qc.pub.util.StringUtil;
+import org.springframework.stereotype.Component;
+
+import java.text.ParseException;
+import java.util.List;
+
+/**
+ * @ClassName : MEDI03169
+ * @Description :缺评定表
+ * @Author : wangsy
+ * @Date: 2021-08-30 16:32
+ */
+@Component
+public class MEDI03169 extends QCCatalogue {
+    @Override
+    protected void start(InputInfo inputInfo, OutputInfo outputInfo) throws ParseException {
+        status.set("0");
+        List<InformedConsentDoc> informedConsentDocs = inputInfo.getInformedConsentDoc();
+        if (ListUtil.isEmpty(informedConsentDocs)) {
+            status.set("-1");
+            return;
+        }
+        boolean flag = true;
+        for (InformedConsentDoc informedConsentDoc : informedConsentDocs) {
+            if (informedConsentDoc.getStructureMap() == null) {
+                continue;
+            }
+            if (StringUtil.isNotEmpty(informedConsentDoc.getStructureMap().get("标题"))) {
+                if ("康复评定表".equals(informedConsentDoc.getStructureMap().get("标题"))) {
+                    flag = false;
+                    break;
+                }
+            }
+        }
+
+        if (flag) {
+            status.set("-1");
+            return;
+        }
+    }
+}

+ 48 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/medicalwriting/MEDI03170.java

@@ -0,0 +1,48 @@
+package com.lantone.qc.kernel.catalogue.medicalwriting;
+
+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.InformedConsentDoc;
+import com.lantone.qc.pub.util.ListUtil;
+import com.lantone.qc.pub.util.StringUtil;
+import org.springframework.stereotype.Component;
+
+import java.text.ParseException;
+import java.util.List;
+
+/**
+ * @ClassName : MEDI03170
+ * @Description :缺康复治疗记录单
+ * @Author : wangsy
+ * @Date: 2021-08-30 16:32
+ */
+@Component
+public class MEDI03170 extends QCCatalogue {
+    @Override
+    protected void start(InputInfo inputInfo, OutputInfo outputInfo) throws ParseException {
+        status.set("0");
+        List<InformedConsentDoc> informedConsentDocs = inputInfo.getInformedConsentDoc();
+        if (ListUtil.isEmpty(informedConsentDocs)) {
+            status.set("-1");
+            return;
+        }
+        boolean flag = true;
+        for (InformedConsentDoc informedConsentDoc : informedConsentDocs) {
+            if (informedConsentDoc.getStructureMap() == null) {
+                continue;
+            }
+            if (StringUtil.isNotEmpty(informedConsentDoc.getStructureMap().get("标题"))) {
+                if ("康复治疗记录单".equals(informedConsentDoc.getStructureMap().get("标题"))) {
+                    flag = false;
+                    break;
+                }
+            }
+        }
+
+        if (flag) {
+            status.set("-1");
+            return;
+        }
+    }
+}

+ 5 - 5
kernel/src/main/java/com/lantone/qc/kernel/catalogue/operationdiscussion/OPE03111.java

@@ -117,12 +117,12 @@ public class OPE03111 extends QCCatalogue {
         boolean flag=false;
         String str = Str(string);
         String rex="[\\s\\S]*(?=流式)[\\s\\S]*";
-        String rex1="[\\s\\S]*(?=穿透)[\\s\\S]{0,10}(?=层)[\\s\\S]*";
-        String rex2="[\\s\\S]*(?=癌)[\\s\\S]{0,10}(?=浸润)[\\s\\S]*";
+        String rex1="[\\s\\S]*(?=穿透)[^,;,;。]{0,7}(?=层)[\\s\\S]*";
+        String rex2="[\\s\\S]*(?=癌)[^,;,;。]{0,6}(?=浸润)[\\s\\S]*";
         String rex3="[\\s\\S]*(?=分化)[\\s\\S]*";
-        String rex4="[\\s\\S]*(?=淋巴结)[\\s\\S]{0,10}(?=转移)[\\s\\S]*";
-        String rex5="[\\s\\S]*(?=浸润性)[\\s\\S]{0,10}(?=癌)[\\s\\S]*";
-        String rex6="[\\s\\S]*(?=突破)[\\s\\S]{0,10}(?=层)[\\s\\S]*";
+        String rex4="[\\s\\S]*(?=淋巴结)[^,;,;。]{0,8}(?=转移)[\\s\\S]*";
+        String rex5="[\\s\\S]*(?=浸润性)[^,;,;。]{0,8}(?=癌)[\\s\\S]*";
+        String rex6="[\\s\\S]*(?=突破)[^,;,;。]{0,7}(?=层)[\\s\\S]*";
         List<String> surgeryPathologyList = Content.surgeryPathologyList;
         for (String surgeryPathology : surgeryPathologyList) {
             if(str.contains(surgeryPathology)){

+ 29 - 39
kernel/src/main/java/com/lantone/qc/kernel/catalogue/operationdiscussion/OPE03119.java

@@ -40,6 +40,7 @@ public class OPE03119 extends QCCatalogue {
                 Map<String, String> structureMap = dad.getStructureMap();
                 String daStatus = structureMap.get(Content.doctorAdviceState);
                 String adviceType = structureMap.get(Content.doctorAdviceType);
+                String medicalOrderName = structureMap.get(Content.medicalOrderName);
                 //取临时医嘱
                 if (StringUtil.isNotEmpty(daStatus)) {
                     if (!Content.cancellationOrderList.contains(daStatus)) {
@@ -54,6 +55,13 @@ public class OPE03119 extends QCCatalogue {
                                       break;
                                   }
                               }
+                              if(StringUtil.isNotEmpty(medicalOrderName)){
+                                  String rex="[\\s\\S]*(?=拟)[\\s\\S]*(?=术)[\\s\\S]*";
+                                  if(medicalOrderName.matches(rex)){
+                                      ssHz = true;
+                                      break;
+                                  }
+                              }
                         }
                     }
                 }
@@ -68,27 +76,22 @@ public class OPE03119 extends QCCatalogue {
                 }
             }
         }
-        /**********手术是否使用了植入物**/
-        //查房
-        if (ListUtil.isNotEmpty(threeLevelWardDocs) && ssHz) {
-            ThreeLevelWardDoc threeLevelWardDoc = threeLevelWardDocs.get(0);
-            //所有查房记录
-            List<ThreeLevelWardDoc> allDoctorWradDocs = threeLevelWardDoc.getAllDoctorWradDocs();
-            if (ListUtil.isNotEmpty(allDoctorWradDocs)) {
-                for (ThreeLevelWardDoc allDoctorWradDoc : allDoctorWradDocs) {
-                    String pathographyStr = allDoctorWradDoc.getStructureMap().get(Content.illnessRecords);
-                    if (StringUtil.isNotEmpty(pathographyStr)) {
-                        if (zrwStr(pathographyStr)) {
-                            zrw=true;
+        //手术记录
+        if(ListUtil.isNotEmpty(operationDocs) && ssHz){
+            for (OperationDoc operationDoc : operationDocs) {
+                OperationInformedConsentDoc operationInformedConsentDoc = operationDoc.getOperationInformedConsentDoc();
+                if(operationInformedConsentDoc!=null){
+                    String str = operationInformedConsentDoc.getStructureMap().get("使用植入性材料");
+                    if(StringUtil.isNotEmpty(str)) {
+                        if (str.equals("true")) {
+                            zrw = true;
                             break;
                         }
+                        if(str.equals("false")){
+                            return;
+                        }
                     }
                 }
-            }
-        }
-        //手术记录
-        if(ListUtil.isNotEmpty(operationDocs) && ssHz){
-            for (OperationDoc operationDoc : operationDocs) {
                 OperationRecordDoc operationRecordDoc = operationDoc.getOperationRecordDoc();
                 if(operationRecordDoc!=null){
                     String key = getKeyByHospitalId();
@@ -109,13 +112,10 @@ public class OPE03119 extends QCCatalogue {
                             }
                         }
                     }
-                }
-                OperationInformedConsentDoc operationInformedConsentDoc = operationDoc.getOperationInformedConsentDoc();
-                if(operationInformedConsentDoc!=null){
-                    String str = operationInformedConsentDoc.getStructureMap().get("使用植入性材料");
-                    if(StringUtil.isNotEmpty(str)) {
-                        if (str.equals("true")) {
-                            zrw = true;
+                    String strzr = operationRecordDoc.getStructureMap().get("植入物名称");
+                    if(StringUtil.isNotEmpty(strzr)){
+                        if(zrwStr(str)){
+                            zrw=true;
                             break;
                         }
                     }
@@ -183,16 +183,6 @@ public class OPE03119 extends QCCatalogue {
                             }
                         }
                     }
-                    OperationInformedConsentDoc operationInformedConsentDoc = operationDoc.getOperationInformedConsentDoc();
-                    if(operationInformedConsentDoc!=null){
-                        String str = operationInformedConsentDoc.getStructureMap().get("使用植入性材料");
-                        if(StringUtil.isNotEmpty(str)) {
-                            if (str.equals("true")) {
-                                status.set("0");
-                                return;
-                            }
-                        }
-                    }
                 }
             }
         }
@@ -217,12 +207,12 @@ public class OPE03119 extends QCCatalogue {
         str = str.replaceAll("\\}", "\\\\}");
         str = str.replaceAll("\\|", "\\\\|");
         str = str.replaceAll("\\/", "\\\\/");
-        String rex1="[\\s\\S]*(?=人工)[^,;,;。]{0,6}(?=体)[\\s\\S]*";
-        String rex2="[\\s\\S]*(?=人工)[^,;,;。]{0,6}(?=关节)[\\s\\S]*";
-        String rex3="[\\s\\S]*(?=生物)[^,;,;。]{0,6}(?=膜)[\\s\\S]*";
+        String rex1="[\\s\\S]*(?=人工)[^,;,;。]{0,7}(?=体)[\\s\\S]*";
+        String rex2="[\\s\\S]*(?=人工)[^,;,;。]{0,7}(?=关节)[\\s\\S]*";
+        String rex3="[\\s\\S]*(?=生物)[^,;,;。]{0,7}(?=膜)[\\s\\S]*";
         String rex4="[\\s\\S]*(?=机械)[\\s\\S]*";
-        String rex5="[\\s\\S]*(?=起搏)[^,;,;。]{0,6}(?=器)[\\s\\S]*";
-        String rex6="[\\s\\S]*(?=粒子)[^,;,;。]{0,6}(?=植入)[\\s\\S]*";
+        String rex5="[\\s\\S]*(?=起搏)[^,;,;。]{0,7}(?=器)[\\s\\S]*";
+        String rex6="[\\s\\S]*(?=粒子)[^,;,;。]{0,7}(?=植入)[\\s\\S]*";
         //植入物集合
         List<String> theImplantsList = Content.theImplantsList;
         for (String theImplants : theImplantsList) {

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

@@ -77,8 +77,8 @@ public class THR03114 extends QCCatalogue {
             return false;
         }
         String str = Str(string);
-        String rex="[\\s\\S]*(?=线断层)[\\s\\S]{0,10}(?=扫)[\\s\\S]*";
-        String rex1="[\\s\\S]*(?=计算机)[\\s\\S]{0,10}(?=断层)[\\s\\S]{0,10}(?=扫)[\\s\\S]*";
+        String rex="[\\s\\S]*(?=线断层)[^,;,;。]{0,8}(?=扫)[\\s\\S]*";
+        String rex1="[\\s\\S]*(?=计算机)[^,;,;。]{0,8}(?=断层)[^,;,;。]{0,7}(?=扫)[\\s\\S]*";
         if (str.contains("CT") || str.matches(rex)||str.matches(rex1)) {
             List<String> notCTList = Content.notCTList;
             for (String list : notCTList) {
@@ -98,8 +98,8 @@ public class THR03114 extends QCCatalogue {
         boolean jsj=false;
         ArrayList<String> cfStrings = new ArrayList<>();
         String str = Str(string);
-        String rex="[\\s\\S]*(?=线断层)[\\s\\S]{0,10}(?=扫)[\\s\\S]*";
-        String rex1="[\\s\\S]*(?=计算机)[\\s\\S]{0,10}(?=断层)[\\s\\S]{0,10}(?=扫)[\\s\\S]*";
+        String rex="[\\s\\S]*(?=线断层)[^,;,;。]{0,8}(?=扫)[\\s\\S]*";
+        String rex1="[\\s\\S]*(?=计算机)[^,;,;。]{0,8}(?=断层)[^,;,;。]{0,7}(?=扫)[\\s\\S]*";
         String rex2="[\\s\\S]{0,5}(?=CT)[\\s\\S]{1,10}";
         //需要判断同时存在mr和IMRT等情况的发生
         if(str.contains("CT")) {

+ 56 - 44
kernel/src/main/java/com/lantone/qc/kernel/catalogue/threelevelward/THR03115.java

@@ -1,5 +1,6 @@
 package com.lantone.qc.kernel.catalogue.threelevelward;
 
+import com.google.common.collect.Lists;
 import com.lantone.qc.kernel.catalogue.QCCatalogue;
 import com.lantone.qc.pub.Content;
 import com.lantone.qc.pub.model.InputInfo;
@@ -28,32 +29,32 @@ public class THR03115 extends QCCatalogue {
     @Override
     public void start(InputInfo inputInfo, OutputInfo outputInfo) {
         status.set("0");
-        boolean flag=false;
+        boolean flag = false;
         List<DoctorAdviceDoc> doctorAdviceDocsList = inputInfo.getDoctorAdviceDocs();
-        if(ListUtil.isNotEmpty(doctorAdviceDocsList)) {
+        if (ListUtil.isNotEmpty(doctorAdviceDocsList)) {
             for (DoctorAdviceDoc doctorAdviceDoc : doctorAdviceDocsList) {
                 Map<String, String> doctorAdviceDocStructureMap = doctorAdviceDoc.getStructureMap();
                 String daStatus = doctorAdviceDocStructureMap.get(Content.doctorAdviceState);
                 if (StringUtil.isNotEmpty(daStatus)) {
                     if (!Content.cancellationOrderList.contains(daStatus)) {
-                    //ct取临时医嘱
-                    String doctorAsks = doctorAdviceDocStructureMap.get(Content.doctorAdviceType);
-                    if (Content.statOrder.equals(doctorAsks)) {
-                        //取医嘱项目名称
-                        String daItemName = doctorAdviceDocStructureMap.get(Content.medicalOrderName);
-                        String nameSs = doctorAdviceDocStructureMap.get("医嘱处方类型");
-                        if (StringUtil.isNotEmpty(daItemName) && StringUtil.isNotEmpty(nameSs)) {
-                                if (dateStr(daItemName) && (nameSs.equals("检查")||nameSs.equals("LAB"))) {
+                        //ct取临时医嘱
+                        String doctorAsks = doctorAdviceDocStructureMap.get(Content.doctorAdviceType);
+                        if (Content.statOrder.equals(doctorAsks)) {
+                            //取医嘱项目名称
+                            String daItemName = doctorAdviceDocStructureMap.get(Content.medicalOrderName);
+                            String nameSs = doctorAdviceDocStructureMap.get("医嘱处方类型");
+                            if (StringUtil.isNotEmpty(daItemName) && StringUtil.isNotEmpty(nameSs)) {
+                                if (dateStr(daItemName) && (nameSs.equals("检查") || nameSs.equals("LAB"))) {
                                     flag = true;
                                     status.set("-1");
                                 }
+                            }
                         }
                     }
-                    }
                 }
             }
         }
-        if(flag) {
+        if (flag) {
             List<ThreeLevelWardDoc> threeLevelWardDocs = inputInfo.getThreeLevelWardDocs();
             if (ListUtil.isNotEmpty(threeLevelWardDocs)) {
                 List<ThreeLevelWardDoc> allDoctorWradDocs = threeLevelWardDocs.get(0).getAllDoctorWradDocs();
@@ -72,18 +73,19 @@ public class THR03115 extends QCCatalogue {
             }
         }
     }
-    private boolean dateStr(String string){
-        if(StringUtil.isEmpty(string)){
+
+    private boolean dateStr(String string) {
+        if (StringUtil.isEmpty(string)) {
             return false;
         }
         String str = Str(string);
-        String rex="[\\s\\S]*(?=线断层)[\\s\\S]{0,10}(?=扫)[\\s\\S]*";
-        String rex1="[\\s\\S]*(?=计算机)[\\s\\S]{0,10}(?=断层)[\\s\\S]{0,10}(?=扫)[\\s\\S]*";
-        if (str.contains("CT") || str.matches(rex)||str.matches(rex1)) {
-            if(str.contains("CT")){
+        String rex = "[\\s\\S]*(?=线断层)[^,;,;。]{0,8}(?=扫)[\\s\\S]*";
+        String rex1 = "[\\s\\S]*(?=计算机)[^,;,;。]{0,8}(?=断层)[^,;,;。]{0,7}(?=扫)[\\s\\S]*";
+        if (str.contains("CT") || str.matches(rex) || str.matches(rex1)) {
+            if (str.contains("CT")) {
                 List<String> notCTList = Content.notCTList;
                 for (String list : notCTList) {
-                    if(str.contains(list)){
+                    if (str.contains(list)) {
                         return false;
                     }
                 }
@@ -93,49 +95,57 @@ public class THR03115 extends QCCatalogue {
         return false;
     }
 
-    private boolean dateStrCf(String string){
-        if(StringUtil.isEmpty(string)){
+    private boolean dateStrCf(String string) {
+        if (StringUtil.isEmpty(string)) {
             return false;
         }
-        boolean ctCf=false;
-        boolean jsj=false;
+        boolean ctCf = false;
+        boolean jsj = false;
         ArrayList<String> cfStrings = new ArrayList<>();
         String str = Str(string);
-        String rex="[\\s\\S]*(?=线断层)[\\s\\S]{0,10}(?=扫)[\\s\\S]*";
-        String rex1="[\\s\\S]*(?=计算机)[\\s\\S]{0,10}(?=断层)[\\s\\S]{0,10}(?=扫)[\\s\\S]*";
-        String rex2="[\\s\\S]{0,5}(?=CT)[\\s\\S]{0,10}";
+        String rex = "[\\s\\S]*(?=线断层)[^,;,;。]{0,8}(?=扫)[\\s\\S]*";
+        String rex1 = "[\\s\\S]*(?=计算机)[^,;,;。]{0,8}(?=断层)[^,;,;。]{0,7}(?=扫)[\\s\\S]*";
+        String rex2 = "[\\s\\S]{0,5}(?=CT)[\\s\\S]{0,10}";
         //需要判断同时存在CT和OCT等情况的发生
-        if(str.contains("CT")) {
+        if (str.contains("CT")) {
             Matcher matcher = Pattern.compile(rex2).matcher(str);
             while (matcher.find()) {
                 String group = matcher.group();
                 cfStrings.add(group);
             }
             List<String> notCTList = Content.notCTList;
-              if (ListUtil.isNotEmpty(cfStrings)) {
-                  for (String notCT : notCTList) {
-                      for (int i = 0; i < cfStrings.size(); i++) {
-                          String cfStr = cfStrings.get(i);
-                          if(cfStr.contains(notCT)){
-                              cfStrings.remove(i);
-                              continue;
-                          }
-                      }
-                  }
-                  if(cfStrings.size()>0){
-                      ctCf=true;
-                  }
+            if (ListUtil.isNotEmpty(cfStrings)) {
+                for (String notCT : notCTList) {
+                    for (int i = 0; i < cfStrings.size(); i++) {
+                        String cfStr = cfStrings.get(i);
+                        if (cfStr.contains(notCT)) {
+                            cfStrings.remove(i);
+                            continue;
+                        }
+                    }
+                }
+                if (cfStrings.size() > 0) {
+                    ctCf = true;
+                }
             }
         }
-        if ( str.matches(rex)||str.matches(rex1)) {
-            jsj= true;
+        if (str.matches(rex) || str.matches(rex1)) {
+            jsj = true;
         }
-        if(jsj||ctCf){
+
+        for (String word : words) {
+            if (str.contains(word)) {
+                return true;
+            }
+        }
+
+        if (jsj || ctCf) {
             return true;
         }
         return false;
     }
-    private String Str(String str){
+
+    private String Str(String str) {
         str = str.replaceAll("\\*", "\\\\*");
         str = str.replaceAll("\\)", "\\\\)");
         str = str.replaceAll("\\.", "\\\\.");
@@ -152,4 +162,6 @@ public class THR03115 extends QCCatalogue {
         str = str.replaceAll("\\/", "\\\\/");
         return str;
     }
+
+    List<String> words = Lists.newArrayList("胸部平扫");
 }

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

@@ -106,12 +106,12 @@ public class THR03116 extends QCCatalogue {
         boolean flag=false;
         String str = Str(string);
         String rex="[\\s\\S]*(?=流式)[\\s\\S]*";
-        String rex1="[\\s\\S]*(?=穿透)[\\s\\S]{0,7}(?=层)[\\s\\S]*";
-        String rex2="[\\s\\S]*(?=癌)[\\s\\S]{0,7}(?=浸润)[\\s\\S]*";
+        String rex1="[\\s\\S]*(?=穿透)[^,;,;。]{0,7}(?=层)[\\s\\S]*";
+        String rex2="[\\s\\S]*(?=癌)[^,;,;。]{0,7}(?=浸润)[\\s\\S]*";
         String rex3="[\\s\\S]*(?=分化)[\\s\\S]*";
-        String rex4="[\\s\\S]*(?=淋巴结)[\\s\\S]{0,7}(?=转移)[\\s\\S]*";
-        String rex5="[\\s\\S]*(?=浸润性)[\\s\\S]{0,7}(?=癌)[\\s\\S]*";
-        String rex6="[\\s\\S]*(?=突破)[\\s\\S]{0,7}(?=层)[\\s\\S]*";
+        String rex4="[\\s\\S]*(?=淋巴结)[^,;,;。]{0,8}(?=转移)[\\s\\S]*";
+        String rex5="[\\s\\S]*(?=浸润性)[^,;,;。]{0,8}(?=癌)[\\s\\S]*";
+        String rex6="[\\s\\S]*(?=突破)[^,;,;。]{0,7}(?=层)[\\s\\S]*";
         List<String> reportCardPathologyList = Content.reportCardPathologyList;
         for (String reportCardPathology : reportCardPathologyList) {
             if(string.contains(reportCardPathology)){

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

@@ -108,12 +108,12 @@ public class THR03117 extends QCCatalogue {
         boolean flag=false;
         String str = Str(string);
         String rex="[\\s\\S]*(?=流式)[\\s\\S]*";
-        String rex1="[\\s\\S]*(?=穿透)[\\s\\S]{0,7}(?=层)[\\s\\S]*";
-        String rex2="[\\s\\S]*(?=癌)[\\s\\S]{0,7}(?=浸润)[\\s\\S]*";
+        String rex1="[\\s\\S]*(?=穿透)[^,;,;。]{0,7}(?=层)[\\s\\S]*";
+        String rex2="[\\s\\S]*(?=癌)[^,;,;。]{0,6}(?=浸润)[\\s\\S]*";
         String rex3="[\\s\\S]*(?=分化)[\\s\\S]*";
-        String rex4="[\\s\\S]*(?=淋巴结)[\\s\\S]{0,7}(?=转移)[\\s\\S]*";
-        String rex5="[\\s\\S]*(?=浸润性)[\\s\\S]{0,7}(?=癌)[\\s\\S]*";
-        String rex6="[\\s\\S]*(?=突破)[\\s\\S]{0,7}(?=层)[\\s\\S]*";
+        String rex4="[\\s\\S]*(?=淋巴结)[^,;,;。]{0,8}(?=转移)[\\s\\S]*";
+        String rex5="[\\s\\S]*(?=浸润性)[^,;,;。]{0,8}(?=癌)[\\s\\S]*";
+        String rex6="[\\s\\S]*(?=突破)[^,;,;。]{0,7}(?=层)[\\s\\S]*";
         String rex7="[\\s\\S]{0,10}(?=病理)[\\s\\S]{0,10}";
         List<String> cfPathologyList = Content.cfPathologyList;
         for (String cfPathology : cfPathologyList) {

+ 33 - 10
kernel/src/main/java/com/lantone/qc/kernel/catalogue/threelevelward/THR03120.java

@@ -34,20 +34,29 @@ public class THR03120 extends QCCatalogue {
         List<DoctorAdviceDoc> doctorAdviceDocs = inputInfo.getDoctorAdviceDocs();
         LeaveHospitalDoc leaveHospitalDoc = inputInfo.getLeaveHospitalDoc();
         List<String> radiotherapyDrugList = Content.radiotherapyDrugList;
+        List<String> tumorDiseaseList = Content.tumorDiseaseList;
         //首页判断出院诊断
         if (firstPageRecordDoc != null) {
             Map<String, Object> structureExtMap = firstPageRecordDoc.getStructureExtMap();
             List<Map<String,String>> dischargeDiag = (List) structureExtMap.get(Content.dischargeDiag);
             if(ListUtil.isNotEmpty(dischargeDiag)){
-                for (Map<String, String> diagMap : dischargeDiag) {
+                zd:for (Map<String, String> diagMap : dischargeDiag) {
                     if(StringUtil.isNotBlank(diagMap.get("诊断名称"))){
                         if(exStr(diagMap.get("诊断名称"))){
                             flag=true;
+                            break zd;
+                        }
+                        for (String tumorDisease : tumorDiseaseList) {
+                            if(diagMap.get("诊断名称").contains(tumorDisease)){
+                                flag=true;
+                                break zd;
+                            }
                         }
                     }
                     if(StringUtil.isNotBlank(diagMap.get("诊断编码"))){
                         if(diagMap.get("诊断编码").toUpperCase().startsWith("C")){
                             flag=true;
+                            break zd;
                         }
                     }
                 }
@@ -62,11 +71,25 @@ public class THR03120 extends QCCatalogue {
                 if(exStr(str)){
                     flag=true;
                 }
+                for (String tumorDisease : tumorDiseaseList) {
+                    if(str.contains(tumorDisease)){
+                        flag=true;
+                        break ;
+                    }
+                }
             }
             //出院诊断
             String str1 = structureMap.get("出院诊断");
-            if(exStr(str1)){
-                flag=true;
+            if(StringUtil.isNotEmpty(str1)) {
+                if (exStr(str1)) {
+                    flag = true;
+                }
+                for (String tumorDisease : tumorDiseaseList) {
+                    if (str1.contains(tumorDisease)) {
+                        flag = true;
+                        break;
+                    }
+                }
             }
         }
         //是否有化疗知情同意书
@@ -140,7 +163,7 @@ public class THR03120 extends QCCatalogue {
             return false;
         }
         String str = Str(string);
-        String rex1="[\\s\\S]*(?=放射)[\\s\\S]{0,6}(?=治疗)[\\s\\S]*";
+        String rex1="[\\s\\S]*(?=放射)[^,;,;。]{0,7}(?=治疗)[\\s\\S]*";
         if(str.contains("放疗") || str.contains("伽马刀") || str.contains("γ刀") || str.contains("粒子植入") || str.contains("立体定向放射") ||
                 str.matches(rex1) ||str.contains("三维适形调强放疗")  ||str.contains("SRT") ||str.contains("靶区勾画")){
             return true;
@@ -153,10 +176,10 @@ public class THR03120 extends QCCatalogue {
             return false;
         }
         String str = Str(string);
-        String rex1="[\\s\\S]*(?=恶性)[\\s\\S]{0,10}(?=瘤)[\\s\\S]*";
-        String rex2="[\\s\\S]*(?=新辅)[\\s\\S]{0,10}(?=治疗)[\\s\\S]*";
-        String rex3="[\\s\\S]*(?=解救)[\\s\\S]{0,10}(?=治疗)[\\s\\S]*";
-        String rex4="[\\s\\S]*(?=恶性)[\\s\\S]{0,10}(?=肿瘤)[\\s\\S]{0,10}(?=全身)[\\s\\S]{0,10}(?=治疗)[\\s\\S]*";
+        String rex1="[\\s\\S]*(?=恶性)[^,;,;。]{0,7}(?=瘤)[\\s\\S]*";
+        String rex2="[\\s\\S]*(?=新辅)[^,;,;。]{0,7}(?=治疗)[\\s\\S]*";
+        String rex3="[\\s\\S]*(?=解救)[^,;,;。]{0,7}(?=治疗)[\\s\\S]*";
+        String rex4="[\\s\\S]*(?=恶性)[^,;,;。]{0,7}(?=肿瘤)[^,;,;。]{0,7}(?=全身)[^,;,;。]{0,7}(?=治疗)[\\s\\S]*";
         String rex5="(?<=CA)\\d";
         Pattern rex5_ = Pattern.compile(rex5, Pattern.CASE_INSENSITIVE);
         String rex6="(?<=can)\\d";
@@ -173,8 +196,8 @@ public class THR03120 extends QCCatalogue {
             return false;
         }
         String str = Str(string);
-        String rex1="[\\s\\S]*(?=化)[\\s\\S]{0,10}(?=疗)[\\s\\S]*";
-        String rex2="[\\s\\S]*(?=放)[\\s\\S]{0,10}(?=疗)[\\s\\S]*";
+        String rex1="[\\s\\S]*(?=化)[^,;,;。]{0,7}(?=疗)[\\s\\S]*";
+        String rex2="[\\s\\S]*(?=放)[^,;,;。]{0,7}(?=疗)[\\s\\S]*";
         if(str.contains("伽马刀") || str.contains("γ刀") || str.contains("粒子植入") || str.contains("立体定向放射") || str.contains("三维适形调强放疗")
                 || str.matches(rex1) ||  str.matches(rex2) ||str.contains("IMRT") ||str.contains("SRT") || str.contains("靶区勾画")
                 ||  str.contains("腹腔灌注")

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

@@ -137,13 +137,13 @@ public class THR03121 extends QCCatalogue {
         str = str.replaceAll("\\}", "\\\\}");
         str = str.replaceAll("\\|", "\\\\|");
         str = str.replaceAll("\\/", "\\\\/");
-        String rex1="[\\s\\S]*(?=痰)[\\s\\S]{0,10}(?=培养)[\\s\\S]*";
-        String rex2="[\\s\\S]*(?=尿)[\\s\\S]{0,10}(?=培养)[\\s\\S]*";
-        String rex3="[\\s\\S]*(?=细菌)[\\s\\S]{0,10}(?=培养)[\\s\\S]*";
-        String rex4="[\\s\\S]*(?=咽)[\\s\\S]{0,10}(?=拭子)[\\s\\S]*";
-        String rex5="[\\s\\S]*(?=血)[\\s\\S]{0,10}(?=培养)[\\s\\S]*";
+        String rex1="[\\s\\S]*(?=痰)[^,;,;。]{0,7}(?=培养)[\\s\\S]*";
+        String rex2="[\\s\\S]*(?=尿)[^,;,;。]{0,7}(?=培养)[\\s\\S]*";
+        String rex3="[\\s\\S]*(?=细菌)[^,;,;。]{0,7}(?=培养)[\\s\\S]*";
+        String rex4="[\\s\\S]*(?=咽)[^,;,;。]{0,7}(?=拭子)[\\s\\S]*";
+        String rex5="[\\s\\S]*(?=血)[^,;,;。]{0,7}(?=培养)[\\s\\S]*";
         String rex6="[\\s\\S]*(?=菌培养)[\\s\\S]*";
-        String rex7="[\\s\\S]*(?=骨髓)[\\s\\S]{0,10}(?=培养)[\\s\\S]*";
+        String rex7="[\\s\\S]*(?=骨髓)[^,;,;。]{0,7}(?=培养)[\\s\\S]*";
         if (str.contains("粪便培养") || str.matches(rex1)|| str.matches(rex2)|| str.matches(rex3)
                 || str.matches(rex4) || str.matches(rex5) || str.matches(rex6) ||str.matches(rex7)) {
             return true;

+ 38 - 14
kernel/src/main/java/com/lantone/qc/kernel/catalogue/threelevelward/THR03123.java

@@ -32,20 +32,30 @@ public class THR03123 extends QCCatalogue {
         List<DoctorAdviceDoc> doctorAdviceDocs = inputInfo.getDoctorAdviceDocs();
         LeaveHospitalDoc leaveHospitalDoc = inputInfo.getLeaveHospitalDoc();
         List<String> chemotherapyList = Content.chemotherapyDrugList;
+        List<String> tumorDiseaseList = Content.tumorDiseaseList;
         //首页判断出院诊断
         if (firstPageRecordDoc != null) {
             Map<String, Object> structureExtMap = firstPageRecordDoc.getStructureExtMap();
             List<Map<String,String>> dischargeDiag = (List) structureExtMap.get(Content.dischargeDiag);
             if(ListUtil.isNotEmpty(dischargeDiag)){
-                for (Map<String, String> diagMap : dischargeDiag) {
+                zd: for (Map<String, String> diagMap : dischargeDiag) {
                     if(StringUtil.isNotBlank(diagMap.get("诊断名称"))){
                         if(exStr(diagMap.get("诊断名称"))){
                             flag=true;
+                            break zd;
                         }
+                        for (String tumorDisease : tumorDiseaseList) {
+                            if(diagMap.get("诊断名称").contains(tumorDisease)){
+                                flag=true;
+                                break zd;
+                            }
+                        }
+
                     }
                     if(StringUtil.isNotBlank(diagMap.get("诊断编码"))){
                         if(diagMap.get("诊断编码").toUpperCase().startsWith("C")){
                             flag=true;
+                            break zd;
                         }
                     }
                 }
@@ -60,11 +70,25 @@ public class THR03123 extends QCCatalogue {
                 if(exStr(str)){
                     flag=true;
                 }
+                for (String tumorDisease : tumorDiseaseList) {
+                    if(str.contains(tumorDisease)){
+                        flag=true;
+                        break ;
+                    }
+                }
             }
             //出院诊断
             String str1 = structureMap.get("出院诊断");
-            if(exStr(str1)){
-                flag=true;
+            if(StringUtil.isNotEmpty(str1)) {
+                if (exStr(str1)) {
+                    flag = true;
+                }
+                for (String tumorDisease : tumorDiseaseList) {
+                    if (str1.contains(tumorDisease)) {
+                        flag = true;
+                        break;
+                    }
+                }
             }
         }
         //是否有化疗知情同意书
@@ -192,10 +216,10 @@ public class THR03123 extends QCCatalogue {
             return false;
         }
         String str = Str(string);
-        String rex1="[\\s\\S]*(?=化)[\\s\\S]{0,6}(?=疗)[\\s\\S]*";
-        String rex2="[\\s\\S]*(?=新辅)[\\s\\S]{0,6}(?=疗)[\\s\\S]*";
-        String rex3="[\\s\\S]*(?=解救)[\\s\\S]{0,6}(?=疗)[\\s\\S]*";
-        String rex4="[\\s\\S]*(?=恶性)[\\s\\S]{0,6}(?=肿瘤)[\\s\\S]{0,6}(?=全身)[\\s\\S]{0,6}(?=治疗)[\\s\\S]*";
+        String rex1="[\\s\\S]*(?=化)[^,;,;。]{0,7}(?=疗)[\\s\\S]*";
+        String rex2="[\\s\\S]*(?=新辅)[^,;,;。]{0,7}(?=疗)[\\s\\S]*";
+        String rex3="[\\s\\S]*(?=解救)[^,;,;。]{0,7}(?=疗)[\\s\\S]*";
+        String rex4="[\\s\\S]*(?=恶性)[^,;,;。]{0,7}(?=肿瘤)[^,;,;。]{0,7}(?=全身)[^,;,;。]{0,7}(?=治疗)[\\s\\S]*";
         if(str.matches(rex1) ||  str.matches(rex2)||  str.matches(rex3)||  str.matches(rex4) ){
             return true;
         }
@@ -207,11 +231,11 @@ public class THR03123 extends QCCatalogue {
             return false;
         }
         String str = Str(string);
-        String rex1="[\\s\\S]*(?=恶性)[\\s\\S]{0,6}(?=瘤)[\\s\\S]*";
-        String rex2="[\\s\\S]*(?=新辅)[\\s\\S]{0,6}(?=治疗)[\\s\\S]*";
-        String rex3="[\\s\\S]*(?=解救)[\\s\\S]{0,6}(?=治疗)[\\s\\S]*";
-        String rex4="[\\s\\S]*(?=恶性)[\\s\\S]{0,6}(?=肿瘤)[\\s\\S]{0,10}(?=全身)[\\s\\S]{0,6}(?=治疗)[\\s\\S]*";
-        String rex5="[\\s\\S]*(?=化)[\\s\\S]{0,6}(?=疗)[\\s\\S]*";
+        String rex1="[\\s\\S]*(?=恶性)[^,;,;。]{0,7}(?=瘤)[\\s\\S]*";
+        String rex2="[\\s\\S]*(?=新辅)[^,;,;。]{0,7}(?=治疗)[\\s\\S]*";
+        String rex3="[\\s\\S]*(?=解救)[^,;,;。]{0,7}(?=治疗)[\\s\\S]*";
+        String rex4="[\\s\\S]*(?=恶性)[^,;,;。]{0,7}(?=肿瘤)[^,;,;。]{0,7}(?=全身)[^,;,;。]{0,7}(?=治疗)[\\s\\S]*";
+        String rex5="[\\s\\S]*(?=化)[^,;,;。]{0,7}(?=疗)[\\s\\S]*";
         if(str.contains("肉瘤") || str.contains("淋巴瘤") || str.contains("白血病") || str.contains("癌") || str.contains("canser") ||
                 str.matches(rex1) ||str.matches(rex2) ||str.matches(rex3) ||str.matches(rex4)||str.contains("can")||str.contains("CA")||str.matches(rex5)){
             return true;
@@ -224,8 +248,8 @@ public class THR03123 extends QCCatalogue {
             return false;
         }
         String str = Str(string);
-        String rex1="[\\s\\S]*(?=化)[\\s\\S]{0,6}(?=疗)[\\s\\S]*";
-        String rex2="[\\s\\S]*(?=放)[\\s\\S]{0,6}(?=疗)[\\s\\S]*";
+        String rex1="[\\s\\S]*(?=化)[^,;,;。]{0,7}(?=疗)[\\s\\S]*";
+        String rex2="[\\s\\S]*(?=放)[^,;,;。]{0,7}(?=疗)[\\s\\S]*";
         if(str.contains("伽马刀") || str.contains("γ刀") || str.contains("粒子植入") || str.contains("立体定向放射") || str.contains("三维适形调强放疗")
                 || str.matches(rex1) ||  str.matches(rex2) ||str.contains("IMRT") ||str.contains("SRT") || str.contains("靶区勾画")
                 ||  str.contains("腹腔灌注")

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

@@ -374,7 +374,10 @@ public class Content {
     );
     //植入物
     public static List<String> theImplantsList= Arrays.asList(
-            "植入","心脏支架","假体","螺钉","融合器","钢板","内固定物","钛网","弹簧圈","硅胶","神经鞘管"
+            "植入","心脏支架","假体","螺钉","融合器","钢板","钛网","弹簧圈","硅胶","神经鞘管",
+            "钢钉","锚钉","铆钉","骨圆针","克氏针","钢丝",
+            "人工心脏瓣膜","骨水泥","动脉支架","血管瘤夹","哈姆洛克夹",
+            "钛夹","吻合器","神经刺激器","人工耳蜗","皮耐克","人工晶体"
     );
     //手术病理检查存在手术记录中无病理相关记录中手术病理
     public static List<String> surgeryPathologyList= Arrays.asList(
@@ -509,7 +512,7 @@ public class Content {
             "注射用卡瑞利珠单抗","信迪利单抗注射液","特瑞普利单抗注射液","度伐利尤单抗注射液","替雷利珠单抗注射液","替雷利珠"
     );
     //恶性肿瘤疾病
-    public static List<String> TumorDiseaseList = Arrays.asList(
+    public static List<String> tumorDiseaseList = Arrays.asList(
             "动态未定肿瘤","恶性肿瘤","转移性肿瘤","溃疡恶变","息肉恶变","恶性瘤细胞","小细胞型恶性肿瘤","巨细胞型恶性肿瘤","梭形细胞型恶性肿瘤","转移性梭形细胞型恶性肿瘤","原位癌","癌",
             "转移性癌","上皮内癌","恶性上皮瘤","大细胞癌","转移性大细胞癌","大细胞神经内分泌癌","转移性大细胞神经内分泌癌","具有杆状显型大细胞癌","玻璃状细胞癌","未分化型癌","转移性未分化癌",
             "癌,间变","多形性癌","转移性多形性癌","多形性肉瘤样癌","巨细胞和梭型细胞癌","巨细胞癌","转移性巨细胞癌","梭形细胞癌","转移性梭形细胞癌","假肉瘤性癌","转移性假肉瘤性癌","肉瘤样癌",

+ 92 - 0
trans/src/main/java/com/lantone/qc/trans/ningbozhongyi/NingBoZhongYiInformedConsentDocTrans.java

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

+ 10 - 0
trans/src/main/java/com/lantone/qc/trans/ningbozhongyi/NingbozhongyiDocTrans.java

@@ -6,6 +6,7 @@ import com.lantone.qc.pub.model.vo.MedrecVo;
 import com.lantone.qc.pub.model.vo.QueryVo;
 import com.lantone.qc.pub.util.ListUtil;
 import com.lantone.qc.trans.DocTrans;
+import com.lantone.qc.trans.beilun.BeilunInformedConsentDocTrans;
 import com.lantone.qc.trans.comsis.OrdinaryAssistant;
 import lombok.extern.slf4j.Slf4j;
 
@@ -124,6 +125,12 @@ public class NingbozhongyiDocTrans extends DocTrans {
                     NingBoZhongYiOutDepDocTrans outDepDocTrans = new NingBoZhongYiOutDepDocTrans();
                     inputInfo.setBeHospitalizedDoc(outDepDocTrans.extract(i));
                 }
+
+                if (i.getTitle().equals("知情同意书")) {
+                    NingBoZhongYiInformedConsentDocTrans informedConsentDocTrans = new NingBoZhongYiInformedConsentDocTrans();
+                    inputInfo.setInformedConsentDoc(informedConsentDocTrans.extract(i));
+                }
+
                 /*******************************VTE评分 trans解析*****************************************/
                 if (i.getTitle().equals("VTE评分")) {
                     NingBoZhongYiVTEGradeDocTrans vteGradeDocTrans = new NingBoZhongYiVTEGradeDocTrans();
@@ -178,6 +185,9 @@ public class NingbozhongyiDocTrans extends DocTrans {
                             .sorted((map1, map2) -> OrdinaryAssistant.pageDataTimeSort(map1, map2, "记录时间", "yyyy-MM-dd HH:mm"))
                             .collect(Collectors.toList()));
         }
+        if (ListUtil.isNotEmpty(inputInfo.getInformedConsentDoc())) {
+            inputInfo.getPageData().put("知情同意书", inputInfo.getInformedConsentDoc().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()));
         }

+ 124 - 0
trans/src/main/java/com/lantone/qc/trans/ningbozhongyi/util/NingBoZhongYiInformedHtmlAnalysis.java

@@ -0,0 +1,124 @@
+package com.lantone.qc.trans.ningbozhongyi.util;
+
+import com.google.common.collect.Lists;
+import com.google.common.collect.Maps;
+import com.lantone.qc.pub.util.MapUtil;
+import com.lantone.qc.pub.util.StringUtil;
+import com.lantone.qc.trans.beilun.util.BeiLunHtmlAnalysis;
+import com.lantone.qc.trans.beilun.util.BeiLunHtmlAnalysisUtil;
+import com.lantone.qc.trans.comsis.CommonAnalysisUtil;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.collections.MapUtils;
+import org.jsoup.Jsoup;
+import org.jsoup.nodes.Document;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @Description: 知情同意书html解析
+ * @author: HUJING
+ * @time: 2020/9/14 15:41
+ */
+@Slf4j
+public class NingBoZhongYiInformedHtmlAnalysis implements NingBoZhongYiHtmlAnalysis {
+
+    private String modeId = "53";
+
+    @Override
+    public Map<String, String> analysis(String... args) {
+        Map<String, String> structureMap = Maps.newLinkedHashMap();
+        try {
+            List<String> titles = Lists.newArrayList(
+                    "医师签名",
+                    "九、患者知情同意",
+                    "患方意见",
+                    "患者签名",
+                    "患方签名",
+                    "患方手写意见",
+                    "患方手写意见患方签名",
+                    "患方或受托代理人签名",
+                    "代理人签名",
+                    "被授权人签名",
+                    "与患者关系",
+                    "其他");
+            String html = args[0];
+            String recTitle = args[1];
+            String recTypeId = args[2];
+            Document doc = Jsoup.parse(html);
+            String htmlContent = BeiLunHtmlAnalysisUtil.blockDivToStr(doc.selectFirst("body").child(0), false);
+            if (StringUtil.isNotBlank(recTitle) && recTitle.contains("知情选择授权书")) {
+                structureMap.put("标题", recTitle);
+                return structureMap;
+            } else if ("自费服务项目、药品、材料使用知情同意书".equals(recTitle)) {
+                if (html.contains("自费服务项目、药品、材料使用知情同意书") && html.split("自费服务项目、药品、材料使用知情同意书")[1].contains("<img")) {
+                    structureMap.put("谈话医生", "<img");
+                    return structureMap;
+                }
+            }
+
+            if (StringUtil.isNotBlank(htmlContent)) {
+                htmlContent = htmlContent.replaceAll("[   ]", " ")
+                        .replace("手印说明(\uF06F右食指 \uF06F左食指)", "")
+                        .replace("手印说明:(\uF06F右食指 \uF06F左食指)其他手印备注", "")
+                        .replace("第1页", "");
+                CommonAnalysisUtil.html2StructureMap(titles, htmlContent, structureMap);
+            }
+            CommonAnalysisUtil.extractDateByTitle(structureMap, "记录时间");
+            for (String ignoreContrast : ignoreContrasts) {
+                if (structureMap.containsKey(ignoreContrast)) {
+                    structureMap.remove(ignoreContrast);
+                }
+            }
+
+            resultHandle(structureMap);
+            disDate(structureMap, "医师签名", "签名时间");
+            NingBoZhongYiHtmlAnalysisUtil.insertModuleId(modeId, recTypeId, structureMap);
+        } catch (Exception e) {
+            log.error(e.getMessage(), e);
+        }
+        return structureMap;
+    }
+
+    private List<String> ignoreContrasts = Lists.newArrayList(
+            "其他",
+            "与患者关系",
+            "手印备注与患者关系",
+            "身份证号码",
+            "九、患者知情同意",
+            "患方意见"
+    );
+
+    private void resultHandle(Map<String, String> result) {
+        if (MapUtils.isEmpty(result)) {
+            return;
+        }
+        if (result.containsKey("代理人签名")) {
+            String signName = result.get("代理人签名");
+
+            if (signName.contains("手印备注")) {
+                signName = signName.split("手印备注")[0];
+                result.put("代理人签名", signName);
+            }
+        }
+        result.forEach((key, value) -> {
+            if (StringUtil.isNotBlank(value)) {
+                value = StringUtil.trim(value);
+                if (value.endsWith(";") || value.endsWith(";")) {
+                    value = value.substring(0, value.length() - 1);
+                }
+                result.put(key, value);
+            }
+        });
+    }
+
+    private void disDate(Map sourceMap, String... args) {
+        Map<String, String> sourceMap_ = MapUtil.copyMap(sourceMap);
+        if (sourceMap.containsKey(args[0]) && sourceMap_.get(args[0]).contains(args[1])) {
+            int index = sourceMap_.get(args[0]).indexOf(args[1]);
+            sourceMap.put(args[0], sourceMap_.get(args[0]).substring(0, index));
+            sourceMap.put(args[0] + args[1], sourceMap_.get(args[0]).substring(index).replace(args[1], "").replaceAll("[::]", ""));
+        }
+    }
+
+}