fix: 修复Bug #318 - 使用contentJson替代note字段存储手术信息
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user