소스 검색

抗生素使用指征不明确添加逻辑:体温大于38度不报错

hujing 4 년 전
부모
커밋
813c2a0ce2
1개의 변경된 파일31개의 추가작업 그리고 3개의 파일을 삭제
  1. 31 3
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/threelevelward/THR03044.java

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

@@ -4,6 +4,7 @@ import com.google.common.collect.ImmutableMap;
 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.BeHospitalizedDoc;
 import com.lantone.qc.pub.model.doc.DoctorAdviceDoc;
 import com.lantone.qc.pub.model.doc.LisDoc;
 import com.lantone.qc.pub.util.StringUtil;
@@ -77,6 +78,12 @@ public class THR03044 extends QCCatalogue {
             return;
         }
 
+        //体温大于38度也不报错
+        double temperature = getTemperature(inputInfo);
+        if (temperature > 38) {
+            return;
+        }
+
         Map<String, String> lises = new HashMap<>();
         Map<String, String> lisReportMap = new HashMap<>();
 
@@ -182,8 +189,8 @@ public class THR03044 extends QCCatalogue {
      */
     private boolean compare(String result, String value) {
         boolean flag = false;
-        String s = num_method(value);
-        String resultValue = num_method(result);
+        String s = getNum(value);
+        String resultValue = getNum(result);
         if (num_contain(resultValue) && num_contain(s)) {
             if (Float.parseFloat(resultValue) > Float.parseFloat(s) && value.contains(">")) {
                 flag = true;
@@ -199,7 +206,7 @@ public class THR03044 extends QCCatalogue {
         return flag;
     }
 
-    public String num_method(String content) {
+    public String getNum(String content) {
         //        String compile = "(\\d+\\.\\d+)|(\\d+)";
         String group = "";
         String compile = "([1-9]\\d*\\.?\\d*)|(0\\.\\d*[1-9])";
@@ -219,4 +226,25 @@ public class THR03044 extends QCCatalogue {
         boolean b = matcher.find();
         return b;
     }
+
+    private double getTemperature(InputInfo inputInfo) {
+        double temp = 0d;
+        BeHospitalizedDoc beHospitalizedDoc = inputInfo.getBeHospitalizedDoc();
+        if (beHospitalizedDoc != null) {
+            Map<String, String> beHStructureMap = beHospitalizedDoc.getStructureMap();
+            String temperature = beHStructureMap.get("体温");
+            if (StringUtil.isNotBlank(temperature)) {
+                temp = Double.parseDouble(getNum(temperature));
+            }
+            String special = beHStructureMap.get("专科小结");
+            if (temp == 0 && StringUtil.isNotBlank(special)) {
+                Pattern p = Pattern.compile("T[1-9]\\d*\\.?\\d*℃");
+                Matcher matcher = p.matcher(special);
+                if (matcher.find()) {
+                    temp = Double.parseDouble(getNum(matcher.group(0)));
+                }
+            }
+        }
+        return temp;
+    }
 }