Bladeren bron

其他值提醒化验

zhoutg 4 jaren geleden
bovenliggende
commit
b3df778d27

+ 1 - 1
src/main/java/com/diagbot/enums/NeoEnum.java

@@ -21,7 +21,7 @@ public enum NeoEnum implements KeyedNamed {
     lis(8, "禁忌实验室检查"),
     pacs(9, "禁忌辅助检查"),
     disease(10, "禁忌疾病"),
-    group(11, "禁人群"),
+    group(11, "禁人群"),
     conflictmeds(12, "配伍禁忌"),
     vitals(13, "禁忌查体"),
     pacsDesc(14, "禁忌辅助检查描述"),

+ 1 - 1
src/main/java/com/diagbot/process/BillProcess.java

@@ -269,7 +269,7 @@ public class BillProcess {
             // 服用药品(现病史一般情况后的药品)
             drugRule.bill(bill.getOralmeds(), allergyAll, bill, billMsgList, NeoEnum.oralmeds.getName());
 
-            // 禁人群
+            // 禁人群
             groupRule.bill(wordCrfDTO, bill, billMsgList, NeoEnum.group.getName());
 
             // 禁用辅助检查描述

+ 10 - 2
src/main/java/com/diagbot/process/OtherTipProcess.java

@@ -8,14 +8,18 @@ import com.diagbot.dto.OtherTipNeoDTO;
 import com.diagbot.dto.OtherTipPacsNeoDTO;
 import com.diagbot.dto.OtherTipTransfusionNeoDTO;
 import com.diagbot.dto.WordCrfDTO;
+import com.diagbot.enums.NeoEnum;
 import com.diagbot.enums.TypeEnum;
+import com.diagbot.rule.GroupRule;
 import com.diagbot.util.CoreUtil;
 import com.diagbot.util.ListUtil;
 import com.diagbot.util.MsgUtil;
 import com.diagbot.util.StringUtil;
 import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
+import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
@@ -28,6 +32,8 @@ import java.util.stream.Collectors;
  */
 @Component
 public class OtherTipProcess {
+    @Autowired
+    GroupRule groupRule;
 
     /**
      * 处理业务——化验
@@ -43,13 +49,15 @@ public class OtherTipProcess {
 
             if (ListUtil.isNotEmpty(factor)) {
                 for (NodeNeoDTO nodeNeoDTO : factor) {
-                    Map map = null;
+                    Map map = new LinkedHashMap();
                     if (TypeEnum.disease.getName().equals(nodeNeoDTO.getTermtype())) { // 诊断
                         map = CoreUtil.compareNameWithNode(nodeNeoDTO, wordCrfDTO.getDiag());
                     } else if (TypeEnum.drug.getName().equals(nodeNeoDTO.getTermtype())) { // 药品
                         map = CoreUtil.compareNameWithNode(nodeNeoDTO, wordCrfDTO.getDrug());
+                    } else if (NeoEnum.group.getName().equals(nodeNeoDTO.getTermtype())) { // "禁忌人群"
+                        map = groupRule.gravidityRule(wordCrfDTO);
                     }
-                    if (map != null && (Boolean)map.get("flag") == true) {
+                    if (CoreUtil.getMapFlag(map) == true) {
                         String content = otherTipNeoDTO.getName() + otherTipNeoDTO.getDetailName();
                         if (StringUtil.isNotBlank(otherTipNeoDTO.getOtherValue())) {
                             content += otherTipNeoDTO.getOtherValue();

+ 46 - 24
src/main/java/com/diagbot/rule/GroupRule.java

@@ -5,10 +5,13 @@ import com.diagbot.dto.BillMsg;
 import com.diagbot.dto.BillNeoMaxDTO;
 import com.diagbot.dto.NodeNeoDTO;
 import com.diagbot.dto.WordCrfDTO;
+import com.diagbot.util.CoreUtil;
 import com.diagbot.util.MsgUtil;
 import org.springframework.stereotype.Component;
 
+import java.util.LinkedHashMap;
 import java.util.List;
+import java.util.Map;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
@@ -38,30 +41,8 @@ public class GroupRule {
 
             switch (node.getName()) {
                 case "妊娠":
-                    // 主诉、现病史、诊断包含“孕妇”,“妊娠”
-                    boolean flag = false;
-                    if (symptom.contains("孕妇") || chief.contains("孕妇")
-                            || symptom.contains("妊娠") || chief.contains("妊娠")) {
-                        flag = true;
-                    } else {
-                        // 主诉、现病史出现孕几周
-                        String regex = ".*孕.{1,4}周.*"; // 孕xx周
-                        if (symptom.matches(regex) || chief.matches(regex)) {
-                            flag = true;
-                        } else {
-                            List<Item> diag = wordCrfDTO.getDiag();
-                            for (Item item : diag) {
-                                // 诊断出现“孕几周”,孕字必须是第一个
-                                String regex1 = "孕.{1,4}周.*"; // 孕xx周
-                                if (item.getUniqueName().matches(regex1) || item.getUniqueName().contains("孕妇")
-                                        || item.getUniqueName().contains("妊娠")) {
-                                    flag = true;
-                                    break;
-                                }
-                            }
-                        }
-                    }
-                    if (flag) {
+                    Map map = gravidityRule(wordCrfDTO);
+                    if (CoreUtil.getMapFlag(map) == true) {
                         BillMsg commonBillMsg = MsgUtil.getCommonBillMsg(
                                 billNeoMaxDTO.getOrderName(), billNeoMaxDTO.getOrderStandName(),
                                 "妊娠", type, billNeoMaxDTO.getType());
@@ -105,4 +86,45 @@ public class GroupRule {
             }
         }
     }
+
+    /**
+     * 判断妊娠规则
+     *
+     * @param wordCrfDTO
+     * @return
+     */
+    public Map gravidityRule(WordCrfDTO wordCrfDTO) {
+        Map<String, Object> map = new LinkedHashMap<>();
+        // 妊娠目前从诊断里判断,包含“妊娠”
+        String symptom = wordCrfDTO.getSymptom(); // 现病史内容
+        String chief = wordCrfDTO.getChief(); // 主诉
+        // 主诉、现病史、诊断包含“孕妇”,“妊娠”
+        boolean flag = false;
+        if (symptom.contains("孕妇") || chief.contains("孕妇")
+                || symptom.contains("妊娠") || chief.contains("妊娠")) {
+            flag = true;
+        } else {
+            // 主诉、现病史出现孕几周
+            String regex = ".*孕.{1,4}周.*"; // 孕xx周
+            if (symptom.matches(regex) || chief.matches(regex)) {
+                flag = true;
+            } else {
+                List<Item> diag = wordCrfDTO.getDiag();
+                for (Item item : diag) {
+                    // 诊断出现“孕几周”,孕字必须是第一个
+                    String regex1 = "孕.{1,4}周.*"; // 孕xx周
+                    if (item.getUniqueName().matches(regex1) || item.getUniqueName().contains("孕妇")
+                            || item.getUniqueName().contains("妊娠")) {
+                        flag = true;
+                        break;
+                    }
+                }
+            }
+        }
+        if (flag) {
+            map.put("flag", flag);
+            map.put("msg", "妊娠");
+        }
+        return map;
+    }
 }

+ 13 - 0
src/main/java/com/diagbot/util/CoreUtil.java

@@ -782,6 +782,19 @@ public class CoreUtil {
         return false;
     }
 
+    /**
+     * 获取mapflag值
+     *
+     * @param map
+     * @return
+     */
+    public static Boolean getMapFlag(Map map) {
+        if (map != null && (Boolean) map.get("flag") == true) {
+            return true;
+        }
+        return false;
+    }
+
     public static void main(String[] args) {
         String ageStr = ".545458";
         System.out.println(Double.parseDouble(ageStr));

+ 3 - 0
src/main/java/com/diagbot/util/MsgUtil.java

@@ -1,5 +1,6 @@
 package com.diagbot.util;
 import com.diagbot.dto.BillMsg;
+import com.diagbot.enums.NeoEnum;
 import com.diagbot.enums.TypeEnum;
 
 /**
@@ -143,6 +144,8 @@ public class MsgUtil {
             msg = String.format("该患者%s,患有%s,请留意", content, name);
         } else if (TypeEnum.drug.getName().equals(type)) {
             msg = String.format("该患者%s,已开%s,请留意", content, name);
+        } else if (NeoEnum.group.getName().equals(type)) {
+            msg = String.format("该患者%s,%s,请留意", content, name);
         }
         billMsg.setMsg(msg);
         billMsg.setContent(content);