zhoutg 4 роки тому
батько
коміт
0a38d4b928

+ 6 - 0
src/main/java/com/diagbot/process/BillProcess.java

@@ -52,6 +52,12 @@ public class BillProcess {
             NodeNeoDTO sexNeo = new NodeNeoDTO();
             sexNeo.setName("男");
             billNeoMaxDTO.setGender(sexNeo);
+            if (billNeoDTO.getName().equals("普通胃镜检查")) {
+                NodeNeoDTO nodeNeoDTO = new NodeNeoDTO();
+                nodeNeoDTO.setName("红细胞压积");
+                nodeNeoDTO.setVal("阳性");
+                billNeoDTO.getPacsBillNeoDTO().getLis().add(nodeNeoDTO);
+            }
             // 测试数据结束
 
             System.out.println(billNeoMaxDTO);

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

@@ -25,7 +25,7 @@ public class AgeRule {
         Boolean flag = false;
         if (ageNeoDTO != null && wordCrfDTO.getAge() != null) {
             Integer age = wordCrfDTO.getAge();
-            flag = CoreUtil.compareValue(ageNeoDTO, age);
+            flag = CoreUtil.compareNum(ageNeoDTO, age);
         }
         if (flag) {
             return CoreUtil.getCommonBillMsg(billNeoMaxDTO.getOrderName(), billNeoMaxDTO.getOrderStandName(),

+ 11 - 3
src/main/java/com/diagbot/rule/LisRule.java

@@ -35,9 +35,17 @@ public class LisRule {
                     String val = lis.getUniqueName();
                     if (StringUtil.isNotBlank(val) && neo.getName().equals(val)) {
                         String val_name = lis.getDetailName();
-                        boolean flag = CoreUtil.compareValue(neo, lis.getValue());
-                        if (flag) {
-                            msgList.add(CoreUtil.getValueMsg(neo, val_name, lis.getValue(), lis.getUnits()));
+                        // 如果有结果数据,就不用比较数值
+                        if (StringUtil.isNotBlank(lis.getResult())) {
+                            boolean flag = CoreUtil.compareStr(neo, lis.getResult());
+                            if (flag) {
+                                msgList.add(CoreUtil.getStrMsg(neo, val_name, lis.getResult()));
+                            }
+                        } else if (lis.getValue() != null) {
+                            boolean flag = CoreUtil.compareNum(neo, lis.getValue());
+                            if (flag) {
+                                msgList.add(CoreUtil.getNumMsg(neo, val_name, lis.getValue(), lis.getUnits()));
+                            }
                         }
                     }
                 }

+ 37 - 4
src/main/java/com/diagbot/util/CoreUtil.java

@@ -236,6 +236,23 @@ public class CoreUtil {
         }
     }
 
+    /**
+     * 比较字符串是否相等
+     *
+     * @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)
      *
@@ -243,7 +260,7 @@ public class CoreUtil {
      * @param value
      * @return
      */
-    public static boolean compareValue(NodeNeoDTO nodeNeoDTO, int value) {
+    public static boolean compareNum(NodeNeoDTO nodeNeoDTO, int value) {
         boolean flag = false;
         BigDecimal min = nodeNeoDTO.getMin();
         BigDecimal max = nodeNeoDTO.getMax();
@@ -275,7 +292,7 @@ public class CoreUtil {
      * @param value
      * @return
      */
-    public static boolean compareValue(NodeNeoDTO nodeNeoDTO, double value) {
+    public static boolean compareNum(NodeNeoDTO nodeNeoDTO, double value) {
         boolean flag = false;
         BigDecimal min = nodeNeoDTO.getMin();
         BigDecimal max = nodeNeoDTO.getMax();
@@ -301,13 +318,13 @@ public class CoreUtil {
     }
 
     /**
-     * 获取提示信息(int
+     * 获取提示信息(double
      *
      * @param nodeNeoDTO
      * @param value
      * @return
      */
-    public static String getValueMsg(NodeNeoDTO nodeNeoDTO, String name, double value, String unit) {
+    public static String getNumMsg(NodeNeoDTO nodeNeoDTO, String name, double value, String unit) {
         if (nodeNeoDTO == null) {
             return "";
         }
@@ -340,6 +357,22 @@ public class CoreUtil {
         return s;
     }
 
+    /**
+     * 获取提示信息(String)
+     *
+     * @param nodeNeoDTO
+     * @param value
+     * @return
+     */
+    public static String getStrMsg(NodeNeoDTO nodeNeoDTO, String name, String value) {
+        if (nodeNeoDTO == null) {
+            return "";
+        }
+        StringBuffer sb = new StringBuffer();
+        sb.append(name).append(value);
+        return sb.toString();
+    }
+
     /**
      * list 转 string
      * @param list