|
@@ -29,6 +29,7 @@ import com.diagbot.vo.neoPushEntity.*;
|
|
import com.google.common.collect.Lists;
|
|
import com.google.common.collect.Lists;
|
|
import com.google.common.collect.Maps;
|
|
import com.google.common.collect.Maps;
|
|
import io.github.lvyahui8.spring.facade.DataFacade;
|
|
import io.github.lvyahui8.spring.facade.DataFacade;
|
|
|
|
+import org.apache.commons.collections.MapUtils;
|
|
import org.springframework.beans.BeanUtils;
|
|
import org.springframework.beans.BeanUtils;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Qualifier;
|
|
import org.springframework.beans.factory.annotation.Qualifier;
|
|
@@ -176,6 +177,18 @@ public class NeoFacade {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ public void vitalCache() {
|
|
|
|
+ List<String> diseaseProperty = nodeRepository.getVitalClass();
|
|
|
|
+ if (ListUtil.isNotEmpty(diseaseProperty)) {
|
|
|
|
+ Map map = diseaseProperty.stream().collect(Collectors.toMap(
|
|
|
|
+ k -> RedisEnum.vitalType.getName() + k,
|
|
|
|
+ v -> v,
|
|
|
|
+ (v1, v2) -> (v2)
|
|
|
|
+ ));
|
|
|
|
+ redisTemplate.opsForValue().multiSet(map);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
public void symptomNumCache() {
|
|
public void symptomNumCache() {
|
|
List<SymptomNumOfDiS> diseaseProperty = nodeRepository.getSymptomNum();
|
|
List<SymptomNumOfDiS> diseaseProperty = nodeRepository.getSymptomNum();
|
|
if (ListUtil.isNotEmpty(diseaseProperty)) {
|
|
if (ListUtil.isNotEmpty(diseaseProperty)) {
|
|
@@ -285,88 +298,109 @@ public class NeoFacade {
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
public List<String> getPush(NeoPushVO pushVO) {
|
|
public List<String> getPush(NeoPushVO pushVO) {
|
|
|
|
+ List<String> pushDis = Lists.newArrayList();
|
|
|
|
+ List<String> pushSpeDis = Lists.newArrayList();
|
|
|
|
+ //年龄
|
|
Double age = pushVO.getAgeNum();
|
|
Double age = pushVO.getAgeNum();
|
|
|
|
+ //性别
|
|
Integer sex = pushVO.getSex();
|
|
Integer sex = pushVO.getSex();
|
|
- List<String> depts = pushVO.getDept();
|
|
|
|
- List<String> presentDiags = Lists.newArrayList();
|
|
|
|
- PresentPushVo presentPushVo = pushVO.getPresentPushVo();
|
|
|
|
- ChiefPushVo chiefPushVo = pushVO.getChiefPushVo();
|
|
|
|
- if (presentPushVo != null) {
|
|
|
|
- List<Diag> diags = presentPushVo.getDiags();
|
|
|
|
- if (ListUtil.isNotEmpty(diags)) {
|
|
|
|
- presentDiags = diags.stream().map(x -> x.getName()).collect(Collectors.toList());
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- if (chiefPushVo != null) {
|
|
|
|
- List<Diag> diags = chiefPushVo.getDiags();
|
|
|
|
- if (ListUtil.isNotEmpty(diags)) {
|
|
|
|
- List<String> collect = diags.stream().map(x -> x.getName()).collect(Collectors.toList());
|
|
|
|
- presentDiags.retainAll(collect);
|
|
|
|
- presentDiags.addAll(collect);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+ //主诉中第一个时间
|
|
List<PD> pds = pushVO.getChiefPushVo().getPds();
|
|
List<PD> pds = pushVO.getChiefPushVo().getPds();
|
|
PD pd = null;
|
|
PD pd = null;
|
|
if (ListUtil.isNotEmpty(pds)) {
|
|
if (ListUtil.isNotEmpty(pds)) {
|
|
pd = pds.get(0);
|
|
pd = pds.get(0);
|
|
}
|
|
}
|
|
- List<String> pushDis = new ArrayList<>();
|
|
|
|
- List<String> allDis = Lists.newArrayList();
|
|
|
|
- //如果化验有特异性就直接推送疾病
|
|
|
|
- List<Lis> lises = null;
|
|
|
|
- LisPushVo lisPushVo = pushVO.getLisPushVo();
|
|
|
|
- if (lisPushVo != null) {
|
|
|
|
- lises = lisPushVo.getLises();
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- pushDis = pushDisBySpecialLis(depts,age, sex, pd, lises, presentDiags);
|
|
|
|
- if (ListUtil.isNotEmpty(pushDis)) {
|
|
|
|
- return pushDis;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- /*// 症状、体征推送出的疾病
|
|
|
|
- pushDisBySymptomOrVital(pushVO, allDis);
|
|
|
|
- //化验推出的疾病
|
|
|
|
- pushDisByLis(allDis, lises);
|
|
|
|
- //辅检推出的疾病
|
|
|
|
- pushDisByPacs(pushVO, allDis);*/
|
|
|
|
|
|
+ //科室
|
|
|
|
+ List<String> depts = pushVO.getDept();
|
|
|
|
+ //初步诊断
|
|
|
|
+ List<String> disByDiag = getDisByDiag(pushVO);
|
|
|
|
+ //现病史拟诊
|
|
|
|
+ List<String> presentDiags = getDisByPresent(pushVO);
|
|
|
|
+ //主诉中提取的诊断
|
|
|
|
+ List<String> chiefDiags = getDiseaseByChief(pushVO);
|
|
|
|
+ //化验特异性诊断
|
|
|
|
+ List<String> pushDisByLis = pushDisBySpecialLis(pushVO);
|
|
|
|
+ //辅检特异性诊断
|
|
|
|
+ List<String> pushDisByPacs = pushDisByPacs(pushVO);
|
|
|
|
|
|
|
|
+ List<String> allDis = Lists.newArrayList();
|
|
try {
|
|
try {
|
|
Map<String, Object> invokeParams = new HashMap<>();
|
|
Map<String, Object> invokeParams = new HashMap<>();
|
|
- invokeParams.put("allDis", allDis);
|
|
|
|
invokeParams.put("pushVo", pushVO);
|
|
invokeParams.put("pushVo", pushVO);
|
|
- invokeParams.put("lis", lises);
|
|
|
|
allDis = DataFacade.get("pushAll", invokeParams, List.class);
|
|
allDis = DataFacade.get("pushAll", invokeParams, List.class);
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "并行推送疾病出错" + e.getMessage());
|
|
throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "并行推送疾病出错" + e.getMessage());
|
|
}
|
|
}
|
|
|
|
|
|
filterAndSort(pushDis, allDis, sex, age, pd,depts);
|
|
filterAndSort(pushDis, allDis, sex, age, pd,depts);
|
|
- pushDis = addDiagFromPresent(pushDis, presentDiags);
|
|
|
|
|
|
+ //特异值推送的诊断添加到症状推送诊断的头部
|
|
|
|
+ pushDisByPacs.removeAll(pushDisByLis);
|
|
|
|
+ pushDisByLis.addAll(pushDisByPacs);
|
|
|
|
+ filterAndSort(pushSpeDis,pushDisByLis, sex, age, pd,depts);
|
|
|
|
+ pushDis.removeAll(pushSpeDis);
|
|
|
|
+ pushSpeDis.addAll(pushDis);
|
|
|
|
+
|
|
|
|
+ //初步诊断、现病史拟诊、主诉诊断添加头部
|
|
|
|
+ chiefDiags.removeAll(presentDiags);
|
|
|
|
+ presentDiags.addAll(chiefDiags);
|
|
|
|
+ presentDiags.removeAll(disByDiag);
|
|
|
|
+ disByDiag.addAll(presentDiags);
|
|
|
|
+
|
|
|
|
+ pushSpeDis.removeAll(disByDiag);
|
|
|
|
+ disByDiag.addAll(pushSpeDis);
|
|
|
|
+
|
|
|
|
+ return disByDiag;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ private List<String> getDiseaseByChief(NeoPushVO pushVO) {
|
|
|
|
+ List<String> chiefDiags = Lists.newArrayList();
|
|
|
|
+ ChiefPushVo chiefPushVo = pushVO.getChiefPushVo();
|
|
|
|
+ if (chiefPushVo != null) {
|
|
|
|
+ List<Diag> diags = chiefPushVo.getDiags();
|
|
|
|
+ if (ListUtil.isNotEmpty(diags)) {
|
|
|
|
+ chiefDiags = diags.stream().map(x -> x.getName()).collect(Collectors.toList());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return chiefDiags;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ private List<String> getDisByPresent(NeoPushVO pushVO) {
|
|
|
|
+ List<String> presentDiags = Lists.newArrayList();
|
|
|
|
+ PresentPushVo presentPushVo = pushVO.getPresentPushVo();
|
|
|
|
+ if (presentPushVo != null) {
|
|
|
|
+ List<Diag> diags = presentPushVo.getDiags();
|
|
|
|
+ if (ListUtil.isNotEmpty(diags)) {
|
|
|
|
+ presentDiags = diags.stream().map(x -> x.getName()).collect(Collectors.toList());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return presentDiags;
|
|
|
|
+ }
|
|
|
|
|
|
- return pushDis;
|
|
|
|
|
|
+ private List<String> getDisByDiag(NeoPushVO pushVO) {
|
|
|
|
+ List<String> diags = Lists.newArrayList();
|
|
|
|
+ if (pushVO.getDiagVo() != null && ListUtil.isNotEmpty(pushVO.getDiagVo().getDiags())) {
|
|
|
|
+ diags = pushVO.getDiagVo().getDiags().stream().map(x -> x.getName()).collect(Collectors.toList());
|
|
|
|
+ }
|
|
|
|
+ return diags;
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
* 化验特异性推送疾病
|
|
* 化验特异性推送疾病
|
|
- *
|
|
|
|
- * @param age
|
|
|
|
- * @param sex
|
|
|
|
- * @param
|
|
|
|
- * @param lises
|
|
|
|
|
|
+ * @param pushVO
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
- public List<String> pushDisBySpecialLis(List<String> depts, Double age, Integer sex, PD pd, List<Lis> lises, List<String> presentDiags) {
|
|
|
|
|
|
+ public List<String> pushDisBySpecialLis(NeoPushVO pushVO) {
|
|
|
|
+ List<Lis> lises = null;
|
|
|
|
+ LisPushVo lisPushVo = pushVO.getLisPushVo();
|
|
|
|
+ if (lisPushVo != null) {
|
|
|
|
+ lises = lisPushVo.getLises();
|
|
|
|
+ }
|
|
List<String> neoPushDTOS = new ArrayList<>();
|
|
List<String> neoPushDTOS = new ArrayList<>();
|
|
if (ListUtil.isNotEmpty(lises)) {
|
|
if (ListUtil.isNotEmpty(lises)) {
|
|
- List<String> lis_dis = lises.parallelStream()
|
|
|
|
|
|
+ neoPushDTOS = lises.parallelStream()
|
|
.map(x -> nodeRepository.getDisByLis_Special(x.getName(), x.getUniqueName() + x.getResult()))
|
|
.map(x -> nodeRepository.getDisByLis_Special(x.getName(), x.getUniqueName() + x.getResult()))
|
|
.flatMap(List::stream).collect(Collectors.toList());
|
|
.flatMap(List::stream).collect(Collectors.toList());
|
|
- if (ListUtil.isNotEmpty(lis_dis)) {
|
|
|
|
- filterAndSort(neoPushDTOS, lis_dis, sex, age, pd, depts);
|
|
|
|
- neoPushDTOS = addDiagFromPresent(neoPushDTOS, presentDiags);
|
|
|
|
- }
|
|
|
|
|
|
+
|
|
}
|
|
}
|
|
return neoPushDTOS;
|
|
return neoPushDTOS;
|
|
}
|
|
}
|
|
@@ -411,33 +445,79 @@ public class NeoFacade {
|
|
* 辅检推送疾病
|
|
* 辅检推送疾病
|
|
*
|
|
*
|
|
* @param pushVO
|
|
* @param pushVO
|
|
- * @param allDis
|
|
|
|
*/
|
|
*/
|
|
- public void pushDisByPacs(NeoPushVO pushVO, List<String> allDis) {
|
|
|
|
|
|
+ public List<String> pushDisByPacs(NeoPushVO pushVO) {
|
|
|
|
+ List<String> allDis_byPacsResult = Lists.newArrayList();
|
|
PacsPushVo pacsPushVo = pushVO.getPacsPushVo();
|
|
PacsPushVo pacsPushVo = pushVO.getPacsPushVo();
|
|
if (pacsPushVo != null) {
|
|
if (pacsPushVo != null) {
|
|
List<Item> pacs = pacsPushVo.getPacs();
|
|
List<Item> pacs = pacsPushVo.getPacs();
|
|
if (ListUtil.isNotEmpty(pacs)) {
|
|
if (ListUtil.isNotEmpty(pacs)) {
|
|
List<String> pacsNames = pacs.stream().map(x -> x.getUniqueName()).collect(Collectors.toList());
|
|
List<String> pacsNames = pacs.stream().map(x -> x.getUniqueName()).collect(Collectors.toList());
|
|
- List<String> allDis_byPacsResult = getDisByPacsResult(pacsNames);
|
|
|
|
- allDis.addAll(allDis_byPacsResult);
|
|
|
|
|
|
+ allDis_byPacsResult = pacsResultRepository.getDisByPacsResults(pacsNames);;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return allDis_byPacsResult;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 根据主症状推送诊断
|
|
|
|
+ * @param pushVO
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ public List<String> pushDisBySymptom_main(NeoPushVO pushVO) {
|
|
|
|
+ List<String> disBySymptom_main = Lists.newArrayList();
|
|
|
|
+ List<String> symptoms = getSymptoms(pushVO);
|
|
|
|
+ if(ListUtil.isNotEmpty(symptoms)){
|
|
|
|
+ String s_m = symptoms.get(0);
|
|
|
|
+ disBySymptom_main = nodeRepository.getDisBySymptom_main(s_m);
|
|
|
|
+ if(ListUtil.isEmpty(disBySymptom_main) && ListUtil.isNotEmpty(pushVO.getSymptoms())){
|
|
|
|
+ String s_second = pushVO.getSymptoms().get(0);
|
|
|
|
+ disBySymptom_main = nodeRepository.getDisBySymptom_main(s_second);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return disBySymptom_main;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public List<String> getSymptoms(NeoPushVO pushVO){
|
|
|
|
+ List<String> symptom_chief = Lists.newArrayList();
|
|
|
|
+ List<String> symptom_present = Lists.newArrayList();
|
|
|
|
+ ChiefPushVo chiefPushVo = pushVO.getChiefPushVo();
|
|
|
|
+ PresentPushVo presentPushVo = pushVO.getPresentPushVo();
|
|
|
|
+ if(chiefPushVo != null){
|
|
|
|
+ List<Symptom> symptoms = chiefPushVo.getSymptoms();
|
|
|
|
+ if(ListUtil.isNotEmpty(symptoms)){
|
|
|
|
+ symptom_chief = symptoms.stream().map(x -> x.getName()).collect(Collectors.toList());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ if(presentPushVo != null){
|
|
|
|
+ List<Symptom> symptoms = presentPushVo.getSymptoms();
|
|
|
|
+ if(ListUtil.isNotEmpty(symptoms)){
|
|
|
|
+ symptom_present = symptoms.stream().map(x -> x.getName()).collect(Collectors.toList());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ symptom_present.removeAll(symptom_chief);
|
|
|
|
+ symptom_chief.addAll(symptom_present);
|
|
|
|
+ return symptom_chief;
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
* 化验推送疾病
|
|
* 化验推送疾病
|
|
*
|
|
*
|
|
- * @param allDis
|
|
|
|
- * @param lises
|
|
|
|
|
|
+ * @param pushVO
|
|
*/
|
|
*/
|
|
- public void pushDisByLis(List<String> allDis, List<Lis> lises) {
|
|
|
|
|
|
+ public List<String> pushDisByLis(NeoPushVO pushVO) {
|
|
|
|
+ List<String> lis_dis = Lists.newArrayList();
|
|
|
|
+ List<Lis> lises = null;
|
|
|
|
+ LisPushVo lisPushVo = pushVO.getLisPushVo();
|
|
|
|
+ if (lisPushVo != null) {
|
|
|
|
+ lises = lisPushVo.getLises();
|
|
|
|
+ }
|
|
if (ListUtil.isNotEmpty(lises)) {
|
|
if (ListUtil.isNotEmpty(lises)) {
|
|
- List<String> lis_dis = lises.parallelStream()
|
|
|
|
|
|
+ lis_dis = lises.parallelStream()
|
|
.map(x -> nodeRepository.getDisByLis(x.getName(), x.getUniqueName() + x.getResult()))
|
|
.map(x -> nodeRepository.getDisByLis(x.getName(), x.getUniqueName() + x.getResult()))
|
|
.flatMap(List::stream).collect(Collectors.toList());
|
|
.flatMap(List::stream).collect(Collectors.toList());
|
|
- allDis.addAll(lis_dis);
|
|
|
|
}
|
|
}
|
|
|
|
+ return lis_dis;
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -469,6 +549,43 @@ public class NeoFacade {
|
|
allDis.addAll(allDis_bySymptom);
|
|
allDis.addAll(allDis_bySymptom);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ public List<String> getDisBySymptom_other(NeoPushVO pushVO){
|
|
|
|
+ List<String> disBySymptoms_1 = Lists.newArrayList();
|
|
|
|
+ List<String> symptoms = getSymptoms(pushVO);
|
|
|
|
+ if(ListUtil.isNotEmpty(symptoms) && symptoms.size() > 2){
|
|
|
|
+ symptoms = symptoms.size() >= 5?symptoms.subList(1,5):symptoms;
|
|
|
|
+ List<String> sv = redisUtil.getSv(symptoms,RedisEnum.symptomVitalType.getName());
|
|
|
|
+ disBySymptoms_1 = symptomRepository.getDisBySymptoms_1(sv);
|
|
|
|
+ }
|
|
|
|
+ return disBySymptoms_1;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public List<String> getDisByVital(NeoPushVO pushVO){
|
|
|
|
+ List<String> disByVital = Lists.newArrayList();
|
|
|
|
+ List<String> symptoms = getSymptoms(pushVO);
|
|
|
|
+ if(ListUtil.isNotEmpty(symptoms)){
|
|
|
|
+ List<String> sv = redisUtil.getSv(symptoms,RedisEnum.vitalType.getName());
|
|
|
|
+ disByVital = symptomRepository.getDisByVital(sv);
|
|
|
|
+ }
|
|
|
|
+ return disByVital;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public List<String> getDisByLis_other(NeoPushVO pushVO){
|
|
|
|
+ List<Lis> lises = null;
|
|
|
|
+ LisPushVo lisPushVo = pushVO.getLisPushVo();
|
|
|
|
+ if (lisPushVo != null) {
|
|
|
|
+ lises = lisPushVo.getLises();
|
|
|
|
+ }
|
|
|
|
+ List<String> neoPushDTOS = new ArrayList<>();
|
|
|
|
+ if (ListUtil.isNotEmpty(lises)) {
|
|
|
|
+ neoPushDTOS = lises.parallelStream()
|
|
|
|
+ .map(x -> nodeRepository.getDisByLis_Other(x.getName(), x.getUniqueName() + x.getResult()))
|
|
|
|
+ .flatMap(List::stream).collect(Collectors.toList());
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ return neoPushDTOS;
|
|
|
|
+ }
|
|
|
|
+
|
|
public void filterAndSort(List<String> dises, List<String> allDis, int gender_code, double age, PD pd, List<String> depts) {
|
|
public void filterAndSort(List<String> dises, List<String> allDis, int gender_code, double age, PD pd, List<String> depts) {
|
|
//推送出的所有疾病进行性别和年龄的过滤
|
|
//推送出的所有疾病进行性别和年龄的过滤
|
|
List<Map<String, String>> diseases = null;
|
|
List<Map<String, String>> diseases = null;
|
|
@@ -479,52 +596,48 @@ public class NeoFacade {
|
|
allDis = diseases.stream().filter(x -> NeoUtil.matchBasic(x, gender_code, age) && NeoUtil.matchPds(x.get("name"), pd)
|
|
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());
|
|
&& 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"))));
|
|
// 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)){
|
|
if(ListUtil.isNotEmpty(symptomNumOfDis)){
|
|
symptomNumOfDis.forEach(x -> {
|
|
symptomNumOfDis.forEach(x -> {
|
|
String name = x.get("name");
|
|
String name = x.get("name");
|
|
Integer num = Integer.parseInt(x.get("num"));
|
|
Integer num = Integer.parseInt(x.get("num"));
|
|
dis_symptom_num.put(name,num);
|
|
dis_symptom_num.put(name,num);
|
|
});
|
|
});
|
|
- }
|
|
|
|
|
|
+ }*/
|
|
}
|
|
}
|
|
|
|
|
|
Map<Long, List<String>> numberDiseasesMap = disCountSort(allDis);
|
|
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<String, Double> disdistributionCache = self.getDisdistributionCache();
|
|
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 -> dis_fbl.get(v), (e1, e2) -> e2));
|
|
|
|
.collect(Collectors.toMap(v -> v, v -> Double.valueOf(dis_symptom_num.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.put(x, collect);
|
|
});
|
|
});
|
|
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()))
|
|
- .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()
|
|
Map<String, Double> collect = y.entrySet().stream()
|
|
.sorted(Map.Entry.comparingByValue())
|
|
.sorted(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));
|
|
disPack.put(x, collect);
|
|
disPack.put(x, collect);
|
|
collect.forEach((k, n) -> {
|
|
collect.forEach((k, n) -> {
|
|
- /*NeoPushDTO neoPushDTO = new NeoPushDTO();
|
|
|
|
- PushBaseDTO pushBaseDTO = new PushBaseDTO();
|
|
|
|
- pushBaseDTO.setName(k);
|
|
|
|
- neoPushDTO.setDisease(pushBaseDTO);
|
|
|
|
- neoPushDTOS.add(neoPushDTO);*/
|
|
|
|
dises.add(k);
|
|
dises.add(k);
|
|
});
|
|
});
|
|
- });
|
|
|
|
|
|
+ });*/
|
|
}
|
|
}
|
|
|
|
|
|
public List<String> getDisBySymptom(List<String> symptoms) {
|
|
public List<String> getDisBySymptom(List<String> symptoms) {
|
|
- List<String> sv = redisUtil.getSv(symptoms);
|
|
|
|
-// List<String> symptomCache = getSymptomCache();
|
|
|
|
-// //取交集
|
|
|
|
-// symptoms.retainAll(symptomCache);
|
|
|
|
|
|
+ List<String> sv = redisUtil.getSv(symptoms,RedisEnum.symptomVitalType.getName());
|
|
List<String> allDis_bySymptom = pushDisBySymptom(symptomRepository, sv);
|
|
List<String> allDis_bySymptom = pushDisBySymptom(symptomRepository, sv);
|
|
return allDis_bySymptom;
|
|
return allDis_bySymptom;
|
|
}
|
|
}
|