Browse Source

宁波中医院提出:胸部平扫属于ct

wangsy 3 years ago
parent
commit
a81463937f

+ 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]*(?=线断层)[^,;,;。]{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")){
+        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]*(?=线断层)[^,;,;。]{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}";
+        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("胸部平扫");
 }