Bladeren bron

标准词转换,输血

zhoutg 4 jaren geleden
bovenliggende
commit
954c9c5a6b

+ 3 - 2
src/main/java/com/diagbot/dto/BillNeoDTO.java

@@ -2,8 +2,6 @@ package com.diagbot.dto;
 
 import lombok.Data;
 
-import java.util.List;
-
 /**
  * @description: 开单合理性图谱数据
  * @author: Mark
@@ -29,4 +27,7 @@ public class BillNeoDTO {
 
     // 手术和操作开单合理性项目
     private OperationBillNeoDTO operationBillNeoDTO;
+
+    // 输血开单合理性项目
+    private TransfusionBillNeoDTO transfusionBillNeoDTO;
 }

+ 53 - 0
src/main/java/com/diagbot/dto/TransfusionBillNeoDTO.java

@@ -0,0 +1,53 @@
+package com.diagbot.dto;
+
+import lombok.Data;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @description: 输血开单合理性图谱数据
+ * @author: Mark
+ * @time: 2020/7/29 9:57
+ */
+@Data
+public class TransfusionBillNeoDTO {
+    // 禁忌性别
+    private NodeNeoDTO gender;
+
+    // 禁忌年龄
+    private NodeNeoDTO ageNeoDTO;
+
+    // 临床表现
+    private List<NodeNeoDTO> clinicfindings = new ArrayList<>();
+
+    // 体征
+    private List<NodeNeoDTO> vitals = new ArrayList<>();
+
+    // 禁忌操作
+    private List<NodeNeoDTO> procedures = new ArrayList<>();
+
+    // 禁忌实验室检查
+    private List<NodeNeoDTO> lis = new ArrayList<>();
+
+    // 禁忌辅助检查
+    private List<NodeNeoDTO> pacs = new ArrayList<>();
+
+    // 禁忌过敏药品
+    private List<NodeNeoDTO> allergicmeds = new ArrayList<>();
+
+    // 禁忌服用药品
+    private List<NodeNeoDTO> oralmeds = new ArrayList<>();
+
+    // 禁忌疾病
+    private List<NodeNeoDTO> disease = new ArrayList<>();
+
+    // 禁用人群
+    private List<NodeNeoDTO> group = new ArrayList<>();
+
+    // 配伍禁忌
+    private List<NodeNeoDTO> conflictmeds = new ArrayList<>();
+
+    // 禁用辅助检查描述
+    private List<NodeNeoDTO> pacsDesc = new ArrayList<>();
+}

+ 3 - 0
src/main/java/com/diagbot/dto/WordCrfDTO.java

@@ -13,6 +13,7 @@ import com.diagbot.model.label.PastLabel;
 import com.diagbot.model.label.PersonalLabel;
 import com.diagbot.model.label.PresentLabel;
 import com.diagbot.model.label.VitalLabel;
+import com.diagbot.vo.ItemExt;
 import lombok.Data;
 
 import java.util.ArrayList;
@@ -68,6 +69,8 @@ public class WordCrfDTO {
     private List<Item> drugOrder = new ArrayList<>();
     // 当前手术开单项
     private List<Item> operationOrder = new ArrayList<>();
+    // 当前输血开单项
+    private List<ItemExt> transfusionOrder = new ArrayList<>();
     /*******************************************入参数据拷贝结束******************************/
     // 化验
     // private LisLabel lisLabel;

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

@@ -17,7 +17,8 @@ public enum StandConvertEnum implements KeyedNamed {
     drug(4, "drug"),
     symptom(5, "symptom"),
     operation(6, "operation"),
-    vital(7, "vital");
+    vital(7, "vital"),
+    transfusion(8, "transfusion");
 
     @Setter
     private int key;

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

@@ -7,12 +7,12 @@ import com.diagbot.dto.BillMsg;
 import com.diagbot.dto.BillNeoDTO;
 import com.diagbot.dto.IndicationDTO;
 import com.diagbot.dto.WordCrfDTO;
-import com.diagbot.entity.node.Operation;
 import com.diagbot.process.BillProcess;
 import com.diagbot.util.ListUtil;
 import com.diagbot.util.StringUtil;
 import com.diagbot.vo.BillNeoVO;
 import com.diagbot.vo.IndicationPushVO;
+import com.diagbot.vo.ItemExt;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
@@ -102,12 +102,15 @@ public class BillFacade {
             billNeoVO.getOperationList().put(item.getName(), item.getUniqueName());
         }
 
-
         List<Item> diags = wordCrfDTO.getDiagOrder();
         for (Item item : diags) {
             billNeoVO.getDiagList().put(item.getName(), item.getUniqueName());
         }
 
+        List<ItemExt> transfusions = wordCrfDTO.getTransfusionOrder();
+        for (ItemExt item : transfusions) {
+            billNeoVO.getTransfusionList().put(item.getName(), item.getUniqueName());
+        }
         return billNeoVO;
     }
 }

+ 14 - 2
src/main/java/com/diagbot/facade/CommonFacade.java

@@ -70,6 +70,9 @@ public class CommonFacade {
         if (ListUtil.isNotEmpty(searchData.getDiag())) {
             wordCrfDTO.setDiag(searchData.getDiag());
         }
+        if (ListUtil.isNotEmpty(searchData.getTransfusionOrder())) {
+            wordCrfDTO.setTransfusionOrder(searchData.getTransfusionOrder());
+        }
         aiAnalyze.aiProcess(searchData, wordCrfDTO);
 
         processPresentLisPacs(wordCrfDTO);
@@ -86,6 +89,7 @@ public class CommonFacade {
         clinicalList.addAll(CoreUtil.getPropertyList(chiefLabel.getClinicals()));
         PresentLabel presentLabel = wordCrfDTO.getPresentLabel();
         clinicalList.addAll(CoreUtil.getPropertyList(presentLabel.getClinicals()));
+        standConvert.setClinicalList(clinicalList);
 
         //所有的疾病(主诉、现病史,诊断,既往史,下的诊断)
         DiagLabel diagLabel = wordCrfDTO.getDiagLabel();
@@ -101,6 +105,7 @@ public class CommonFacade {
         //传的诊断
         diagList.addAll(wordCrfDTO.getDiag().stream().filter(x -> StringUtils.isBlank(x.getUniqueName()))
                 .map(x -> x.getName()).collect(Collectors.toList()));
+        standConvert.setDiaglList(diagList);
 
         //所有化验(结构化数据)
         List<String> allLis = new ArrayList<>();
@@ -157,8 +162,13 @@ public class CommonFacade {
         vitalList.addAll(CoreUtil.getPropertyList(vitalLabel.getVitals()));
         standConvert.setVitalList(vitalList);
 
-        standConvert.setClinicalList(clinicalList);
-        standConvert.setDiaglList(diagList);
+        // 输血
+        List<String> transfusionList = new ArrayList<>();
+        if (ListUtil.isNotEmpty(wordCrfDTO.getTransfusionOrder())) {
+            transfusionList.addAll(wordCrfDTO.getTransfusionOrder().stream().filter(z -> StringUtils.isBlank(z.getUniqueName())).map(x -> x.getName()).collect(Collectors.toList()));
+            standConvert.setTransfusionList(transfusionList);
+        }
+
         return standConvert;
     }
 
@@ -195,6 +205,8 @@ public class CommonFacade {
         CoreUtil.setPropertyList(presentLabel.getOperations(), map.get(StandConvertEnum.operation.getName()));
         CoreUtil.setPropertyList(pastLabel.getOperations(), map.get(StandConvertEnum.operation.getName()));
         CoreUtil.setPropertyList(wordCrfDTO.getOperationOrder(), "name", "uniqueName",map.get(StandConvertEnum.operation.getName()));
+        //输血回填
+        CoreUtil.setPropertyList(wordCrfDTO.getTransfusionOrder(), "name", "uniqueName",map.get(StandConvertEnum.transfusion.getName()));
     }
 
     /**

+ 32 - 37
src/main/java/com/diagbot/facade/NeoFacade.java

@@ -9,7 +9,10 @@ import com.diagbot.dto.HighRiskNeoDTO;
 import com.diagbot.dto.NeoPushDTO;
 import com.diagbot.dto.StandConvertCrfBatchDTO;
 import com.diagbot.dto.StandConvertCrfDTO;
-import com.diagbot.entity.node.*;
+import com.diagbot.entity.node.ICDDisease;
+import com.diagbot.entity.node.Medicine;
+import com.diagbot.entity.node.Medicine_Anatomy;
+import com.diagbot.entity.node.Medicine_Code;
 import com.diagbot.enums.StandConvertEnum;
 import com.diagbot.exception.CommonErrorCode;
 import com.diagbot.exception.CommonException;
@@ -37,7 +40,6 @@ import com.diagbot.vo.NeoPushVO;
 import com.diagbot.vo.StandConvert;
 import com.diagbot.vo.StandConvertCrfVO;
 import com.diagbot.vo.neoPushEntity.Diag;
-import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.cache.annotation.Cacheable;
@@ -390,6 +392,7 @@ public class NeoFacade {
         List<String> diseaseConList = getConvertList(standConvert.getDiaglList(), StandConvertEnum.disease.getName(), standConvertCrfVOList);
         List<String> pacsConList = getConvertList(standConvert.getPacsList(), StandConvertEnum.pacs.getName(), standConvertCrfVOList);
         List<String> lisConList = getConvertList(standConvert.getLisList(), StandConvertEnum.lis.getName(), standConvertCrfVOList);
+        List<String> transfusionConList = getConvertList(standConvert.getTransfusionList(), StandConvertEnum.transfusion.getName(), standConvertCrfVOList);
 
         StandConvertCrfBatchDTO standConvertCrfBatchDTO = null;
         try {
@@ -405,6 +408,7 @@ public class NeoFacade {
         getConvertMap(crfMap, StandConvertEnum.disease.getName(), diseaseConList, standConvert.getDiaglList(), map);
         getConvertMap(crfMap, StandConvertEnum.pacs.getName(), pacsConList, standConvert.getPacsList(), map);
         getConvertMap(crfMap, StandConvertEnum.lis.getName(), lisConList, standConvert.getLisList(), map);
+        getConvertMap(crfMap, StandConvertEnum.transfusion.getName(), transfusionConList, standConvert.getTransfusionList(), map);
 
         return map;
     }
@@ -456,53 +460,44 @@ public class NeoFacade {
                               List<String> orginList, Map<String, Map<String, String>> map) {
         Map<String, StandConvertCrfDTO> crfMap = crfDTO.get(type);
         Map<String, String> typeMap = new LinkedHashMap<>();
-        // 从redis获取对应的内容
-        Map<String, String> redisMap = null;
-        redisMap = redisUtil.getValueByType(type);
-        if (ListUtil.isEmpty(convertList) || crfMap == null) {
-            for (String orgS : orginList) {
-                String standWord = redisMap.get(orgS);
-                if(StringUtils.isBlank(standWord)){
-                    standWord = orgS;
-                }
-                typeMap.put(orgS, standWord);
-            }
-        } else {
-
-            if (redisMap == null) {
-                redisMap = new LinkedHashMap<>();
-            }
+        Boolean updateRedis = false;
 
-            for (String s : convertList) {
+        // 从redis获取对应的内容
+        Map<String, String> redisMap = redisUtil.getValueByType(type);
+        if (redisMap == null) {
+            redisMap = new LinkedHashMap<>();
+        }
+        for (String s : orginList) {
+            if (redisMap.containsKey(s)) {
+                typeMap.put(s, redisMap.get(s));
+            } else if (crfMap != null) {
                 StandConvertCrfDTO standConvertCrfDTO = crfMap.get(s);
                 if (standConvertCrfDTO != null) {
                     String rateStr = standConvertCrfDTO.getStandard_words().get(0).get("rate");
-                    if (StringUtil.isBlank(rateStr)) {
-                        redisMap.put(s, s); // 没有rate就用原词
+                    BigDecimal rate = new BigDecimal(rateStr);
+                    int flag = rate.compareTo(new BigDecimal(standConvertRate));
+                    if (flag < 0) {
+                        redisMap.put(s, s); // rate 小于阈值
+                        typeMap.put(s, s);
                     } else {
-                        BigDecimal rate = new BigDecimal(rateStr);
-                        int flag = rate.compareTo(new BigDecimal(standConvertRate));
-                        if (flag < 0) {
-                            redisMap.put(s, s); // rate 小于阈值
-                        } else {
-                            redisMap.put(s, standConvertCrfDTO.getStandard_words().get(0).get("standard_word"));
-                        }
+                        redisMap.put(s, standConvertCrfDTO.getStandard_words().get(0).get("standard_word"));
+                        typeMap.put(s, standConvertCrfDTO.getStandard_words().get(0).get("standard_word"));
                     }
                 } else {
                     redisMap.put(s, s); // 找不到就认为是标准词
+                    typeMap.put(s, s); // 找不到就认为是标准词
                 }
+                updateRedis = true;
+            } else {
+                redisMap.put(s, s); // 找不到就认为是标准词
+                typeMap.put(s, s); // 找不到就认为是标准词
+                updateRedis = true;
             }
+        }
 
-            // 更新redis
+        // 更新redis
+        if (updateRedis) {
             redisUtil.updateValueByType(redisMap, type);
-
-            for (String orgS : orginList) {
-                if (StringUtil.isNotBlank(redisMap.get(orgS))) {
-                    typeMap.put(orgS, redisMap.get(orgS));
-                } else {
-                    typeMap.put(orgS, orgS);
-                }
-            }
         }
         map.put(type, typeMap);
     }

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

@@ -53,6 +53,8 @@ public class BillProcess {
                 BeanUtil.copyProperties(billNeoDTO.getPacsBillNeoDTO(), billNeoMaxDTO);
             } else if (billNeoDTO.getOperationBillNeoDTO() != null) {
                 BeanUtil.copyProperties(billNeoDTO.getOperationBillNeoDTO(), billNeoMaxDTO);
+            } else if (billNeoDTO.getTransfusionBillNeoDTO() != null) {
+                BeanUtil.copyProperties(billNeoDTO.getTransfusionBillNeoDTO(), billNeoMaxDTO);
             }
             billNeoMaxDTO.setOrderName(billNeoDTO.getName()); // 开单名称
             billNeoMaxDTO.setOrderStandName(billNeoDTO.getStandname()); // 开单标准名称

+ 3 - 0
src/main/java/com/diagbot/vo/BillNeoVO.java

@@ -25,4 +25,7 @@ public class BillNeoVO {
 
     // 手术和操作入参
     private Map<String, String> operationList = new HashMap<>();
+
+    // 输血开单项
+    private Map<String, String> transfusionList = new HashMap<>();
 }

+ 9 - 0
src/main/java/com/diagbot/vo/StandConvert.java

@@ -13,11 +13,20 @@ import java.util.List;
  */
 @Data
 public class StandConvert {
+    // 临床表现
     private List<String> clinicalList;
+    // 诊断
     private List<String> diaglList;
+    // 化验
     private List<String> lisList;
+    // 辅检
     private List<String> pacsList;
+    // 药品
     private List<String> drugList;
+    // 体征
     private List<String> vitalList;
+    // 手术
     private List<String> operationList;
+    // 输血
+    private List<String> transfusionList;
 }