Explorar o código

更新图谱中的疾病节点数据结构

MarkHuang %!s(int64=4) %!d(string=hai) anos
pai
achega
bf48ccb7d2

+ 6 - 6
src/main/java/com/diagbot/entity/node/Disease.java

@@ -22,11 +22,14 @@ public class Disease extends BaseNode  {
     @Relationship(type="疾病相关年龄", direction = Relationship.OUTGOING)
     private Age age;
 
+    @Relationship(type="疾病相关性别", direction = Relationship.OUTGOING)
+    private Gender gender;
+
     @Relationship(type="疾病相关治愈率", direction = Relationship.OUTGOING)
-    private Set<CureRate> curerates = new HashSet<>();
+    private CureRate curerate;
 
     @Relationship(type="疾病相关治疗周期", direction = Relationship.OUTGOING)
-    private Set<TreatCycle> treatcycles = new HashSet<>();
+    private TreatCycle treatcycle;
 
     @Relationship(type="疾病相关传染途径", direction = Relationship.OUTGOING)
     private Set<Infection> infections = new HashSet<>();
@@ -50,14 +53,11 @@ public class Disease extends BaseNode  {
     private Set<Situation> situations = new HashSet<>();
 
     @Relationship(type="疾病相关编码", direction = Relationship.OUTGOING)
-    private Set<Code> codes = new HashSet<>();
+    private Code code;
 
     @Relationship(type="疾病相关标准科室", direction = Relationship.OUTGOING)
     private Set<Dept> stddepts = new HashSet<>();
 
-    @Relationship(type="疾病相关性别", direction = Relationship.OUTGOING)
-    private Set<Gender> genders = new HashSet<>();
-
     @Relationship(type="疾病相关并发症", direction = Relationship.OUTGOING)
     private Set<Complication> complications = new HashSet<>();
 

+ 182 - 0
src/main/java/com/diagbot/repository/DiseaseNode.java

@@ -0,0 +1,182 @@
+package com.diagbot.repository;
+
+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.Set;
+
+public class DiseaseNode {
+
+	public void DiseasetoDiseaseDTO(Disease disease) {
+
+
+		Age age = disease.getAge();
+		if (null!=age) {
+			NodeNeoDTO ageNeoDTO = new NodeNeoDTO();
+			ageNeoDTO.setMin(BigDecimal.valueOf(age.getMinval()));
+			ageNeoDTO.setMax(BigDecimal.valueOf(age.getMaxval()));
+			ageNeoDTO.setName("年龄");
+//			lisBillNeoDTO.setAgeNeoDTO(ageNeoDTO);
+		}
+
+		Gender gender = disease.getGender();
+		if (null!=gender) {
+			NeoUtil.updateNodeInfo(gender.getName(), null, null, null);
+		}
+
+
+		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();
+			NeoUtil.updateNodeInfo(name, null, null, null);
+		}
+
+		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) {
+			NeoUtil.updateNodeInfo(symptom.getName(), null, null, null);
+		}
+
+		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) {
+			String name = complication.getName();
+			NeoUtil.updateNodeInfo(complication.getName(), null, null, null);
+		}
+
+		Set<PACS> pacss = disease.getPacs();
+		for (PACS pacs : pacss) {
+			String name = pacs.getName();
+			String min = pacs.getMinval();
+			String max = pacs.getMaxval();
+			String unit = pacs.getUnit();
+			NeoUtil.updateNodeInfo(name, min, max, unit);
+		}
+
+		Set<Medicine> medicines = disease.getMedicines();
+		for (Medicine medicine : medicines) {
+			NeoUtil.updateNodeInfo(medicine.getName(), null, null, null);
+		}
+
+		Set<Cause> causes = disease.getCauses();
+		for (Cause cause : causes) {
+			NeoUtil.updateNodeInfo(cause.getName(), null, null, null);
+		}
+
+		Set<Disease> diff_diseases = disease.getDiff_diseases();
+		for (Disease diff_disease : diff_diseases) {
+			NeoUtil.updateNodeInfo(diff_disease.getName(), null, null, null);
+		}
+
+		Set<Operation> operations = disease.getOperations();
+		for (Operation operation : operations) {
+			NeoUtil.updateNodeInfo(operation.getName(), null, null, null);
+		}
+
+		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();
+		for (LIS lis : liss) {
+			String name = lis.getName();
+			String min = lis.getMinval();
+			String max = lis.getMaxval();
+			String unit = lis.getUnit();
+			NeoUtil.updateNodeInfo(name, min, max, unit);
+		}
+
+		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);
+		}
+
+	}
+
+
+	
+}
+
+
+

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

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