diff --git a/virtual-patient-common/src/main/java/com/supervision/config/JwtInterceptor.java b/virtual-patient-common/src/main/java/com/supervision/config/JwtInterceptor.java
index 67b4691e..3a2737e1 100644
--- a/virtual-patient-common/src/main/java/com/supervision/config/JwtInterceptor.java
+++ b/virtual-patient-common/src/main/java/com/supervision/config/JwtInterceptor.java
@@ -37,7 +37,7 @@ public class JwtInterceptor implements HandlerInterceptor {
cacheAuth(JWTUtil.parseToken(devActiveUser()));
return true;
} else {
- throw new BusinessException("当前用户未登录", HttpStatus.UNAUTHORIZED.value());
+ throw new BusinessException("The current user is not logged in.", HttpStatus.UNAUTHORIZED.value());
}
}
JWT jwt = JWTUtil.parseToken(token);
@@ -63,7 +63,7 @@ public class JwtInterceptor implements HandlerInterceptor {
// 校验是否比当前时间大
long currentTimeMillis = System.currentTimeMillis();
if (currentTimeMillis > l) {
- throw new BusinessException("用户登录已过期,请重新登录", HttpStatus.UNAUTHORIZED.value());
+ throw new BusinessException("The current user is not logged in.", HttpStatus.UNAUTHORIZED.value());
}
}
@@ -73,7 +73,7 @@ public class JwtInterceptor implements HandlerInterceptor {
JSONObject claimsJson = jwt.getPayload().getClaimsJson();
ThreadCache.USER.set(claimsJson.toString());
} catch (Exception e) {
- log.error("用户信息异常", e);
+ log.error("Abnormal Patient Information", e);
}
}
diff --git a/virtual-patient-graph/pom.xml b/virtual-patient-graph/pom.xml
index 64f4d6f5..a684a8af 100644
--- a/virtual-patient-graph/pom.xml
+++ b/virtual-patient-graph/pom.xml
@@ -114,6 +114,21 @@
lombok
provided
+
+ org.springframework.boot
+ spring-boot-test
+ test
+
+
+ junit
+ junit
+ test
+
+
+ org.springframework
+ spring-test
+ test
+
diff --git a/virtual-patient-graph/src/main/java/com/supervision/enums/TagEnum.java b/virtual-patient-graph/src/main/java/com/supervision/enums/TagEnum.java
index 09d3ccf6..ec6f91ad 100644
--- a/virtual-patient-graph/src/main/java/com/supervision/enums/TagEnum.java
+++ b/virtual-patient-graph/src/main/java/com/supervision/enums/TagEnum.java
@@ -1,41 +1,41 @@
package com.supervision.enums;
public enum TagEnum {
- medical_rec("病例", 1, "#2F7CFF", "病历", null),
+ medical_rec("case", 1, "#2F7CFF", "case", null),
- process_medical("电子病历", 2, "#55CBAD", "电子病历", medical_rec),
+ process_medical("Electronic Health Record", 2, "#55CBAD", "Electronic Health Record", medical_rec),
- self_desc("主诉", 3, "#55CBAD", "电子病历", process_medical),
+ self_desc("Chief Complaint", 3, "#55CBAD", "Electronic Health Record", process_medical),
- previous_history("既往病史", 3, "#55CBAD", "电子病历", process_medical),
+ previous_history("Past Medical History", 3, "#55CBAD", "Electronic Health Record", process_medical),
- illness_history("现病史", 3, "#55CBAD", "电子病历", process_medical),
+ illness_history("Current Medical History", 3, "#55CBAD", "Electronic Health Record", process_medical),
- personal_history("个人史", 3, "#55CBAD", "电子病历", process_medical),
+ personal_history("Past Medical History", 3, "#55CBAD", "Electronic Health Record", process_medical),
- allergy_history("过敏史", 3, "#55CBAD", "电子病历", process_medical),
+ allergy_history("allergy history", 3, "#55CBAD", "Electronic Health Record", process_medical),
- family_history("家族史", 3, "#55CBAD", "电子病历", process_medical),
+ family_history("Family history", 3, "#55CBAD", "Electronic Health Record", process_medical),
- marriage_child_history("婚育史", 3, "#55CBAD", "电子病历", process_medical),
+ marriage_child_history("marital and reproductive history", 3, "#55CBAD", "Electronic Health Record", process_medical),
- operation_history("手术史", 3, "#55CBAD", "电子病历", process_medical),
+ operation_history("Surgical History", 3, "#55CBAD", "Electronic Health Record", process_medical),
- symptoms("症状", 2, "#55CBAD", "电子病历", process_medical),
+ symptoms("symptoms", 2, "#55CBAD", "Electronic Health Record", process_medical),
- patient("患者信息", 2, "#55CBAD", "电子病历", process_medical),
+ patient("Patient Information", 2, "#55CBAD", "Electronic Health Record", process_medical),
- physical("体格检查", 2, "#8D8BFF", "体格检查", medical_rec),
+ physical("physical examination", 2, "#8D8BFF", "physical examination", medical_rec),
- physical_result("体格检查结果", 3, "#8D8BFF", "体格检查", physical),
+ physical_result("Physical Examination Findings", 3, "#8D8BFF", "physical examination", physical),
- ancillary("辅助检查", 2, "#4E8CFF", "辅助检查", medical_rec),
+ ancillary("Auxiliary examination", 2, "#4E8CFF", "Auxiliary examination", medical_rec),
- ancillary_result("辅助检查结果", 3, "#4E8CFF", "辅助检查", ancillary),
+ ancillary_result("Results of Auxiliary Examinations", 3, "#4E8CFF", "Auxiliary examination", ancillary),
- treatment_plan("处置计划", 2, "#2BCCFF", "处置计划", medical_rec),
+ treatment_plan("Disposal Plan", 2, "#2BCCFF", "Disposal Plan", medical_rec),
- diagnosis("诊断", 2, "#FF6667", "诊断结果", medical_rec);
+ diagnosis("Diagnosis", 2, "#FF6667", "Diagnostic results", medical_rec);
private final String type;
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 779e1c02..d2208ef5 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
@@ -77,33 +77,33 @@ public class GraphNebulaServiceImpl implements GraphNebulaService {
@Override
public String creatGraphByNebula(String processId) {
- Process process = Optional.ofNullable(processService.getById(processId)).orElseThrow(() -> new BusinessException("未找到流程,创建图谱失败"));
+ Process process = Optional.ofNullable(processService.getById(processId)).orElseThrow(() -> new BusinessException("Workflow not found, failed to create map"));
// 根据processId找到对应的诊疗计划,如果没有找到,说明治疗流程未完成,诊断失败
List treatmentPlanRecordList = treatmentPlanRecordService.lambdaQuery().eq(TreatmentPlanRecord::getProcessId, processId).list();
Integer disposalMethod = treatmentPlanRecordList.stream().findAny().orElse(new TreatmentPlanRecord()).getDisposalMethod();
- MedicalRec medicalRec = Optional.ofNullable(medicalRecService.getById(process.getMedicalRecId())).orElseThrow(() -> new BusinessException("未找到病历"));
+ MedicalRec medicalRec = Optional.ofNullable(medicalRecService.getById(process.getMedicalRecId())).orElseThrow(() -> new BusinessException("Medical records not found"));
// 首先创建一个病历
MedicalRecVertex medicalRecVertex = new MedicalRecVertex();
// 格式:患者名称-门诊/住院(时间)
// 如果没有填写治疗计划,默认为门诊
- medicalRecVertex.setNodeValue((ObjectUtil.isEmpty(disposalMethod) || disposalMethod == 0 ? "门诊" : "住院") + "-" + medicalRec.getPatientName() + "(" + DateUtil.format(process.getCreateTime(), "yyyy-MM-dd") + ")");
+ medicalRecVertex.setNodeValue((ObjectUtil.isEmpty(disposalMethod) || disposalMethod == 0 ? "Outpatient" : "Hospitalization") + "-" + medicalRec.getPatientName() + "(" + DateUtil.format(process.getCreateTime(), "yyyy-MM-dd") + ")");
medicalRecDao.insert(medicalRecVertex);
log.info("病历图谱ID:{}", medicalRecVertex.getId());
// 根据processId找到电子病历
- ProcessMedical processMedical = processMedicalService.lambdaQuery().eq(ProcessMedical::getProcessId, processId).oneOpt().orElseThrow(() -> new BusinessException("未找到电子病历"));
+ ProcessMedical processMedical = processMedicalService.lambdaQuery().eq(ProcessMedical::getProcessId, processId).oneOpt().orElseThrow(() -> new BusinessException("Medical records not found"));
ProcessMedicalVertex processMedicalVertex = new ProcessMedicalVertex();
- processMedicalVertex.setNodeValue("病历(" + DateUtil.format(processMedical.getCreateTime(), "yyyy-MM-dd") + ")");
+ processMedicalVertex.setNodeValue("medical record(" + DateUtil.format(processMedical.getCreateTime(), "yyyy-MM-dd") + ")");
processMedicalDao.insert(processMedicalVertex);
- medicalRecDao.insertEdge(medicalRecVertex, new SinglePropertyEdge("电子病历"), processMedicalVertex);
+ medicalRecDao.insertEdge(medicalRecVertex, new SinglePropertyEdge("Electronic Health Record"), processMedicalVertex);
// 创建主诉节点
if (StrUtil.isNotBlank(processMedical.getPatientSelfDesc())) {
SelfDescVertex selfDescVertex = new SelfDescVertex();
selfDescVertex.setNodeValue(processMedical.getPatientSelfDesc());
selfDescDao.insert(selfDescVertex);
// 保存节点之间的关系
- processMedicalDao.insertEdge(processMedicalVertex, new SinglePropertyEdge("主诉"), selfDescVertex);
+ processMedicalDao.insertEdge(processMedicalVertex, new SinglePropertyEdge("Chief Complaint"), selfDescVertex);
}
// 创建现病史节点
if (StrUtil.isNotBlank(processMedical.getIllnessHistory())) {
@@ -111,7 +111,7 @@ public class GraphNebulaServiceImpl implements GraphNebulaService {
illnessHistoryVertex.setNodeValue(processMedical.getIllnessHistory());
illnessHistoryDao.insert(illnessHistoryVertex);
// 保存节点之间的关系
- processMedicalDao.insertEdge(processMedicalVertex, new SinglePropertyEdge("现病史"), illnessHistoryVertex);
+ processMedicalDao.insertEdge(processMedicalVertex, new SinglePropertyEdge("Current Medical History"), illnessHistoryVertex);
}
// 创建个人史节点
if (StrUtil.isNotBlank(processMedical.getPersonalHistory())) {
@@ -119,7 +119,7 @@ public class GraphNebulaServiceImpl implements GraphNebulaService {
personalHistoryVertex.setNodeValue(processMedical.getPersonalHistory());
personalHistoryDao.insert(personalHistoryVertex);
// 保存节点之间的关系
- processMedicalDao.insertEdge(processMedicalVertex, new SinglePropertyEdge("个人史"), personalHistoryVertex);
+ processMedicalDao.insertEdge(processMedicalVertex, new SinglePropertyEdge("Past Medical History"), personalHistoryVertex);
}
// 创建过敏史节点
if (ObjectUtil.isNotEmpty(processMedical.getAllergyHistoryFlag()) && 1 == processMedical.getAllergyHistoryFlag() && StrUtil.isNotBlank(processMedical.getAllergyHistory())) {
@@ -127,7 +127,7 @@ public class GraphNebulaServiceImpl implements GraphNebulaService {
allergyHistoryVertex.setNodeValue(processMedical.getAllergyHistory());
allergyHistoryDao.insert(allergyHistoryVertex);
// 保存节点之间的关系
- processMedicalDao.insertEdge(processMedicalVertex, new SinglePropertyEdge("过敏史"), allergyHistoryVertex);
+ processMedicalDao.insertEdge(processMedicalVertex, new SinglePropertyEdge("allergy history"), allergyHistoryVertex);
}
// 创建既往史节点
if (ObjectUtil.isNotEmpty(processMedical.getPreviousHistoryFlag()) && 1 == processMedical.getPreviousHistoryFlag() && StrUtil.isNotBlank(processMedical.getPreviousHistory())) {
@@ -135,7 +135,7 @@ public class GraphNebulaServiceImpl implements GraphNebulaService {
previousHistoryVertex.setNodeValue(processMedical.getPreviousHistory());
previousHistoryDao.insert(previousHistoryVertex);
// 保存节点之间的关系
- processMedicalDao.insertEdge(processMedicalVertex, new SinglePropertyEdge("既往史"), previousHistoryVertex);
+ processMedicalDao.insertEdge(processMedicalVertex, new SinglePropertyEdge("Past Medical History"), previousHistoryVertex);
}
// 创建家族史节点
if (ObjectUtil.isNotEmpty(processMedical.getFamilyHistoryFlag()) && 1 == processMedical.getFamilyHistoryFlag() && StrUtil.isNotBlank(processMedical.getFamilyHistory())) {
@@ -143,7 +143,7 @@ public class GraphNebulaServiceImpl implements GraphNebulaService {
familyHistoryVertex.setNodeValue(processMedical.getFamilyHistory());
familyHistoryDao.insert(familyHistoryVertex);
// 保存节点之间的关系
- processMedicalDao.insertEdge(processMedicalVertex, new SinglePropertyEdge("家族史"), familyHistoryVertex);
+ processMedicalDao.insertEdge(processMedicalVertex, new SinglePropertyEdge("Family history"), familyHistoryVertex);
}
// 创建手术史节点
if (ObjectUtil.isNotEmpty(processMedical.getOperationHistory()) && 1 == processMedical.getOperationHistoryFlag() && StrUtil.isNotBlank(processMedical.getOperationHistory())) {
@@ -151,7 +151,7 @@ public class GraphNebulaServiceImpl implements GraphNebulaService {
operationHistoryVertex.setNodeValue(processMedical.getOperationHistory());
operationHistoryDao.insert(operationHistoryVertex);
// 保存节点之间的关系
- processMedicalDao.insertEdge(processMedicalVertex, new SinglePropertyEdge("手术史"), operationHistoryVertex);
+ processMedicalDao.insertEdge(processMedicalVertex, new SinglePropertyEdge("Surgical History"), operationHistoryVertex);
}
@@ -169,12 +169,12 @@ public class GraphNebulaServiceImpl implements GraphNebulaService {
PhysicalVertex physicalVertex = new PhysicalVertex();
physicalVertex.setNodeValue(tool.getToolName() + (location != null ? ("-" + location.getLocationName()) : ""));
physicalDao.insert(physicalVertex);
- processMedicalDao.insertEdge(medicalRecVertex, new SinglePropertyEdge("体格检查"), physicalVertex);
+ processMedicalDao.insertEdge(medicalRecVertex, new SinglePropertyEdge("physical examination"), physicalVertex);
// 获取查询结果,增加到结果节点中
PhysicalResultVertex physicalResultVertex = new PhysicalResultVertex();
- physicalResultVertex.setNodeValue(StrUtil.blankToDefault(physicalRecord.getResult(), "无相关资讯"));
+ physicalResultVertex.setNodeValue(StrUtil.blankToDefault(physicalRecord.getResult(), "No relevant information"));
physicalResultDao.insert(physicalResultVertex);
- physicalResultDao.insertEdge(physicalVertex, new SinglePropertyEdge("结果"), physicalResultVertex);
+ physicalResultDao.insertEdge(physicalVertex, new SinglePropertyEdge("result"), physicalResultVertex);
// 如果是证实诊断依据,添加到证实诊断依据里面去
if (NumberUtil.equals(1, physicalRecord.getBasisConfirmFlag())) {
physicalConfirmMap.put(physicalRecord.getId(), physicalVertex);
@@ -192,13 +192,13 @@ public class GraphNebulaServiceImpl implements GraphNebulaService {
ancillaryVertex.setNodeValue(configAncillaryItem.getItemName());
ancillaryDao.insert(ancillaryVertex);
// 保存病历和辅助检查连线
- medicalRecDao.insertEdge(medicalRecVertex, new SinglePropertyEdge("辅助检查"), ancillaryVertex);
+ medicalRecDao.insertEdge(medicalRecVertex, new SinglePropertyEdge("Auxiliary examination"), ancillaryVertex);
// 结果节点
AncillaryResultVertex ancillaryResultVertex = new AncillaryResultVertex();
- ancillaryResultVertex.setNodeValue(StrUtil.blankToDefault(diagnosisAncillaryRecord.getResult(), "无相关资讯"));
+ ancillaryResultVertex.setNodeValue(StrUtil.blankToDefault(diagnosisAncillaryRecord.getResult(), "No relevant information"));
ancillaryResultDao.insert(ancillaryResultVertex);
// 保存检查结果连线
- ancillaryDao.insertEdge(ancillaryVertex, new SinglePropertyEdge("结果"), ancillaryResultVertex);
+ ancillaryDao.insertEdge(ancillaryVertex, new SinglePropertyEdge("Results"), ancillaryResultVertex);
// 如果是证实诊断依据,添加到证实诊断依据里面去
if (NumberUtil.equals(1, diagnosisAncillaryRecord.getBasisConfirmFlag())) {
ancillaryConfirmMap.put(diagnosisAncillaryRecord.getId(), ancillaryVertex);
@@ -215,7 +215,7 @@ public class GraphNebulaServiceImpl implements GraphNebulaService {
DiagnosisVertex diagnosisVertex = new DiagnosisVertex();
diagnosisVertex.setNodeValue(disease.getDiseaseNameAlias());
diagnosisDao.insert(diagnosisVertex);
- diagnosisDao.insertEdge(medicalRecVertex, new SinglePropertyEdge("诊断"), diagnosisVertex);
+ diagnosisDao.insertEdge(medicalRecVertex, new SinglePropertyEdge("Diagnosis"), diagnosisVertex);
diagnosisMap.put(diagnosisPrimary.getId(), diagnosisVertex);
}
}
@@ -228,12 +228,12 @@ public class GraphNebulaServiceImpl implements GraphNebulaService {
// 如果疾病诊断不为空,则根据relationId,查询对应的体格检查节点
PhysicalVertex physicalVertex = physicalConfirmMap.get(relation.getRelationId());
if (ObjectUtil.isNotEmpty(physicalVertex)) {
- physicalDao.insertEdge(diagnosisVertex, new SinglePropertyEdge("依据"), physicalVertex);
+ physicalDao.insertEdge(diagnosisVertex, new SinglePropertyEdge("based on"), physicalVertex);
}
// 再尝试找辅助检查
AncillaryVertex ancillaryVertex = ancillaryConfirmMap.get(relation.getRelationId());
if (ObjectUtil.isNotEmpty(ancillaryVertex)) {
- ancillaryDao.insertEdge(diagnosisVertex, new SinglePropertyEdge("依据"), ancillaryVertex);
+ ancillaryDao.insertEdge(diagnosisVertex, new SinglePropertyEdge("based on"), ancillaryVertex);
}
}
}
@@ -245,7 +245,7 @@ public class GraphNebulaServiceImpl implements GraphNebulaService {
@Override
public GraphVO queryGraph(String processId, Integer level) {
- Process process = Optional.ofNullable(processService.getById(processId)).orElseThrow(() -> new BusinessException("未找到对应的问诊流程"));
+ Process process = Optional.ofNullable(processService.getById(processId)).orElseThrow(() -> new BusinessException("Corresponding consultation process not found"));
// 如果图谱ID为空,则创建图谱
if (StrUtil.isEmpty(process.getGraphId())) {
String graphId = creatGraphByNebula(processId);
diff --git a/virtual-patient-graph/src/main/resources/bootstrap.yml b/virtual-patient-graph/src/main/resources/bootstrap.yml
index 524e3266..d15fa1ce 100644
--- a/virtual-patient-graph/src/main/resources/bootstrap.yml
+++ b/virtual-patient-graph/src/main/resources/bootstrap.yml
@@ -1,5 +1,5 @@
spring:
profiles:
- active: dev
+ active: test
application:
name: virtual-patient-graph
\ No newline at end of file
diff --git a/virtual-patient-graph/src/test/java/com/supervision/VirtualPatientGraphApplicationTest.java b/virtual-patient-graph/src/test/java/com/supervision/VirtualPatientGraphApplicationTest.java
new file mode 100644
index 00000000..a8842e60
--- /dev/null
+++ b/virtual-patient-graph/src/test/java/com/supervision/VirtualPatientGraphApplicationTest.java
@@ -0,0 +1,27 @@
+package com.supervision;
+
+import cn.hutool.json.JSONUtil;
+import com.supervision.service.GraphNebulaService;
+import com.supervision.vo.TreeNodeVO;
+import lombok.extern.slf4j.Slf4j;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
+
+import java.util.List;
+
+@Slf4j
+@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
+@RunWith(SpringJUnit4ClassRunner.class)
+public class VirtualPatientGraphApplicationTest {
+
+ @Autowired
+ private GraphNebulaService graphNebulaService;
+ @Test
+ public void contextLoads() {
+ List treeNodeVOS = graphNebulaService.queryTreeGraph("1955889668823777281", 3);
+ System.out.println(JSONUtil.toJsonStr(treeNodeVOS));
+ }
+}
diff --git a/virtual-patient-manage/src/main/java/com/supervision/manage/controller/system/UserManager.java b/virtual-patient-manage/src/main/java/com/supervision/manage/controller/system/UserManager.java
index c34b8165..27125abd 100644
--- a/virtual-patient-manage/src/main/java/com/supervision/manage/controller/system/UserManager.java
+++ b/virtual-patient-manage/src/main/java/com/supervision/manage/controller/system/UserManager.java
@@ -38,7 +38,7 @@ public class UserManager {
Assert.notBlank(user.getPassword(), "用户密码不能为空");
Assert.notEmpty(user.getRoleCode(), "用户角色不能为空");
if (0 > userService.lambdaQuery().eq(User::getAccount, user.getAccount()).count()) {
- throw new BusinessException("账户名已存在");
+ throw new BusinessException("Account name already exists");
}
userService.save(user);
}
diff --git a/virtual-patient-manage/src/main/java/com/supervision/manage/enums/VirtualSheetNameEnum.java b/virtual-patient-manage/src/main/java/com/supervision/manage/enums/VirtualSheetNameEnum.java
index f115373e..a891aff6 100644
--- a/virtual-patient-manage/src/main/java/com/supervision/manage/enums/VirtualSheetNameEnum.java
+++ b/virtual-patient-manage/src/main/java/com/supervision/manage/enums/VirtualSheetNameEnum.java
@@ -12,9 +12,9 @@ public enum VirtualSheetNameEnum {
BASIC_INFO("基本信息"),
CLINICAL_INTERVIEW("临床问诊"),
- PHYSICAL_EXAMINATION("体格检查"),
- AUXILIARY_EXAMINATION("辅助检查"),
- TREATMENT_PLAN("处置计划"),
+ PHYSICAL_EXAMINATION("physical examination"),
+ AUXILIARY_EXAMINATION("Auxiliary examination"),
+ TREATMENT_PLAN("Disposal Plan"),
SUMMARY_OF_EVALUATION_RESULTS("评估结果概述"),
;
diff --git a/virtual-patient-manage/src/main/java/com/supervision/manage/service/impl/DiseaseTreatmentPlanManageServiceImpl.java b/virtual-patient-manage/src/main/java/com/supervision/manage/service/impl/DiseaseTreatmentPlanManageServiceImpl.java
index 90be8e4d..64dab84c 100644
--- a/virtual-patient-manage/src/main/java/com/supervision/manage/service/impl/DiseaseTreatmentPlanManageServiceImpl.java
+++ b/virtual-patient-manage/src/main/java/com/supervision/manage/service/impl/DiseaseTreatmentPlanManageServiceImpl.java
@@ -249,7 +249,7 @@ public class DiseaseTreatmentPlanManageServiceImpl implements DiseaseTreatmentPl
for (int i = 0; i < listList.size(); i++) {
List