Browse Source

反推更新(symptom,vital,lis,pacs)

kongwz 4 years ago
parent
commit
0715f44dac

+ 2 - 2
src/main/java/com/diagbot/entity/node/YiBaoDiseaseName.java

@@ -38,10 +38,10 @@ public class YiBaoDiseaseName extends BaseNode  {
 	@Relationship(type = "医保疾病名称相关体征", direction = Relationship.OUTGOING)
 	@Relationship(type = "医保疾病名称相关体征", direction = Relationship.OUTGOING)
 	private Set<Vital> vitals = new HashSet<>();
 	private Set<Vital> vitals = new HashSet<>();
 
 
-	@Relationship(type = "实验室检查相关医保疾病名称", direction = Relationship.INCOMING)
+	@Relationship(type = "医保疾病名称相关实验室检查名称", direction = Relationship.OUTGOING)
 	private Set<LisName> lisnames = new HashSet<>();
 	private Set<LisName> lisnames = new HashSet<>();
 
 
-	@Relationship(type = "辅助检查名称相关医保疾病名称", direction = Relationship.INCOMING)
+	@Relationship(type = "医保疾病名称相关辅助检查名称", direction = Relationship.OUTGOING)
 	private Set<PacsName> pacsnames = new HashSet<>();
 	private Set<PacsName> pacsnames = new HashSet<>();
 
 
 	@Relationship(type = "实验室检查结果相关医保疾病名称", direction = Relationship.INCOMING)
 	@Relationship(type = "实验室检查结果相关医保疾病名称", direction = Relationship.INCOMING)

+ 0 - 5
src/main/java/com/diagbot/facade/NeoFacade.java

@@ -227,13 +227,8 @@ public class NeoFacade {
      */
      */
     public List<NeoPushDTO> getReversePush(NeoPushVO pushVO) {
     public List<NeoPushDTO> getReversePush(NeoPushVO pushVO) {
         List<NeoPushDTO> neoPushDTOS = new ArrayList<>();
         List<NeoPushDTO> neoPushDTOS = new ArrayList<>();
-        List<String> diags = new ArrayList<>();
         // 如果有诊断名称,则通过诊断反推
         // 如果有诊断名称,则通过诊断反推
         if (null != pushVO.getDiagVo() && pushVO.getDiagVo().getDiags().size() > 0) {
         if (null != pushVO.getDiagVo() && pushVO.getDiagVo().getDiags().size() > 0) {
-            for (Diag diag : pushVO.getDiagVo().getDiags()) {
-                diags.add(diag.getName());
-            }
-
             neoPushDTOS = getDiagInfo(pushVO);
             neoPushDTOS = getDiagInfo(pushVO);
         }
         }
 
 

+ 7 - 6
src/main/java/com/diagbot/process/PushProcess.java

@@ -40,7 +40,7 @@ public class PushProcess {
         Map<String, List<PushBaseDTO>> dis = new HashMap<>();
         Map<String, List<PushBaseDTO>> dis = new HashMap<>();
         //如果下的诊断有数据就反推
         //如果下的诊断有数据就反推
         if(pushVO.getDiagVo() != null && pushVO.getDiagVo().getDiags().size() > 0){
         if(pushVO.getDiagVo() != null && pushVO.getDiagVo().getDiags().size() > 0){
-            reversePushPackage(length, pushDTO, ruleTypeList, typeWords, pushVO,dis,wordCrfDTO.getDiag());
+            reversePushPackage(length, pushDTO, ruleTypeList, typeWords, pushVO,dis);
         }else {
         }else {
             //正推
             //正推
             List<NeoPushDTO> push = neoFacade.getPush(pushVO);
             List<NeoPushDTO> push = neoFacade.getPush(pushVO);
@@ -55,7 +55,7 @@ public class PushProcess {
                 //把第一个推送出来的诊断set到diagOrder中,再反推
                 //把第一个推送出来的诊断set到diagOrder中,再反推
                 setPushVo(pushVO, push);
                 setPushVo(pushVO, push);
                 //调用反推
                 //调用反推
-                reversePushPackage(length, pushDTO, ruleTypeList, typeWords, pushVO,dis,wordCrfDTO.getDiag());
+                reversePushPackage(length, pushDTO, ruleTypeList, typeWords, pushVO,dis);
             }
             }
         }
         }
         return pushDTO;
         return pushDTO;
@@ -88,7 +88,7 @@ public class PushProcess {
         return typeWordsMap;
         return typeWordsMap;
     }
     }
 
 
-    private void reversePushPackage(int length, PushDTO pushDTO, List<String> ruleTypeList, Map<String, List<String>> typeWords, NeoPushVO pushVO, Map<String, List<PushBaseDTO>> dis, List<Item> diags) {
+    private void reversePushPackage(int length, PushDTO pushDTO, List<String> ruleTypeList, Map<String, List<String>> typeWords, NeoPushVO pushVO, Map<String, List<PushBaseDTO>> dis) {
         List<NeoPushDTO> reversePush = neoFacade.getReversePush(pushVO);
         List<NeoPushDTO> reversePush = neoFacade.getReversePush(pushVO);
         if(ListUtil.isNotEmpty(reversePush)){
         if(ListUtil.isNotEmpty(reversePush)){
             // 症状
             // 症状
@@ -200,13 +200,14 @@ public class PushProcess {
     }
     }
 
 
     private List<PushBaseDTO> getPackagePushBaseDTO(Map<String, List<String>> typeWords, List<String> symptoms, StandConvertEnum symptom) {
     private List<PushBaseDTO> getPackagePushBaseDTO(Map<String, List<String>> typeWords, List<String> symptoms, StandConvertEnum symptom) {
-
-        List<PushBaseDTO> symptomPush = symptoms.stream().map(x -> {
+        List<PushBaseDTO> symptomPush = symptoms.stream()
+                .filter(x -> !typeWords.get(symptom.toString()).contains(x))
+                .map(x -> {
             PushBaseDTO pushBaseDTO = new PushBaseDTO();
             PushBaseDTO pushBaseDTO = new PushBaseDTO();
             pushBaseDTO.setName(x);
             pushBaseDTO.setName(x);
             return pushBaseDTO;
             return pushBaseDTO;
         }).collect(Collectors.toList());
         }).collect(Collectors.toList());
-        return symptomPush.stream().filter(x -> !typeWords.get(symptom.getName()).contains(x.getName())).collect(Collectors.toList());
+        return symptomPush;
     }
     }
 }
 }
 
 

+ 16 - 8
src/main/java/com/diagbot/repository/YiBaoDiseaseNode.java

@@ -3,19 +3,15 @@ package com.diagbot.repository;
 import com.diagbot.dto.DiseaseInfoDTO;
 import com.diagbot.dto.DiseaseInfoDTO;
 import com.diagbot.dto.NeoPushDTO;
 import com.diagbot.dto.NeoPushDTO;
 import com.diagbot.dto.PushBaseDTO;
 import com.diagbot.dto.PushBaseDTO;
-import com.diagbot.entity.node.GuoLinDiseaseName;
-import com.diagbot.entity.node.GuoLinICD_10Code;
-import com.diagbot.entity.node.PathwayName;
-import com.diagbot.entity.node.YiBaoDiseaseName;
-import com.diagbot.entity.node.YiBaoICD_10Code;
+import com.diagbot.entity.node.*;
 import com.diagbot.util.ListUtil;
 import com.diagbot.util.ListUtil;
+import com.diagbot.util.NeoUtil;
 import com.diagbot.vo.NeoPushVO;
 import com.diagbot.vo.NeoPushVO;
-import org.springframework.data.domain.Page;
-import org.springframework.data.domain.PageRequest;
 
 
 import java.util.ArrayList;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.List;
 import java.util.Set;
 import java.util.Set;
+import java.util.stream.Collectors;
 
 
 public class YiBaoDiseaseNode {
 public class YiBaoDiseaseNode {
 
 
@@ -27,11 +23,23 @@ public class YiBaoDiseaseNode {
 		int gender = neoPushVO.getSex();
 		int gender = neoPushVO.getSex();
 		int age = neoPushVO.getAge();
 		int age = neoPushVO.getAge();
 
 
-		if (matchBasic(disease, gender, age)) {
+		if (NeoUtil.matchBasic(disease, gender, age)) {
 
 
 			pushBaseDTO = new PushBaseDTO();
 			pushBaseDTO = new PushBaseDTO();
 			pushBaseDTO.setName(disease.getName());
 			pushBaseDTO.setName(disease.getName());
 			pushDTO.setDisease(pushBaseDTO);
 			pushDTO.setDisease(pushBaseDTO);
+
+			pushDTO.setSymptoms(disease.getSymptoms().stream().map(x ->NeoUtil.updatePushInfo(x.getName())).collect(Collectors.toList()));
+
+			pushDTO.setVitals(disease.getVitals().stream().map(x ->NeoUtil.updatePushInfo(x.getName())).collect(Collectors.toList()));
+
+			pushDTO.setLis(disease.getLisnames().stream().map(x ->NeoUtil.updatePushInfo(x.getName())).collect(Collectors.toList()));
+
+			pushDTO.setPacs(disease.getPacsnames().stream().map(x ->NeoUtil.updatePushInfo(x.getName())).collect(Collectors.toList()));
+
+
+
+
 		/*
 		/*
 		CureRate curerate = disease.getCurerate();
 		CureRate curerate = disease.getCurerate();
 		if (null != curerate) {
 		if (null != curerate) {