فهرست منبع

获取图谱标准ICD疾病名称列表

MarkHuang 4 سال پیش
والد
کامیت
a06eaaf048

+ 40 - 0
src/main/java/com/diagbot/entity/node/ICDDisease.java

@@ -0,0 +1,40 @@
+package com.diagbot.entity.node;
+
+import com.diagbot.entity.node.base.BaseNode;
+import lombok.Getter;
+import lombok.Setter;
+import org.neo4j.ogm.annotation.NodeEntity;
+import org.neo4j.ogm.annotation.Property;
+import org.neo4j.ogm.annotation.Relationship;
+
+import java.util.HashSet;
+import java.util.Set;
+
+@Setter
+@Getter
+//@EqualsAndHashCode(callSuper = false)
+@NodeEntity(label = "医保ICD-10疾病")
+public class ICDDisease extends BaseNode  {
+
+    @Property(name="医保ICD-10代码")
+    private String icdcode;
+
+    @Property(name="疾病名称")
+    private String othername;
+
+    @Relationship(type="医保ICD-10疾病相关实验室检查", direction = Relationship.OUTGOING)
+    private Set<LIS> liss_dis = new HashSet<>();
+
+    @Relationship(type="医保ICD-10疾病相关辅助检查", direction = Relationship.OUTGOING)
+    private Set<PACS> pacs = new HashSet<>();
+
+    @Relationship(type="医保ICD-10疾病相关实验室检查套餐", direction = Relationship.OUTGOING)
+    private Set<LISPack> lispack_dis = new HashSet<>();
+
+}
+
+
+
+
+
+

+ 15 - 102
src/main/java/com/diagbot/facade/NeoFacade.java

@@ -49,6 +49,8 @@ public class NeoFacade {
     @Autowired
     DiseaseRepository diseaseRepository;
     @Autowired
+    ICDDiseaseRepository icdDiseaseRepository;
+    @Autowired
     MedicineCodeRepository medicineCodeRepository;
     @Autowired
     ChiefPresentSimilarityServiceClient chiefPresentSimilarityServiceClient;
@@ -101,9 +103,10 @@ public class NeoFacade {
     public Map<String, List<String>> getSimilarCache() {
         Map<String, List<String>> res = new HashMap<>();
         // 临床表现,诊断,化验,辅检,药品,查体,手术
+        res.put(StandConvertEnum.disease.getName(), getDiseaseList());
         // TODO 测试数据
         res.put(StandConvertEnum.clinical.getName(), Arrays.asList("胸痛","咳嗽"));
-        res.put(StandConvertEnum.disease.getName(), Arrays.asList("高血压", "糖尿病"));
+//        res.put(StandConvertEnum.disease.getName(), Arrays.asList("高血压", "糖尿病"));
         return res;
     }
 
@@ -132,9 +135,6 @@ public class NeoFacade {
         billNeoDTOs.addAll(getLisDetailBill(billNeoVO.getLisDetailList()));
         billNeoDTOs.addAll(getLisBill(billNeoVO.getLisList()));
 
-        // for (BillNeoDTO billNeoDTO:billNeoDTOs) {
-        //     System.out.println(billNeoDTO);
-        // }
         return billNeoDTOs;
     }
 
@@ -144,34 +144,9 @@ public class NeoFacade {
      * 处理处方开单合理性
      */
     public List<BillNeoDTO> getDrugBill(Map<String, String> medsterm) {
-        List<BillNeoDTO> billNeoDTOs = new ArrayList<>();
-        BillNeoDTO billNeoDTO;
-
-        DrugBillNeoDTO drugBillNeoDTO;
 
         MedicineNode medicineNode = new MedicineNode();
-        Medicine medicine;
-        String medname;
-
-        for (String term : medsterm.keySet()) {
-            billNeoDTO = new BillNeoDTO();
-            medname = medsterm.get(term);
-            billNeoDTO.setName(term);
-            billNeoDTO.setStandname(medname);
-
-            drugBillNeoDTO = new DrugBillNeoDTO();
-
-            medicine = medicineRepository.findByNameIs(medname);
-
-            if (medicine != null) {
-                drugBillNeoDTO = medicineNode.MedicinetoDrugDTO(medicine);
-            }
-
-            billNeoDTO.setDrugBillNeoDTO(drugBillNeoDTO);
-
-            billNeoDTOs.add(billNeoDTO);
-        }
-
+        List<BillNeoDTO> billNeoDTOs = medicineNode.getDrugBill(medsterm, medicineRepository);
 
         return billNeoDTOs;
     }
@@ -181,33 +156,9 @@ public class NeoFacade {
      * 处理辅检开单合理性
      */
     public List<BillNeoDTO> getPacsBill(Map<String, String> pacsterm) {
-        List<BillNeoDTO> billNeoDTOs = new ArrayList<>();
-        BillNeoDTO billNeoDTO;
-
-        PacsBillNeoDTO pacsBillNeoDTO;
 
         PACSNode pacsNode = new PACSNode();
-        PACS pacs;
-        String pacsname;
-
-        for (String term : pacsterm.keySet()) {
-            billNeoDTO = new BillNeoDTO();
-            pacsname = pacsterm.get(term);
-            billNeoDTO.setName(term);
-            billNeoDTO.setStandname(pacsname);
-
-            pacsBillNeoDTO = new PacsBillNeoDTO();
-
-            pacs = pacsRepository.findByNameIs(pacsname);
-
-            if (pacs != null) {
-                pacsBillNeoDTO = pacsNode.PacstoPACSDTO(pacs);
-            }
-
-            billNeoDTO.setPacsBillNeoDTO(pacsBillNeoDTO);
-
-            billNeoDTOs.add(billNeoDTO);
-        }
+        List<BillNeoDTO> billNeoDTOs = pacsNode.getPacsBill(pacsterm, pacsRepository);
 
         return billNeoDTOs;
     }
@@ -217,33 +168,9 @@ public class NeoFacade {
      * 处理化验套餐开单合理性
      */
     public List<BillNeoDTO> getLisBill(Map<String, String> lispackterm) {
-        List<BillNeoDTO> billNeoDTOs = new ArrayList<>();
-        BillNeoDTO billNeoDTO;
-
-        LisBillNeoDTO lisBillNeoDTO;
 
         LISPackNode lisPackNode = new LISPackNode();
-        LISPack lispack;
-        String lispackname;
-
-        for (String term : lispackterm.keySet()) {
-            billNeoDTO = new BillNeoDTO();
-            lispackname = lispackterm.get(term);
-            billNeoDTO.setName(term);
-            billNeoDTO.setStandname(lispackname);
-
-            lisBillNeoDTO = new LisBillNeoDTO();
-
-            lispack = lisPackRepository.findByNameIs(lispackname);
-
-            if (lispack != null) {
-                lisBillNeoDTO = lisPackNode.LisPacktoLISDTO(lispack);
-            }
-
-            billNeoDTO.setLisBillNeoDTO(lisBillNeoDTO);
-
-            billNeoDTOs.add(billNeoDTO);
-        }
+        List<BillNeoDTO> billNeoDTOs = lisPackNode.getLisBill(lispackterm, lisPackRepository);
 
         return billNeoDTOs;
     }
@@ -253,38 +180,24 @@ public class NeoFacade {
      * 处理化验开单合理性
      */
     public List<BillNeoDTO> getLisDetailBill(Map<String, String> listerm) {
-        List<BillNeoDTO> billNeoDTOs = new ArrayList<>();
-        BillNeoDTO billNeoDTO;
-
-        LisBillNeoDTO lisBillNeoDTO;
 
         LISNode lisNode = new LISNode();
-        LIS lis;
-        String lisname;
-
-        for (String term : listerm.keySet()) {
-            billNeoDTO = new BillNeoDTO();
-            lisname = listerm.get(term);
-            billNeoDTO.setName(term);
-            billNeoDTO.setStandname(lisname);
+        List<BillNeoDTO> billNeoDTOs = lisNode.getLisDetailBill(listerm, lisRepository);
 
-            lisBillNeoDTO = new LisBillNeoDTO();
-
-            lis = lisRepository.findByNameIs(lisname);
+        return billNeoDTOs;
+    }
 
-            if (lis != null) {
-                lisBillNeoDTO = lisNode.ListoLISDTO(lis);
-            }
 
-            billNeoDTO.setLisBillNeoDTO(lisBillNeoDTO);
+    public List<String> getDiseaseList() {
 
-            billNeoDTOs.add(billNeoDTO);
-        }
+        ICDDiseaseNode diseaseNode = new ICDDiseaseNode();
+        List<String> diseaselist = diseaseNode.getDiseaseNameList(icdDiseaseRepository);
 
-        return billNeoDTOs;
+        return diseaselist;
     }
 
 
+
     public Map<String, PushDTO> getDiag(List<String> diaglist) {
 
         Map<String, PushDTO> pushDTOs = new HashMap<>();

+ 199 - 0
src/main/java/com/diagbot/repository/ICDDiseaseNode.java

@@ -0,0 +1,199 @@
+package com.diagbot.repository;
+
+import com.diagbot.dto.PushBaseDTO;
+import com.diagbot.dto.PushDTO;
+import com.diagbot.entity.node.*;
+import com.diagbot.util.NeoUtil;
+
+import java.util.*;
+
+public class ICDDiseaseNode {
+
+	public PushDTO ICDDiseasetoDiseaseDTO(ICDDisease disease) {
+
+        PushDTO pushDTO = new PushDTO();
+
+		/*
+		CureRate curerate = disease.getCurerate();
+		if (null != curerate) {
+			NeoUtil.updateNodeInfo(curerate.getName(), null, null, null);
+		}
+
+		TreatCycle treatcycle = disease.getTreatcycle();
+		if (null != treatcycle) {
+			NeoUtil.updateNodeInfo(treatcycle.getName(), null, null, null);
+		}
+
+		Set<Infection> infections = disease.getInfections();
+		for (Infection infection : infections) {
+			NeoUtil.updateNodeInfo(infection.getName(), null, null, null);
+		}
+
+		Set<Group> groups = disease.getGroups();
+		for (Group group : groups) {
+			NeoUtil.updateNodeInfo(group.getName(), null, null, null);
+		}
+
+		Set<Alias> aliass = disease.getAlias();
+		for (Alias alias : aliass) {
+			NeoUtil.updateNodeInfo(alias.getName(), null, null, null);
+		}
+
+
+		Set<Vital> vitals = disease.getVitals();
+		for (Vital vital : vitals) {
+			String name = vital.getName();
+			pushDTO.getVital().add(NeoUtil.updatePushInfo(name));
+		}
+
+		/*
+		Set<Dept> depts = disease.getDepts();
+		for (Dept dept : depts) {
+			NeoUtil.updateNodeInfo(dept.getName(), null, null, null);
+		}
+
+
+		Set<Symptom> symptoms = disease.getSymptoms();
+		for (Symptom symptom : symptoms) {
+            pushDTO.getSymptom().add(NeoUtil.updatePushInfo(symptom.getName()));
+		}
+
+		/*
+		Set<Situation> situations = disease.getSituations();
+		for (Situation situation : situations) {
+			NeoUtil.updateNodeInfo(situation.getName(), null, null, null);
+		}
+
+		Code code = disease.getCode();
+		if (null != code) {
+			NeoUtil.updateNodeInfo(code.getName(), null, null, null);
+		}
+
+		Set<Dept> stddepts = disease.getDepts();
+		for (Dept stddept : stddepts) {
+			NeoUtil.updateNodeInfo(stddept.getName(), null, null, null);
+		}
+
+
+		Set<Complication> complications = disease.getComplications();
+		for (Complication complication : complications) {
+			pushDTO.getComplications().add(NeoUtil.updatePushInfo(complication.getName()));
+		}
+		*/
+
+		Set<PACS> pacss = disease.getPacs();
+		for (PACS pacs : pacss) {
+			String name = pacs.getName();
+			pushDTO.getPacs().add(NeoUtil.updatePushInfo(name));
+		}
+
+		/*
+		Set<Medicine> medicines = disease.getMedicines();
+		for (Medicine medicine : medicines) {
+			pushDTO.getMedicines().add(NeoUtil.updatePushInfo(medicine.getName()));
+		}
+
+		/*
+		Set<Cause> causes = disease.getCauses();
+		for (Cause cause : causes) {
+			NeoUtil.updateNodeInfo(cause.getName(), null, null, null);
+		}
+
+
+		Set<Disease> diff_diseases = disease.getDiff_diseases();
+		List<PushBaseDTO> pushBaseDTOs = new ArrayList<>();
+		for (Disease diff_disease : diff_diseases) {
+			pushBaseDTOs.add(NeoUtil.updatePushInfo(diff_disease.getName()));
+		}
+		Map<String, List<PushBaseDTO>> dis = new HashMap<>();
+		dis.put("鉴别诊断", pushBaseDTOs);
+		pushDTO.setDis(dis);
+
+		Set<Operation> operations = disease.getOperations();
+		for (Operation operation : operations) {
+			pushDTO.getOperations().add(NeoUtil.updatePushInfo(operation.getName()));
+		}
+
+		/*
+		Set<Pathogen> pathogens = disease.getPathogens();
+		for (Pathogen pathogen : pathogens) {
+			NeoUtil.updateNodeInfo(pathogen.getName(), null, null, null);
+		}
+
+		Set<Heredity> hereditys = disease.getHereditys();
+		for (Heredity heredity : hereditys) {
+			NeoUtil.updateNodeInfo(heredity.getName(), null, null, null);
+		}
+
+		Set<Treatment> treatments = disease.getTreatments();
+		for (Treatment treatment : treatments) {
+			NeoUtil.updateNodeInfo(treatment.getName(), null, null, null);
+		}
+
+		Set<DiseaseType> diseasetypes = disease.getDiseasetypes();
+		for (DiseaseType diseasetype : diseasetypes) {
+			NeoUtil.updateNodeInfo(diseasetype.getName(), null, null, null);
+		}
+
+		Set<Complication> localcompls = disease.getLocalcompls();
+		for (Complication localcompl : localcompls) {
+			NeoUtil.updateNodeInfo(localcompl.getName(), null, null, null);
+		}
+
+		Set<Complication> generalcompls = disease.getGeneralcompls();
+		for (Complication generalcompl : generalcompls) {
+			NeoUtil.updateNodeInfo(generalcompl.getName(), null, null, null);
+		}
+		*/
+
+		Set<LIS> liss = disease.getLiss_dis();
+		for (LIS lis : liss) {
+			pushDTO.getLis().add(NeoUtil.updatePushInfo(lis.getName()));
+		}
+
+		/*
+		Set<PACS> pacs_disease= disease.getPacs_disease();
+		for (PACS pacs : pacs_disease) {
+			String name = pacs.getName();
+			String min = pacs.getMinval();
+			String max = pacs.getMaxval();
+			String unit = pacs.getUnit();
+			NeoUtil.updateNodeInfo(name, min, max, unit);
+		}
+
+		Medicine_Code medicine_code = disease.getMedicine_code();
+		if (null != medicine_code) {
+			NeoUtil.updateNodeInfo(medicine_code.getName(), null, null, null);
+		}
+		*/
+
+		return pushDTO;
+	}
+
+
+    /**
+	 * 获取疾病名称列表
+	 */
+	public List<String> getDiseaseNameList(ICDDiseaseRepository diseaseRepository) {
+		String icdname;
+
+		ICDDisease current;
+
+		List<String> dislist = new ArrayList<>();
+
+		Iterator<ICDDisease> disIter = diseaseRepository.findAll().iterator();
+
+		while (disIter.hasNext()) {
+			current = disIter.next();
+			icdname = current.getName();
+
+			if (!dislist.contains(icdname)) {
+				dislist.add(icdname);
+			}
+		}
+
+		return dislist;
+	}
+
+}
+

+ 12 - 0
src/main/java/com/diagbot/repository/ICDDiseaseRepository.java

@@ -0,0 +1,12 @@
+package com.diagbot.repository;
+
+import com.diagbot.entity.node.Disease;
+import com.diagbot.entity.node.ICDDisease;
+import org.springframework.data.neo4j.repository.Neo4jRepository;
+
+
+public interface ICDDiseaseRepository extends Neo4jRepository<ICDDisease, Long> {
+
+    ICDDisease findByNameIs(String name);
+}
+

+ 37 - 1
src/main/java/com/diagbot/repository/LISNode.java

@@ -1,11 +1,15 @@
 package com.diagbot.repository;
 
+import com.diagbot.dto.BillNeoDTO;
 import com.diagbot.dto.LisBillNeoDTO;
 import com.diagbot.dto.NodeNeoDTO;
 import com.diagbot.entity.node.*;
 import com.diagbot.util.NeoUtil;
 
 import java.math.BigDecimal;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
 import java.util.Set;
 
 public class LISNode {
@@ -88,6 +92,38 @@ public class LISNode {
 	}
 
 
-	
+	/**
+	 * 处理化验开单合理性
+	 */
+	public List<BillNeoDTO> getLisDetailBill(Map<String, String> listerm, LisRepository lisRepository) {
+		List<BillNeoDTO> billNeoDTOs = new ArrayList<>();
+		BillNeoDTO billNeoDTO;
+
+		LisBillNeoDTO lisBillNeoDTO;
+
+		LIS lis;
+		String lisname;
+
+		for (String term : listerm.keySet()) {
+			billNeoDTO = new BillNeoDTO();
+			lisname = listerm.get(term);
+			billNeoDTO.setName(term);
+			billNeoDTO.setStandname(lisname);
+
+			lisBillNeoDTO = new LisBillNeoDTO();
+
+			lis = lisRepository.findByNameIs(lisname);
+
+			if (lis != null) {
+				lisBillNeoDTO = ListoLISDTO(lis);
+			}
+
+			billNeoDTO.setLisBillNeoDTO(lisBillNeoDTO);
+
+			billNeoDTOs.add(billNeoDTO);
+		}
+
+		return billNeoDTOs;
+	}
 }
 

+ 38 - 1
src/main/java/com/diagbot/repository/LISPackNode.java

@@ -1,11 +1,15 @@
 package com.diagbot.repository;
 
+import com.diagbot.dto.BillNeoDTO;
 import com.diagbot.dto.LisBillNeoDTO;
 import com.diagbot.dto.NodeNeoDTO;
 import com.diagbot.entity.node.*;
 import com.diagbot.util.NeoUtil;
 
 import java.math.BigDecimal;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
 import java.util.Set;
 
 public class LISPackNode {
@@ -88,6 +92,39 @@ public class LISPackNode {
 	}
 
 
-	
+	/**
+	 * 处理化验套餐开单合理性
+	 */
+	public List<BillNeoDTO> getLisBill(Map<String, String> lispackterm, LisPackRepository lisPackRepository) {
+		List<BillNeoDTO> billNeoDTOs = new ArrayList<>();
+		BillNeoDTO billNeoDTO;
+
+		LisBillNeoDTO lisBillNeoDTO;
+
+		LISPack lispack;
+		String lispackname;
+
+		for (String term : lispackterm.keySet()) {
+			billNeoDTO = new BillNeoDTO();
+			lispackname = lispackterm.get(term);
+			billNeoDTO.setName(term);
+			billNeoDTO.setStandname(lispackname);
+
+			lisBillNeoDTO = new LisBillNeoDTO();
+
+			lispack = lisPackRepository.findByNameIs(lispackname);
+
+			if (lispack != null) {
+				lisBillNeoDTO = LisPacktoLISDTO(lispack);
+			}
+
+			billNeoDTO.setLisBillNeoDTO(lisBillNeoDTO);
+
+			billNeoDTOs.add(billNeoDTO);
+		}
+
+		return billNeoDTOs;
+	}
+
 }
 

+ 39 - 0
src/main/java/com/diagbot/repository/MedicineNode.java

@@ -1,11 +1,15 @@
 package com.diagbot.repository;
 
+import com.diagbot.dto.BillNeoDTO;
 import com.diagbot.dto.DrugBillNeoDTO;
 import com.diagbot.dto.NodeNeoDTO;
 import com.diagbot.entity.node.*;
 import com.diagbot.util.NeoUtil;
 
 import java.math.BigDecimal;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
 import java.util.Set;
 
 public class MedicineNode {
@@ -103,5 +107,40 @@ public class MedicineNode {
 
         return drugBillNeoDTO;
     }
+
+    /**
+     * 处理处方开单合理性
+     */
+    public List<BillNeoDTO> getDrugBill(Map<String, String> medsterm, MedicineRepository medicineRepository) {
+        List<BillNeoDTO> billNeoDTOs = new ArrayList<>();
+        BillNeoDTO billNeoDTO;
+
+        DrugBillNeoDTO drugBillNeoDTO;
+
+        Medicine medicine;
+        String medname;
+
+        for (String term : medsterm.keySet()) {
+            billNeoDTO = new BillNeoDTO();
+            medname = medsterm.get(term);
+            billNeoDTO.setName(term);
+            billNeoDTO.setStandname(medname);
+
+            drugBillNeoDTO = new DrugBillNeoDTO();
+
+            medicine = medicineRepository.findByNameIs(medname);
+
+            if (medicine != null) {
+                drugBillNeoDTO = MedicinetoDrugDTO(medicine);
+            }
+
+            billNeoDTO.setDrugBillNeoDTO(drugBillNeoDTO);
+
+            billNeoDTOs.add(billNeoDTO);
+        }
+
+
+        return billNeoDTOs;
+    }
 }
 

+ 39 - 0
src/main/java/com/diagbot/repository/PACSNode.java

@@ -1,11 +1,15 @@
 package com.diagbot.repository;
 
+import com.diagbot.dto.BillNeoDTO;
 import com.diagbot.dto.PacsBillNeoDTO;
 import com.diagbot.dto.NodeNeoDTO;
 import com.diagbot.entity.node.*;
 import com.diagbot.util.NeoUtil;
 
 import java.math.BigDecimal;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
 import java.util.Set;
 
 public class PACSNode {
@@ -85,6 +89,41 @@ public class PACSNode {
 
         return pacsBillNeoDTO;
     }
+
+
+    /**
+     * 处理辅检开单合理性
+     */
+    public List<BillNeoDTO> getPacsBill(Map<String, String> pacsterm, PacsRepository pacsRepository) {
+        List<BillNeoDTO> billNeoDTOs = new ArrayList<>();
+        BillNeoDTO billNeoDTO;
+
+        PacsBillNeoDTO pacsBillNeoDTO;
+
+        PACS pacs;
+        String pacsname;
+
+        for (String term : pacsterm.keySet()) {
+            billNeoDTO = new BillNeoDTO();
+            pacsname = pacsterm.get(term);
+            billNeoDTO.setName(term);
+            billNeoDTO.setStandname(pacsname);
+
+            pacsBillNeoDTO = new PacsBillNeoDTO();
+
+            pacs = pacsRepository.findByNameIs(pacsname);
+
+            if (pacs != null) {
+                pacsBillNeoDTO = PacstoPACSDTO(pacs);
+            }
+
+            billNeoDTO.setPacsBillNeoDTO(pacsBillNeoDTO);
+
+            billNeoDTOs.add(billNeoDTO);
+        }
+
+        return billNeoDTOs;
+    }
 }