瀏覽代碼

高危药品和手术规则处理

zhoutg 4 年之前
父節點
當前提交
889922fbea

+ 19 - 0
src/main/java/com/diagbot/dto/BillMsg.java

@@ -2,6 +2,8 @@ package com.diagbot.dto;
 
 import lombok.Data;
 
+import java.util.Objects;
+
 /**
  * @description: 开单合理性提示语
  * @author: zhoutg
@@ -22,4 +24,21 @@ public class BillMsg {
     private String content;
     // 类型
     private String type;
+
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) {
+            return true;
+        }
+        if (o == null || getClass() != o.getClass()) {
+            return false;
+        }
+        BillMsg billMsg = (BillMsg) o;
+        return Objects.equals(msg, billMsg.msg);
+    }
+
+    @Override
+    public int hashCode() {
+        return Objects.hash(msg);
+    }
 }

+ 2 - 1
src/main/java/com/diagbot/dto/LisOtherDTO.java

@@ -12,7 +12,8 @@ import java.util.List;
  */
 @Data
 public class LisOtherDTO {
-    private String name; // 提示名称
+    private String name; // 化验拼接提示语
+    private String msg; // 输血名称
     private List<String> drugMsg = new ArrayList<>(); // 药品拼接提示语
     private List<String> diseaseMsg = new ArrayList<>(); // 诊断拼接提示语
     private List<String> groupMsg = new ArrayList<>(); // 人群拼接提示语

+ 13 - 1
src/main/java/com/diagbot/enums/ConEnum.java

@@ -27,7 +27,10 @@ public enum ConEnum implements KeyedNamed {
     pacsDesc(14, "禁忌辅助检查描述"),
     medEqu(15, "禁忌医疗器械及物品"),
     exclusion(16, "开单项互斥"),
-    otherAllergy(17, "禁忌其他过敏原");
+    otherAllergy(17, "禁忌其他过敏原"),
+    repeat24(18, "24小时重复开立"),
+    repeat(19, "正常项目重复开立"),
+    ;
 
     @Setter
     private int key;
@@ -54,6 +57,15 @@ public enum ConEnum implements KeyedNamed {
         return item != null ? item.name : null;
     }
 
+    public static ConEnum getEnum(String value) {
+        for (ConEnum item : ConEnum.values()) {
+            if (item.getName().equals(value)) {
+                return item;
+            }
+        }
+        return null;
+    }
+
     @Override
     public int getKey() {
         return key;

+ 0 - 67
src/main/java/com/diagbot/enums/NeoEnum.java

@@ -1,67 +0,0 @@
-package com.diagbot.enums;
-
-import com.diagbot.core.KeyedNamed;
-import lombok.Setter;
-
-/**
- * @author zhoutg
- * @Description: 图谱禁忌类型
- * @date 2018年10月11日 下午3:33:22
- */
-
-public enum NeoEnum implements KeyedNamed {
-
-    gender(1, "禁忌性别"),
-    ageNeoDTO(2, "禁忌年龄"),
-    clinicfindings(3, "禁忌临床表现"),
-    oralmeds(4, "禁忌服用药品"),
-    allergicmeds(5, "禁忌过敏药品"),
-    operations(6, "禁忌手术"),
-    procedures(7, "禁忌操作"),
-    lis(8, "禁忌实验室检查"),
-    pacs(9, "禁忌辅助检查"),
-    disease(10, "禁忌疾病"),
-    group(11, "禁忌人群"),
-    conflictmeds(12, "配伍禁忌"),
-    vitals(13, "禁忌查体"),
-    pacsDesc(14, "禁忌辅助检查描述"),
-    medEqu(15, "禁忌医疗器械及物品"),
-    exclusion(16, "开单项互斥");
-
-    @Setter
-    private int key;
-
-    @Setter
-    private String name;
-
-    NeoEnum(int key, String name) {
-        this.key = key;
-        this.name = name;
-    }
-
-    public static NeoEnum getEnum(int key) {
-        for (NeoEnum item : NeoEnum.values()) {
-            if (item.key == key) {
-                return item;
-            }
-        }
-        return null;
-    }
-
-    public static String getName(int key) {
-        NeoEnum item = getEnum(key);
-        return item != null ? item.name : null;
-    }
-
-    @Override
-    public int getKey() {
-        return key;
-    }
-
-    @Override
-    public String getName() {
-        return name;
-    }
-
-
-}

+ 2 - 1
src/main/java/com/diagbot/enums/TypeEnum.java

@@ -19,7 +19,8 @@ public enum TypeEnum implements KeyedNamed {
     operation(6, "手术"),
     vital(7, "查体"),
     transfusion(8, "输血"),
-    age(9,"年龄");
+    age(9,"年龄"),
+    group(10, "人群");
 
     @Setter
     private int key;

+ 4 - 2
src/main/java/com/diagbot/facade/HighRiskFacade.java

@@ -32,9 +32,11 @@ public class HighRiskFacade {
      * @return
      */
     public void highRiskFac(IndicationPushVO indicationPushVO, WordCrfDTO wordCrfDTO, IndicationDTO res) {
-        // 高危药品 TODO
+        // 高危药品
+        highRiskProcess.processDrug(wordCrfDTO, res);
 
-        // 高危手术 TODO
+        // 高危手术
+        highRiskProcess.processOperation(wordCrfDTO, res);
         // // 高风险图谱接口调用
         // // HighRiskNeoVO highRiskNeoVO = fillHighRiskNeo(wordCrfDTO);
         // List<HighRiskNeoDTO> highRiskNeoDTOList = neoFacade.getHighRiskNeo(wordCrfDTO);

+ 1 - 1
src/main/java/com/diagbot/facade/IndicationFacade.java

@@ -97,7 +97,7 @@ public class IndicationFacade {
         }
         CoreUtil.getDebugStr(standStart, "标准词转换耗时", debug);
         //正则匹配开始
-        wordCrfDTO = klRegularConfigFacade.getRegularConfigs(wordCrfDTO,indicationPushVO);
+        wordCrfDTO = klRegularConfigFacade.getRegularConfigs(wordCrfDTO, indicationPushVO);
         //正则匹配结束
         // 合并【数据来源】
         wordCrfDTO.setDiagSource(commonRule.getDiseaseSource(wordCrfDTO));

+ 6 - 8
src/main/java/com/diagbot/facade/OtherTipFacade.java

@@ -28,16 +28,14 @@ public class OtherTipFacade {
      * @return
      */
     public void otherTipFac(WordCrfDTO wordCrfDTO, IndicationDTO res) {
-        // 其他值提醒——化验 TODO
+        // 其他值提醒——化验
+        otherTipProcess.processLis(wordCrfDTO, res);
 
-        // 其他值提醒——辅检 TODO
+        // 其他值提醒——辅检
+        otherTipProcess.processPacs(wordCrfDTO, res);
 
-        // 其他值提醒——输血 TODO
-
-        // // 其他提示——建议输血
-        // List<OtherTipTransfusionNeoDTO> otherTipTransfusionNeoDTOList = neoFacade.getRecommendTransfs(wordCrfDTO);
-        // // TODO 测试数据结束
-        // otherTipProcess.processTransfusion(otherTipTransfusionNeoDTOList, res);
+        // 其他值提醒——输血
+        otherTipProcess.processTransfusion(wordCrfDTO, res);
 
         // 结果去重处理
         commonFacade.dealMsg(res.getOtherList());

+ 4 - 1
src/main/java/com/diagbot/facade/TestFacade.java

@@ -597,6 +597,7 @@ public class TestFacade {
         long start = System.currentTimeMillis();
         List<IndicationPushVO> indicationPushVOList = new ArrayList<>();
         List<TestIndicationVO> data = ExcelUtils.importExcelMultiSheets(file, 0, 1, testLineVO.getSheetIndex(), TestIndicationVO.class);
+        List<String> drugForm = Arrays.asList("注射剂", "片剂", "缓释剂", "胶囊剂", "滴丸剂");
         for (TestIndicationVO bean : data) {
             if (StringUtil.isNotEmpty(testLineVO.getIdNum()) && !testLineVO.getIdNum().equals(bean.getIdNum())) {
                 continue;
@@ -604,6 +605,9 @@ public class TestFacade {
             if (StringUtil.isEmpty(bean.getDrugLevel())) {
                 continue;
             }
+            if (!drugForm.contains(bean.getDrugForm())) {
+                continue;
+            }
             IndicationPushVO indicationPushVO = new IndicationPushVO();
             indicationPushVO.setRuleType("3");
             indicationPushVO.setIdNum(bean.getIdNum());
@@ -882,7 +886,6 @@ public class TestFacade {
                                 indicationPushVOList.add(indphysiquePushVO);
                             }
                         } else {
-                            //TODO 血氧饱和度 待删除
                             if ("血氧饱和度".equals(vitalArr[0].trim())) {
                                 sbVital.append(vitalArr[0]);
                                 sbVital.append(getValue(vitalArr));

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

@@ -152,7 +152,7 @@ public class BillProcess {
                                     case pacs: // 辅检项目
                                         if (ruleBaseDTO.getBaseType() != null && ruleBaseDTO.getBaseType().equals(BaseTypeEnum.B5.getKey())) {
                                             // 开单项互斥
-                                            commonRule.exclusionBill(wordCrfDTO, ruleBaseDTO, billMsgList, ruleSimpleDTO, set);
+                                            commonRule.exclusionBill(wordCrfDTO, ruleBaseDTO, billMsgList, ConEnum.exclusion.getName(), ruleSimpleDTO, set);
                                         } else {
                                             // 辅检项目,暂无数据
                                             pacsRule.bill(wordCrfDTO.getPacs(), ruleBaseDTO, billMsgList, ConEnum.pacs.getName(), ruleSimpleDTO);
@@ -198,7 +198,7 @@ public class BillProcess {
                     case repeat:  // redis 数据以 _6结尾
                         for (RuleBaseDTO ruleBaseDTO : ruleBaseDTOList) {
                             // 无需重复开单项
-                            commonRule.needlessRepeatOrder(wordCrfDTO, ruleBaseDTO, billMsgList, ruleSimpleDTO);
+                            commonRule.needlessRepeatOrder(wordCrfDTO, ruleBaseDTO, billMsgList, ConEnum.repeat.getName(), ruleSimpleDTO);
                         }
                         break;
                     default:

+ 30 - 24
src/main/java/com/diagbot/process/HighRiskProcess.java

@@ -20,6 +20,7 @@ import com.diagbot.rule.CommonRule;
 import com.diagbot.rule.LisRule;
 import com.diagbot.rule.VitalRule;
 import com.diagbot.util.BeanUtil;
+import com.diagbot.util.MsgUtil;
 import com.diagbot.util.StringUtil;
 import com.diagbot.vo.Drug;
 import com.diagbot.vo.RuleVO;
@@ -84,7 +85,7 @@ public class HighRiskProcess {
     }
 
     /**
-     * 处理业务——高危药品
+     * 处理业务——高危手术
      *
      * @param wordCrfDTO
      * @param res
@@ -106,29 +107,34 @@ public class HighRiskProcess {
                 // 3、规则匹配
                 List<RuleConditionDTO> ruleConditionDTOList = ruleExtDTO.getRuleConditionDTOList();
                 for (RuleConditionDTO ruleConditionDTO : ruleConditionDTOList) {
-                    List<RuleBaseDTO> ruleBaseDTOList = ruleConditionDTO.getRuleBaseDTOList();
-                    for (RuleBaseDTO ruleBaseDTO : ruleBaseDTOList ) {
-                        if (LibTypeEnum.getEnum(ruleBaseDTO.getBaseLibType()) != null) { // 避免空指针
-                            switch (LibTypeEnum.getEnum(ruleBaseDTO.getBaseLibType())) {
-                                case age: // 年龄
-                                    ageRule.highOperation(wordCrfDTO, ruleBaseDTO, highRiskList, ruleSimpleDTO);
-                                    break;
-                                case disease: // 诊断
-                                    commonRule.compareItemWithHighRisk(wordCrfDTO.getDiag(), ruleBaseDTO, highRiskList, ruleSimpleDTO);
-                                    break;
-                                case lisDetail: // 化验
-                                    lisRule.highOperation(wordCrfDTO.getLis(), ruleBaseDTO, highRiskList, ruleSimpleDTO);
-                                    break;
-                                case vitalRes: //体格检查结果
-                                case vital: // 体格检查项目
-                                    vitalRule.highOperation(wordCrfDTO.getVitalLabel(), ruleBaseDTO, highRiskList, ruleSimpleDTO);
-                                    break;
-                                case pacsResult: // 禁用辅助检查描述
-                                    // 【辅检结果数据来源】
-                                    PacsLabel pacsLabel = wordCrfDTO.getPacsLabel();
-                                    List<Item> pacsDescList = pacsLabel.getRes();
-                                    commonRule.compareItemWithHighRisk(pacsDescList, ruleBaseDTO, highRiskList, ruleSimpleDTO);
-                                    break;
+                    if (ruleConditionDTO.getHasSubCond().equals(0)) { // 3,4级高危手术,本身高危
+                        BillMsg highRisk = MsgUtil.getCommonHighRiskMsg("", ruleExtDTO.getInputName(), TypeEnum.operation.getName());
+                        highRiskList.add(highRisk);
+                    } else { // 2级高危手术
+                        List<RuleBaseDTO> ruleBaseDTOList = ruleConditionDTO.getRuleBaseDTOList();
+                        for (RuleBaseDTO ruleBaseDTO : ruleBaseDTOList) {
+                            if (LibTypeEnum.getEnum(ruleBaseDTO.getBaseLibType()) != null) { // 避免空指针
+                                switch (LibTypeEnum.getEnum(ruleBaseDTO.getBaseLibType())) {
+                                    case age: // 年龄
+                                        ageRule.highOperation(wordCrfDTO, ruleBaseDTO, highRiskList, ruleSimpleDTO);
+                                        break;
+                                    case disease: // 诊断
+                                        commonRule.compareItemWithHighRisk(wordCrfDTO.getDiag(), ruleBaseDTO, highRiskList, ruleSimpleDTO);
+                                        break;
+                                    case lisDetail: // 化验
+                                        lisRule.highOperation(wordCrfDTO.getLis(), ruleBaseDTO, highRiskList, ruleSimpleDTO);
+                                        break;
+                                    case vitalRes: //体格检查结果
+                                    case vital: // 体格检查项目
+                                        vitalRule.highOperation(wordCrfDTO.getVitalLabel(), ruleBaseDTO, highRiskList, ruleSimpleDTO);
+                                        break;
+                                    case pacsResult: // 禁用辅助检查描述
+                                        // 【辅检结果数据来源】
+                                        PacsLabel pacsLabel = wordCrfDTO.getPacsLabel();
+                                        List<Item> pacsDescList = pacsLabel.getRes();
+                                        commonRule.compareItemWithHighRisk(pacsDescList, ruleBaseDTO, highRiskList, ruleSimpleDTO);
+                                        break;
+                                }
                             }
                         }
                     }

+ 0 - 66
src/main/java/com/diagbot/process/OtherTipProcess.java

@@ -4,7 +4,6 @@ import com.diagbot.biz.push.entity.Item;
 import com.diagbot.biz.push.entity.Lis;
 import com.diagbot.dto.BillMsg;
 import com.diagbot.dto.IndicationDTO;
-import com.diagbot.dto.OtherTipTransfusionNeoDTO;
 import com.diagbot.dto.RuleBaseDTO;
 import com.diagbot.dto.RuleConditionDTO;
 import com.diagbot.dto.RuleExtDTO;
@@ -18,17 +17,12 @@ import com.diagbot.rule.CommonRule;
 import com.diagbot.rule.GroupRule;
 import com.diagbot.rule.LisRule;
 import com.diagbot.rule.PacsRule;
-import com.diagbot.util.CoreUtil;
-import com.diagbot.util.ListUtil;
-import com.diagbot.util.MsgUtil;
 import com.diagbot.util.StringUtil;
 import com.diagbot.vo.RuleVO;
-import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
 import java.util.List;
-import java.util.stream.Collectors;
 
 /**
  * @Description: 其他提示总入口
@@ -170,64 +164,4 @@ public class OtherTipProcess {
         }
         return null;
     }
-
-    /**
-     * 处理业务——输血
-     *
-     * @param otherTipTransfusionNeoDTOList
-     * @param res
-     */
-    public void processTransfusion(List<OtherTipTransfusionNeoDTO> otherTipTransfusionNeoDTOList, IndicationDTO res) {
-        for (OtherTipTransfusionNeoDTO bean : otherTipTransfusionNeoDTOList) {
-            if (StringUtil.isBlank(bean.getName())) {
-                continue;
-            }
-            StringBuffer sb = new StringBuffer();
-            // 诊断
-            if (ListUtil.isNotEmpty(bean.getDiag())) {
-                sb.append("诊断");
-                List<String> diag = bean.getDiag().stream().map(r -> r.getName()).collect(Collectors.toList());
-                sb.append(StringUtils.join(diag, ","));
-            }
-            // 辅检结果
-            if (ListUtil.isNotEmpty(bean.getPacsRes())) {
-                List<String> pacsRes = bean.getPacsRes().stream().map(r -> r.getName()).collect(Collectors.toList());
-                sb.append(StringUtils.join(pacsRes, ","));
-            }
-            // 化验
-            if (ListUtil.isNotEmpty(bean.getLisList())) {
-                for (Lis lis : bean.getLisList()) {
-                    if (sb.toString().length() > 0) {
-                        sb.append(",");
-                    }
-                    if (lis.getName() == null || lis.getDetailName() == null
-                            || !lis.getName().equals(lis.getDetailName())) {
-                        sb.append(lis.getName() + lis.getDetailName() + CoreUtil.getLisValue(lis));
-                    } else {
-                        sb.append(lis.getDetailName() + CoreUtil.getLisValue(lis));
-                    }
-                }
-            }
-            // 辅检名称
-            if (ListUtil.isNotEmpty(bean.getPacs())) {
-                if (sb.toString().length() > 0) {
-                    sb.append(",");
-                }
-                sb.append("已开");
-                List<String> pacs = bean.getPacs().stream().map(r -> r.getName()).collect(Collectors.toList());
-                sb.append(StringUtils.join(pacs, ","));
-            }
-            // 手术
-            if (ListUtil.isNotEmpty(bean.getOperation())) {
-                List<String> operation = bean.getOperation().stream().map(r -> r.getName()).collect(Collectors.toList());
-                if (sb.toString().length() > 0) {
-                    sb.append(",");
-                }
-                sb.append("已开");
-                sb.append(StringUtils.join(operation, ","));
-            }
-            BillMsg billMsg = MsgUtil.getCommonOtherTipTransfusionMsg(sb.toString(), bean.getName());
-            res.getOtherList().add(billMsg);
-        }
-    }
 }

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

@@ -49,7 +49,7 @@ public class AgeRule {
         Boolean flag = getFlag(wordCrfDTO, ruleBaseDTO);
         if (flag) {
             String message = "年龄:" + wordCrfDTO.getAge();
-            BillMsg billMsg = MsgUtil.getComplexOperationMsg(message, ruleSimpleDTO.getInputName(), ruleSimpleDTO.getLibTypeName());
+            BillMsg billMsg = MsgUtil.getCommonHighRiskMsg(message, ruleSimpleDTO.getInputName(), ruleSimpleDTO.getLibTypeName());
             highRiskList.add(billMsg);
         }
     }

+ 27 - 34
src/main/java/com/diagbot/rule/CommonRule.java

@@ -8,7 +8,7 @@ import com.diagbot.dto.NodeNeoDTO;
 import com.diagbot.dto.RuleBaseDTO;
 import com.diagbot.dto.RuleSimpleDTO;
 import com.diagbot.dto.WordCrfDTO;
-import com.diagbot.enums.NeoEnum;
+import com.diagbot.enums.ConEnum;
 import com.diagbot.enums.TypeEnum;
 import com.diagbot.model.entity.Negative;
 import com.diagbot.util.CatalogueUtil;
@@ -18,7 +18,6 @@ import com.diagbot.util.ListUtil;
 import com.diagbot.util.MsgUtil;
 import com.diagbot.util.StringUtil;
 import org.apache.commons.lang3.StringUtils;
-import org.apache.poi.ss.formula.functions.T;
 import org.springframework.stereotype.Component;
 
 import java.util.ArrayList;
@@ -59,17 +58,10 @@ public class CommonRule {
                     String c = (String) CoreUtil.getFieldValue(d, "standName");
                     String c_name = (String) CoreUtil.getFieldValue(d, "name");
                     if (StringUtils.isNotBlank(c) && CoreUtil.compareName(ruleBaseDTO, c)) {
-                        if ("禁忌手术".equals(conType)) {
-                            BillMsg commonBillMsg = MsgUtil.getCommonSurgeryMsg(
-                                    ruleSimpleDTO.getInputName(), ruleSimpleDTO.getLibName(),
-                                    c_name, conType, ruleSimpleDTO.getLibTypeName());
-                            billMsgList.add(commonBillMsg);
-                        } else {
-                            BillMsg commonBillMsg = MsgUtil.getCommonBillMsg(
-                                    ruleSimpleDTO.getInputName(), ruleSimpleDTO.getLibName(),
-                                    c_name, conType, ruleSimpleDTO.getLibTypeName());
-                            billMsgList.add(commonBillMsg);
-                        }
+                        BillMsg commonBillMsg = MsgUtil.getCommonBillMsg(
+                                ruleSimpleDTO.getInputName(), ruleSimpleDTO.getLibName(),
+                                c_name, conType, ruleSimpleDTO.getLibTypeName());
+                        billMsgList.add(commonBillMsg);
                     }
                 }
             }
@@ -164,7 +156,7 @@ public class CommonRule {
                 String c = (String) CoreUtil.getFieldValue(t, "uniqueName"); // 标准名称
                 String c_name = (String) CoreUtil.getFieldValue(t, "name"); // 界面名称
                 if (CoreUtil.compareName(ruleBaseDTO, c)) {
-                    BillMsg billMsg = MsgUtil.getComplexOperationMsg(c_name, ruleSimpleDTO.getInputName(), ruleSimpleDTO.getLibTypeName());
+                    BillMsg billMsg = MsgUtil.getCommonHighRiskMsg(c_name, ruleSimpleDTO.getInputName(), ruleSimpleDTO.getLibTypeName());
                     highRiskList.add(billMsg);
                 }
             }
@@ -179,7 +171,7 @@ public class CommonRule {
      * @param billMsgList
      * @param ruleSimpleDTO
      */
-    public void needlessRepeatOrder(WordCrfDTO wordCrfDTO, RuleBaseDTO ruleBaseDTO, List<BillMsg> billMsgList, RuleSimpleDTO ruleSimpleDTO) {
+    public void needlessRepeatOrder(WordCrfDTO wordCrfDTO, RuleBaseDTO ruleBaseDTO, List<BillMsg> billMsgList, String conType, RuleSimpleDTO ruleSimpleDTO) {
         String orderStandName = ruleBaseDTO.getBaseLibName();
         Map<String, List<Pacs>> map = EntityUtil.makeEntityListMap(wordCrfDTO.getPacs(), "uniqueName");
         List<Pacs> pacsList = map.get(orderStandName);
@@ -195,10 +187,10 @@ public class CommonRule {
                     Date dateValueDate = CatalogueUtil.parseStringDate(dateValue);
                     Date orderDateValueDate = CatalogueUtil.parseStringDate(orderDateValue);
                     if (dateValueDate != null && orderDateValueDate != null) {
-                        if (!CatalogueUtil.compareTime(dateValueDate, orderDateValueDate, 60L * 24 * 7)) {
-                            BillMsg commonBillMsg = MsgUtil.getNeedlessRepeatOrderMsg(
+                        if (!CatalogueUtil.compareTime(dateValueDate, orderDateValueDate, 60L * 24 * 7, false)) {
+                            BillMsg commonBillMsg = MsgUtil.getCommonBillMsg(
                                     ruleSimpleDTO.getInputName(), ruleSimpleDTO.getLibName(),
-                                    pacs.getName(), ruleSimpleDTO.getLibTypeName());
+                                    pacs.getName(), conType, ruleSimpleDTO.getLibTypeName());
                             billMsgList.add(commonBillMsg);
                         }
                     }
@@ -265,11 +257,11 @@ public class CommonRule {
      * @param billMsgList
      */
     public void repeat24Bill(WordCrfDTO wordCrfDTO, List<BillMsg> billMsgList) {
-        repeat24BillWithType(billMsgList, wordCrfDTO.getLisOrder(), TypeEnum.lis.getName()); // 化验重复开单
-        repeat24BillWithType(billMsgList, wordCrfDTO.getPacsOrder(), TypeEnum.pacs.getName()); // 辅检重复开单
-        // repeat24BillWithType(billMsgList, wordCrfDTO.getDrugOrder(), TypeEnum.drug.getName()); // 药品重复开单
-        // repeat24BillWithType(billMsgList, wordCrfDTO.getOperationOrder(), TypeEnum.operation.getName()); // 手术重复开单
-        // repeat24BillWithType(billMsgList, wordCrfDTO.getTransfusionOrder(), TypeEnum.transfusion.getName()); // 输血重复开单
+        repeat24BillWithType(billMsgList, wordCrfDTO.getLisOrder(), TypeEnum.lis.getName(), ConEnum.repeat24.getName()); // 化验重复开单
+        repeat24BillWithType(billMsgList, wordCrfDTO.getPacsOrder(), TypeEnum.pacs.getName(), ConEnum.repeat24.getName()); // 辅检重复开单
+        // repeat24BillWithType(billMsgList, wordCrfDTO.getDrugOrder(), TypeEnum.drug.getName(), ConEnum.repeat24.getName()); // 药品重复开单
+        // repeat24BillWithType(billMsgList, wordCrfDTO.getOperationOrder(), TypeEnum.operation.getName(), ConEnum.repeat24.getName()); // 手术重复开单
+        // repeat24BillWithType(billMsgList, wordCrfDTO.getTransfusionOrder(), TypeEnum.transfusion.getName(), ConEnum.repeat24.getName()); // 输血重复开单
     }
 
     /**
@@ -281,7 +273,7 @@ public class CommonRule {
      * @param ruleSimpleDTO
      * @param set 用于记录:A与B不宜同时进行, B与A不宜同时进行 只能提示一个
      */
-    public void exclusionBill(WordCrfDTO wordCrfDTO, RuleBaseDTO ruleBaseDTO, List<BillMsg> billMsgList, RuleSimpleDTO ruleSimpleDTO, Set<String> set) {
+    public void exclusionBill(WordCrfDTO wordCrfDTO, RuleBaseDTO ruleBaseDTO, List<BillMsg> billMsgList, String conType, RuleSimpleDTO ruleSimpleDTO, Set<String> set) {
         // 辅检开单项互斥
         List<Pacs> pacsOrder = wordCrfDTO.getPacsOrder();
         if (ListUtil.isNotEmpty(pacsOrder) && pacsOrder.size() > 1) {
@@ -295,10 +287,9 @@ public class CommonRule {
                     if (!set.contains(ruleSimpleDTO.getLibName() + "******" + orginName)) {
                         set.add(ruleSimpleDTO.getLibName() + "******" + orginName);
                         set.add(orginName + "******" + ruleSimpleDTO.getLibName());
-                        BillMsg commonBillMsg = MsgUtil.getBillExclusionMsg(
-                                ruleSimpleDTO.getInputName(), orginName,
-                                ruleSimpleDTO.getInputName() + "," + orginName,
-                                NeoEnum.exclusion.getName());
+                        BillMsg commonBillMsg = MsgUtil.getCommonBillMsg(
+                                ruleSimpleDTO.getInputName(), "",
+                                orginName, conType, ruleSimpleDTO.getLibTypeName());
                         billMsgList.add(commonBillMsg);
                     }
                 }
@@ -312,8 +303,10 @@ public class CommonRule {
      * @param billMsgList
      * @param itemList
      * @param type
+     * @param conType 禁忌条件
+     * @param <T>
      */
-    public <T> void repeat24BillWithType(List<BillMsg> billMsgList, List<T> itemList, String type) {
+    public <T> void repeat24BillWithType(List<BillMsg> billMsgList, List<T> itemList, String type, String conType) {
         if (ListUtil.isEmpty(itemList)) {
             return;
         }
@@ -351,8 +344,8 @@ public class CommonRule {
                                 if (!CatalogueUtil.compareTime(last, cur, 60L * 24)) {
                                     String name = (String) CoreUtil.getFieldValue(it, "name");
                                     String uniqueName = (String) CoreUtil.getFieldValue(it, "uniqueName");
-                                    BillMsg commonBillMsg = MsgUtil.getBill24RepeatMsg(
-                                            name, uniqueName, name, type);
+                                    BillMsg commonBillMsg = MsgUtil.getCommonBillMsg(
+                                            name, uniqueName, name, ConEnum.repeat24.getName(), type);
                                     billMsgList.add(commonBillMsg);
                                     break;
                                 } else {
@@ -387,8 +380,8 @@ public class CommonRule {
      * @param highRiskList
      */
     public void highRisk(RuleSimpleDTO ruleSimpleDTO, List<BillMsg> highRiskList) {
-        BillMsg billMsg = MsgUtil.getCommonHighRiskMsg(ruleSimpleDTO.getInputName(),
-                ruleSimpleDTO.getMsg(), ruleSimpleDTO.getLibTypeName());
+        BillMsg billMsg = MsgUtil.getCommonHighRiskMsg(ruleSimpleDTO.getMsg(),
+                ruleSimpleDTO.getInputName(), ruleSimpleDTO.getLibTypeName());
         highRiskList.add(billMsg);
     }
 
@@ -399,7 +392,7 @@ public class CommonRule {
      * @param highRiskList
      */
     public void highRiskComplex(NodeNeoDTO nodeNeoDTO, List<BillMsg> highRiskList, HighRiskNeoDTO highRiskNeoDTO) {
-        BillMsg billMsg = MsgUtil.getComplexOperationMsg(nodeNeoDTO.getVal(), highRiskNeoDTO.getName(), nodeNeoDTO.getTermtype());
+        BillMsg billMsg = MsgUtil.getCommonHighRiskMsg(nodeNeoDTO.getVal(), highRiskNeoDTO.getName(), nodeNeoDTO.getTermtype());
         highRiskList.add(billMsg);
     }
 

+ 6 - 9
src/main/java/com/diagbot/rule/DrugRule.java

@@ -3,6 +3,7 @@ package com.diagbot.rule;
 import com.diagbot.dto.BillMsg;
 import com.diagbot.dto.RuleBaseDTO;
 import com.diagbot.dto.RuleSimpleDTO;
+import com.diagbot.enums.LibTypeEnum;
 import com.diagbot.enums.RedisEnum;
 import com.diagbot.util.CoreUtil;
 import com.diagbot.util.ListUtil;
@@ -40,8 +41,10 @@ public class DrugRule {
                          RuleSimpleDTO ruleSimpleDTO) {
         if (ListUtil.isNotEmpty(inputList)) {
             List<String> allDrug = new ArrayList<>();
-            if (ruleBaseDTO.getBaseLibType().equals(301) || ruleBaseDTO.getBaseLibType().equals(302)
-                    || ruleBaseDTO.getBaseLibType().equals(303) || ruleBaseDTO.getBaseLibType().equals(304)) {
+            if (ruleBaseDTO.getBaseLibType().equals(LibTypeEnum.yphxwzlb.getKey())
+                    || ruleBaseDTO.getBaseLibType().equals(LibTypeEnum.ypzlxlb.getKey())
+                    || ruleBaseDTO.getBaseLibType().equals(LibTypeEnum.ypylxlb.getKey())
+                    || ruleBaseDTO.getBaseLibType().equals(LibTypeEnum.ypjpxlb.getKey())) {
                 List<String> drugRedis = redisUtil.get(RedisEnum.drugType.getName() + ruleBaseDTO.getBaseLibName());
                 if (ListUtil.isNotEmpty(drugRedis)) {
                     allDrug.addAll(drugRedis);
@@ -53,15 +56,9 @@ public class DrugRule {
                 String uniqueName = (String) CoreUtil.getFieldValue(d, "uniqueName");
                 String name = (String) CoreUtil.getFieldValue(d, "name");
                 if (StringUtils.isNotBlank(uniqueName) && allDrug.contains(uniqueName)) {
-                    String message = "";
-                    if ("禁忌过敏药品".equals(conType)) {
-                        message = name + "过敏";
-                    } else {
-                        message = "可能正在用药" + name;
-                    }
                     BillMsg commonBillMsg = MsgUtil.getCommonBillMsg(
                             ruleSimpleDTO.getInputName(), ruleSimpleDTO.getLibName(),
-                            message, conType, ruleSimpleDTO.getLibTypeName());
+                            name, conType, ruleSimpleDTO.getLibTypeName());
                     billMsgList.add(commonBillMsg);
                 }
             }

+ 43 - 15
src/main/java/com/diagbot/rule/LisRule.java

@@ -71,7 +71,7 @@ public class LisRule {
                 if (StringUtil.isNotBlank(uniqueName) && uniqueName.equals(ruleBaseDTO.getBaseLibName())) {
                     Map<String, Object> map = CoreUtil.compareLis(ruleBaseDTO, lis);
                     if ((Boolean) map.get("flag") == true) {
-                        BillMsg billMsg = MsgUtil.getComplexOperationMsg((String) map.get("msg"), ruleSimpleDTO.getInputName(), ruleSimpleDTO.getLibTypeName());
+                        BillMsg billMsg = MsgUtil.getCommonHighRiskMsg((String) map.get("msg"), ruleSimpleDTO.getInputName(), ruleSimpleDTO.getLibTypeName());
                         highRiskList.add(billMsg);
                     }
                 }
@@ -135,18 +135,28 @@ public class LisRule {
         // 条件全部符合
         if (i == ruleBaseDTOList.size()) {
             if (StringUtil.isNotBlank(lisOtherDTO.getName())) {
+                // 诊断
                 if (ListUtil.isNotEmpty(lisOtherDTO.getDiseaseMsg())) {
                     for (String str : lisOtherDTO.getDiseaseMsg()) {
-                        BillMsg billMsg = MsgUtil.getCommonOtherTipLisMsg(lisOtherDTO.getName(), str, TypeEnum.disease.getName(), lisBean);
+                        BillMsg billMsg = MsgUtil.getCommonOtherMsg(TypeEnum.lis.getName(), lisOtherDTO.getName(), str, TypeEnum.disease.getName(), lisBean);
                         otherList.add(billMsg);
                     }
                 }
+                // 药品
                 if (ListUtil.isNotEmpty(lisOtherDTO.getDrugMsg())) {
                     for (String str : lisOtherDTO.getDrugMsg()) {
-                        BillMsg billMsg = MsgUtil.getCommonOtherTipLisMsg(lisOtherDTO.getName(), str, TypeEnum.drug.getName(), lisBean);
+                        BillMsg billMsg = MsgUtil.getCommonOtherMsg(TypeEnum.lis.getName(), lisOtherDTO.getName(), str, TypeEnum.drug.getName(), lisBean);
                         otherList.add(billMsg);
                     }
                 }
+                // 人群
+                if (ListUtil.isNotEmpty(lisOtherDTO.getGroupMsg())) {
+                    for (String str : lisOtherDTO.getGroupMsg()) {
+                        BillMsg billMsg = MsgUtil.getCommonOtherMsg(TypeEnum.lis.getName(), lisOtherDTO.getName(), str, TypeEnum.group.getName(), lisBean);
+                        otherList.add(billMsg);
+                    }
+                }
+
             }
         }
     }
@@ -164,6 +174,7 @@ public class LisRule {
             return ;
         }
         LisOtherDTO lisOtherDTO = new LisOtherDTO();
+        lisOtherDTO.setMsg(msg);
         int i = 0;
         for (RuleBaseDTO ruleBaseDTO : ruleBaseDTOList) {
             if (LibTypeEnum.getEnum(ruleBaseDTO.getBaseLibType()) != null) { // 避免空指针
@@ -173,7 +184,7 @@ public class LisRule {
                         if (ruleBaseDTO.getBaseLibName().equals(lisBean.getUniqueName())) {
                             map = CoreUtil.compareLis(ruleBaseDTO, lisBean);
                             if ((Boolean) map.get("flag") == true) {
-                                lisOtherDTO.setName(msg);
+                                lisOtherDTO.setName((String)map.get("msg"));
                                 i++;
                             }
                         }
@@ -185,13 +196,13 @@ public class LisRule {
                             i++;
                         }
                         break;
-                    case drug:
+                    case drug: // 药品
                         map = commonRule.compareItem(wordCrfDTO.getDrug(), ruleBaseDTO);
                         if (CoreUtil.getMapFlag(map)) {
                             lisOtherDTO.setDrugMsg((List<String>)map.get("msgList"));
                             i++;
                         }
-                    case operation:
+                    case operation: // 手术
                         map = commonRule.compareItem(wordCrfDTO.getOperation(), ruleBaseDTO);
                         if (CoreUtil.getMapFlag(map)) {
                             lisOtherDTO.setOperationMsg((List<String>)map.get("msgList"));
@@ -206,17 +217,34 @@ public class LisRule {
         // 条件全部符合
         if (i == ruleBaseDTOList.size()) {
             if (StringUtil.isNotBlank(lisOtherDTO.getName())) {
-                if (ListUtil.isNotEmpty(lisOtherDTO.getDiseaseMsg())) {
-                    for (String str : lisOtherDTO.getDiseaseMsg()) {
-                        BillMsg billMsg = MsgUtil.getCommonOtherTipLisMsg(lisOtherDTO.getName(), str, TypeEnum.disease.getName(), lisBean);
-                        otherList.add(billMsg);
+                // 化验本身符合,其他不符号
+                if (ListUtil.isEmpty(lisOtherDTO.getDiseaseMsg()) && ListUtil.isEmpty(lisOtherDTO.getOperationMsg())) {
+                    BillMsg billMsg = MsgUtil.getCommonOtherMsg(TypeEnum.transfusion.getName(),
+                            lisOtherDTO.getName(), msg, TypeEnum.lis.getName(), lisBean);
+                    otherList.add(billMsg);
+                } else {
+                    if (ListUtil.isNotEmpty(lisOtherDTO.getDiseaseMsg())) {
+                        for (String str : lisOtherDTO.getDiseaseMsg()) {
+                            BillMsg billMsg = MsgUtil.getCommonOtherMsg(TypeEnum.transfusion.getName(),
+                                    "诊断" + str + "," + lisOtherDTO.getName(), msg, TypeEnum.disease.getName(), lisBean);
+                            otherList.add(billMsg);
+                        }
                     }
-                }
-                if (ListUtil.isNotEmpty(lisOtherDTO.getDrugMsg())) {
-                    for (String str : lisOtherDTO.getDrugMsg()) {
-                        BillMsg billMsg = MsgUtil.getCommonOtherTipLisMsg(lisOtherDTO.getName(), str, TypeEnum.drug.getName(), lisBean);
-                        otherList.add(billMsg);
+                    if (ListUtil.isNotEmpty(lisOtherDTO.getOperationMsg())) {
+                        for (String str : lisOtherDTO.getOperationMsg()) {
+                            BillMsg billMsg = MsgUtil.getCommonOtherMsg(TypeEnum.transfusion.getName(),
+                                    lisOtherDTO.getName() + ",已开" + str, msg, TypeEnum.operation.getName(), lisBean);
+                            otherList.add(billMsg);
+                        }
                     }
+                    // // 药品暂未用
+                    // if (ListUtil.isNotEmpty(lisOtherDTO.getDrugMsg())) {
+                    //     for (String str : lisOtherDTO.getDrugMsg()) {
+                    //         BillMsg billMsg = MsgUtil.getCommonOtherMsg(TypeEnum.transfusion.getName(),
+                    //                 lisOtherDTO.getName(), msg, TypeEnum.drug.getName(), lisBean);
+                    //         otherList.add(billMsg);
+                    //     }
+                    // }
                 }
             }
         }

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

@@ -37,7 +37,7 @@ public class MedEquRule {
             flag = true;
         }
         if (flag) {
-            BillMsg billMsg = MsgUtil.getBillMedEquMsg(ruleSimpleDTO.getInputName(), ruleSimpleDTO.getLibName(),
+            BillMsg billMsg = MsgUtil.getCommonBillMsg(ruleSimpleDTO.getInputName(), ruleSimpleDTO.getLibName(),
                     ruleBaseDTO.getBaseLibName(), conType, ruleSimpleDTO.getLibTypeName());
             billMsgList.add(billMsg);
         }

+ 10 - 3
src/main/java/com/diagbot/rule/PacsRule.java

@@ -4,6 +4,7 @@ import com.diagbot.dto.BillMsg;
 import com.diagbot.dto.RuleBaseDTO;
 import com.diagbot.dto.RuleSimpleDTO;
 import com.diagbot.dto.WordCrfDTO;
+import com.diagbot.enums.BaseTypeEnum;
 import com.diagbot.enums.LibTypeEnum;
 import com.diagbot.enums.TypeEnum;
 import com.diagbot.util.CoreUtil;
@@ -109,8 +110,14 @@ public class PacsRule {
                         break;
                     case pacsResult: // 辅检结果
                         map = commonRule.compareItem(wordCrfDTO.getPacsLabel().getRes(), ruleBaseDTO);
-                        if (CoreUtil.getMapFlag(map)) {
-                            i++;
+                        if (ruleBaseDTO.getBaseType().equals(BaseTypeEnum.B3.getKey())) {
+                            if (!CoreUtil.getMapFlag(map)) {
+                                i++;
+                            }
+                        } else {
+                            if (CoreUtil.getMapFlag(map)) {
+                                i++;
+                            }
                         }
                         break;
                     default:
@@ -120,7 +127,7 @@ public class PacsRule {
         }
         // 条件全部符合
         if (i == ruleBaseDTOList.size()) {
-            BillMsg otherMsg = MsgUtil.getCommonOtherTipPacsMsg(msg);
+            BillMsg otherMsg = MsgUtil.getCommonOtherMsg(TypeEnum.pacs.getName(), msg, msg, null, null);
             otherList.add(otherMsg);
         }
     }

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

@@ -49,7 +49,7 @@ public class VitalRule {
     public void highOperation(VitalLabel vitalLabel, RuleBaseDTO ruleBaseDTO, List<BillMsg> highRiskList, RuleSimpleDTO ruleSimpleDTO) {
         Map<String, Object> map = CoreUtil.compareVital(ruleBaseDTO, vitalLabel);
         if ((Boolean) map.get("flag") == true) {
-            BillMsg billMsg = MsgUtil.getComplexOperationMsg((String) map.get("msg"), ruleSimpleDTO.getInputName(), ruleSimpleDTO.getLibTypeName());
+            BillMsg billMsg = MsgUtil.getCommonHighRiskMsg((String) map.get("msg"), ruleSimpleDTO.getInputName(), ruleSimpleDTO.getLibTypeName());
             highRiskList.add(billMsg);
         }
     }

+ 35 - 0
src/main/java/com/diagbot/util/CatalogueUtil.java

@@ -187,6 +187,41 @@ public class CatalogueUtil {
         return overtime;
     }
 
+    /**
+     * 比较时间,以分钟为单位
+     * endDate比startDate多diff分钟则返回true
+     *
+     * @param startDate
+     * @param endDate
+     * @param diff
+     * @param hasEqual 是否包含“等号”
+     * @return
+     */
+    public static boolean compareTime(Date startDate, Date endDate, Long diff, boolean hasEqual) {
+        boolean overtime = false;
+        if (startDate == null || endDate == null) {
+            return false;
+        }
+        Calendar calendar_s = Calendar.getInstance();
+        Calendar calendar_e = Calendar.getInstance();
+        Long time_s, time_e;
+        try {
+            calendar_s.setTime(startDate);
+            calendar_e.setTime(endDate);
+
+            time_s = calendar_s.getTimeInMillis();
+            time_e = calendar_e.getTimeInMillis();
+            if (hasEqual) {
+                return (time_e - time_s) >=  diff * 1000 * 60;
+            } else {
+                return (time_e - time_s) >  diff * 1000 * 60;
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return overtime;
+    }
+
     /**
      * 获取查房记录标题中医师职称
      *

+ 83 - 204
src/main/java/com/diagbot/util/MsgUtil.java

@@ -2,7 +2,7 @@ package com.diagbot.util;
 
 import com.diagbot.biz.push.entity.Lis;
 import com.diagbot.dto.BillMsg;
-import com.diagbot.enums.NeoEnum;
+import com.diagbot.enums.ConEnum;
 import com.diagbot.enums.TypeEnum;
 
 /**
@@ -15,18 +15,29 @@ public class MsgUtil {
     /**
      * 高危药品、手术通用提示信息
      *
-     * @param name
-     * @param highLevel
-     * @param type
+     * @param content
+     * @param name    名称
+     * @param type    类型
      * @return
      */
-    public static BillMsg getCommonHighRiskMsg(String name, String highLevel, String type) {
+    public static BillMsg getCommonHighRiskMsg(String content, String name, String type) {
         BillMsg billMsg = new BillMsg();
+        String msg = "";
         if (TypeEnum.operation.getName().equals(type)) {
-            billMsg.setMsg(name + "为高风险手术,请留意");
+            if (StringUtil.isBlank(content)) {
+                // 本身高危手术
+                msg = String.format("%s为高风险手术,请留意", name);
+            } else {
+                // 复杂情况高危手术
+                msg = String.format("该患者%s,%s为高风险手术,请留意", content, name);
+                billMsg.setContent(content);
+            }
         } else if (TypeEnum.drug.getName().equals(type)) {
-            billMsg.setMsg(name + "为" + highLevel + "药品,请留意");
+            msg = String.format("%s为%s药品,请留意", name, content);
+            billMsg.setContent(content);
         }
+        billMsg.setOrderName(name);
+        billMsg.setMsg(msg);
         billMsg.setType(type);
         return billMsg;
     }
@@ -35,7 +46,7 @@ public class MsgUtil {
      * 危急值通用提示信息
      *
      * @param content 匹配内容
-     * @param type 类型
+     * @param type    类型
      * @return
      */
     public static BillMsg getCommonCriticalMsg(String content, String type) {
@@ -51,88 +62,7 @@ public class MsgUtil {
     }
 
     /**
-     * 开单合理性通用提示信息
-     *
-     * @param orderName 原开单项
-     * @param orderStandName 标准开单项
-     * @param content 匹配内容
-     * @param type 类型
-     * @param type 开单项类型
-     * @return
-     */
-    public static BillMsg getCommonBillMsg(String orderName, String orderStandName, String content, String type, String orderType) {
-        BillMsg billMsg = new BillMsg();
-        String msg = String.format("该患者%s,不宜开%s", content, orderName);
-        // 输血提示语是另一种写法
-        if (TypeEnum.transfusion.getName().equals(orderType)) {
-            msg = String.format("该患者%s,谨慎输注%s", content, orderName);
-        }
-        billMsg.setMsg(msg);
-        billMsg.setOrderName(orderName);
-        billMsg.setOrderStandName(orderStandName);
-        billMsg.setContent(content);
-        billMsg.setType(type);
-        return billMsg;
-    }
-
-    /**
-     * 开单合理性通用提示信息
-     *
-     * @param orderName 原开单项
-     * @param orderStandName 标准开单项
-     * @param content 匹配内容
-     * @param type 类型
-     * @return
-     */
-    public static BillMsg getBillLisOrderMsg(String orderName, String orderStandName, String content, String type) {
-        BillMsg billMsg = new BillMsg();
-        String msg = String.format("该患者可能正在用药%s,会影响%s结果,请留意", content, orderName);
-        billMsg.setMsg(msg);
-        billMsg.setOrderName(orderName);
-        billMsg.setOrderStandName(orderStandName);
-        billMsg.setContent(content);
-        billMsg.setType(type);
-        return billMsg;
-    }
-
-    /**
-     * 开单合理性——互斥提示信息
-     *
-     * @param complexOrderName 多个开单项
-     * @param orderName 原开单项
-     * @param content 匹配内容
-     * @param type 类型
-     * @return
-     */
-    public static BillMsg getBillExclusionMsg(String orderName, String content, String complexOrderName, String type) {
-        BillMsg billMsg = new BillMsg();
-        String msg = String.format("检查项目互斥:%s与%s不宜同时进行", orderName, content);
-        billMsg.setMsg(msg);
-        billMsg.setOrderName(complexOrderName);
-        billMsg.setContent(content);
-        billMsg.setType(type);
-        return billMsg;
-    }
-
-    /**
-     * 复杂情况高危手术提示
-     *
-     * @param content
-     * @param name
-     * @param type
-     * @return
-     */
-    public static BillMsg getComplexOperationMsg(String name, String content, String type) {
-        BillMsg billMsg = new BillMsg();
-        String msg = String.format("该患者%s,%s为高风险手术,请留意", name, content);
-        billMsg.setMsg(msg);
-        billMsg.setContent(content);
-        billMsg.setType(type);
-        return billMsg;
-    }
-
-    /**
-     * 其他提醒——化验
+     * 其他值通用提示信息
      *
      * @param content
      * @param name
@@ -140,141 +70,90 @@ public class MsgUtil {
      * @param lis
      * @return
      */
-    public static BillMsg getCommonOtherTipLisMsg(String content, String name, String type, Lis lis) {
+    public static BillMsg getCommonOtherMsg(String otherType, String content, String name, String type, Lis lis) {
         BillMsg billMsg = new BillMsg();
         String msg = "";
-        if (TypeEnum.disease.getName().equals(type)) {
-            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);
+        switch (TypeEnum.getEnum(otherType)) {
+            case lis: // 其他值提醒——化验
+                if (TypeEnum.disease.getName().equals(type)) {
+                    msg = String.format("该患者%s,患有%s,请留意", content, name);
+                } else if (TypeEnum.drug.getName().equals(type)) {
+                    msg = String.format("该患者%s,可能正在服用%s,请留意", content, name);
+                } else if (ConEnum.group.getName().equals(type)) {
+                    msg = String.format("该患者%s,%s,请留意", content, name);
+                }
+                billMsg.setType(type);
+                billMsg.setOrderName(lis.getName());
+                billMsg.setOrderDetailName(lis.getDetailName());
+                break;
+            case pacs: // 其他值提醒——辅检
+                msg = content;
+                break;
+            case transfusion: // 其他值提醒——输血
+                msg = String.format("该患者%s,建议输注%s", content, name);
+                break;
+            default:
+                break;
         }
         billMsg.setMsg(msg);
         billMsg.setContent(content);
-        billMsg.setType(type);
-        billMsg.setOrderName(lis.getName());
-        billMsg.setOrderDetailName(lis.getDetailName());
-        return billMsg;
-    }
-
-    /**
-     * 其他提醒——辅检
-     *
-     * @param content
-     * @return
-     */
-    public static BillMsg getCommonOtherTipPacsMsg(String content) {
-        BillMsg billMsg = new BillMsg();
-        billMsg.setMsg(content);
-        billMsg.setContent(content);
-        return billMsg;
-    }
-
-    /**
-     * 其他提醒——输血
-     *
-     * @param content
-     * @param name
-     * @return
-     */
-    public static BillMsg getCommonOtherTipTransfusionMsg(String content, String name) {
-        BillMsg billMsg = new BillMsg();
-        String msg = String.format("该患者%s,建议输注%s", content, name);
-        billMsg.setMsg(msg);
-        billMsg.setContent(content);
-        return billMsg;
-    }
-
-    /**
-     * 开单合理性24小时重复开通用提示信息
-     *
-     * @param orderName 原开单项
-     * @param orderStandName 标准开单项
-     * @param content 匹配内容
-     * @param type 类型
-     * @return
-     */
-    public static BillMsg getBill24RepeatMsg(String orderName, String orderStandName, String content, String type) {
-        BillMsg billMsg = new BillMsg();
-        String msg = String.format("%s重复开立", orderName);
-        billMsg.setMsg(msg);
-        billMsg.setOrderName(orderName);
-        billMsg.setOrderStandName(orderStandName);
-        billMsg.setContent(content);
-        billMsg.setType(type);
-        return billMsg;
-    }
-
-    /**
-     * 无需重复辅检开单项
-     *
-     * @param orderName 原开单项
-     * @param orderStandName 标准开单项
-     * @param content 匹配内容
-     * @param type 类型
-     * @return
-     */
-    public static BillMsg getNeedlessRepeatOrderMsg(String orderName, String orderStandName, String content, String type) {
-        BillMsg billMsg = new BillMsg();
-        String msg = String.format("重复开立:该患者近期做过%s,且结果无异常", content);
-        billMsg.setMsg(msg);
-        billMsg.setOrderName(orderName);
-        billMsg.setOrderStandName(orderStandName);
-        billMsg.setContent(content);
-        billMsg.setType(type);
         return billMsg;
     }
 
-
     /**
-     * 开单合理性禁忌医疗器械及物品提示信息
+     * 开单合理性通用提示信息
      *
-     * @param orderName 原开单项
+     * @param orderName      原开单项
      * @param orderStandName 标准开单项
-     * @param content 匹配内容
-     * @param type 类型
+     * @param content        匹配内容
+     * @param conType        禁忌类型
+     * @param orderType      开单项类型
      * @return
      */
-    public static BillMsg getBillMedEquMsg(String orderName, String orderStandName, String content, String type, String orderType) {
+    public static BillMsg getCommonBillMsg(String orderName, String orderStandName, String content, String conType, String orderType) {
         BillMsg billMsg = new BillMsg();
-        if (content.startsWith("具有")) {
-            content = content.replaceFirst("具有", ""); // 将“具有”替换成空
-        }
-        String msg = String.format("该患者具有%s,不宜开%s", content, orderName);
-        // 输血提示语是另一种写法
-        if (TypeEnum.transfusion.getName().equals(orderType)) {
-            msg = String.format("该患者具有%s,谨慎输注%s", content, orderName);
+        // 禁忌项拼接提示语
+        switch (ConEnum.getEnum(conType)) {
+            case oralmeds: // 服用药品
+                content = "可能正在用药" + content;
+                break;
+            case allergicmeds: // 禁忌药品
+                content = content + "过敏";
+                break;
+            case operations: // 手术
+                content = "有" + content + "史";
+                break;
+            case medEqu: // 禁忌医疗器械及物品
+                if (!content.startsWith("具有")) {
+                    content = "具有" + content;
+                }
+                break;
         }
-        billMsg.setMsg(msg);
-        billMsg.setOrderName(orderName);
-        billMsg.setOrderStandName(orderStandName);
-        billMsg.setContent(content);
-        billMsg.setType(type);
-        return billMsg;
-    }
-
-    /**
-     * 开单合理性手术提示信息
-     *
-     * @param orderName 原开单项
-     * @param orderStandName 标准开单项
-     * @param content 匹配内容
-     * @param type 类型
-     * @return
-     */
-    public static BillMsg getCommonSurgeryMsg(String orderName, String orderStandName, String content, String type, String orderType) {
-        BillMsg billMsg = new BillMsg();
-        String msg = String.format("该患者有%s史,不宜开%s", content, orderName);
-        // 输血提示语是另一种写法
+        // 通用提示语
+        String msg = String.format("该患者%s,不宜开%s", content, orderName);
+        // 特殊情况下提示语
         if (TypeEnum.transfusion.getName().equals(orderType)) {
-            msg = String.format("该患者有%s史,谨慎输注%s", content, orderName);
+            // 输血开单项提示语
+            msg = String.format("该患者%s,谨慎输注%s", content, orderName);
+        } else if (TypeEnum.lis.getName().equals(orderType) && ConEnum.oralmeds.getName().equals(conType)) {
+            // 化验开单项 + 禁忌服用药品提示语
+            msg = String.format("该患者%s,会影响%s结果,请留意", content, orderName);
+        } else if (ConEnum.repeat24.getName().equals(conType)) {
+            // 24小时重复开立
+            msg = String.format("%s重复开立", orderName);
+        } else if (ConEnum.repeat.getName().equals(conType)) {
+            // 辅检正常项目无需重复开立
+            msg = String.format("重复开立:该患者近期做过%s,且结果无异常", content);
+        } else  if (ConEnum.exclusion.getName().equals(conType)) {
+            // 开单项互斥
+            msg = String.format("检查项目互斥:%s与%s不宜同时进行", orderName, content);
+            billMsg.setMsg(msg);
         }
         billMsg.setMsg(msg);
         billMsg.setOrderName(orderName);
         billMsg.setOrderStandName(orderStandName);
         billMsg.setContent(content);
-        billMsg.setType(type);
+        billMsg.setType(conType);
         return billMsg;
     }
 }