Browse Source

化验开单项阳性、阴性特殊处理

zhoutg 4 years ago
parent
commit
87628e98a4

+ 2 - 0
src/main/java/com/diagbot/facade/IndicationFacade.java

@@ -8,6 +8,7 @@ import com.diagbot.exception.CommonException;
 import com.diagbot.rule.CommonRule;
 import com.diagbot.util.CoreUtil;
 import com.diagbot.util.ListUtil;
+import com.diagbot.util.ParamUtil;
 import com.diagbot.vo.IndicationPushVO;
 import com.diagbot.vo.StandConvert;
 import io.github.lvyahui8.spring.facade.DataFacade;
@@ -102,6 +103,7 @@ public class IndicationFacade {
         // 合并【数据来源】
         wordCrfDTO.setDiagSource(commonRule.getDiseaseSource(wordCrfDTO));
         wordCrfDTO.setDrugSource(commonRule.getDrugSource(wordCrfDTO));
+        ParamUtil.dealLisIndication(wordCrfDTO.getLis());
 
         try {
             Map<String, Object> invokeParams = new HashMap<>();

+ 26 - 5
src/main/java/com/diagbot/util/CoreUtil.java

@@ -239,7 +239,7 @@ public class CoreUtil {
             //将 object 中 field 所代表的值 设置为 value
             String key = (String)field.get(object);
             String key1 = (String)field1.get(object);
-//            String lis_c = key+key1;
+            //            String lis_c = key+key1;
             String lis_c = key1;
             if (value != null && value.get(lis_c) != null) {
                 Field standField = getDeclaredField(object, unique) ;
@@ -313,9 +313,19 @@ public class CoreUtil {
                 // 套餐和明细一样,提示语只取其中一个
                 if (lis.getName() == null || lis.getDetailName() == null
                         || !lis.getName().equals(lis.getDetailName())) {
-                    map.put("msg", lis.getName() + lis.getDetailName() + lis.getOtherValue());
+                    // 有医院原值就提示医院值
+                    if (StringUtil.isNotBlank(lis.getResult())) {
+                        map.put("msg", lis.getName() + lis.getDetailName() + lis.getResult());
+                    } else {
+                        map.put("msg", lis.getName() + lis.getDetailName() + lis.getOtherValue());
+                    }
                 } else {
-                    map.put("msg", lis.getDetailName() + lis.getOtherValue());
+                    // 有医院原值就提示医院值
+                    if (StringUtil.isNotBlank(lis.getResult())) {
+                        map.put("msg", lis.getDetailName() + lis.getResult());
+                    } else {
+                        map.put("msg", lis.getDetailName() + lis.getOtherValue());
+                    }
                 }
                 flag = true;
             }
@@ -325,9 +335,17 @@ public class CoreUtil {
             if (flag) {
                 if (lis.getName() == null || lis.getDetailName() == null
                         || !lis.getName().equals(lis.getDetailName())) {
-                    map.put("msg", lis.getName() + lis.getDetailName() + subZeroAndDot(String.valueOf(lis.getValue())));
+                    if (StringUtil.isNotBlank(lis.getResult())) {
+                        map.put("msg", lis.getName() + lis.getDetailName() + lis.getResult());
+                    } else {
+                        map.put("msg", lis.getName() + lis.getDetailName() + subZeroAndDot(String.valueOf(lis.getValue())));
+                    }
                 } else {
-                    map.put("msg", lis.getDetailName() + subZeroAndDot(String.valueOf(lis.getValue())));
+                    if (StringUtil.isNotBlank(lis.getResult())) {
+                        map.put("msg", lis.getDetailName() + lis.getResult());
+                    } else {
+                        map.put("msg", lis.getDetailName() + subZeroAndDot(String.valueOf(lis.getValue())));
+                    }
                 }
             }
         }
@@ -641,6 +659,9 @@ public class CoreUtil {
         if (lis == null) {
             return "";
         }
+        if (StringUtil.isNotBlank(lis.getResult())) {
+            return lis.getResult();
+        }
         return StringUtil.isNotBlank(lis.getOtherValue()) ? lis.getOtherValue() : subZeroAndDot(lis.getValue().toString());
     }
 

+ 59 - 14
src/main/java/com/diagbot/util/ParamUtil.java

@@ -36,12 +36,18 @@ public class ParamUtil {
                     case "++":
                     case "+++":
                     case "++++":
+                    case "阳":
+                    case "阳(+)":
+                    case "阳(+)":
                         lis.setResult("阳性");
                         break;
                     case "-":
                     case "--":
                     case "---":
                     case "----":
+                    case "阴":
+                    case "阴(-)":
+                    case "阴(-)":
                         lis.setResult("阴性");
                         break;
                     default: // 其他类型
@@ -62,28 +68,67 @@ public class ParamUtil {
         }
     }
 
+    /**
+     * 化验结果设置
+     *
+     * @param list
+     */
+    public static void dealLisIndication(List<Lis> list) {
+        if (ListUtil.isEmpty(list)) {
+            return ;
+        }
+        for (Lis lis : list) {
+            String otherValue = lis.getOtherValue();
+            if (StringUtil.isNotBlank(otherValue)) {
+                switch (otherValue) {
+                    case "+":
+                    case "++":
+                    case "+++":
+                    case "++++":
+                    case "阳":
+                    case "阳(+)":
+                    case "阳(+)":
+                        lis.setResult(otherValue);
+                        lis.setOtherValue("阳性");
+                        break;
+                    case "-":
+                    case "--":
+                    case "---":
+                    case "----":
+                    case "阴":
+                    case "阴(-)":
+                    case "阴(-)":
+                        lis.setResult(otherValue);
+                        lis.setOtherValue("阴性");
+                        break;
+                    default: // 其他类型
+                        break;
+                }
+            }
+        }
+    }
+
     public static void main(String[] args) {
         List<Lis> lisList = new ArrayList<>();
         Lis lis1 = new Lis();
-        lis1.setOtherValue("阳性");
+        lis1.setOtherValue("阳");
         lisList.add(lis1);
 
         Lis lis2 = new Lis();
-        lis2.setOtherValue("++");
+        lis2.setOtherValue("阳(+)");
         lisList.add(lis2);
-        dealLis(lisList);
-
-        Lis lis3 = new Lis();
-        lis3.setMaxValue(10.0D);
-        lis3.setMinValue(3.0D);
-        lis3.setValue(1D);
-        lisList.add(lis3);
-        dealLis(lisList);
+        dealLisIndication(lisList);
 
-        Lis lis4 = new Lis();
-        lis4.setOtherValue("-");
-        lisList.add(lis4);
-        dealLis(lisList);
+        // Lis lis3 = new Lis();
+        // lis3.setMaxValue(10.0D);
+        // lis3.setMinValue(3.0D);
+        // lis3.setValue(1D);
+        // lisList.add(lis3);
+        // dealLis(lisList);
+        //
+        // Lis lis4 = new Lis();
+        // lis4.setOtherValue("-");
+        // lisList.add(lis4);
         System.out.println(lisList);
     }