fix(doctorstation): 解决医嘱签发时关键字段缺失问题 bug#181
- 处理前端体征字段中的 null 值转换为空字符串 - 移除后端保存和签发逻辑中的条件判断,确保关键字段始终被设置 - 修复 BUG #181 中医嘱签发时缺少必要业务字段的问题 - 统一保存和签发流程中的字段赋值逻辑 - 保持业务编号在签发时的一致性处理
This commit is contained in:
@@ -634,9 +634,11 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
|
|||||||
if (is_sign) {
|
if (is_sign) {
|
||||||
medicationRequest.setSignCode(signCode);
|
medicationRequest.setSignCode(signCode);
|
||||||
}
|
}
|
||||||
// 保存时,处理数据(请求,发放,账单)
|
// 🔧 Bug Fix: 签发时也需要设置关键字段(修复BUG #181)
|
||||||
|
// 保存时生成业务编号,签发时沿用已有编号
|
||||||
if (is_save) {
|
if (is_save) {
|
||||||
medicationRequest.setBusNo(assignSeqUtil.getSeqByDay(AssignSeqEnum.MEDICATION_RES_NO.getPrefix(), 4));
|
medicationRequest.setBusNo(assignSeqUtil.getSeqByDay(AssignSeqEnum.MEDICATION_RES_NO.getPrefix(), 4));
|
||||||
|
}
|
||||||
medicationRequest.setGenerateSourceEnum(GenerateSource.DOCTOR_PRESCRIPTION.getValue()); // 生成来源
|
medicationRequest.setGenerateSourceEnum(GenerateSource.DOCTOR_PRESCRIPTION.getValue()); // 生成来源
|
||||||
medicationRequest.setQuantity(adviceSaveDto.getQuantity()); // 请求数量
|
medicationRequest.setQuantity(adviceSaveDto.getQuantity()); // 请求数量
|
||||||
medicationRequest.setExecuteNum(adviceSaveDto.getExecuteNum()); // 执行次数
|
medicationRequest.setExecuteNum(adviceSaveDto.getExecuteNum()); // 执行次数
|
||||||
@@ -665,7 +667,7 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
|
|||||||
medicationRequest.setSkinTestFlag(adviceSaveDto.getSkinTestFlag()); // 皮试标志
|
medicationRequest.setSkinTestFlag(adviceSaveDto.getSkinTestFlag()); // 皮试标志
|
||||||
medicationRequest.setInfusionFlag(adviceSaveDto.getInjectFlag()); // 输液标志
|
medicationRequest.setInfusionFlag(adviceSaveDto.getInjectFlag()); // 输液标志
|
||||||
medicationRequest.setSortNumber(adviceSaveDto.getSortNumber()); // 排序号
|
medicationRequest.setSortNumber(adviceSaveDto.getSortNumber()); // 排序号
|
||||||
}
|
|
||||||
if (medicationRequest.getId() == null) {
|
if (medicationRequest.getId() == null) {
|
||||||
firstTimeSave = true;
|
firstTimeSave = true;
|
||||||
}
|
}
|
||||||
@@ -896,9 +898,11 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
|
|||||||
deviceRequest.setCreateBy(currentUsername); // 设置创建人
|
deviceRequest.setCreateBy(currentUsername); // 设置创建人
|
||||||
deviceRequest.setCreateTime(curDate); // 设置创建时间
|
deviceRequest.setCreateTime(curDate); // 设置创建时间
|
||||||
|
|
||||||
// 保存时,处理数据(请求,发放,账单)
|
// 🔧 Bug Fix: 签发时也需要设置关键字段(修复BUG #181)
|
||||||
|
// 保存时生成业务编号,签发时沿用已有编号
|
||||||
if (is_save) {
|
if (is_save) {
|
||||||
deviceRequest.setBusNo(assignSeqUtil.getSeqByDay(AssignSeqEnum.DEVICE_RES_NO.getPrefix(), 4));
|
deviceRequest.setBusNo(assignSeqUtil.getSeqByDay(AssignSeqEnum.DEVICE_RES_NO.getPrefix(), 4));
|
||||||
|
}
|
||||||
deviceRequest.setGenerateSourceEnum(GenerateSource.DOCTOR_PRESCRIPTION.getValue()); // 生成来源
|
deviceRequest.setGenerateSourceEnum(GenerateSource.DOCTOR_PRESCRIPTION.getValue()); // 生成来源
|
||||||
deviceRequest.setQuantity(adviceSaveDto.getQuantity()); // 请求数量
|
deviceRequest.setQuantity(adviceSaveDto.getQuantity()); // 请求数量
|
||||||
deviceRequest.setUnitCode(adviceSaveDto.getUnitCode()); // 请求单位编码
|
deviceRequest.setUnitCode(adviceSaveDto.getUnitCode()); // 请求单位编码
|
||||||
@@ -920,7 +924,6 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
|
|||||||
deviceRequest.setConditionId(adviceSaveDto.getConditionId()); // 诊断id
|
deviceRequest.setConditionId(adviceSaveDto.getConditionId()); // 诊断id
|
||||||
deviceRequest.setEncounterDiagnosisId(adviceSaveDto.getEncounterDiagnosisId()); // 就诊诊断id
|
deviceRequest.setEncounterDiagnosisId(adviceSaveDto.getEncounterDiagnosisId()); // 就诊诊断id
|
||||||
|
|
||||||
}
|
|
||||||
iDeviceRequestService.saveOrUpdate(deviceRequest);
|
iDeviceRequestService.saveOrUpdate(deviceRequest);
|
||||||
if (is_save) {
|
if (is_save) {
|
||||||
// 处理耗材发放
|
// 处理耗材发放
|
||||||
@@ -1047,9 +1050,11 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
|
|||||||
if (is_sign) {
|
if (is_sign) {
|
||||||
serviceRequest.setSignCode(signCode);
|
serviceRequest.setSignCode(signCode);
|
||||||
}
|
}
|
||||||
// 只有保存时才处理的字段属性
|
// 🔧 Bug Fix: 签发时也需要设置关键字段(修复BUG #181)
|
||||||
|
// 保存时生成业务编号,签发时沿用已有编号
|
||||||
if (is_save) {
|
if (is_save) {
|
||||||
serviceRequest.setBusNo(assignSeqUtil.getSeqByDay(AssignSeqEnum.SERVICE_RES_NO.getPrefix(), 4));
|
serviceRequest.setBusNo(assignSeqUtil.getSeqByDay(AssignSeqEnum.SERVICE_RES_NO.getPrefix(), 4));
|
||||||
|
}
|
||||||
serviceRequest.setGenerateSourceEnum(GenerateSource.DOCTOR_PRESCRIPTION.getValue()); // 生成来源
|
serviceRequest.setGenerateSourceEnum(GenerateSource.DOCTOR_PRESCRIPTION.getValue()); // 生成来源
|
||||||
serviceRequest.setQuantity(adviceSaveDto.getQuantity()); // 请求数量
|
serviceRequest.setQuantity(adviceSaveDto.getQuantity()); // 请求数量
|
||||||
serviceRequest.setUnitCode(adviceSaveDto.getUnitCode()); // 请求单位编码
|
serviceRequest.setUnitCode(adviceSaveDto.getUnitCode()); // 请求单位编码
|
||||||
@@ -1083,8 +1088,6 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
|
|||||||
serviceRequest.setBasedOnTable(CommonConstants.TableName.MED_MEDICATION_REQUEST);
|
serviceRequest.setBasedOnTable(CommonConstants.TableName.MED_MEDICATION_REQUEST);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
iServiceRequestService.saveOrUpdate(serviceRequest);
|
iServiceRequestService.saveOrUpdate(serviceRequest);
|
||||||
|
|
||||||
// 保存时保存诊疗费用项
|
// 保存时保存诊疗费用项
|
||||||
|
|||||||
@@ -575,7 +575,8 @@ const handleSubmit = async () => {
|
|||||||
const vitalSignFields = ['height', 'weight', 'temperature', 'hertRate', 'pulse', 'endBloodPressure', 'highBloodPressure'];
|
const vitalSignFields = ['height', 'weight', 'temperature', 'hertRate', 'pulse', 'endBloodPressure', 'highBloodPressure'];
|
||||||
if (vitalSignFields.includes(key)) {
|
if (vitalSignFields.includes(key)) {
|
||||||
// 体征字段:提交所有值,包括空字符串(用于清除数据)
|
// 体征字段:提交所有值,包括空字符串(用于清除数据)
|
||||||
formData[key] = value === undefined ? '' : value;
|
// 处理 undefined 和 null 都转为空字符串
|
||||||
|
formData[key] = (value === undefined || value === null) ? '' : String(value);
|
||||||
} else if (value !== '' && value !== null && value !== undefined) {
|
} else if (value !== '' && value !== null && value !== undefined) {
|
||||||
// 其他字段:只保留非空值
|
// 其他字段:只保留非空值
|
||||||
formData[key] = value;
|
formData[key] = value;
|
||||||
|
|||||||
Reference in New Issue
Block a user