Browse Source

基本数据更新

kwzbigdata 5 years ago
parent
commit
95d0d82782

+ 43 - 0
src/main/java/com/diagbot/facade/CommonFacade.java

@@ -1,22 +1,28 @@
 package com.diagbot.facade;
 
+import com.diagbot.biz.push.entity.Lis;
+import com.diagbot.biz.push.entity.Pacs;
 import com.diagbot.client.CRFServiceClient;
 import com.diagbot.dto.WordCrfDTO;
 import com.diagbot.enums.StandConvertEnum;
 import com.diagbot.model.ai.AIAnalyze;
+import com.diagbot.model.entity.Medicine;
 import com.diagbot.model.label.ChiefLabel;
 import com.diagbot.model.label.DiagLabel;
 import com.diagbot.model.label.PastLabel;
 import com.diagbot.model.label.PresentLabel;
 import com.diagbot.util.CoreUtil;
+import com.diagbot.util.ListUtil;
 import com.diagbot.vo.SearchData;
 import com.diagbot.vo.StandConvert;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
+import java.util.stream.Collectors;
 
 /**
  * @Description: 通过业务facade
@@ -64,6 +70,28 @@ public class CommonFacade {
         diagList.addAll(CoreUtil.getPropertyList(diagLabel.getDiags()));
         diagList.addAll(CoreUtil.getPropertyList(pastLabel.getDiags()));
 
+        //所有化验(结构化数据)
+        List<Lis> lis = wordCrfDTO.getLis();
+        if(ListUtil.isNotEmpty(lis)){
+            List<String> lis_unique = lis.stream().filter(x -> StringUtils.isBlank(x.getUniqueName()))
+                    .map(x ->x.getName()+x.getDetailName()).collect(Collectors.toList());
+            standConvert.setLisList(lis_unique);
+        }
+
+        //所有辅助检查(结构化数据)
+        List<Pacs> pacs = wordCrfDTO.getPacs();
+        if(ListUtil.isNotEmpty(pacs)){
+            List<String> pacss_unique = pacs.stream().filter(x -> StringUtils.isBlank(x.getUniqueName()))
+                    .map(x ->x.getName()).collect(Collectors.toList());
+            standConvert.setLisList(pacss_unique);
+        }
+
+        //所有药品
+        List<String> drugList = new ArrayList<>();
+        //1、现病史中的药品
+        drugList.addAll(CoreUtil.getPropertyList(presentLabel.getMedicines()));
+        standConvert.setDrugList(drugList);
+
         standConvert.setClinicalList(clinicalList);
         standConvert.setDiaglList(diagList);
         return standConvert;
@@ -72,7 +100,22 @@ public class CommonFacade {
     //把图谱返回的标准词set到label中
     public void dataTypeSet(WordCrfDTO wordCrfDTO, Map<Integer, Map<String, String>> map){
         ChiefLabel chiefLabel = wordCrfDTO.getChiefLabel();
+        PresentLabel presentLabel = wordCrfDTO.getPresentLabel();
+        DiagLabel diagLabel = wordCrfDTO.getDiagLabel();
+        List<Lis> lis = wordCrfDTO.getLis();
+        List<Pacs> pacs = wordCrfDTO.getPacs();
+
+        //症状回填
         CoreUtil.setPropertyList(chiefLabel.getClinicals(),map.get(StandConvertEnum.clinical.getKey()));
+        CoreUtil.setPropertyList(presentLabel.getClinicals(),map.get(StandConvertEnum.clinical.getKey()));
+        //诊断回填
+        CoreUtil.setPropertyList(diagLabel.getDiags(),map.get(StandConvertEnum.disease.getKey()));
+        //药品回填
+        CoreUtil.setPropertyList(presentLabel.getClinicals(),map.get(StandConvertEnum.drug.getKey()));
+        // TODO: 2020/8/5 化验回填
+//        CoreUtil.setPropertyList(lis,map.get(StandConvertEnum.lis.getKey()));
+        // TODO: 2020/8/5 辅助检查回填
+//        CoreUtil.setPropertyList(pacs,map.get(StandConvertEnum.pacs.getKey()));
     }
 
 }

+ 15 - 9
src/main/java/com/diagbot/model/label/VitalLabel.java

@@ -1,10 +1,16 @@
-package com.diagbot.model.label;
-
-/**
- * @ClassName : VatilLabel
- * @Description : 体格检查(一般检查)
- * @Author : 楼辉荣
- * @Date: 2020-03-03 18:49
- */
-public class VitalLabel extends GeneralLabel{
+package com.diagbot.model.label;
+
+import com.diagbot.model.entity.Vital;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @ClassName : VatilLabel
+ * @Description : 体格检查(一般检查)
+ * @Author : 楼辉荣
+ * @Date: 2020-03-03 18:49
+ */
+public class VitalLabel extends GeneralLabel{
+    private List<Vital> vitals = new ArrayList<>();
 }

+ 4 - 2
src/main/java/com/diagbot/rule/LisRule.java

@@ -31,8 +31,10 @@ public class LisRule {
 
         Map<String,String> old_stand = new HashMap<>();
         if(ListUtil.isNotEmpty(drugLis) && ListUtil.isNotEmpty(inputLis)){
-            Map<String, BigDecimal> nameMax = drugLis.stream().collect(Collectors.toMap(NodeNeoDTO::getName, NodeNeoDTO::getMax));
-            Map<String, BigDecimal> nameMin = drugLis.stream().collect(Collectors.toMap(NodeNeoDTO::getName, NodeNeoDTO::getMin));
+            Map<String, BigDecimal> nameMax = drugLis.stream().collect(Collectors.toMap(NodeNeoDTO::getName, NodeNeoDTO::getMax
+            ,(oldValue,newValue)->newValue));
+            Map<String, BigDecimal> nameMin = drugLis.stream().collect(Collectors.toMap(NodeNeoDTO::getName, NodeNeoDTO::getMin
+                    ,(oldValue,newValue)->newValue));
 
             for (Lis lis:inputLis) {
                 String val =lis.getUniqueName();