BMS-HOSxP Community

HOSxP => Report Exchange => ข้อความที่เริ่มโดย: tonkawhom ที่ มกราคม 19, 2011, 09:47:07 AM

หัวข้อ: ขอรายงานผู้ป่วยในคร้าๆๆๆ
เริ่มหัวข้อโดย: tonkawhom ที่ มกราคม 19, 2011, 09:47:07 AM
 ;D ขอรายงานการส่งต่อผู้ป่วยในจำแนกตามสิทธิบัตร    คะ ;D ;D
หัวข้อ: Re: ขอรายงานผู้ป่วยในคร้าๆๆๆ
เริ่มหัวข้อโดย: ไม่เสียสละ ชัยชนะไม่เกิด ที่ มกราคม 19, 2011, 10:23:37 AM
มีรูปแบบไหมครับ
หัวข้อ: Re: ขอรายงานผู้ป่วยในคร้าๆๆๆ
เริ่มหัวข้อโดย: niyomstd ที่ มกราคม 19, 2011, 10:33:48 AM
ลองเอา Code ไปปรับดูว่าใช้ได้หรือเปล่านะครับ ไม่รู้รายละเอียดครับ
select ro.department,ro.vn,ro.refer_number,ro.hn,d.name
as doctor_name,ro.refer_date,o.vstdate,ro.refer_time,o.vsttime,concat(p.pname,p.fname,'  ',p.lname)
as ptname,  concat(h.hosptype,' ',h.name) as hospname,pe.name as pttype_name,  r.name
as refername, ro.refer_point,ro.pre_diagnosis,ro.pdx as icd,ic.name as icd_name,o.vstdate
from referout ro  left outer join ovst o on o.vn = ro.vn
left outer join patient p on p.hn=ro.hn
left outer join hospcode h on h.hospcode = ro.hospcode
left outer join rfrcs r on r.rfrcs = ro.rfrcs
left outer join doctor d on d.code = ro.doctor
left outer join pttype pe on pe.pttype = o.pttype
left outer join icd101 ic on ic.code = ro.pdx
where   ro.department = 'IPD'and ro.refer_date between '2011-01-01' and '2011-01-02'
union  select ro.department,ro.vn,ro.refer_number,ro.hn,d.name as doctor_name,ro.refer_date,o.regdate as vstdate,ro.refer_time,o.regtime as vsttime,concat(p.pname,p.fname,'  ',p.lname) as ptname,  concat(h.hosptype,' ',h.name) as hospname,pe.name as pttype_name,  r.name as refername,ro.refer_point,ro.pre_diagnosis,ro.pdx as icd,ic.name as icd_name,o.regdate as vstdate   from referout ro  left outer join ipt o on o.an = ro.vn  left outer join patient p on p.hn=ro.hn  left outer join hospcode h on h.hospcode = ro.hospcode  left outer join rfrcs r on r.rfrcs = ro.rfrcs  left outer join doctor d on d.code = ro.doctor  left outer join pttype pe on pe.pttype = o.pttype  left outer join icd101 ic on ic.code = ro.pdx  where   ro.department = 'IPD' and ro.refer_date between '2011-01-01' and '2011-01-02'
order by pttype_name
หัวข้อ: Re: ขอรายงานผู้ป่วยในคร้าๆๆๆ
เริ่มหัวข้อโดย: tonkawhom ที่ มกราคม 19, 2011, 14:53:54 PM
ขอบคุณคะคุณพี่มะยมเดี๋ยวเอาไปลองปรับดู (หน้าตาประมาณนี้อะคะตามภาพ)