Ver código fonte

1、出院其他诊断不完整
2、激素 抗生素规则修改

louhr 5 anos atrás
pai
commit
d9fbbfb941

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

@@ -61,7 +61,7 @@ public class FIRP0178 extends QCCatalogue {
                 if (jsonArray.size() == 2) {
                     /* 相似度分数 */
                     double likeRate = jsonArray.getDoubleValue(1);
-                    if (likeRate > 0.9) {
+                    if (likeRate < 0.9) {
                         infoStr = CatalogueUtil.concatInfo(infoStr, leaveDiag);
                     }
                 }

+ 1 - 23
kernel/src/main/java/com/lantone/qc/kernel/catalogue/leavehospital/LEA02987.java

@@ -64,7 +64,7 @@ public class LEA02987 extends QCCatalogue {
 
         //没有包含的药品再次查看商品名或化学名在出院医嘱书写
         for (String drug : notContainsDrugs) {
-            Set<String> splitDrugs = getRegexWords(drug, "[((][^()()]+[))]");
+            Set<String> splitDrugs = CatalogueUtil.getRegexWords(drug, "[((\\[][^\\[\\]()()]+[\\]))]");
             boolean isFind = false;
             for (String sd : splitDrugs) {
                 if (dischargeOrder.contains(sd)){
@@ -81,26 +81,4 @@ public class LEA02987 extends QCCatalogue {
         }
     }
 
-
-    private Set<String> getRegexWords(String word, String regex) {
-        Set<String> ret = new HashSet<>();
-        if (StringUtil.isNotBlank(word) && StringUtil.isNotBlank(regex)) {
-            Pattern pattern = Pattern.compile(regex);
-            Matcher matcher = pattern.matcher(word);
-            if (matcher.find()) {
-                ret.add(matcher.group().replaceAll("[(())]", ""));
-                int startIndex = matcher.start();
-                int endIndex = matcher.end();
-                if (startIndex > 0) {
-                    ret.add(word.substring(0, startIndex));
-                }
-                if (endIndex <= word.length()) {
-                    ret.addAll(getRegexWords(word.substring(endIndex), regex));
-                }
-            } else {
-                ret.add(word);
-            }
-        }
-        return ret;
-    }
 }

+ 20 - 10
kernel/src/main/java/com/lantone/qc/kernel/catalogue/threelevelward/THR02985.java

@@ -7,12 +7,11 @@ import com.lantone.qc.pub.model.OutputInfo;
 import com.lantone.qc.pub.model.doc.DoctorAdviceDoc;
 import com.lantone.qc.pub.model.doc.ThreeLevelWardDoc;
 import com.lantone.qc.pub.util.StringUtil;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.stereotype.Component;
 
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import java.text.SimpleDateFormat;
+import java.util.*;
 
 /**
  * @ClassName : THR02985
@@ -48,13 +47,24 @@ public class THR02985 extends QCCatalogue {
             return;
         }
         String infoStr = "";
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
         for (Map.Entry<Date, String> doctorAdviceDrug : doctorAdviceDrugMap.entrySet()) {
             Date doctorAdviceDate = doctorAdviceDrug.getKey();
-            String drug = doctorAdviceDrug.getValue();
-            int matchSum = 0;
-            matchSum = getMatchSum(allDoctorWradDocs, doctorAdviceDate, drug, matchSum, 2);
-            if (matchSum == 0) {
-                infoStr = CatalogueUtil.concatInfo(infoStr, drug);
+            Set<String> splitDrugs = CatalogueUtil.getRegexWords(doctorAdviceDrug.getValue(), "[((\\[][^\\[\\]()()]+[\\]))]");
+
+            boolean isFind = false;
+            for (String drug : splitDrugs) {
+                int matchSum = 0;
+                if (drug.equals("合资") || drug.equals("进口") || drug.equals("国产") ) {
+                    continue;
+                }
+                matchSum = getMatchSum(allDoctorWradDocs, doctorAdviceDate, drug, matchSum, 2);
+                if (matchSum > 0) {
+                    isFind = true;
+                }
+            }
+            if (!isFind) {
+                String.format(infoStr = CatalogueUtil.concatInfo(infoStr, doctorAdviceDrug.getValue() + "<医嘱时间>:" + sdf.format(doctorAdviceDate)));
             }
         }
 
@@ -70,7 +80,7 @@ public class THR02985 extends QCCatalogue {
         for (ThreeLevelWardDoc threeLevelWardDoc : allDoctorWradDocs) {
             Map<String, String> wardDocStructureMap = threeLevelWardDoc.getStructureMap();
             String wardDateStr = wardDocStructureMap.get("查房日期");
-            String content = wardDocStructureMap.get("病情记录");
+            String content = wardDocStructureMap.get("病情记录") + wardDocStructureMap.get("治疗计划和措施");
             Date wardDate = StringUtil.parseDateTime(wardDateStr);
             if (doctorAdviceDate.before(wardDate) && !CatalogueUtil.compareTime(doctorAdviceDate, wardDate, days * 24 * 60L)) {
                 if (content.contains(drug)) {

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

@@ -69,7 +69,7 @@ public class THR02986 extends QCCatalogue {
         for (ThreeLevelWardDoc threeLevelWardDoc : allDoctorWradDocs) {
             Map<String, String> wardDocStructureMap = threeLevelWardDoc.getStructureMap();
             String wardDateStr = wardDocStructureMap.get("查房日期");
-            String content = wardDocStructureMap.get("病情记录");
+            String content = wardDocStructureMap.get("病情记录") + wardDocStructureMap.get("治疗计划和措施");
             Date wardDate = StringUtil.parseDateTime(wardDateStr);
             if (doctorAdviceDate.before(wardDate) && !CatalogueUtil.compareTime(doctorAdviceDate, wardDate, days * 24 * 60L)) {
                 if (content.contains(drug)) {

+ 23 - 7
kernel/src/main/java/com/lantone/qc/kernel/util/CatalogueUtil.java

@@ -17,13 +17,7 @@ import lombok.Setter;
 import org.apache.commons.lang3.StringUtils;
 
 import java.text.SimpleDateFormat;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Calendar;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
@@ -553,4 +547,26 @@ public class CatalogueUtil {
         return false;
     }
 
+    public static Set<String> getRegexWords(String word, String regex) {
+        Set<String> ret = new HashSet<>();
+        if (StringUtil.isNotBlank(word) && StringUtil.isNotBlank(regex)) {
+            Pattern pattern = Pattern.compile(regex);
+            Matcher matcher = pattern.matcher(word);
+            if (matcher.find()) {
+                ret.add(matcher.group().replaceAll("[\\[\\](())]", ""));
+                int startIndex = matcher.start();
+                int endIndex = matcher.end();
+                if (startIndex > 0) {
+                    ret.add(word.substring(0, startIndex));
+                }
+                if (endIndex <= word.length()) {
+                    ret.addAll(getRegexWords(word.substring(endIndex), regex));
+                }
+            } else {
+                ret.add(word);
+            }
+        }
+        return ret;
+    }
+
 }