|
@@ -180,6 +180,43 @@ public class PushProcess {
|
|
|
Map<Long, List<String>> items = klRelationFacade.getItemByDiseaseMap(diseaseItemVO);
|
|
|
Map<Long, List<DiseaseItemDTO>> infos = klRelationFacade.getInfoByDiseaseMap(diseaseItemVO);
|
|
|
if (MapUtils.isNotEmpty(items)) {
|
|
|
+ if (ruleTypeList.contains("6")) {
|
|
|
+ Map<String, List<PushBaseDTO>> classificationPacs = new LinkedHashMap<>();
|
|
|
+ // 将infos中键值为505的数据取出
|
|
|
+ if(ListUtil.isNotEmpty(items.get(PushRelationTypeEnum.PACS.getKey()))){
|
|
|
+ List<PushBaseDTO> pushBasePacs = new ArrayList<>();
|
|
|
+ infos.get(PushRelationTypeEnum.PACS.getKey()).forEach(x -> {
|
|
|
+ PushBaseDTO pushBaseDTO = new PushBaseDTO();
|
|
|
+ pushBaseDTO.setName(x.getItemName());
|
|
|
+ pushBasePacs.add(pushBaseDTO);
|
|
|
+ });
|
|
|
+ classificationPacs.put(PushRelationTypeEnum.PACS.getName(),pushBasePacs);
|
|
|
+ }
|
|
|
+ //518
|
|
|
+ if(ListUtil.isNotEmpty(items.get(PushRelationTypeEnum.IDENTIFICATIONCHECK.getKey()))){
|
|
|
+ List<PushBaseDTO> pushBasePacs = new ArrayList<>();
|
|
|
+ infos.get(PushRelationTypeEnum.IDENTIFICATIONCHECK.getKey()).forEach(x -> {
|
|
|
+ PushBaseDTO pushBaseDTO = new PushBaseDTO();
|
|
|
+ pushBaseDTO.setName(x.getItemName());
|
|
|
+ pushBasePacs.add(pushBaseDTO);
|
|
|
+ });
|
|
|
+ classificationPacs.put(PushRelationTypeEnum.IDENTIFICATIONCHECK.getName(),pushBasePacs);
|
|
|
+ }
|
|
|
+ //519
|
|
|
+ if(ListUtil.isNotEmpty(items.get(PushRelationTypeEnum.COMORBIDITYCHECK.getKey()))){
|
|
|
+ List<PushBaseDTO> pushBasePacs = new ArrayList<>();
|
|
|
+ infos.get(PushRelationTypeEnum.COMORBIDITYCHECK.getKey()).forEach(x -> {
|
|
|
+ PushBaseDTO pushBaseDTO = new PushBaseDTO();
|
|
|
+ pushBaseDTO.setName(x.getItemName());
|
|
|
+ pushBasePacs.add(pushBaseDTO);
|
|
|
+ });
|
|
|
+ classificationPacs.put(PushRelationTypeEnum.COMORBIDITYCHECK.getName(),pushBasePacs);
|
|
|
+ }
|
|
|
+ if (MapUtils.isNotEmpty(classificationPacs)) {
|
|
|
+ pushDTO.getPacs().putAll(classificationPacs);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
if (ruleTypeList.contains("8") && ListUtil.isNotEmpty(items.get(PushRelationTypeEnum.DRUG.getKey()))) {
|
|
|
// 将infos中键值为506的数据取出,以drugC聚合,如果drugC为空,则给map中的key赋值为“其他”,“其他”放在最后
|
|
|
Map<String, List<PushBaseDTO>> unclassifiedDrugs = new LinkedHashMap<>();
|
|
@@ -228,6 +265,14 @@ public class PushProcess {
|
|
|
return pushBaseDTO;
|
|
|
}).collect(Collectors.toList()));
|
|
|
}
|
|
|
+ //历史病例
|
|
|
+ if (ruleTypeList.contains("15") && ListUtil.isNotEmpty(items.get(PushRelationTypeEnum.HISTORICALCASE.getKey()))) {
|
|
|
+ pushDTO.setHistoricalCases(items.get(PushRelationTypeEnum.HISTORICALCASE.getKey()).stream().map(x -> {
|
|
|
+ PushBaseDTO pushBaseDTO = new PushBaseDTO();
|
|
|
+ pushBaseDTO.setName(x);
|
|
|
+ return pushBaseDTO;
|
|
|
+ }).collect(Collectors.toList()));
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
// if (reverseInfoByDisName != null) {
|
|
@@ -341,7 +386,7 @@ public class PushProcess {
|
|
|
if (ListUtil.isNotEmpty(pushDTO.getSymptom())
|
|
|
|| ListUtil.isNotEmpty(pushDTO.getVital())
|
|
|
|| ListUtil.isNotEmpty(pushDTO.getLis())
|
|
|
- || ListUtil.isNotEmpty(pushDTO.getPacs())
|
|
|
+ || MapUtils.isNotEmpty(pushDTO.getPacs())
|
|
|
|| (pushDTO.getDis() != null && pushDTO.getDis().size() > 0)
|
|
|
|| ListUtil.isNotEmpty(pushDTO.getComplications())) {
|
|
|
return false;
|
|
@@ -685,7 +730,7 @@ public class PushProcess {
|
|
|
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, filterMap.get(StandConvertEnum.pacs.toString())); // 过滤界面已有
|
|
|
- pushDTO.setPacs(generatePushBaseDTO(list, length)); // 放入对象返回
|
|
|
+ pushDTO.setPacs(generatePushBaseMapDTO(list, length)); // 放入对象返回
|
|
|
}
|
|
|
}
|
|
|
// 鉴别诊断, 注意这个类型与其他类型不一样
|
|
@@ -755,6 +800,30 @@ public class PushProcess {
|
|
|
return pushBaseDTOList;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 将名称列表生成推送返回类型
|
|
|
+ *
|
|
|
+ * @param nameList
|
|
|
+ * @param length 最长个数, -1:无限制
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public Map<String,List<PushBaseDTO>> generatePushBaseMapDTO(List<String> nameList, int length) {
|
|
|
+ Map<String,List<PushBaseDTO>> map = new HashMap<>();
|
|
|
+ List<PushBaseDTO> pushBaseDTOList = Lists.newArrayList();
|
|
|
+ if (ListUtil.isNotEmpty(nameList)) {
|
|
|
+ for (int i = 0; i < nameList.size(); i++) {
|
|
|
+ if (length != -1 && pushBaseDTOList.size() >= length) {
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ PushBaseDTO pushBaseDTO = new PushBaseDTO();
|
|
|
+ pushBaseDTO.setName(nameList.get(i));
|
|
|
+ pushBaseDTOList.add(pushBaseDTO);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ map.put("疾病相关辅助检查项目",pushBaseDTOList);
|
|
|
+ return map;
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 生成反推的入参
|
|
|
*
|
|
@@ -863,16 +932,31 @@ public class PushProcess {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- // 辅检
|
|
|
- if (ruleTypeList.contains("6")) {
|
|
|
- if (ListUtil.isNotEmpty(reversePush.getPacs())) {
|
|
|
- List<String> pacses = reversePush.getPacs().stream().map(x -> x.getName()).collect(Collectors.toList());
|
|
|
- if (pacses.size() > 0) {
|
|
|
- List<PushBaseDTO> filterpacs = getPackagePushBaseDTO(typeWords, pacses, StandConvertEnum.pacs);
|
|
|
- pushDTO.setPacs(filterpacs.subList(0, filterpacs.size() >= length ? length : filterpacs.size()));
|
|
|
+ if (ruleTypeList.contains("8")) {
|
|
|
+ if (reversePush.getTreat() != null && ListUtil.isNotEmpty(reversePush.getTreat().get(MedicalAdviceEnum.drug.getName()))) {
|
|
|
+ List<String> drugs = reversePush.getTreat().get(MedicalAdviceEnum.drug.getName()).stream().map(x -> x.getName()).collect(Collectors.toList());
|
|
|
+ /*reversePush.stream().filter(x ->x.getTreat() != null && ListUtil.isNotEmpty(x.getTreat().get(MedicalAdviceEnum.drug.getName())))
|
|
|
+ .forEach(x -> {
|
|
|
+ List<String> drugList = x.getTreat().get(MedicalAdviceEnum.drug.getName()).stream().map(y -> y.getName()).collect(Collectors.toList());
|
|
|
+ drugs.removeAll(drugList);
|
|
|
+ drugs.addAll(drugList);
|
|
|
+ });*/
|
|
|
+ if (drugs.size() > 0) {
|
|
|
+ List<PushBaseDTO> filterdrugs = getPackagePushBaseDTO(typeWords, drugs, StandConvertEnum.drug);
|
|
|
+ pushDTO.setMedicines(filterdrugs.subList(0, filterdrugs.size() >= length ? length : filterdrugs.size()));
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ // 辅检
|
|
|
+// if (ruleTypeList.contains("6")) {
|
|
|
+// if (ListUtil.isNotEmpty(reversePush.getPacs())) {
|
|
|
+// List<String> pacses = reversePush.getPacs().stream().map(x -> x.getName()).collect(Collectors.toList());
|
|
|
+// if (pacses.size() > 0) {
|
|
|
+// Map<String,List<PushBaseDTO>> filterpacs = getPackagePushBaseMapDTO(typeWords, pacses, StandConvertEnum.pacs);
|
|
|
+// pushDTO.setPacs(filterpacs);
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
// 药品
|
|
|
if (ruleTypeList.contains("8")) {
|
|
|
if (reversePush.getTreat() != null && ListUtil.isNotEmpty(reversePush.getTreat().get(MedicalAdviceEnum.drug.getName()))) {
|
|
@@ -937,6 +1021,23 @@ public class PushProcess {
|
|
|
}).collect(Collectors.toList());
|
|
|
return symptomPush;
|
|
|
}
|
|
|
+
|
|
|
+ private Map<String,List<PushBaseDTO>> getPackagePushBaseMapDTO(Map<String, List<String>> typeWords, List<String> symptoms, StandConvertEnum symptom) {
|
|
|
+
|
|
|
+ Map<String,List<PushBaseDTO>> map = new HashMap<>();
|
|
|
+ List<PushBaseDTO> symptomPush = symptoms.stream()
|
|
|
+ .map(x -> {
|
|
|
+ x = ListUtil.isNotEmpty(typeWords.get(symptom.toString())) ? !typeWords.get(symptom.toString()).contains(x) ? x : "" : x;
|
|
|
+ return x;
|
|
|
+ }).filter(x -> StringUtils.isNotBlank(x)).map(x -> {
|
|
|
+ PushBaseDTO pushBaseDTO = new PushBaseDTO();
|
|
|
+ pushBaseDTO.setName(x);
|
|
|
+ return pushBaseDTO;
|
|
|
+ }).collect(Collectors.toList());
|
|
|
+ map.put("疾病相关辅助检查项目",symptomPush);
|
|
|
+ return map;
|
|
|
+ }
|
|
|
+
|
|
|
private List<PushBaseDTO> getPackagePushBaseDTO(List<String> symptoms) {
|
|
|
List<PushBaseDTO> symptomPush = new ArrayList<>();
|
|
|
if(ListUtil.isNotEmpty(symptoms)){
|