|
@@ -285,54 +285,32 @@ public class NeoFacade {
|
|
|
* @return
|
|
|
*/
|
|
|
public List<String> getPush(NeoPushVO pushVO) {
|
|
|
+ List<String> pushDis = Lists.newArrayList();
|
|
|
+ //年龄
|
|
|
Double age = pushVO.getAgeNum();
|
|
|
+ //性别
|
|
|
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();
|
|
|
PD pd = null;
|
|
|
if (ListUtil.isNotEmpty(pds)) {
|
|
|
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);
|
|
|
|
|
|
- try {
|
|
|
+ List<String> allDis = Lists.newArrayList();
|
|
|
+ /*try {
|
|
|
Map<String, Object> invokeParams = new HashMap<>();
|
|
|
invokeParams.put("allDis", allDis);
|
|
|
invokeParams.put("pushVo", pushVO);
|
|
@@ -340,7 +318,7 @@ public class NeoFacade {
|
|
|
allDis = DataFacade.get("pushAll", invokeParams, List.class);
|
|
|
} catch (Exception e) {
|
|
|
throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "并行推送疾病出错" + e.getMessage());
|
|
|
- }
|
|
|
+ }*/
|
|
|
|
|
|
filterAndSort(pushDis, allDis, sex, age, pd,depts);
|
|
|
pushDis = addDiagFromPresent(pushDis, presentDiags);
|
|
@@ -348,25 +326,55 @@ public class NeoFacade {
|
|
|
return pushDis;
|
|
|
}
|
|
|
|
|
|
+ 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;
|
|
|
+ }
|
|
|
+
|
|
|
+ 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
|
|
|
*/
|
|
|
- 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<>();
|
|
|
if (ListUtil.isNotEmpty(lises)) {
|
|
|
- List<String> lis_dis = lises.parallelStream()
|
|
|
+ neoPushDTOS = lises.parallelStream()
|
|
|
.map(x -> nodeRepository.getDisByLis_Special(x.getName(), x.getUniqueName() + x.getResult()))
|
|
|
.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;
|
|
|
}
|
|
@@ -411,33 +419,75 @@ public class NeoFacade {
|
|
|
* 辅检推送疾病
|
|
|
*
|
|
|
* @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();
|
|
|
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);
|
|
|
+ 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);
|
|
|
+ }
|
|
|
+ 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)) {
|
|
|
- List<String> lis_dis = lises.parallelStream()
|
|
|
+ lis_dis = lises.parallelStream()
|
|
|
.map(x -> nodeRepository.getDisByLis(x.getName(), x.getUniqueName() + x.getResult()))
|
|
|
.flatMap(List::stream).collect(Collectors.toList());
|
|
|
- allDis.addAll(lis_dis);
|
|
|
}
|
|
|
+ return lis_dis;
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -469,6 +519,17 @@ public class NeoFacade {
|
|
|
allDis.addAll(allDis_bySymptom);
|
|
|
}
|
|
|
|
|
|
+ public List<String> getDisBySymptom_vital_other(NeoPushVO pushVO){
|
|
|
+ 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());
|
|
|
+ List<String> disBySymptoms_1 = symptomRepository.getDisBySymptoms_1(sv);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
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;
|
|
@@ -521,10 +582,7 @@ public class NeoFacade {
|
|
|
}
|
|
|
|
|
|
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);
|
|
|
return allDis_bySymptom;
|
|
|
}
|