|
@@ -51,6 +51,8 @@ public class NeoFacade {
|
|
@Autowired
|
|
@Autowired
|
|
PacsNameRepository pacsNameRepository;
|
|
PacsNameRepository pacsNameRepository;
|
|
@Autowired
|
|
@Autowired
|
|
|
|
+ PacsSubNameRepository pacsSubNameRepository;
|
|
|
|
+ @Autowired
|
|
LisNameRepository lisNameRepository;
|
|
LisNameRepository lisNameRepository;
|
|
@Autowired
|
|
@Autowired
|
|
LisSetRepository lisSetRepository;
|
|
LisSetRepository lisSetRepository;
|
|
@@ -225,6 +227,22 @@ public class NeoFacade {
|
|
Integer sex = pushVO.getSex();
|
|
Integer sex = pushVO.getSex();
|
|
List<NeoPushDTO> neoPushDTOS = new ArrayList<>();
|
|
List<NeoPushDTO> neoPushDTOS = new ArrayList<>();
|
|
List<String> allDis = Lists.newArrayList();
|
|
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();
|
|
ChiefPushVo chiefPushVo = pushVO.getChiefPushVo();
|
|
PresentPushVo presentPushVo = pushVO.getPresentPushVo();
|
|
PresentPushVo presentPushVo = pushVO.getPresentPushVo();
|
|
@@ -246,19 +264,18 @@ public class NeoFacade {
|
|
List<String> allDis_bySymptom = getDisBySymptom(symptoms,age,sex);
|
|
List<String> allDis_bySymptom = getDisBySymptom(symptoms,age,sex);
|
|
allDis.addAll(allDis_bySymptom);
|
|
allDis.addAll(allDis_bySymptom);
|
|
//化验推出的疾病
|
|
//化验推出的疾病
|
|
- LisPushVo lisPushVo = pushVO.getLisPushVo();
|
|
|
|
- if(lisPushVo != null){
|
|
|
|
- List<Lis> lises = lisPushVo.getLises();
|
|
|
|
|
|
+
|
|
if(ListUtil.isNotEmpty(lises)){
|
|
if(ListUtil.isNotEmpty(lises)){
|
|
- List<YiBaoDiseaseName> collect = lises.parallelStream()
|
|
|
|
- .map(x -> nodeRepository.getDisByLis(x.getUniqueName(), x.getDetailName())).collect(Collectors.toList());
|
|
|
|
- List<String> lis_dis = lises.parallelStream()
|
|
|
|
|
|
+ /*List<String> lis_dis = lises.parallelStream()
|
|
.map(x -> nodeRepository.getDisByLis(x.getUniqueName(), x.getDetailName()))
|
|
.map(x -> nodeRepository.getDisByLis(x.getUniqueName(), x.getDetailName()))
|
|
.filter(z->z!=null && NeoUtil.matchBasic(z,sex,age)).map(z->z.getName())
|
|
.filter(z->z!=null && NeoUtil.matchBasic(z,sex,age)).map(z->z.getName())
|
|
- .collect(Collectors.toList());
|
|
|
|
|
|
+ .collect(Collectors.toList());*/
|
|
|
|
+ List<String> lis_dis = lises.parallelStream()
|
|
|
|
+ .map(x -> nodeRepository.getDisByLis(x.getUniqueName(), x.getDetailName()))
|
|
|
|
+ .flatMap(List::stream).collect(Collectors.toList());
|
|
allDis.addAll(lis_dis);
|
|
allDis.addAll(lis_dis);
|
|
}
|
|
}
|
|
- }
|
|
|
|
|
|
+
|
|
//辅检推出的疾病
|
|
//辅检推出的疾病
|
|
PacsPushVo pacsPushVo = pushVO.getPacsPushVo();
|
|
PacsPushVo pacsPushVo = pushVO.getPacsPushVo();
|
|
if(pacsPushVo !=null){
|
|
if(pacsPushVo !=null){
|
|
@@ -269,31 +286,22 @@ public class NeoFacade {
|
|
allDis.addAll(allDis_byPacsResult);
|
|
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<Long,List<String>> numberDiseasesMap = disCountSort(allDis);
|
|
//根据发病率排序
|
|
//根据发病率排序
|
|
Map<String, Double> disdistributionCache = self.getDisdistributionCache();
|
|
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<>();
|
|
Map<Long,Map<String,Double>> disPack = new LinkedHashMap<>();
|
|
numberDiseasesMap.forEach((x,y)->{
|
|
numberDiseasesMap.forEach((x,y)->{
|
|
Map<String, Double> collect = y.stream()
|
|
Map<String, Double> collect = y.stream()
|
|
.collect(Collectors.toMap(v -> v, v -> disdistributionCache.get(v) != null?disdistributionCache.get(v):0.0, (e1, e2) -> e2));
|
|
.collect(Collectors.toMap(v -> v, v -> disdistributionCache.get(v) != null?disdistributionCache.get(v):0.0, (e1, e2) -> e2));
|
|
disPack.put(x,collect);
|
|
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)->{
|
|
disPack.forEach((x,y)->{
|
|
Map<String, Double> collect = y.entrySet().stream()
|
|
Map<String, Double> collect = y.entrySet().stream()
|
|
.sorted(Collections.reverseOrder(Map.Entry.comparingByValue()))
|
|
.sorted(Collections.reverseOrder(Map.Entry.comparingByValue()))
|
|
@@ -307,8 +315,6 @@ public class NeoFacade {
|
|
neoPushDTOS.add(neoPushDTO);
|
|
neoPushDTOS.add(neoPushDTO);
|
|
});
|
|
});
|
|
});
|
|
});
|
|
-
|
|
|
|
- return neoPushDTOS;
|
|
|
|
}
|
|
}
|
|
|
|
|
|
public List<String> getDisBySymptom(List<String> symptoms,Double age,Integer sex){
|
|
public List<String> getDisBySymptom(List<String> symptoms,Double age,Integer sex){
|
|
@@ -322,6 +328,7 @@ public class NeoFacade {
|
|
}
|
|
}
|
|
|
|
|
|
public List<String> getDisByPacsResult(List<String> pacsResult,Double age,Integer sex){
|
|
public List<String> getDisByPacsResult(List<String> pacsResult,Double age,Integer sex){
|
|
|
|
+
|
|
List<PacsResult> byNameIn = pacsResultRepository.findByNameIn(pacsResult);
|
|
List<PacsResult> byNameIn = pacsResultRepository.findByNameIn(pacsResult);
|
|
List<String> allDis = byNameIn.stream()
|
|
List<String> allDis = byNameIn.stream()
|
|
.map(z -> z.getDisease().stream().filter(o -> NeoUtil.matchBasic(o,sex,age)).map(y -> y.getName()).collect(Collectors.toList())).flatMap(List::stream)
|
|
.map(z -> z.getDisease().stream().filter(o -> NeoUtil.matchBasic(o,sex,age)).map(y -> y.getName()).collect(Collectors.toList())).flatMap(List::stream)
|
|
@@ -339,10 +346,11 @@ public class NeoFacade {
|
|
*/
|
|
*/
|
|
public List<String> pushDisBySymptom(SymptomNameRepository symptomNameRepository,List<String> symptoms,Double age,Integer sex){
|
|
public List<String> pushDisBySymptom(SymptomNameRepository symptomNameRepository,List<String> symptoms,Double age,Integer sex){
|
|
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()
|
|
.map(z -> z.getDisease().stream().filter(o -> NeoUtil.matchBasic(o,sex,age)).map(y -> y.getName()).collect(Collectors.toList())).flatMap(List::stream)
|
|
.map(z -> z.getDisease().stream().filter(o -> NeoUtil.matchBasic(o,sex,age)).map(y -> y.getName()).collect(Collectors.toList())).flatMap(List::stream)
|
|
- .collect(Collectors.toList());
|
|
|
|
|
|
+ .collect(Collectors.toList());*/
|
|
|
|
+ allDis = symptomNameRepository.getDisBySymptoms(symptoms);
|
|
return allDis;
|
|
return allDis;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -589,6 +597,9 @@ public class NeoFacade {
|
|
PacsNameNode pacsNode = new PacsNameNode();
|
|
PacsNameNode pacsNode = new PacsNameNode();
|
|
List<BillNeoDTO> billNeoDTOs = pacsNode.getPacsBill(pacsterm, pacsNameRepository);
|
|
List<BillNeoDTO> billNeoDTOs = pacsNode.getPacsBill(pacsterm, pacsNameRepository);
|
|
|
|
|
|
|
|
+ PacsSubNameNode pacsSubNode = new PacsSubNameNode();
|
|
|
|
+ billNeoDTOs.addAll(pacsSubNode.getSubPacsBill(pacsterm, pacsSubNameRepository));
|
|
|
|
+
|
|
return billNeoDTOs;
|
|
return billNeoDTOs;
|
|
}
|
|
}
|
|
|
|
|