|
@@ -225,6 +225,22 @@ public class NeoFacade {
|
|
|
Integer sex = pushVO.getSex();
|
|
|
List<NeoPushDTO> neoPushDTOS = new ArrayList<>();
|
|
|
List<String> allDis = Lists.newArrayList();
|
|
|
+ //如果化验有特异性就直接推送疾病
|
|
|
+ List<Lis> lises = null;
|
|
|
+ LisPushVo lisPushVo = pushVO.getLisPushVo();
|
|
|
+ if(lisPushVo != null){
|
|
|
+ lises = lisPushVo.getLises();
|
|
|
+ }
|
|
|
+ if(ListUtil.isNotEmpty(lises)){
|
|
|
+ List<String> lis_dis = lises.parallelStream()
|
|
|
+ .map(x -> nodeRepository.getDisByLis_Special(x.getUniqueName(), x.getDetailName()))
|
|
|
+ .flatMap(List::stream).collect(Collectors.toList());
|
|
|
+ filterAndSort(neoPushDTOS,lis_dis);
|
|
|
+ if(ListUtil.isNotEmpty(neoPushDTOS)){
|
|
|
+ return neoPushDTOS;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
// 如果没有诊断名称,则通过其它信息推送诊断
|
|
|
ChiefPushVo chiefPushVo = pushVO.getChiefPushVo();
|
|
|
PresentPushVo presentPushVo = pushVO.getPresentPushVo();
|
|
@@ -246,9 +262,7 @@ public class NeoFacade {
|
|
|
List<String> allDis_bySymptom = getDisBySymptom(symptoms,age,sex);
|
|
|
allDis.addAll(allDis_bySymptom);
|
|
|
//化验推出的疾病
|
|
|
- LisPushVo lisPushVo = pushVO.getLisPushVo();
|
|
|
- if(lisPushVo != null){
|
|
|
- List<Lis> lises = lisPushVo.getLises();
|
|
|
+
|
|
|
if(ListUtil.isNotEmpty(lises)){
|
|
|
/*List<String> lis_dis = lises.parallelStream()
|
|
|
.map(x -> nodeRepository.getDisByLis(x.getUniqueName(), x.getDetailName()))
|
|
@@ -259,7 +273,7 @@ public class NeoFacade {
|
|
|
.flatMap(List::stream).collect(Collectors.toList());
|
|
|
allDis.addAll(lis_dis);
|
|
|
}
|
|
|
- }
|
|
|
+
|
|
|
//辅检推出的疾病
|
|
|
PacsPushVo pacsPushVo = pushVO.getPacsPushVo();
|
|
|
if(pacsPushVo !=null){
|
|
@@ -270,31 +284,22 @@ public class NeoFacade {
|
|
|
allDis.addAll(allDis_byPacsResult);
|
|
|
}
|
|
|
}
|
|
|
+ filterAndSort(neoPushDTOS, allDis);
|
|
|
+
|
|
|
+ return neoPushDTOS;
|
|
|
+ }
|
|
|
|
|
|
+ private void filterAndSort(List<NeoPushDTO> neoPushDTOS, List<String> allDis) {
|
|
|
//推送出的所有疾病进行性别和年龄的过滤
|
|
|
Map<Long,List<String>> numberDiseasesMap = disCountSort(allDis);
|
|
|
//根据发病率排序
|
|
|
Map<String, Double> disdistributionCache = self.getDisdistributionCache();
|
|
|
- /*numberDiseasesMap.forEach((x,y)->{
|
|
|
- y.forEach(z ->{
|
|
|
- if(disdistributionCache.containsKey(z)){
|
|
|
- disdistributionCache.put(z,disdistributionCache.get(z));
|
|
|
- }else {
|
|
|
- disdistributionCache.put(z,0.0);
|
|
|
- }
|
|
|
- });
|
|
|
- });*/
|
|
|
Map<Long,Map<String,Double>> disPack = new LinkedHashMap<>();
|
|
|
numberDiseasesMap.forEach((x,y)->{
|
|
|
Map<String, Double> collect = y.stream()
|
|
|
.collect(Collectors.toMap(v -> v, v -> disdistributionCache.get(v) != null?disdistributionCache.get(v):0.0, (e1, e2) -> e2));
|
|
|
disPack.put(x,collect);
|
|
|
});
|
|
|
- /*numberDiseasesMap.forEach((x,y)->{
|
|
|
- Map<String,Double> dis_dbt = new HashMap<>();
|
|
|
- y.forEach(dis -> dis_dbt.put(dis,disdistributionCache.get(dis)));
|
|
|
- disPack.put(x,dis_dbt);
|
|
|
- });*/
|
|
|
disPack.forEach((x,y)->{
|
|
|
Map<String, Double> collect = y.entrySet().stream()
|
|
|
.sorted(Collections.reverseOrder(Map.Entry.comparingByValue()))
|
|
@@ -308,8 +313,6 @@ public class NeoFacade {
|
|
|
neoPushDTOS.add(neoPushDTO);
|
|
|
});
|
|
|
});
|
|
|
-
|
|
|
- return neoPushDTOS;
|
|
|
}
|
|
|
|
|
|
public List<String> getDisBySymptom(List<String> symptoms,Double age,Integer sex){
|