|
@@ -141,21 +141,19 @@ public class NeoFacade {
|
|
public void diseasePropertyCache() {
|
|
public void diseasePropertyCache() {
|
|
List<DiseaseProperty> diseaseProperty = nodeRepository.getDiseaseProperty();
|
|
List<DiseaseProperty> diseaseProperty = nodeRepository.getDiseaseProperty();
|
|
if (ListUtil.isNotEmpty(diseaseProperty)) {
|
|
if (ListUtil.isNotEmpty(diseaseProperty)) {
|
|
- diseaseProperty.parallelStream().forEach(
|
|
|
|
- x -> {
|
|
|
|
- String name = x.getName();
|
|
|
|
- String sex = x.getSex();
|
|
|
|
- String age = x.getAge();
|
|
|
|
- String fbl = x.getFbl();
|
|
|
|
|
|
+ Map map = diseaseProperty.stream().collect(Collectors.toMap(
|
|
|
|
+ k -> RedisEnum.diseaseType.getName() + k.getName(),
|
|
|
|
+ v -> {
|
|
Map<String, String> desc = new HashMap<>();
|
|
Map<String, String> desc = new HashMap<>();
|
|
- desc.put("name", name);
|
|
|
|
- desc.put("sex", sex);
|
|
|
|
- desc.put("age", age);
|
|
|
|
- desc.put("fbl", fbl);
|
|
|
|
- redisUtil.updateValue(desc, RedisEnum.diseaseType.getName() + name);
|
|
|
|
- }
|
|
|
|
- );
|
|
|
|
-
|
|
|
|
|
|
+ desc.put("name", v.getName());
|
|
|
|
+ desc.put("sex", v.getSex());
|
|
|
|
+ desc.put("age", v.getAge());
|
|
|
|
+ desc.put("fbl", v.getFbl());
|
|
|
|
+ return desc;
|
|
|
|
+ },
|
|
|
|
+ (v1, v2) -> (v2)
|
|
|
|
+ ));
|
|
|
|
+ redisTemplate.opsForValue().multiSet(map);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -262,6 +260,29 @@ public class NeoFacade {
|
|
if (lisPushVo != null) {
|
|
if (lisPushVo != null) {
|
|
lises = lisPushVo.getLises();
|
|
lises = lisPushVo.getLises();
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ if (pushDisBySpecialLis(age, sex, neoPushDTOS, lises)) return neoPushDTOS;
|
|
|
|
+
|
|
|
|
+ // 症状、体征推送出的疾病
|
|
|
|
+ pushDisBySymptomOrVital(pushVO, allDis);
|
|
|
|
+ //化验推出的疾病
|
|
|
|
+ pushDisByLis(allDis, lises);
|
|
|
|
+ //辅检推出的疾病
|
|
|
|
+ pushDisByPacs(pushVO, allDis);
|
|
|
|
+ filterAndSort(neoPushDTOS, allDis, sex, age);
|
|
|
|
+
|
|
|
|
+ return neoPushDTOS;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 化验特异性推送疾病
|
|
|
|
+ * @param age
|
|
|
|
+ * @param sex
|
|
|
|
+ * @param neoPushDTOS
|
|
|
|
+ * @param lises
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ private boolean pushDisBySpecialLis(Double age, Integer sex, List<NeoPushDTO> neoPushDTOS, List<Lis> lises) {
|
|
if (ListUtil.isNotEmpty(lises)) {
|
|
if (ListUtil.isNotEmpty(lises)) {
|
|
List<String> lis_dis = lises.parallelStream()
|
|
List<String> lis_dis = lises.parallelStream()
|
|
.map(x -> nodeRepository.getDisByLis_Special(x.getName(), x.getUniqueName() + x.getResult()))
|
|
.map(x -> nodeRepository.getDisByLis_Special(x.getName(), x.getUniqueName() + x.getResult()))
|
|
@@ -269,12 +290,50 @@ public class NeoFacade {
|
|
if (ListUtil.isNotEmpty(lis_dis)) {
|
|
if (ListUtil.isNotEmpty(lis_dis)) {
|
|
filterAndSort(neoPushDTOS, lis_dis, sex, age);
|
|
filterAndSort(neoPushDTOS, lis_dis, sex, age);
|
|
if (ListUtil.isNotEmpty(neoPushDTOS)) {
|
|
if (ListUtil.isNotEmpty(neoPushDTOS)) {
|
|
- return neoPushDTOS;
|
|
|
|
|
|
+ return true;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 辅检推送疾病
|
|
|
|
+ * @param pushVO
|
|
|
|
+ * @param allDis
|
|
|
|
+ */
|
|
|
|
+ private void pushDisByPacs(NeoPushVO pushVO, List<String> allDis) {
|
|
|
|
+ PacsPushVo pacsPushVo = pushVO.getPacsPushVo();
|
|
|
|
+ if (pacsPushVo != null) {
|
|
|
|
+ List<Item> pacs = pacsPushVo.getPacs();
|
|
|
|
+ if (ListUtil.isNotEmpty(pacs)) {
|
|
|
|
+ List<String> pacsNames = pacs.stream().map(x -> x.getUniqueName()).collect(Collectors.toList());
|
|
|
|
+ List<String> allDis_byPacsResult = getDisByPacsResult(pacsNames);
|
|
|
|
+ allDis.addAll(allDis_byPacsResult);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 化验推送疾病
|
|
|
|
+ * @param allDis
|
|
|
|
+ * @param lises
|
|
|
|
+ */
|
|
|
|
+ private void pushDisByLis(List<String> allDis, List<Lis> lises) {
|
|
|
|
+ if (ListUtil.isNotEmpty(lises)) {
|
|
|
|
+ List<String> lis_dis = lises.parallelStream()
|
|
|
|
+ .map(x -> nodeRepository.getDisByLis(x.getName(), x.getUniqueName() + x.getResult()))
|
|
|
|
+ .flatMap(List::stream).collect(Collectors.toList());
|
|
|
|
+ allDis.addAll(lis_dis);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
|
|
- // 如果没有诊断名称,则通过其它信息推送诊断
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 症状和体征推送疾病
|
|
|
|
+ * @param pushVO
|
|
|
|
+ * @param allDis
|
|
|
|
+ */
|
|
|
|
+ private void pushDisBySymptomOrVital(NeoPushVO pushVO, List<String> allDis) {
|
|
ChiefPushVo chiefPushVo = pushVO.getChiefPushVo();
|
|
ChiefPushVo chiefPushVo = pushVO.getChiefPushVo();
|
|
PresentPushVo presentPushVo = pushVO.getPresentPushVo();
|
|
PresentPushVo presentPushVo = pushVO.getPresentPushVo();
|
|
List<String> symptoms = new ArrayList<>();
|
|
List<String> symptoms = new ArrayList<>();
|
|
@@ -292,29 +351,8 @@ public class NeoFacade {
|
|
}
|
|
}
|
|
symptoms = Stream.of(symptom_chief, symptom_present).flatMap(Collection::stream).distinct().collect(Collectors.toList());
|
|
symptoms = Stream.of(symptom_chief, symptom_present).flatMap(Collection::stream).distinct().collect(Collectors.toList());
|
|
//症状、体征推疾病
|
|
//症状、体征推疾病
|
|
- List<String> allDis_bySymptom = getDisBySymptom(symptoms, age, sex);
|
|
|
|
|
|
+ List<String> allDis_bySymptom = getDisBySymptom(symptoms);
|
|
allDis.addAll(allDis_bySymptom);
|
|
allDis.addAll(allDis_bySymptom);
|
|
- //化验推出的疾病
|
|
|
|
- if (ListUtil.isNotEmpty(lises)) {
|
|
|
|
- List<String> lis_dis = lises.parallelStream()
|
|
|
|
- .map(x -> nodeRepository.getDisByLis(x.getName(), x.getUniqueName() + x.getResult()))
|
|
|
|
- .flatMap(List::stream).collect(Collectors.toList());
|
|
|
|
- allDis.addAll(lis_dis);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- //辅检推出的疾病
|
|
|
|
- PacsPushVo pacsPushVo = pushVO.getPacsPushVo();
|
|
|
|
- if (pacsPushVo != null) {
|
|
|
|
- List<Item> pacs = pacsPushVo.getPacs();
|
|
|
|
- if (ListUtil.isNotEmpty(pacs)) {
|
|
|
|
- List<String> pacsNames = pacs.stream().map(x -> x.getUniqueName()).collect(Collectors.toList());
|
|
|
|
- List<String> allDis_byPacsResult = getDisByPacsResult(pacsNames, age, sex);
|
|
|
|
- allDis.addAll(allDis_byPacsResult);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- filterAndSort(neoPushDTOS, allDis, sex, age);
|
|
|
|
-
|
|
|
|
- return neoPushDTOS;
|
|
|
|
}
|
|
}
|
|
|
|
|
|
private void filterAndSort(List<NeoPushDTO> neoPushDTOS, List<String> allDis, int gender_code, double age) {
|
|
private void filterAndSort(List<NeoPushDTO> neoPushDTOS, List<String> allDis, int gender_code, double age) {
|
|
@@ -352,17 +390,17 @@ public class NeoFacade {
|
|
});
|
|
});
|
|
}
|
|
}
|
|
|
|
|
|
- public List<String> getDisBySymptom(List<String> symptoms, Double age, Integer sex) {
|
|
|
|
|
|
+ public List<String> getDisBySymptom(List<String> symptoms) {
|
|
List<String> symptomCache = getSymptomCache();
|
|
List<String> symptomCache = getSymptomCache();
|
|
//取交集
|
|
//取交集
|
|
symptoms.retainAll(symptomCache);
|
|
symptoms.retainAll(symptomCache);
|
|
long start = System.currentTimeMillis();
|
|
long start = System.currentTimeMillis();
|
|
- List<String> allDis_bySymptom = pushDisBySymptom(symptomNameRepository, symptoms, age, sex);
|
|
|
|
|
|
+ List<String> allDis_bySymptom = pushDisBySymptom(symptomNameRepository, symptoms);
|
|
long end = System.currentTimeMillis();
|
|
long end = System.currentTimeMillis();
|
|
return allDis_bySymptom;
|
|
return allDis_bySymptom;
|
|
}
|
|
}
|
|
|
|
|
|
- public List<String> getDisByPacsResult(List<String> pacsResult, Double age, Integer sex) {
|
|
|
|
|
|
+ public List<String> getDisByPacsResult(List<String> pacsResult) {
|
|
|
|
|
|
/*List<PacsResult> byNameIn = pacsResultRepository.findByNameIn(pacsResult);
|
|
/*List<PacsResult> byNameIn = pacsResultRepository.findByNameIn(pacsResult);
|
|
List<String> allDis = byNameIn.stream()
|
|
List<String> allDis = byNameIn.stream()
|
|
@@ -380,7 +418,7 @@ public class NeoFacade {
|
|
* @param symptoms
|
|
* @param symptoms
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
- public List<String> pushDisBySymptom(SymptomNameRepository symptomNameRepository, List<String> symptoms, Double age, Integer sex) {
|
|
|
|
|
|
+ public List<String> pushDisBySymptom(SymptomNameRepository symptomNameRepository, List<String> symptoms) {
|
|
List<String> allDis = Lists.newArrayList();
|
|
List<String> allDis = Lists.newArrayList();
|
|
/*List<Symptom> byNameIn = symptomNameRepository.findByNameIn(symptoms);
|
|
/*List<Symptom> byNameIn = symptomNameRepository.findByNameIn(symptoms);
|
|
allDis = byNameIn.parallelStream()
|
|
allDis = byNameIn.parallelStream()
|