fix(doctorstation): 解决医嘱删除时的空指针异常和费用项处理问题

- 添加了对EMR详情中的contextJson字段进行空值检查,避免解析空值导致异常
- 优化了医嘱删除时的patientId和encounterId补全逻辑,支持从药品、耗材、诊疗医嘱记录中获取缺失信息
- 修复了删除不同类型医嘱时费用项过滤问题,确保只处理对应类型的费用项目
- 简化了费用项删除逻辑,移除冗余的查询验证步骤,直接执行删除操作
- 增强了日志记录,便于追踪医嘱删除过程中的关键操作和状态变化
This commit is contained in:
2026-03-24 13:27:31 +08:00
parent 9f6e94da4b
commit c2b1d7d9d9
2 changed files with 70 additions and 39 deletions

View File

@@ -2340,11 +2340,13 @@ function handleEmrTreatment() {
}
});
getEmrDetail(props.patientInfo.encounterId).then((res) => {
// 🔧 BugFix#219: 添加空值检查
const contextJson = res.data?.contextJson ? JSON.parse(res.data.contextJson) : {};
saveEmr({
patientId: props.patientInfo.patientId,
encounterId: props.patientInfo.encounterId,
contextJson: {
...JSON.parse(res.data.contextJson),
...contextJson,
treatment: treatment,
},
});