BMS-HOSxP Community

HOSxP => Report Exchange => ข้อความที่เริ่มโดย: phatipan2 ที่ ตุลาคม 25, 2009, 10:36:44 AM

หัวข้อ: อยากได้รายงานโรคเบาหวาน(E112,E113,E119)และความดัน(I10)ที่มี โรคI64,I613ร่วมด้วย
เริ่มหัวข้อโดย: phatipan2 ที่ ตุลาคม 25, 2009, 10:36:44 AM
อยากได้รายงานโรคเบาหวาน(E112,E113,E119)และความดัน(I10)ที่มี โรคI64,I613,I500,N189,I259 อย่างใดอย่างหนึ่งร่วมอยู่ด้วย ครับ ตัวอย่างใช้คำสั่งไม่ถูกต้อง ครับ ช่วยด้วย ครับ
หัวข้อ: Re: อยากได้รายงานโรคเบาหวาน(E112,E113,E119)และความดัน(I10)ที่มี โรคI64,I613ร่วมด้วย
เริ่มหัวข้อโดย: atit ที่ ตุลาคม 25, 2009, 14:15:42 PM
1.แนะนำตัวด้วยครับ
2.ลองดึงจากคลินิกก่อนซิครับ
select v.hn,c1.name,v.vstdate,concat(p.pname,p.fname,"   ",p.lname)as f_name,concat(p.addrpart," ","Á.",p.moopart," ",a.full_name) as tt
,if(v.sex="1","ªÒÂ","Ë­Ô§")as sex,v.pttype,pt.name,concat(v.age_y," ","»Õ"," ",v.age_m," ","à´×͹")as age
from vn_stat v
left outer join patient p on p.hn=v.hn
left outer join clinicmember c on c.hn=p.hn
left outer join clinic c1 on c1.clinic=c.clinic
left outer join thaiaddress a on a.addressid=v.aid
left outer join pttype pt on pt.pttype=v.pttype
left outer join icd101 i on i.code = v.pdx
where v.vstdate between "2009-10-01" and "2009-10-10"  and c.clinic in(001,002)
and i.code in ("I64","I613","I500","N189","I259")