|
|
@ -89,10 +89,11 @@ public class GraphNebulaServiceImpl implements GraphNebulaService {
|
|
|
|
List<TreatmentPlanRecord> treatmentPlanRecordList = treatmentPlanRecordService.lambdaQuery().eq(TreatmentPlanRecord::getProcessId, processId).list();
|
|
|
|
List<TreatmentPlanRecord> treatmentPlanRecordList = treatmentPlanRecordService.lambdaQuery().eq(TreatmentPlanRecord::getProcessId, processId).list();
|
|
|
|
Assert.notEmpty(treatmentPlanRecordList, () -> new BusinessException("治疗计划为空,请先完成治疗计划"));
|
|
|
|
Assert.notEmpty(treatmentPlanRecordList, () -> new BusinessException("治疗计划为空,请先完成治疗计划"));
|
|
|
|
Integer disposalMethod = treatmentPlanRecordList.stream().findAny().orElseThrow(() -> new BusinessException("治疗计划为空,请先完成治疗计划")).getDisposalMethod();
|
|
|
|
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 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);
|
|
|
|
medicalRecDao.insert(medicalRecVertex);
|
|
|
|
log.info("病历图谱ID:{}", medicalRecVertex.getId());
|
|
|
|
log.info("病历图谱ID:{}", medicalRecVertex.getId());
|
|
|
|
// 根据processId找到电子病历
|
|
|
|
// 根据processId找到电子病历
|
|
|
@ -159,13 +160,7 @@ public class GraphNebulaServiceImpl implements GraphNebulaService {
|
|
|
|
// 保存节点之间的关系
|
|
|
|
// 保存节点之间的关系
|
|
|
|
processMedicalDao.insertEdge(processMedicalVertex, new NoPropertyEdge(), operationHistoryVertex);
|
|
|
|
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不为空,即为只查配置了检查结果的结果)
|
|
|
|
// 创建体格检查节点(physicalId不为空,即为只查配置了检查结果的结果)
|
|
|
|
List<DiagnosisPhysicalRecord> physicalRecordList = diagnosisPhysicalRecordService.lambdaQuery()
|
|
|
|
List<DiagnosisPhysicalRecord> physicalRecordList = diagnosisPhysicalRecordService.lambdaQuery()
|
|
|
|