Browse Source

Merge remote-tracking branch 'origin/master'

MarkHuang 4 years ago
parent
commit
ef27e58fdc

+ 3 - 5
src/main/java/com/diagbot/dto/BillMsg.java

@@ -16,10 +16,8 @@ public class BillMsg {
     private String orderName;
     // 开单标准名称
     private String orderStandName;
-    // 匹配名称
-    private String compareName;
-    // 匹配标准名称
-    private String compareStandName;
-    // 禁忌类型
+    // 匹配的内容
+    private String content;
+    // 类型
     private String type;
 }

+ 1 - 2
src/main/java/com/diagbot/process/CriticalProcess.java

@@ -37,8 +37,7 @@ public class CriticalProcess {
                     if (critical.getStandname().equals(bean.getUniqueName())) {
                         Map<String, Object> map = CoreUtil.compareLis(nodeNeoDTO, bean);
                         if ((Boolean) map.get("flag") == true) {
-                            BillMsg criticalMsg = CoreUtil.getCommonCriticalMsg(critical.getName(), critical.getStandname(),
-                                    (String)map.get("msg"), TypeEnum.lis.getName());
+                            BillMsg criticalMsg = CoreUtil.getCommonCriticalMsg((String)map.get("msg"), TypeEnum.lis.getName());
                             criticalList.add(criticalMsg);
                         }
                     }

+ 1 - 1
src/main/java/com/diagbot/rule/AgeRule.java

@@ -33,7 +33,7 @@ public class AgeRule {
             // String message = CoreUtil.getStrMsgWithRange(ageNeoDTO, "年龄", String.valueOf(wordCrfDTO.getAge()));
             String message = "年龄" + wordCrfDTO.getAge();
             BillMsg billMsg = CoreUtil.getCommonBillMsg(billNeoMaxDTO.getOrderName(), billNeoMaxDTO.getOrderStandName(),
-                    message, message, type);
+                    message, type);
             billMsgList.add(billMsg);
         }
     }

+ 1 - 1
src/main/java/com/diagbot/rule/CommonRule.java

@@ -45,7 +45,7 @@ public class CommonRule {
                 for (Map.Entry<String, String> d : old_stand.entrySet()) {
                     BillMsg commonBillMsg = CoreUtil.getCommonBillMsg(
                             billNeoMaxDTO.getOrderName(), billNeoMaxDTO.getOrderStandName(),
-                            d.getKey(), d.getKey(), type);
+                            d.getKey(), type);
                     billMsgList.add(commonBillMsg);
                 }
             }

+ 1 - 1
src/main/java/com/diagbot/rule/DrugRule.java

@@ -59,7 +59,7 @@ public class DrugRule {
                     }
                     BillMsg commonBillMsg = CoreUtil.getCommonBillMsg(
                             billNeoMaxDTO.getOrderName(), billNeoMaxDTO.getOrderStandName(),
-                            message, message, type);
+                            message, type);
                     billMsgList.add(commonBillMsg);
                 }
             }

+ 4 - 20
src/main/java/com/diagbot/rule/LisRule.java

@@ -9,6 +9,7 @@ import com.diagbot.util.ListUtil;
 import com.diagbot.util.StringUtil;
 
 import java.util.List;
+import java.util.Map;
 
 /**
  * @description: 化验规则
@@ -31,27 +32,10 @@ public class LisRule {
                 for (Lis lis : inputLis) {
                     String val = lis.getUniqueName();
                     if (StringUtil.isNotBlank(val) && val.equals(neo.getName())) {
-                        String val_name = lis.getDetailName();
-                        // 如果有结果数据,就不用比较数值
-                        String message = "";
-                        boolean flag = false;
-                        String otherValue = lis.getOtherValue();
-                        if (StringUtil.isNotBlank(otherValue)) {
-                            flag = CoreUtil.compareStr(neo, otherValue);
-                            if (flag) {
-                                // message = CoreUtil.getStrMsg(neo, val_name, lis.getResult());
-                                message = lis.getName() + val_name + otherValue;
-                            }
-                        } else if (lis.getValue() != null) {
-                            flag = CoreUtil.compareNum(neo, lis.getValue());
-                            if (flag) {
-                                // message = CoreUtil.getNumMsg(neo, val_name, lis.getValue(), lis.getUnits());
-                                message = lis.getName() + val_name + lis.getValue();
-                            }
-                        }
-                        if (flag) {
+                        Map<String, Object> map = CoreUtil.compareLis(neo, lis);
+                        if ((Boolean) map.get("flag") == true) {
                             BillMsg commonBillMsg = CoreUtil.getCommonBillMsg(billNeoMaxDTO.getOrderName(),
-                                    billNeoMaxDTO.getOrderStandName(), message, message, type);
+                                    billNeoMaxDTO.getOrderStandName(), (String)map.get("msg"), type);
                             billMsgList.add(commonBillMsg);
                         }
                     }

+ 1 - 1
src/main/java/com/diagbot/rule/PacsRule.java

@@ -41,7 +41,7 @@ public class PacsRule {
             for (Map.Entry<String,String> d: old_stand.entrySet()) {
                 BillMsg commonBillMsg = CoreUtil.getCommonBillMsg(
                         billNeoMaxDTO.getOrderName(),billNeoMaxDTO.getOrderStandName(),
-                        "已开" + d.getKey(),"已开" + d.getKey(), type);
+                        "已开" + d.getKey(), type);
                 billMsgList.add(commonBillMsg);
             }
         }

+ 2 - 2
src/main/java/com/diagbot/rule/SexRule.java

@@ -36,11 +36,11 @@ public class SexRule {
             if (sex.equals(sexStr)) {
                 if ("男性".equals(sexStr)) {
                     BillMsg billMsg = CoreUtil.getCommonBillMsg(billNeoMaxDTO.getOrderName(), billNeoMaxDTO.getOrderStandName(),
-                            "男性", "男性", type);
+                            "男性", type);
                     billMsgList.add(billMsg);
                 } else if ("女性".equals(sexStr)) {
                     BillMsg billMsg = CoreUtil.getCommonBillMsg(billNeoMaxDTO.getOrderName(), billNeoMaxDTO.getOrderStandName(),
-                            "女性", "女性", type);
+                            "女性", type);
                     billMsgList.add(billMsg);
                 }
             }

+ 1 - 1
src/main/java/com/diagbot/rule/VitalRule.java

@@ -50,7 +50,7 @@ public class VitalRule {
                         }
                         if (flag) {
                             BillMsg commonBillMsg = CoreUtil.getCommonBillMsg(billNeoMaxDTO.getOrderName(),
-                                    billNeoMaxDTO.getOrderStandName(), message, message, type);
+                                    billNeoMaxDTO.getOrderStandName(), message, type);
                             billMsgList.add(commonBillMsg);
                         }
                     }

+ 10 - 65
src/main/java/com/diagbot/util/CoreUtil.java

@@ -217,19 +217,16 @@ public class CoreUtil {
     /**
      * 危急值通用提示信息
      *
-     * @param compareName 匹配名称
-     * @param compareStandName 匹配标准名称
+     * @param content 匹配内容
      * @param type 类型
      * @return
      */
-    public static BillMsg getCommonCriticalMsg(String compareName,
-                                           String compareStandName, String message, String type) {
+    public static BillMsg getCommonCriticalMsg(String content, String type) {
         BillMsg billMsg = new BillMsg();
-        String msg = String.format("该患者%s,请留意", message);
+        String msg = String.format("该患者%s,请留意", content);
         billMsg.setMsg(msg);
-        billMsg.setCompareName(compareName);
-        billMsg.setCompareStandName(compareStandName);
         billMsg.setType(type);
+        billMsg.setContent(content);
         return billMsg;
     }
 
@@ -238,37 +235,21 @@ public class CoreUtil {
      *
      * @param orderName 原开单项
      * @param orderStandName 标准开单项
-     * @param compareName 匹配名称
-     * @param compareStandName 匹配标准名称
+     * @param content 匹配内容
      * @param type 类型
      * @return
      */
-    public static BillMsg getCommonBillMsg(String orderName, String orderStandName, String compareName,
-                                           String compareStandName, String type) {
+    public static BillMsg getCommonBillMsg(String orderName, String orderStandName, String content, String type) {
         BillMsg billMsg = new BillMsg();
-        String msg = String.format("该患者" + compareName + ",不宜开%s", orderName);
+        String msg = String.format("该患者%s,不宜开%s", content, orderName);
         billMsg.setMsg(msg);
-        billMsg.setCompareName(compareName);
-        billMsg.setCompareStandName(compareStandName);
         billMsg.setOrderName(orderName);
         billMsg.setOrderStandName(orderStandName);
+        billMsg.setContent(content);
         billMsg.setType(type);
         return billMsg;
     }
 
-    /**
-     * 开单合理性固定提示信息
-     *
-     * @param msg
-     * @param msg
-     * @return
-     */
-    public static BillMsg getBillMsgWithConst(String msg) {
-        BillMsg billMsg = new BillMsg();
-        billMsg.setMsg(msg);
-        return billMsg;
-    }
-
     /**
      * 将对象添加到列表中
      *
@@ -306,51 +287,15 @@ public class CoreUtil {
             }
         } else if (lis.getValue() != null) {
             double value = lis.getValue();
-            BigDecimal min = nodeNeoDTO.getMin();
-            BigDecimal max = nodeNeoDTO.getMax();
-
-            if (min != null && max != null) {
-                int minAge = min.intValue();
-                int maxAge = max.intValue();
-                if (minAge <= value && value <= maxAge) {
-                    flag = true;
-                }
-            } else if (min != null && max == null) {
-                int minAge = min.intValue();
-                if (minAge <= value) {
-                    flag = true;
-                }
-            } else if (min == null && max != null) {
-                int maxAge = max.intValue();
-                if (value <= maxAge) {
-                    flag = true;
-                }
-            }
+            flag = compareNum(nodeNeoDTO, value);
             if (flag) {
-                map.put("msg", lis.getName() + lis.getDetailName() + lis.getValue());
+                map.put("msg", lis.getName() + lis.getDetailName() + subZeroAndDot(String.valueOf(lis.getValue())));
             }
         }
         map.put("flag", flag);
         return map;
     }
 
-    /**
-     * 比较字符串是否相等
-     *
-     * @param nodeNeoDTO
-     * @param value
-     * @return
-     */
-    public static boolean compareStr(NodeNeoDTO nodeNeoDTO, String value) {
-        boolean flag = false;
-        if (StringUtil.isNotBlank(value)) {
-            if (value.equals(nodeNeoDTO.getVal())) {
-                flag = true;
-            }
-        }
-        return flag;
-    }
-
     /**
      * 比较数值大小(int)
      *