dev_2.1.0
liu 1 year ago
parent 707da3c8b0
commit 2a362c4e2b

@ -89,10 +89,11 @@ public class GraphNebulaServiceImpl implements GraphNebulaService {
List<TreatmentPlanRecord> treatmentPlanRecordList = treatmentPlanRecordService.lambdaQuery().eq(TreatmentPlanRecord::getProcessId, processId).list();
Assert.notEmpty(treatmentPlanRecordList, () -> new BusinessException("治疗计划为空,请先完成治疗计划"));
Integer disposalMethod = treatmentPlanRecordList.stream().findAny().orElseThrow(() -> new BusinessException("治疗计划为空,请先完成治疗计划")).getDisposalMethod();
MedicalRec medicalRec = Optional.ofNullable(medicalRecService.getById(process.getMedicalRecId())).orElseThrow(() -> new BusinessException("未找到病历"));
// 首先创建一个病历
MedicalRecVertex medicalRecVertex = new MedicalRecVertex();
medicalRecVertex.setNodeValue((disposalMethod == 0 ? "门诊" : "住院") + "(" + DateUtil.format(process.getCreateTime(), "yyyy-MM-dd") + ")");
// 格式:患者名称-门诊(时间)
medicalRecVertex.setNodeValue((disposalMethod == 0 ? "门诊" : "住院") + "-" + medicalRec.getPatientName() + "(" + DateUtil.format(process.getCreateTime(), "yyyy-MM-dd") + ")");
medicalRecDao.insert(medicalRecVertex);
log.info("病历图谱ID:{}", medicalRecVertex.getId());
// 根据processId找到电子病历
@ -159,13 +160,7 @@ public class GraphNebulaServiceImpl implements GraphNebulaService {
// 保存节点之间的关系
processMedicalDao.insertEdge(processMedicalVertex, new NoPropertyEdge(), operationHistoryVertex);
}
// 创建患者节点
MedicalRec medicalRec = Optional.ofNullable(medicalRecService.getById(process.getMedicalRecId())).orElseThrow(() -> new BusinessException("未找到病历"));
PatientVertex patientVertex = new PatientVertex();
patientVertex.setNodeValue(medicalRec.getPatientName());
patientDao.insert(patientVertex);
processMedicalDao.insertEdge(medicalRecVertex, new NoPropertyEdge(), patientVertex);
processMedicalDao.insertEdge(processMedicalVertex, new SinglePropertyEdge("问诊"), patientVertex);
// 创建体格检查节点(physicalId不为空,即为只查配置了检查结果的结果)
List<DiagnosisPhysicalRecord> physicalRecordList = diagnosisPhysicalRecordService.lambdaQuery()

@ -26,8 +26,6 @@ CREATE TAG IF NOT EXISTS marriage_child_history(nodeValue string);
CREATE TAG IF NOT EXISTS operation_history(nodeValue string);
// 创建症状节点
CREATE TAG IF NOT EXISTS symptoms(nodeValue string);
// 创建患者信息节点
CREATE TAG IF NOT EXISTS patient(nodeValue string);
// 创建体格检查节点
CREATE TAG IF NOT EXISTS physical(nodeValue string);
// 创建体格检查结果节点

Loading…
Cancel
Save