BMS-HOSxP Community
HOSxP => Report Exchange => ข้อความที่เริ่มโดย: prapansak ที่ ตุลาคม 14, 2011, 09:00:47 AM
-
พอดีเขียนรายงาน 20 อันดับโรค เสร็จแล้วต้องการแยกเป็นจำนวนคนที่มารับบริการและจำนวนครั้งที่มา
แต่ปัญหาคือเขียนโค้ดได้แค่คนที่มารับบริการแต่เขียน จำนวนครั้งเพิ่มเข้าไปไม่ได้ ช่วยดูให้หน่อยจ้า
select v.pdx,count(v.pdx) as pdx_count, i.name as icdname
from vn_stat v
left outer join icd101 i on i.code=v.pdx
left outer join ovst o on o.vn=v.vn
where v.vstdate between "2011-01-01" and "2011-01-31" and v.pdx is not null and v.pdx<>"" and main_dep=011
group by v.pdx,i.name,v.hn
order by pdx_count desc
limit 20
-
select v.pdx,count(distinct v.hn) as pdx_count,count(v.vn) as amount, i.name as icdname
from vn_stat v
left outer join icd101 i on i.code=v.pdx
left outer join ovst o on o.vn=v.vn
where v.vstdate between "2011-01-01" and "2011-01-31" and v.pdx is not null and v.pdx<>"" and main_dep=011
group by v.pdx
order by pdx_count desc
limit 20
-
ขอบคุณครับ
-
อ. เกื้อมี รายงาน 20 อันดับโรคผู้ป่วยใน ใหม่ครับุ ถ้ามีก็ขอหน่อยครับ ...
-
อ. เกื้อมี รายงาน 20 อันดับโรคผู้ป่วยใน ใหม่ครับุ ถ้ามีก็ขอหน่อยครับ ...
ทุกรายงานหลักมีอยู่แล้วครับ..ในนี้..
-
ถ้าจะนับโรคของผู้ป่วยห้องฉุกเฉิน
ผมจะนับจาก vn ใน er_regist ครับ..
main_dep ="011" อาจแค่มาทำแผล แต่ไปขอยาเบาหวาน หรือไปตรวจโรคอื่น ๆ
และหากจะนับโรค ผมจะไม่เอา Z ครับ...ไม่ใช่ป่วยรายใหม่ แต่เป็นการดูแลต่อเนื่องทั่วไปตามมาตรฐานครับ..
ทั้งทำแผลและรับวัคซินตามนัด.................. :D :D :D