diff --git a/virtual-patient-graph/src/main/java/com/supervision/service/GraphNebulaService.java b/virtual-patient-graph/src/main/java/com/supervision/service/GraphNebulaService.java index 009af60c..60113101 100644 --- a/virtual-patient-graph/src/main/java/com/supervision/service/GraphNebulaService.java +++ b/virtual-patient-graph/src/main/java/com/supervision/service/GraphNebulaService.java @@ -7,7 +7,7 @@ import java.util.List; public interface GraphNebulaService { - void creatGraphByNebula(String processId); + String creatGraphByNebula(String processId); GraphVO queryGraph(String processId, Integer level); diff --git a/virtual-patient-graph/src/main/java/com/supervision/service/impl/GraphNebulaServiceImpl.java b/virtual-patient-graph/src/main/java/com/supervision/service/impl/GraphNebulaServiceImpl.java index 3fb9bd3b..d997d4b0 100644 --- a/virtual-patient-graph/src/main/java/com/supervision/service/impl/GraphNebulaServiceImpl.java +++ b/virtual-patient-graph/src/main/java/com/supervision/service/impl/GraphNebulaServiceImpl.java @@ -80,7 +80,7 @@ public class GraphNebulaServiceImpl implements GraphNebulaService { private AncillaryResultDao ancillaryResultDao; @Override - public void creatGraphByNebula(String processId) { + public String creatGraphByNebula(String processId) { Process process = Optional.ofNullable(processService.getById(processId)).orElseThrow(() -> new BusinessException("未找到流程,创建图谱失败")); // 根据processId找到对应的诊疗计划,如果没有找到,说明治疗流程未完成,诊断失败 List treatmentPlanRecordList = treatmentPlanRecordService.lambdaQuery().eq(TreatmentPlanRecord::getProcessId, processId).list(); @@ -244,6 +244,7 @@ public class GraphNebulaServiceImpl implements GraphNebulaService { } log.info("病历图谱ID:{}", medicalRecVertex.getId()); processService.lambdaUpdate().set(Process::getGraphId, medicalRecVertex.getId()).eq(Process::getId, processId).update(); + return medicalRecVertex.getId(); } @@ -252,8 +253,8 @@ public class GraphNebulaServiceImpl implements GraphNebulaService { Process process = Optional.ofNullable(processService.getById(processId)).orElseThrow(() -> new BusinessException("未找到对应的问诊流程")); // 如果图谱ID为空,则创建图谱 if (StrUtil.isEmpty(process.getGraphId())) { - creatGraphByNebula(processId); - process = Optional.ofNullable(processService.getById(processId)).orElseThrow(() -> new BusinessException("未找到对应的问诊流程")); + String graphId = creatGraphByNebula(processId); + process.setGraphId(graphId); } List> subgraphList = medicalRecDao.selectSubgraph(process.getGraphId());