Files
his/md/bug-analysis/bug444-analysis.md

31 lines
1.8 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Bug #444 分析报告
## Bug 描述
生成临时医嘱界面,"已引用计费药品"列表未正常显示药品详细名称信息。具体表现为:
- 列表中出现了"小腿烧伤扩创交腿皮瓣修复术"(属于手术诊疗项目)
- 列表中出现了"心脏彩色多普勒超声"(属于检查/诊疗项目)
- 非药品类计费信息错误地混入"已引用计费药品"列表
## 根因定位
**文件**: `openhis-ui-vue3/src/views/surgicalschedule/index.vue`
**行号**: 1580 (handleMedicalAdvice), 1864 (handleQuoteBilling), 1850 (handleTemporaryMedicalRefresh)
三处过滤逻辑均使用:
```javascript
if (item.adviceType !== 1) return false;
```
**问题1主因**: `adviceType` 字段命名兼容不完整。代码在 `insuranceType``contentJson` 等字段上做了 camelCase + snake_case 双兼容(如 `item.insuranceType || item.insurance_type`),但 `adviceType` 只检查了 camelCase。若后端返回 snake_case 数据(`advice_type``item.adviceType``undefined``undefined !== 1``true`,导致所有非药品项目全部放行。
**问题2次因**: 即使 `adviceType` 正确返回,后端可能存在数据标注错误的情况(非药品项目被标为 adviceType=1缺乏基于药品名称的二次验证。
## 修复方案
1. `adviceType` 检查增加 snake_case 回退:`const at = item.adviceType ?? item.advice_type; if (at !== 1) return false;`
2. 增加药品名称关键字二次过滤:排除名称中包含"术"、"检查"、"超声"、"多普勒"等关键词的非药品项目
## 验收标准
1. "已引用计费药品"列表中只显示药品类项目
2. 不显示手术诊疗项目(如"小腿烧伤扩创交腿皮瓣修复术"
3. 不显示检查项目(如"心脏彩色多普勒超声"
4. 药品名称正常显示