select o.科室,o.出院人数,
nvl(p.康复治疗例数,0) 康复治疗例数,
round((nvl(p.康复治疗例数,0)/o.出院人数*100),2)||'%' 康复治疗使用率,
nvl(p.中医非药物疗法,0) 中医非药物疗法,
round((nvl(p.中医非药物疗法,0)/o.出院人数*100),2)||'%' 中医非药物疗法使用率,
nvl(p.中成药人数,0) 中成药人数,
nvl(p.中药饮片人数,0) 中药饮片人数,
nvl(p.中药类应用例数,0) 中药类应用例数,
round((nvl(p.中药类应用例数,0)/o.出院人数*100),2)||'%' 中药类应用例数使用率
from(select
b.名称 as 科室 ,count( *) 出院人数
from 病案主页 a, 部门表 b
where a.出院日期 between
[] and [1]
and a.出院科室id = b.id
group by b.名称) o,
(select c.名称,
sum(aa.康复) 康复治疗例数,
sum(aa.中成药) 中成药人数 ,
sum(aa.中药饮片) 中药饮片人数,
sum(aa.中医非药物治疗) 中医非药物疗法,
sum (aa.中药类) 中药类应用例数
from (select t.病人id,t.主页id, max(a.出院科室id) 出院科室 ,
max(case when t.收费细目id in (select u.id from 收费项目目录 u where u.病案费目='康复费') and t.实收金额>0 then 1 end) 康复,
max(case when t.收据费目='中成药费' and t.实收金额>0 then 1 end) 中成药,
max(case when t.收据费目='中草药费' and t.实收金额>0 then 1 end) 中药饮片,
max(case when t.收费细目id in (select u.id from 收费项目目录 u where u.病案费目='中医治疗费') and t.实收金额>0 then 1 end) 中医非药物治疗,
max(case when t.收据费目 in ('中草药费','中成药费') and t.实收金额>0 then 1 end) 中药类 from 住院费用记录 t, 病案主页 a
where a.病人id=t.病人id
and a.主页id=t.主页id
and a.出院日期 between
[] and [1]
group by t.病人id,t.主页id) aa, 部门表 c
where aa.出院科室=c.id
group by c.名称
) p
where o.科室=p.名称(+)
中药应用及治疗情况
最新推荐文章于 2024-07-17 20:22:19 发布