BMS-HOSxP Community

HOSxP => Report Exchange => ข้อความที่เริ่มโดย: ayu_ka1 ที่ เมษายน 04, 2008, 09:43:27 AM

หัวข้อ: รายงานยาเสพติด(Morphine)
เริ่มหัวข้อโดย: ayu_ka1 ที่ เมษายน 04, 2008, 09:43:27 AM
Mr.Nuttavut   มีรายงานยาเสพติด(Morphine) ยส.5 ส่ง อ.ย.ม้ยครับ  ถ้ามีช่วยโหลดมาด้วยครับ
หัวข้อ: Re: รายงานยาเสพติด(Morphine)
เริ่มหัวข้อโดย: sungoku ที่ เมษายน 04, 2008, 09:50:55 AM
select
concat(pt.pname,pt.fname,"  ",pt.lname) as fullname,
concat(pt.addrpart," ËÁÙè ",pt.moopart," µ.",t3.name," Í.",t2.name," ¨.",t1.name) as fulladdressname,
op.an,icode,qty,year(rxdate)-year(birthday) as age,rxdate,order_no
from ovst ov
left outer join patient pt on pt.hn=ov.hn
left outer join thaiaddress t1 on t1.chwpart=pt.chwpart and
     t1.amppart="00" and t1.tmbpart="00"
left outer join thaiaddress t2 on t2.chwpart=pt.chwpart and
     t2.amppart=pt.amppart and t2.tmbpart="00"
left outer join thaiaddress t3 on t3.chwpart=pt.chwpart and
     t3.amppart=pt.amppart and t3.tmbpart=pt.tmbpart
left outer join opitemrece op on op.hn=ov.hn

where op.rxdate between "2007-01-01" and "2007-01-01"  and op. icode ="1490006"   
  ตรง  icode นี้เปลี่ยนตามรหัสของยาmorphine ของท่านเองครับ


group by order_no
order by rxdate
หัวข้อ: Re: รายงานยาเสพติด(Morphine)
เริ่มหัวข้อโดย: sungoku ที่ เมษายน 04, 2008, 09:55:11 AM
ตัว custom ครับ  ลองเอาไปดู เปลี่ยน Icode เองอีกทีนะครับ