Selaa lähdekoodia

手术病理检查存在手术记录中无病理相关记录

zhaops 3 vuotta sitten
vanhempi
commit
2f99443936

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

@@ -1,10 +1,13 @@
 package com.lantone.qc.kernel.catalogue.operationdiscussion;
 
 import com.lantone.qc.kernel.catalogue.QCCatalogue;
+import com.lantone.qc.kernel.util.RegexUtil;
 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.*;
+import com.lantone.qc.pub.model.doc.DoctorAdviceDoc;
+import com.lantone.qc.pub.model.doc.FirstPageRecordDoc;
+import com.lantone.qc.pub.model.doc.PathologyShipDoc;
 import com.lantone.qc.pub.model.doc.operation.OperationDoc;
 import com.lantone.qc.pub.model.doc.operation.OperationRecordDoc;
 import com.lantone.qc.pub.util.ListUtil;
@@ -34,18 +37,18 @@ public class OPE03111 extends QCCatalogue {
         FirstPageRecordDoc firstPageRecordDoc = inputInfo.getFirstPageRecordDoc();
         List<OperationDoc> operationDocs = inputInfo.getOperationDocs();
         //是否包含手术记录
-        if(operationDocs==null || operationDocs.size()==0){
+        if (operationDocs == null || operationDocs.size() == 0) {
             return;
         }
-        if(operationDocs!=null) {
+        if (operationDocs != null) {
             for (OperationDoc operationDoc : operationDocs) {
                 OperationRecordDoc operationRecordDoc = operationDoc.getOperationRecordDoc();
                 if (operationRecordDoc == null) {
-                   return;
+                    return;
                 }
                 String pathological = operationRecordDoc.getStructureMap().get("病理检查");
-                if (StringUtil.isNotEmpty(pathological)){
-                    if (pathological.contains("送")){
+                if (StringUtil.isNotEmpty(pathological)) {
+                    if (pathological.contains("送")) {
                         status.set("0");
                         continue;
                     }
@@ -75,43 +78,47 @@ public class OPE03111 extends QCCatalogue {
             }
         }
         //用首页或出院判断是否进行了病理检查
-        if(firstPageRecordDoc!=null){
+        if (firstPageRecordDoc != null) {
             String str = firstPageRecordDoc.getStructureMap().get("病理诊断费");
-            if ( !str.equals("0") && StringUtil.isNotEmpty(str)) {
+            if (!str.equals("0") && StringUtil.isNotEmpty(str)) {
                 double a = Double.parseDouble(str);
-                if ( a > Content.pathologicalFee) {
-                    blHz=true;
+                if (a > Content.pathologicalFee) {
+                    blHz = true;
                 }
             }
         }
         List<PathologyShipDoc> pathologyShipDocs = inputInfo.getPathologyShipDocs();
-        if(ListUtil.isNotEmpty(pathologyShipDocs)){
-            blHz=true;
+        if (ListUtil.isNotEmpty(pathologyShipDocs)) {
+            blHz = true;
         }
         //判断手术记录有无标本记录
-        if(blHz) {
+        if (blHz) {
             status.set("-1");
-            if (operationDocs != null ) {
+            if (operationDocs != null) {
                 //有手术记录的情况下,手术记录中应该出现体现有标本
                 for (OperationDoc operationDoc : operationDocs) {
                     String specimens = operationDoc.getOperationRecordDoc().getStructureMap().get("术中取病理标本");
-                    if(StringUtil.isNotEmpty(specimens)){
-                        if(specimens.equals("有")){
+                    if (StringUtil.isNotEmpty(specimens)) {
+                        if (specimens.equals("有")) {
                             status.set("0");
                             return;
                         }
-                        if(specimens.equals("无")){
+                        if (specimens.equals("无")) {
                             status.set("0");
                             return;
                         }
                     }
                     OperationRecordDoc operationRecordDoc = operationDoc.getOperationRecordDoc();
                     if (operationRecordDoc != null) {
-                        String str = operationRecordDoc.getStructureMap().get("手术经过及处理");
-                        if (StringUtil.isNotEmpty(str)) {
-                            if (dateStr(str)) {
-                                status.set("0");
-                                return;
+                        for (Map.Entry<String, String> entry : operationRecordDoc.getStructureMap().entrySet()) {
+                            if (RegexUtil.getRegexRes(entry.getKey(), "手术[\\u4e00-\\u9fa5]{0,}经过")) {
+                                String str = entry.getValue();
+                                if (StringUtil.isNotEmpty(str)) {
+                                    if (dateStr(str)) {
+                                        status.set("0");
+                                        return;
+                                    }
+                                }
                             }
                         }
                     }
@@ -121,58 +128,60 @@ public class OPE03111 extends QCCatalogue {
 
     }
 
-    private boolean dateStr(String string){
-        if(StringUtil.isEmpty(string)){
+    private boolean dateStr(String string) {
+        if (StringUtil.isEmpty(string)) {
             return false;
         }
-        boolean flag=false;
+        boolean flag = false;
         String str = Str(string);
-        String rex="[\\s\\S]*(?=流式)[\\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]*(?=淋巴结)[^,;,;。]{0,8}(?=转移)[\\s\\S]*";
-        String rex5="[\\s\\S]*(?=浸润性)[^,;,;。]{0,8}(?=癌)[\\s\\S]*";
-        String rex6="[\\s\\S]*(?=突破)[^,;,;。]{0,7}(?=层)[\\s\\S]*";
+        String rex = "[\\s\\S]*(?=流式)[\\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]*(?=淋巴结)[^,;,;。]{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)){
-                flag=true;
+            if (str.contains(surgeryPathology)) {
+                flag = true;
             }
         }
-        if(flag || str.matches(rex1)|| str.matches(rex2)
-                ||str.matches(rex3)|| str.matches(rex4)||str.matches(rex5)|| str.matches(rex6)|| str.matches(rex)){
+        if (flag || str.matches(rex1) || str.matches(rex2)
+                || str.matches(rex3) || str.matches(rex4) || str.matches(rex5) || str.matches(rex6) || str.matches(rex)) {
             return true;
         }
-        if(str.contains("冰冻")){
-            if(bdStr(str)){
+        if (str.contains("冰冻")) {
+            if (bdStr(str)) {
                 return true;
             }
         }
         return false;
     }
-    private boolean bLStr(String string){
-        if(StringUtil.isEmpty(string)){
+
+    private boolean bLStr(String string) {
+        if (StringUtil.isEmpty(string)) {
             return false;
         }
         String str = Str(string);
         List<String> doctorAdvicePathologyList = Content.doctorAdvicePathologyList;
         for (String doctorAdvicePathology : doctorAdvicePathologyList) {
-            if(str.contains(doctorAdvicePathology)){
+            if (str.contains(doctorAdvicePathology)) {
                 return true;
             }
         }
-        if(str.contains("冰冻")){
-            if(bdStr(str)){
+        if (str.contains("冰冻")) {
+            if (bdStr(str)) {
                 return true;
             }
         }
         return false;
     }
+
     //判断包含冰冻但不属于病理
     private boolean bdStr(String str) {
         ArrayList<String> blStrings = new ArrayList<>();
-        String rex1="[\\s\\S]{0,10}(?=冰冻)[\\s\\S]{0,10}";
+        String rex1 = "[\\s\\S]{0,10}(?=冰冻)[\\s\\S]{0,10}";
         Matcher matcher = Pattern.compile(rex1).matcher(str);
         while (matcher.find()) {
             String group = matcher.group();
@@ -196,7 +205,7 @@ public class OPE03111 extends QCCatalogue {
         return false;
     }
 
-    private String Str(String str){
+    private String Str(String str) {
         str = str.replaceAll("\\*", "\\\\*");
         str = str.replaceAll("\\)", "\\\\)");
         str = str.replaceAll("\\.", "\\\\.");
@@ -213,4 +222,4 @@ public class OPE03111 extends QCCatalogue {
         str = str.replaceAll("\\/", "\\\\/");
         return str;
     }
-}
+}