|
@@ -29,6 +29,7 @@ import com.diagbot.vo.neoPushEntity.*;
|
|
|
import com.google.common.collect.Lists;
|
|
|
import com.google.common.collect.Maps;
|
|
|
import io.github.lvyahui8.spring.facade.DataFacade;
|
|
|
+import org.apache.commons.collections.MapUtils;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Qualifier;
|
|
@@ -591,45 +592,44 @@ public class NeoFacade {
|
|
|
allDis = diseases.stream().filter(x -> NeoUtil.matchBasic(x, gender_code, age) && NeoUtil.matchPds(x.get("name"), pd)
|
|
|
&& NeoUtil.matchDept(x,depts)).map(x -> x.get("name")).collect(Collectors.toList());
|
|
|
// diseases.forEach(x -> dis_fbl.put(x.get("name"), Double.parseDouble(x.get("fbl"))));
|
|
|
- List<Map<String, String>> symptomNumOfDis = redisUtil.getSymptomNumOfDis(allDis);
|
|
|
+ /*List<Map<String, String>> symptomNumOfDis = redisUtil.getSymptomNumOfDis(allDis);
|
|
|
if(ListUtil.isNotEmpty(symptomNumOfDis)){
|
|
|
symptomNumOfDis.forEach(x -> {
|
|
|
String name = x.get("name");
|
|
|
Integer num = Integer.parseInt(x.get("num"));
|
|
|
dis_symptom_num.put(name,num);
|
|
|
});
|
|
|
- }
|
|
|
+ }*/
|
|
|
}
|
|
|
|
|
|
Map<Long, List<String>> numberDiseasesMap = disCountSort(allDis);
|
|
|
- //根据发病率排序
|
|
|
+ if(MapUtils.isNotEmpty(numberDiseasesMap)){
|
|
|
+ for(Map.Entry<Long, List<String>> ds:numberDiseasesMap.entrySet()){
|
|
|
+ dises.addAll(ds.getValue());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ /*//根据发病率排序
|
|
|
// Map<String, Double> disdistributionCache = self.getDisdistributionCache();
|
|
|
Map<Long, Map<String, Double>> disPack = new LinkedHashMap<>();
|
|
|
numberDiseasesMap.forEach((x, y) -> {
|
|
|
Map<String, Double> collect = y.stream()
|
|
|
-// .collect(Collectors.toMap(v -> v, v -> dis_fbl.get(v), (e1, e2) -> e2));
|
|
|
.collect(Collectors.toMap(v -> v, v -> Double.valueOf(dis_symptom_num.get(v)), (e1, e2) -> e2));
|
|
|
disPack.put(x, collect);
|
|
|
});
|
|
|
disPack.forEach((x, y) -> {
|
|
|
//倒序排序
|
|
|
- /*Map<String, Double> collect = y.entrySet().stream()
|
|
|
+ *//*Map<String, Double> collect = y.entrySet().stream()
|
|
|
.sorted(Collections.reverseOrder(Map.Entry.comparingByValue()))
|
|
|
- .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (e1, e2) -> e2, LinkedHashMap::new));*/
|
|
|
+ .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (e1, e2) -> e2, LinkedHashMap::new));*//*
|
|
|
//正序排序
|
|
|
Map<String, Double> collect = y.entrySet().stream()
|
|
|
.sorted(Map.Entry.comparingByValue())
|
|
|
.collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (e1, e2) -> e2, LinkedHashMap::new));
|
|
|
disPack.put(x, collect);
|
|
|
collect.forEach((k, n) -> {
|
|
|
- /*NeoPushDTO neoPushDTO = new NeoPushDTO();
|
|
|
- PushBaseDTO pushBaseDTO = new PushBaseDTO();
|
|
|
- pushBaseDTO.setName(k);
|
|
|
- neoPushDTO.setDisease(pushBaseDTO);
|
|
|
- neoPushDTOS.add(neoPushDTO);*/
|
|
|
dises.add(k);
|
|
|
});
|
|
|
- });
|
|
|
+ });*/
|
|
|
}
|
|
|
|
|
|
public List<String> getDisBySymptom(List<String> symptoms) {
|