Browse Source

其他值化验提醒

zhoutg 4 years ago
parent
commit
b11f01a90c

+ 35 - 1
src/main/java/com/diagbot/aggregate/IndicationAggregate.java

@@ -5,6 +5,7 @@ import com.diagbot.dto.WordCrfDTO;
 import com.diagbot.facade.BillFacade;
 import com.diagbot.facade.CriticalFacade;
 import com.diagbot.facade.HighRiskFacade;
+import com.diagbot.facade.OtherTipFacade;
 import com.diagbot.util.CoreUtil;
 import com.diagbot.util.StringUtil;
 import com.diagbot.vo.IndicationPushVO;
@@ -32,6 +33,8 @@ public class IndicationAggregate {
     HighRiskFacade highRiskFacade;
     @Autowired
     CriticalFacade criticalFacade;
+    @Autowired
+    OtherTipFacade otherTipFacade;
 
     @DataProvider("indicationAll")
     public IndicationDTO indicationAll(
@@ -40,7 +43,8 @@ public class IndicationAggregate {
             @InvokeParameter("debug") Map<String, Object> debug,
             @DataConsumer("bill") IndicationDTO billDTO,
             @DataConsumer("highrisk") IndicationDTO highriskDTO,
-            @DataConsumer("critical") IndicationDTO criticalDTO) {
+            @DataConsumer("critical") IndicationDTO criticalDTO,
+            @DataConsumer("otherTip") IndicationDTO otherDTO) {
         IndicationDTO res = new IndicationDTO();
         if (billDTO != null) {
             res.setBillMsgList(billDTO.getBillMsgList());
@@ -54,6 +58,10 @@ public class IndicationAggregate {
             res.setCriticalValList(criticalDTO.getCriticalValList());
             debug.putAll(criticalDTO.getDebug()); // 调试信息
         }
+        if (otherDTO != null) {
+            res.setOtherList(otherDTO.getOtherList());
+            debug.putAll(otherDTO.getDebug()); // 调试信息
+        }
         res.setDebug(debug);
         return res;
     }
@@ -137,4 +145,30 @@ public class IndicationAggregate {
         }
         return null;
     }
+
+    /**
+     * 其他提示
+     *
+     * @param wordCrfDTO
+     * @param indicationPushVO
+     * @return
+     */
+    @DataProvider("otherTip")
+    public IndicationDTO otherTip(@InvokeParameter("wordCrfDTO") WordCrfDTO wordCrfDTO,
+                                  @InvokeParameter("indicationPushVO") IndicationPushVO indicationPushVO) {
+        long start = System.currentTimeMillis();
+        IndicationDTO res = new IndicationDTO();
+        // 其他提示
+        if (indicationPushVO != null && indicationPushVO.getRuleTypeList().contains("4")) {
+            try {
+                otherTipFacade.otherTipFac(indicationPushVO, wordCrfDTO, res);
+                CoreUtil.getDebugStr(start, "其他值提示耗时", res.getDebug());
+                return res;
+            } catch (Exception e) {
+                log.error("【其他值提示出错】" + e.getMessage());
+                CoreUtil.getDebugStr("【其他值提示出错】", e.getMessage(), res.getDebug());
+            }
+        }
+        return null;
+    }
 }

+ 20 - 0
src/main/java/com/diagbot/dto/OtherTipNeoDTO.java

@@ -0,0 +1,20 @@
+package com.diagbot.dto;
+
+import com.diagbot.biz.push.entity.Lis;
+import lombok.Data;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @description: 其他提醒数据
+ * @author: Mark
+ * @time: 2020/7/29 9:57
+ */
+@Data
+public class OtherTipNeoDTO extends Lis {
+
+    // 其他提醒相关因素
+    private List<NodeNeoDTO> factor = new ArrayList<>();
+
+}

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

@@ -44,6 +44,7 @@ public class IndicationFacade {
         methodMap.put("1", Arrays.asList("crf", "stand"));
         methodMap.put("2", Arrays.asList("crf", "stand"));
         methodMap.put("3", Arrays.asList("crf", "stand"));
+        methodMap.put("4", Arrays.asList("crf", "stand"));
     }
 
 

+ 67 - 0
src/main/java/com/diagbot/facade/OtherTipFacade.java

@@ -0,0 +1,67 @@
+package com.diagbot.facade;
+
+import com.diagbot.dto.IndicationDTO;
+import com.diagbot.dto.OtherTipNeoDTO;
+import com.diagbot.dto.WordCrfDTO;
+import com.diagbot.process.OtherTipProcess;
+import com.diagbot.vo.IndicationPushVO;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @Description: 其他提示facade
+ * @author: zhoutg
+ * @time: 2018/8/6 9:11
+ */
+@Component
+public class OtherTipFacade {
+
+    @Autowired
+    NeoFacade neoFacade;
+    @Autowired
+    OtherTipProcess otherTipProcess;
+    @Autowired
+    CommonFacade commonFacade;
+
+    /**
+     * 其他提示
+     *
+     * @param
+     * @return
+     */
+    public void otherTipFac(IndicationPushVO indicationPushVO, WordCrfDTO wordCrfDTO, IndicationDTO res) {
+        List<OtherTipNeoDTO> otherTipNeoDTOList = new ArrayList<>();
+        // 其他提示——化验
+        // // TODO 测试数据开始
+        // OtherTipNeoDTO otherTipNeoDTO = new OtherTipNeoDTO();
+        // otherTipNeoDTO.setName("血常规");
+        // otherTipNeoDTO.setDetailName("血葡萄糖测定");
+        // otherTipNeoDTO.setValue(20.0D);
+        // List<NodeNeoDTO> factor = new ArrayList<>();
+        // NodeNeoDTO nodeNeoDTO = new NodeNeoDTO();
+        // // otherTipNeoDTO.setOtherValue("阳性");
+        // nodeNeoDTO.setName("急性胰腺炎");
+        // nodeNeoDTO.setTermtype("诊断");
+        // factor.add(nodeNeoDTO);
+        // otherTipNeoDTO.setFactor(factor);
+        // otherTipNeoDTOList.add(otherTipNeoDTO);
+        //
+        // OtherTipNeoDTO otherTipNeoDTO2 = new OtherTipNeoDTO();
+        // otherTipNeoDTO2.setName("血生化检查");
+        // otherTipNeoDTO2.setDetailName("血肌酐测定");
+        // otherTipNeoDTO2.setValue(200.0);
+        // List<NodeNeoDTO> factor2 = new ArrayList<>();
+        // NodeNeoDTO nodeNeoDTO2 = new NodeNeoDTO();
+        // nodeNeoDTO2.setName("坦洛新");
+        // nodeNeoDTO2.setTermtype("药品");
+        // factor2.add(nodeNeoDTO2);
+        // otherTipNeoDTO2.setFactor(factor2);
+        // otherTipNeoDTOList.add(otherTipNeoDTO2);
+        // // TODO 测试数据结束
+        otherTipProcess.processLis(otherTipNeoDTOList, wordCrfDTO, res);
+    }
+
+}

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

@@ -0,0 +1,58 @@
+package com.diagbot.process;
+
+import com.diagbot.dto.BillMsg;
+import com.diagbot.dto.IndicationDTO;
+import com.diagbot.dto.NodeNeoDTO;
+import com.diagbot.dto.OtherTipNeoDTO;
+import com.diagbot.dto.WordCrfDTO;
+import com.diagbot.enums.TypeEnum;
+import com.diagbot.util.CoreUtil;
+import com.diagbot.util.ListUtil;
+import com.diagbot.util.StringUtil;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+
+/**
+ * @Description: 其他提示总入口
+ * @author: zhoutg
+ * @time: 2018/8/6 9:11
+ */
+@Component
+public class OtherTipProcess {
+
+    /**
+     * 处理业务
+     *
+     * @param otherTipNeoDTOList
+     * @param wordCrfDTO
+     * @param res
+     */
+    public void processLis(List<OtherTipNeoDTO> otherTipNeoDTOList, WordCrfDTO wordCrfDTO, IndicationDTO res) {
+        // 化验结果与诊断和开单药品进行匹配
+        for (OtherTipNeoDTO otherTipNeoDTO : otherTipNeoDTOList) {
+            List<NodeNeoDTO> factor = otherTipNeoDTO.getFactor();
+
+            if (ListUtil.isNotEmpty(factor)) {
+                for (NodeNeoDTO nodeNeoDTO : factor) {
+                    Boolean flag = false;
+                    if (TypeEnum.disease.getName().equals(nodeNeoDTO.getTermtype())) { // 诊断
+                        flag = CoreUtil.compareNameWithNodeNeoDTO(nodeNeoDTO, wordCrfDTO.getDiag());
+                    } else if (TypeEnum.drug.getName().equals(nodeNeoDTO.getTermtype())) { // 药品
+                        flag = CoreUtil.compareNameWithNodeNeoDTO(nodeNeoDTO, wordCrfDTO.getDrugOrder());
+                    }
+                    if (flag) {
+                        String content = otherTipNeoDTO.getName() + otherTipNeoDTO.getDetailName();
+                        if (StringUtil.isNotBlank(otherTipNeoDTO.getOtherValue())) {
+                            content += otherTipNeoDTO.getOtherValue();
+                        } else {
+                            content += otherTipNeoDTO.getValue();
+                        }
+                        BillMsg billMsg = CoreUtil.getCommonOtherTipLisMsg(content, nodeNeoDTO.getName(), nodeNeoDTO.getTermtype());
+                        res.getOtherList().add(billMsg);
+                    }
+                }
+            }
+        }
+    }
+}

+ 45 - 2
src/main/java/com/diagbot/util/CoreUtil.java

@@ -1,8 +1,10 @@
 package com.diagbot.util;
 
+import com.diagbot.biz.push.entity.Item;
 import com.diagbot.biz.push.entity.Lis;
 import com.diagbot.dto.BillMsg;
 import com.diagbot.dto.NodeNeoDTO;
+import com.diagbot.enums.TypeEnum;
 import com.diagbot.model.entity.Clinical;
 import com.diagbot.model.entity.Usual;
 import com.diagbot.model.entity.Vital;
@@ -250,7 +252,7 @@ public class CoreUtil {
      */
     public static BillMsg getCommonCriticalMsg(String content, String type) {
         BillMsg billMsg = new BillMsg();
-        String msg = String.format("该患者%s,请留意", content);
+        String msg = String.format("该患者%s请留意", content);
         billMsg.setMsg(msg);
         billMsg.setType(type);
         billMsg.setContent(content);
@@ -268,7 +270,7 @@ public class CoreUtil {
      */
     public static BillMsg getCommonBillMsg(String orderName, String orderStandName, String content, String type) {
         BillMsg billMsg = new BillMsg();
-        String msg = String.format("该患者%s,不宜开%s", content, orderName);
+        String msg = String.format("该患者%s不宜开%s", content, orderName);
         billMsg.setMsg(msg);
         billMsg.setOrderName(orderName);
         billMsg.setOrderStandName(orderStandName);
@@ -277,6 +279,28 @@ public class CoreUtil {
         return billMsg;
     }
 
+    /**
+     * 其他提醒化验提醒
+     *
+     * @param content
+     * @param name
+     * @param type
+     * @return
+     */
+    public static BillMsg getCommonOtherTipLisMsg(String content, String name, String type) {
+        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);
+        }
+        billMsg.setMsg(msg);
+        billMsg.setContent(content);
+        billMsg.setType(type);
+        return billMsg;
+    }
+
     /**
      * 开单合理性24小时重复开通用提示信息
      *
@@ -313,6 +337,25 @@ public class CoreUtil {
         }
     }
 
+    /**
+     * 比较name是否一样
+     *
+     * @param nodeNeoDTO
+     * @param item
+     * @return
+     */
+    public static Boolean compareNameWithNodeNeoDTO(NodeNeoDTO nodeNeoDTO,  List<? extends Item> item) {
+        if (ListUtil.isEmpty(item) || nodeNeoDTO == null) {
+            return false;
+        }
+        for (Item it : item) {
+            if (it.getUniqueName().equals(nodeNeoDTO.getName())) {
+                return true;
+            }
+        }
+        return  false;
+    }
+
     /**
      * 比较化验是否匹配
      *