فهرست منبع

抗生素使用指征不明确添加逻辑:从入院记录辅检提取化验数据判断

hujing 4 سال پیش
والد
کامیت
49fd332951
1فایلهای تغییر یافته به همراه50 افزوده شده و 6 حذف شده
  1. 50 6
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/threelevelward/THR03044.java

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

@@ -1,7 +1,9 @@
 package com.lantone.qc.kernel.catalogue.threelevelward;
 
 import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.Lists;
 import com.lantone.qc.kernel.catalogue.QCCatalogue;
+import com.lantone.qc.kernel.util.CatalogueUtil;
 import com.lantone.qc.pub.model.InputInfo;
 import com.lantone.qc.pub.model.OutputInfo;
 import com.lantone.qc.pub.model.doc.BeHospitalizedDoc;
@@ -55,9 +57,9 @@ public class THR03044 extends QCCatalogue {
             .build();
 
     public static Map<String, String> lisGroupData = ImmutableMap.<String, String>builder()
-            .put("白细胞计数[电阻抗法]", "<0.4")
-            .put("中性粒细胞绝对数", ">12")
-            .put("中性粒百分数", ">70")
+            .put("血常规=白细胞计数[电阻抗法]", ">12")
+            .put("血常规=中性粒细胞绝对数", ">7")
+            .put("血常规=中性粒百分数", ">70")
             .build();
 
     public void start(InputInfo inputInfo, OutputInfo outputInfo) {
@@ -85,6 +87,47 @@ public class THR03044 extends QCCatalogue {
             return;
         }
 
+        //从入院记录辅检中提取化验判断
+        if (inputInfo.getBeHospitalizedDoc() != null) {
+            Map<String, String> behStructureMap = inputInfo.getBeHospitalizedDoc().getStructureMap();
+            String pacs = CatalogueUtil.structureMapJoin(behStructureMap, Lists.newArrayList("辅助检查", "实验室检查", "专科检查"));
+            if (StringUtil.isNotBlank(pacs)) {
+                pacs = StringUtil.removeBlank(pacs);
+                List<String> regexWord = Lists.newArrayList("反应蛋白numbermg/L", "中性粒细胞number%", "白细胞number");
+                boolean firstMatch = false, secondMatch = false;
+                for (String regex : regexWord) {
+                    Pattern p = Pattern.compile(regex.replace("number", "[1-9]\\d*\\.?\\d*"));
+                    Matcher matcher = p.matcher(pacs);
+                    if (matcher.find()) {
+                        String lis = matcher.group(0);
+                        if (lis.contains("反应蛋白")) {
+                            double lisResult = Double.parseDouble(getNum(lis));
+                            if (lisResult < 10) {
+                                status.set("-1");
+                                return;
+                            }
+                        } else if (lis.contains("中性粒细胞")) {
+                            double lisResult = Double.parseDouble(getNum(lis));
+                            if (lisResult < 70) {
+                                firstMatch = true;
+                            }
+                        } else if (lis.contains("白细胞")) {
+                            double lisResult = Double.parseDouble(getNum(lis));
+                            if (lisResult < 7) {
+                                secondMatch = true;
+                            }
+                        }
+
+                    }
+                }
+                if (firstMatch || secondMatch) {
+                    status.set("-1");
+                    return;
+                }
+            }
+        }
+
+        /************************************************处理数据库中化验数据************************************************/
         Map<String, String> lises = new HashMap<>();
         Map<String, String> lisReportMap = new HashMap<>();
 
@@ -105,21 +148,21 @@ public class THR03044 extends QCCatalogue {
          * 白细胞组合项单独处理
          */
         if (lises.containsKey("白细胞计数[电阻抗法]")) {
-            String wbcValue = lisGroupData.get("白细胞计数[电阻抗法]");
+            String wbcValue = lisGroupData.get("血常规=白细胞计数[电阻抗法]");
             String wbc = lises.get("白细胞计数[电阻抗法]");
             if (!compare(wbc, wbcValue)) {
                 status.set("-1");
                 return;
             }
             if (lises.containsKey("中性粒细胞绝对数")) {
-                String neutrophilValue = lisGroupData.get("中性粒细胞绝对数");
+                String neutrophilValue = lisGroupData.get("血常规=中性粒细胞绝对数");
                 String neutrophil = lises.get("中性粒细胞绝对数");
                 if (!compare(neutrophil, neutrophilValue)) {
                     status.set("-1");
                     return;
                 }
             } else if (lises.containsKey("中性粒百分数")) {
-                String neutrophilValue = lisGroupData.get("中性粒百分数");
+                String neutrophilValue = lisGroupData.get("血常规=中性粒百分数");
                 String neutrophil = lises.get("中性粒百分数");
                 if (!compare(neutrophil, neutrophilValue)) {
                     status.set("-1");
@@ -270,6 +313,7 @@ public class THR03044 extends QCCatalogue {
 
     /**
      * 从文本中取体温
+     *
      * @param content 文本
      * @return
      */