fix: 修复Bug #318 - 使用contentJson替代note字段存储手术信息

This commit is contained in:
2026-03-31 17:52:17 +08:00
parent 544d7ee95c
commit 6e5315fdd6

View File

@@ -256,25 +256,30 @@ public class RequestFormManageAppServiceImpl implements IRequestFormManageAppSer
surgeryServiceRequest.setEncounterId(encounterId);
surgeryServiceRequest.setAuthoredTime(curDate);
surgeryServiceRequest.setOrgId(orgId);
// 设置手术相关信息到 note 字段
StringBuilder noteBuilder = new StringBuilder();
// 设置手术相关信息到 contentJson 字段
Map<String, String> contentMap = new java.util.HashMap<>();
if (surgeryName != null && !surgeryName.isEmpty()) {
noteBuilder.append("手术名称:").append(surgeryName).append("; ");
contentMap.put("surgeryName", surgeryName);
}
if (surgeryCode != null && !surgeryCode.isEmpty()) {
noteBuilder.append("手术编码:").append(surgeryCode).append("; ");
contentMap.put("surgeryCode", surgeryCode);
}
if (plannedTime != null && !plannedTime.isEmpty()) {
noteBuilder.append("计划时间:").append(plannedTime).append("; ");
contentMap.put("plannedTime", plannedTime);
}
if (surgeryIndication != null && !surgeryIndication.isEmpty()) {
noteBuilder.append("手术指征:").append(surgeryIndication).append("; ");
contentMap.put("surgeryIndication", surgeryIndication);
}
if (preoperativeDiagnosis != null && !preoperativeDiagnosis.isEmpty()) {
noteBuilder.append("术前诊断:").append(preoperativeDiagnosis).append("; ");
contentMap.put("preoperativeDiagnosis", preoperativeDiagnosis);
}
if (noteBuilder.length() > 0) {
surgeryServiceRequest.setNote(noteBuilder.toString());
if (!contentMap.isEmpty()) {
try {
ObjectMapper objectMapper = new ObjectMapper();
surgeryServiceRequest.setContentJson(objectMapper.writeValueAsString(contentMap));
} catch (Exception e) {
log.error("序列化手术信息失败", e);
}
}
iServiceRequestService.save(surgeryServiceRequest);