zhoutg 4 anos atrás
pai
commit
d376f5ef4d

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

@@ -350,7 +350,7 @@ public class CommonFacade {
         PastLabel pastLabel = wordCrfDTO.getPastLabel();
         List<Lis> lis = wordCrfDTO.getLis();
         //        List<Pacs> pacs = wordCrfDTO.getPacs();
-        // TODO 辅检
+        // 辅检
         PacsLabel pacsLabel = wordCrfDTO.getPacsLabel();
         // List<PacsNew> pacsNewList = wordCrfDTO.getPacsLabel().getPacsNewList();
         pushVO.setAge(wordCrfDTO.getAge());
@@ -440,7 +440,7 @@ public class CommonFacade {
             lisPushVo.setLises(lis);
             pushVO.setLisPushVo(lisPushVo);
         }
-        // TODO 辅检
+        // 辅检
         if (pacsLabel != null) {
             PacsPushVo pacsPushVo = new PacsPushVo();
             pacsPushVo.setPacs(pacsLabel.getRes());

+ 5 - 0
src/main/java/com/diagbot/facade/PushFacade.java

@@ -73,6 +73,11 @@ public class PushFacade {
         }
     }
 
+    /**
+     * 5.0 推送总入口
+     * @param pushVo
+     * @return
+     */
     public PushDTO processAggreate(PushVO pushVo) {
         // 年龄容错处理
         if (pushVo.getAgeNum() == null) {

+ 1 - 1
src/main/java/com/diagbot/model/ai/process/EntityProcessClinic.java

@@ -116,7 +116,7 @@ public class EntityProcessClinic extends EntityProcess {
 //            List<Pacs> pacses = entityProcessLis.extractEntity(aiOut);
 //            presentLabel.setPacses(pacses);
 
-            // TODO 辅检
+            // 辅检
 //             EntityProcessPacsNew entityProcessPacsNew = new EntityProcessPacsNew();
 //             Map<String, PacsNew> pacsNewMap = entityProcessPacsNew.extractEntity(aiOut);
 //             List<PacsNew> collect = new ArrayList<>();

+ 43 - 27
src/main/java/com/diagbot/process/PushProcess.java

@@ -390,10 +390,10 @@ public class PushProcess {
         }
         // 查询数据
         List<ReverseDTO> reverseDTOList = conceptInfoFacade.getReverseFac(reverseVO);
-        // 界面过滤元素
-        Map<String, List<String>> typeWords = filterWords(wordCrfDTO);
+        // 获取各个类型的界面过滤元素
+        Map<String, List<String>> filterMap = getFilterMap(wordCrfDTO);
         // 设置推送信息(过滤已有)
-        setPushItem(pushDTO, ruleTypeList, typeWords, reverseDTOList, pushVo.getLength());
+        setPushItem(pushDTO, ruleTypeList, filterMap, reverseDTOList, pushVo.getLength());
     }
 
     /**
@@ -527,26 +527,42 @@ public class PushProcess {
     }
 
     /**
-     * 生成各个类型的界面过滤元素
+     * 获取各个类型的界面过滤元素
      *
      * @param wordCrfDTO
      * @return
      */
-    public Map<String, List<String>> filterWords(WordCrfDTO wordCrfDTO) {
-        Map<String, List<String>> typeWordsMap = new HashMap<>();
+    public Map<String, List<String>> getFilterMap(WordCrfDTO wordCrfDTO) {
+        Map<String, List<String>> filterMap = new HashMap<>();
         // TODO 界面过滤元素
-        typeWordsMap.put(StandConvertEnum.lis.getName(), CoreUtil.getByPropertyName(wordCrfDTO.getLis(), "name", "uniqueName"));
-        // for (Map.Entry<String, Map<String, String>> s : standConvertMap.entrySet()) {
-        //     List<String> words = new ArrayList<>();
-        //     String type = s.getKey();
-        //     Map<String, String> value = s.getValue();
-        //     value.forEach((name, standName) -> {
-        //         words.add(name);
-        //         words.add(standName);
-        //     });
-        //     typeWordsMap.put(type, new ArrayList<>(new LinkedHashSet<>(words)));
-        // }
-        return typeWordsMap;
+        // 主诉症状
+        dealFilter(filterMap, StandConvertEnum.symptom.toString(),
+                CoreUtil.getByPropertyName(wordCrfDTO.getChiefLabel().getClinicals(), "name", "standName"));
+        // 现病史症状
+        dealFilter(filterMap, StandConvertEnum.symptom.toString(),
+                CoreUtil.getByPropertyName(wordCrfDTO.getPresentLabel().getClinicals(), "name", "standName"));
+        // 查体结果
+        dealFilter(filterMap, StandConvertEnum.vital.toString(),
+                CoreUtil.getByPropertyName(wordCrfDTO.getVitalLabel().getClinicals(), "name", "standName"));
+        return filterMap;
+    }
+
+    /**
+     * 根据类型生成过滤词
+     *
+     * @param map
+     * @param key
+     * @param filteString
+     */
+    public void  dealFilter(Map<String, List<String>> map, String key, List<String> filteString) {
+        if (ListUtil.isEmpty(filteString)) {
+            return;
+        }
+        if (ListUtil.isNotEmpty(map.get(key))) { // 有值就追加
+            map.get(key).addAll(filteString);
+        } else { // 无值就初始化
+            map.put(key, filteString);
+        }
     }
 
     /**
@@ -554,17 +570,17 @@ public class PushProcess {
      *
      * @param pushDTO
      * @param ruleTypeList
-     * @param typeWords
+     * @param filterMap
      * @param reverseDTOList
      */
-    public void setPushItem(PushDTO pushDTO, List<String> ruleTypeList, Map<String, List<String>> typeWords, List<ReverseDTO> reverseDTOList, int length) {
+    public void setPushItem(PushDTO pushDTO, List<String> ruleTypeList, Map<String, List<String>> filterMap, List<ReverseDTO> reverseDTOList, int length) {
         Map<String, List<PushBaseDTO>> dis = pushDTO.getDis();
         Map<Integer, List<ReverseDTO>> map = EntityUtil.makeEntityListMap(reverseDTOList, "sonType");
         // 症状
         if (ruleTypeList.contains("1")) {
             if (map.get(LexiconEnum.Symptom.getKey()) != null) {
                 List<String> list = map.get(LexiconEnum.Symptom.getKey()).stream().map(r -> r.getSonName()).collect(Collectors.toList());
-                CoreUtil.removeRepeat(list, typeWords.get(StandConvertEnum.symptom.toString())); // 过滤界面已有
+                CoreUtil.removeRepeat(list, filterMap.get(StandConvertEnum.symptom.toString())); // 过滤界面已有
                 pushDTO.setSymptom(getPushBaseDTO(list, length)); // 放入对象返回
             }
         }
@@ -572,7 +588,7 @@ public class PushProcess {
         if (ruleTypeList.contains("4")) {
             if (map.get(LexiconEnum.VitalResult.getKey()) != null) {
                 List<String> list = map.get(LexiconEnum.VitalResult.getKey()).stream().map(r -> r.getSonName()).collect(Collectors.toList());
-                CoreUtil.removeRepeat(list, typeWords.get(StandConvertEnum.vital.toString())); // 过滤界面已有
+                CoreUtil.removeRepeat(list, filterMap.get(StandConvertEnum.vital.toString())); // 过滤界面已有
                 pushDTO.setVital(getPushBaseDTO(list, length)); // 放入对象返回
             }
         }
@@ -580,7 +596,7 @@ public class PushProcess {
         if (ruleTypeList.contains("5")) {
             if (map.get(LexiconEnum.LisName.getKey()) != null) {
                 List<String> list = map.get(LexiconEnum.LisName.getKey()).stream().map(r -> r.getSonName()).collect(Collectors.toList());
-                CoreUtil.removeRepeat(list, typeWords.get(StandConvertEnum.lis.toString())); // 过滤界面已有
+                CoreUtil.removeRepeat(list, filterMap.get(StandConvertEnum.lis.toString())); // 过滤界面已有
                 pushDTO.setLis(getPushBaseDTO(list, length)); // 放入对象返回
             }
         }
@@ -588,7 +604,7 @@ public class PushProcess {
         if (ruleTypeList.contains("6")) {
             if (map.get(LexiconEnum.PacsName.getKey()) != null) {
                 List<String> list = map.get(LexiconEnum.PacsName.getKey()).stream().map(r -> r.getSonName()).collect(Collectors.toList());
-                CoreUtil.removeRepeat(list, typeWords.get(StandConvertEnum.pacs.toString())); // 过滤界面已有
+                CoreUtil.removeRepeat(list, filterMap.get(StandConvertEnum.pacs.toString())); // 过滤界面已有
                 pushDTO.setPacs(getPushBaseDTO(list, length)); // 放入对象返回
             }
         }
@@ -596,7 +612,7 @@ public class PushProcess {
         if (ruleTypeList.contains("7")) {
             if (map.get(LexiconEnum.Disease.getKey()) != null) {
                 List<String> list = map.get(LexiconEnum.Disease.getKey()).stream().map(r -> r.getSonName()).collect(Collectors.toList());
-                CoreUtil.removeRepeat(list, typeWords.get(StandConvertEnum.disease.toString())); // 过滤界面已有
+                CoreUtil.removeRepeat(list, filterMap.get(StandConvertEnum.disease.toString())); // 过滤界面已有
                 List<PushBaseDTO> pushBaseDTO = getPushBaseDTO(list, length);
                 if (ListUtil.isNotEmpty(pushBaseDTO)) {
                     dis.put(DiseaseTypeEnum.identify.getName(), pushBaseDTO);
@@ -607,7 +623,7 @@ public class PushProcess {
         if (ruleTypeList.contains("8")) {
             if (map.get(LexiconEnum.Medicine.getKey()) != null) {
                 List<String> list = map.get(LexiconEnum.Medicine.getKey()).stream().map(r -> r.getSonName()).collect(Collectors.toList());
-                CoreUtil.removeRepeat(list, typeWords.get(StandConvertEnum.drug.toString())); // 过滤界面已有
+                CoreUtil.removeRepeat(list, filterMap.get(StandConvertEnum.drug.toString())); // 过滤界面已有
                 pushDTO.setMedicines(getPushBaseDTO(list, length)); // 放入对象返回
             }
         }
@@ -615,7 +631,7 @@ public class PushProcess {
         if (ruleTypeList.contains("9")) {
             if (map.get(LexiconEnum.Operation.getKey()) != null) {
                 List<String> list = map.get(LexiconEnum.Operation.getKey()).stream().map(r -> r.getSonName()).collect(Collectors.toList());
-                CoreUtil.removeRepeat(list, typeWords.get(StandConvertEnum.operation.toString())); // 过滤界面已有
+                CoreUtil.removeRepeat(list, filterMap.get(StandConvertEnum.operation.toString())); // 过滤界面已有
                 pushDTO.setOperations(getPushBaseDTO(list, length)); // 放入对象返回
             }
         }

+ 1 - 1
src/main/java/com/diagbot/util/CoreUtil.java

@@ -928,7 +928,7 @@ public class CoreUtil {
      * @param splitList
      */
     public static void removeRepeat(List<String> orginList, List<String> splitList) {
-        if (ListUtil.isNotEmpty(orginList) || ListUtil.isEmpty(splitList)) {
+        if (ListUtil.isEmpty(orginList) || ListUtil.isEmpty(splitList)) {
             return ;
         }
         Iterator<String> iterator = orginList.iterator();