zhoutg 3 anni fa
parent
commit
14308680c1

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

@@ -12,7 +12,6 @@ import com.diagbot.process.BillProcess;
 import com.diagbot.rule.DrugRule;
 import com.diagbot.rule.OtherRule;
 import com.diagbot.util.MsgNewUtil;
-import com.diagbot.rule.OtherRule;
 import com.diagbot.util.RedisUtil;
 import com.diagbot.util.StringUtil;
 import com.diagbot.vo.Drug;
@@ -60,7 +59,6 @@ public class BillFacade {
 
         // 【特殊规则】过敏原自身过敏
         otherRule.allergy(wordCrfDTO, res);
-
         // 【特殊规则】七院:非阻塞性睡眠呼吸暂停综合征且非混合性睡眠呼吸暂停综合征,不宜同时开立睡眠呼吸监测和眼电图(EOG)(双眼)
         otherRule.smhxjcAndYdteog(wordCrfDTO, res);
 

+ 0 - 18
src/main/java/com/diagbot/facade/NeoFacade.java

@@ -494,24 +494,6 @@ public class NeoFacade {
         try {
             Map<String, Object> invokeParams = new HashMap<>();
             Map<String, RuleDTO> map = DataFacade.get("getAllRules", invokeParams, Map.class);
-            // // TODO 过敏原添加自身过敏
-            // for (String key : map.keySet()) {
-            //     if (key.startsWith(RedisEnum.allRule.getName() + LexiconEnum.Medicine.getKey()) && key.endsWith("_1")) {
-            //         RuleDTO ruleDTO = map.get(key);
-            //         List<RuleConditionDTO> ruleConditionDTOList = ruleDTO.getRuleConditionDTOList();
-            //         RuleConditionDTO ruleConditionDTO = new RuleConditionDTO();
-            //         ruleConditionDTO.setHasSubCond(1);
-            //         ruleConditionDTO.setRuleGroup("11");
-            //         List<RuleBaseDTO> ruleBaseDTOList = new ArrayList<>();
-            //         RuleBaseDTO ruleBaseDTO = new RuleBaseDTO();
-            //         ruleBaseDTO.setBaseLibName(ruleDTO.getLibName());
-            //         ruleBaseDTO.setBaseLibType(ruleDTO.getLibType());
-            //         ruleBaseDTO.setBaseType(BaseTypeEnum.B1.getKey());
-            //         ruleBaseDTOList.add(ruleBaseDTO);
-            //         ruleConditionDTO.setRuleBaseDTOList(ruleBaseDTOList);
-            //         ruleConditionDTOList.add(ruleConditionDTO);
-            //     }
-            // }
             redisUtil.multiSet(map);
         } catch (Exception e) {
             throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "获取所有规则失败" + e.getMessage());

+ 61 - 1
src/main/java/com/diagbot/rule/OtherRule.java

@@ -1,5 +1,7 @@
 package com.diagbot.rule;
 
+import com.diagbot.biz.push.entity.Item;
+import com.diagbot.biz.push.entity.Pacs;
 import com.diagbot.dto.BillMsg;
 import com.diagbot.dto.IndicationDTO;
 import com.diagbot.dto.RuleSimpleDTO;
@@ -16,6 +18,7 @@ import com.diagbot.util.MsgNewUtil;
 import com.diagbot.util.RedisUtil;
 import com.diagbot.util.StringUtil;
 import com.diagbot.vo.Drug;
+import com.google.common.collect.Lists;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 import java.util.List;
@@ -35,7 +38,7 @@ public class OtherRule {
     RedisUtil redisUtil;
 
     /**
-     * 过敏原自身过敏,如果规则已存在,就不再比较;如果不存在,比较是否与自身过敏
+     * 过敏原自身过敏,如果规则已维护,就不再比较;如果没有维护,比较是否与自身过敏
      *
      * @param
      * @return
@@ -71,4 +74,61 @@ public class OtherRule {
         }
     }
 
+    /**
+     * 七院需求:
+     * 非阻塞性睡眠呼吸暂停综合征和非混合性睡眠呼吸暂停综合征,不宜同时开立呼吸睡眠监测和眼电图(EOG)
+     *
+     * @param
+     * @return
+     */
+    public void smhxjcAndYdteog(WordCrfDTO wordCrfDTO, IndicationDTO res) {
+        // 七院特有
+        if (6 != wordCrfDTO.getHospitalId()) {
+            return;
+        }
+        // 1、比较是否包含2种诊断
+        List<Item> diagAllList = wordCrfDTO.getDiag(); // 结构化诊断
+        List<String> zsxList = Lists.newArrayList();// 阻塞性睡眠呼吸暂停综合征医院名称
+        List<String> hhxList = Lists.newArrayList();// 混合性睡眠呼吸暂停综合征医院名称
+        for (Item item : diagAllList) {
+            if ("阻塞性睡眠呼吸暂停综合征".equals(item.getUniqueName())) {
+                zsxList.add(item.getName());
+            } else if ("混合性睡眠呼吸暂停综合征".equals(item.getUniqueName())) {
+                hhxList.add((item.getName()));
+            }
+        }
+        // 如果两种疾病有其一,就不提示
+        if (ListUtil.isNotEmpty(zsxList) || ListUtil.isNotEmpty(hhxList)) {
+            return;
+        }
+
+        // 2、比较是否包含2种辅检开单项
+        List<Pacs> pacsList = wordCrfDTO.getPacsOrder(); // 辅检开单项
+        List<String> hxsmjcList = Lists.newArrayList();// 呼吸睡眠监测医院名称
+        List<String> ydteogList = Lists.newArrayList();// 眼电图(EOG)医院名称
+        for (Pacs pacs : pacsList) {
+            if ("呼吸睡眠监测".equals(pacs.getUniqueName())) {
+                hxsmjcList.add(pacs.getName());
+            } else if ("眼电图(EOG)".equals(pacs.getUniqueName())) {
+                ydteogList.add(pacs.getName());
+            }
+        }
+        // 辅检开单项必须有两个,否则就不提示
+        if (ListUtil.isEmpty(hxsmjcList) || ListUtil.isEmpty(ydteogList)) {
+            return;
+        }
+
+        // 3、提示语组合
+        List<BillMsg> billMsgList = res.getBillMsgList();
+        for (String hxsm : hxsmjcList) {
+            for (String ydt : ydteogList) {
+                BillMsg billMsg = new BillMsg();
+                billMsg.setType(TypeEnum.pacs.getName());
+                billMsg.setMsg(String.format("非阻塞性睡眠呼吸暂停综合征和非混合性睡眠呼吸暂停综合征患者,不宜同时开立%s和%s",
+                        hxsm, ydt));
+                billMsgList.add(billMsg);
+            }
+        }
+    }
+
 }

+ 1 - 45
src/main/java/com/diagbot/util/RedisUtil.java

@@ -92,51 +92,7 @@ public class RedisUtil {
      * @return
      */
     public <T> void multiSet(Map<String, T> map) {
-        putHashMap("ffff", map);
-        Map<String, T> sonMap = new LinkedHashMap<>();
-        int j = 1;
-        for (String key : map.keySet()) {
-            sonMap.put(key, map.get(key));
-            if (j / 5000 > 0 && j % 5000 == 0) {
-                redisTemplate.opsForValue().multiSet(sonMap);
-                System.out.println("添加redis");
-                sonMap.clear();
-            }
-            j++;
-        }
-        // System.out.println(map.size());
-        // int threadNum = 1; // 推荐的总线程数 = cpu个数 * 每个cpu的核数
-        // List<Map<String, T>> threadData = divideByCopies(map, threadNum);
-        // int sum = 0;
-        // for (Map<String, T> map1 : threadData) {
-        //     sum += map1.size();
-        // }
-        // System.out.println(sum == map.size());
-        //
-        // List<Future<Boolean>> list = new ArrayList<>();
-        // ExecutorService executor = Executors.newFixedThreadPool(threadNum);
-        // for (int i = 0; i < threadNum; i++) {
-        //     final int index = i; // 这一行代码很重要,如果使用成员变量,下面会报错
-        //     Future<Boolean> future = executor.submit(new Callable<Boolean>() {
-        //         @Override
-        //         public Boolean call() {
-        //             Map<String, T> data = threadData.get(index);
-        //             redisTemplate.opsForValue().multiSet(data);
-        //             return true;
-        //         }
-        //     });
-        //     list.add(future);
-        // }
-        //
-        // // 拼接返回数据
-        // System.out.println(list.size());
-        // for (int i = 0; i < list.size(); i++) {
-        //     Future<Boolean> future = list.get(i);
-        //     while (!future.isDone()) {
-        //         ; // 这一行代码很重要
-        //     }
-        // }
-        System.out.println("添加完毕");
+        redisTemplate.opsForValue().multiSet(map);
     }
 
     public <T> List<Map<String, T>> divideByCopies(Map<String, T> originList, int num) {