Sfoglia il codice sorgente

其他值提醒添加标签[化验套餐和明细]

zhoutg 3 anni fa
parent
commit
9a2c64f403
1 ha cambiato i file con 21 aggiunte e 34 eliminazioni
  1. 21 34
      src/main/java/com/diagbot/util/CoreUtil.java

+ 21 - 34
src/main/java/com/diagbot/util/CoreUtil.java

@@ -323,53 +323,43 @@ public class CoreUtil {
      */
     public static MatchDTO compareLis(RuleBaseDTO ruleBaseDTO, Lis lis) {
         boolean flag = false; // 规则是否匹配
-        boolean nameEqualDetailFlag = false; // 化验套餐名和明细名称是否一样
         if (ruleBaseDTO == null || lis == null) {
             return null;
         }
-        String content = "";
+        String unionName = ""; // 化验拼接名称,套餐+细项,细项
+        String content = ""; // 最终提示语
         String uniqueName = lis.getUniqueName();
         // 标准名称相同
         if (StringUtil.isNotBlank(uniqueName) && uniqueName.equals(ruleBaseDTO.getBaseLibName())) {
+            // 套餐和明细名称一样,优化提示语只取细项
+            if (StringUtil.isNotBlank(lis.getName()) && lis.getName().equals(lis.getDetailName())) {
+                unionName = lis.getDetailName(); // 取细项
+            } else {
+                unionName = lis.getName() + lis.getDetailName(); // 套餐+细项
+            }
             if (StringUtil.isNotBlank(lis.getOtherValue())) {
+                // 文本比较
                 if (lis.getOtherValue().equals(ruleBaseDTO.getBaseEqValue())) {
-                    // 套餐和明细名称一样,提示语只取其中一个
-                    if (StringUtil.isNotBlank(lis.getName()) && lis.getName().equals(lis.getDetailName())) {
-                        nameEqualDetailFlag = true;
-                        // 有医院原值就提示医院值
-                        if (StringUtil.isNotBlank(lis.getResult())) {
-                            content = lis.getDetailName() + "结果" + lis.getResult();
-                        } else {
-                            content = lis.getDetailName() + "结果" + lis.getOtherValue();
-                        }
+                    // 有医院原值就提示医院值
+                    if (StringUtil.isNotBlank(lis.getResult())) {
+                        content = unionName + "结果" + lis.getResult();
                     } else {
-                        // 有医院原值就提示医院值
-                        if (StringUtil.isNotBlank(lis.getResult())) {
-                            content = lis.getName() + lis.getDetailName() + "结果" + lis.getResult();
-                        } else {
-                            content = lis.getName() + lis.getDetailName() + "结果" + lis.getOtherValue();
-                        }
+                        content = unionName + "结果" + lis.getOtherValue();
                     }
                     flag = true;
                 }
             } else if (lis.getValue() != null) {
+                // 数值比较
                 double value = lis.getValue();
                 flag = compareNum(ruleBaseDTO, value);
                 if (flag) {
-                    // 获取化验单位拼接
+                    // 获取化验单位拼接,默认会返回空字符串
                     String unitsJoint = getJointUnits(lis);
-                    if (StringUtil.isNotBlank(lis.getName()) && lis.getName().equals(lis.getDetailName())) {
-                        if (StringUtil.isNotBlank(lis.getResult())) {
-                            content = lis.getDetailName() + "结果" + lis.getResult() + unitsJoint;
-                        } else {
-                            content = lis.getDetailName() + "结果" + subZeroAndDot(String.valueOf(lis.getValue())) + unitsJoint;
-                        }
+                    // 有医院原值就提示医院值,例如: 医院result字段: >10,技术服务部会将value设置成10.1,但提示语还是>10
+                    if (StringUtil.isNotBlank(lis.getResult())) {
+                        content = unionName + "结果" + lis.getResult() + unitsJoint;
                     } else {
-                        if (StringUtil.isNotBlank(lis.getResult())) {
-                            content = lis.getName() + lis.getDetailName() + "结果" + lis.getResult() + unitsJoint;
-                        } else {
-                            content = lis.getName() + lis.getDetailName() + "结果" + subZeroAndDot(String.valueOf(lis.getValue())) + unitsJoint;
-                        }
+                        content = unionName + "结果" + subZeroAndDot(String.valueOf(lis.getValue())) + unitsJoint;
                     }
                 }
             }
@@ -378,11 +368,7 @@ public class CoreUtil {
         if (flag) {
             MatchDTO matchDTO = new MatchDTO();
             matchDTO.setContent(content);
-            if (nameEqualDetailFlag) {
-                matchDTO.setLisNameDetail(lis.getDetailName()); // 取明细
-            } else {
-                matchDTO.setLisNameDetail(lis.getName() + lis.getDetailName()); // 拼接套餐和明细
-            }
+            matchDTO.setLisNameDetail(unionName);
             return matchDTO;
         }
         return null;
@@ -399,6 +385,7 @@ public class CoreUtil {
         if (lis == null || StringUtil.isBlank(lis.getUnits())) {
             return unitsJoint;
         }
+        // 单位以数字开头,拼接“×”
         boolean flag = RegexUtil.getRegexRes(lis.getUnits(), "^\\d");
         if (flag) {
             unitsJoint = "×" + lis.getUnits();