Files
his/openhis-server-new
关羽 7cac4701b9 Fix Bug #489: 【医嘱闭环】医生站签发单条长期药品医嘱,护士校对界面生成重复(两条)待校对记录
根因:selectInpatientAdvicePage 查询中,med_medication (T3) 和 med_medication_dispense (mmd) 的 LEFT JOIN 在一对多关系下产生笛卡尔积,导致单条药品医嘱返回多行重复记录。

修复方案:
1. 将 T3.total_volume 改为关联子查询,避免同一药品定义多条库存记录导致行倍增
2. 将 mmd.dispense_status 改为关联子查询,避免同一医嘱请求多条发药记录导致行倍增
3. 移除对应的 LEFT JOIN

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-10 16:04:14 +08:00
..