|
@@ -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;
|
|
|
+ }
|
|
|
+
|
|
|
+}
|
|
|
+
|