ผู้เขียน หัวข้อ: กรองผู้ป่วยเบาหวานที่ไม่มีภาวะแทรกซ้อน (กรองจากผลวินิจฉัย)  (อ่าน 3803 ครั้ง)

0 สมาชิก และ 1 บุคคลทั่วไป กำลังดูหัวข้อนี้

ออฟไลน์ Bluebird

  • Hero Member
  • *****
  • กระทู้: 1,062
  • Respect: +2
    • ดูรายละเอียด
    • โรงพยาบาลระแงะ จังหวัดนราธิวาส
select pt.cid,pt.hn, concat(pt.pname,pt.fname,"  ",pt.lname) as fullname,pt.birthday,concat(pt.addrpart," หมู่ ",pt.moopart," ต.",t3.name," อ.",t2.name," จ.",t1.name) as fulladdressname,
pt.moopart, ov.age_y
from ovst ovst
left outer join patient pt on pt.hn=ovst.hn
left outer join vn_stat ov on ov.vn=ovst.vn
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
where  ov.vstdate between "2010-10-01" and "2010-10-31"
and ov.aid="960501"
and ov.moopart ="2"
and ( (ov.pdx = "E10")
 or (ov.dx0 = "E10")
 or (ov.dx1 = "E10")
 or (ov.dx2 = "E10")
 or (ov.dx3 = "E10")
 or (ov.dx4 = "E10")
 or (ov.dx5 = "E10")
 or (ov.pdx = "E11")
 or (ov.dx0 = "E11")
 or (ov.dx1 = "E11")
 or (ov.dx2 = "E11")
 or (ov.dx3 = "E11")
 or (ov.dx4 = "E11")
 or (ov.dx5 = "E11")
 or (ov.pdx = "E109")
 or (ov.dx0 = "E109")
 or (ov.dx1 = "E109")
 or (ov.dx2 = "E109")
 or (ov.dx3 = "E109")
 or (ov.dx4 = "E109")
 or (ov.dx5 = "E109")
 or (ov.pdx = "E119")
 or (ov.dx0 = "E119")
 or (ov.dx1 = "E119")
 or (ov.dx2 = "E119")
 or (ov.dx3 = "E119")
 or (ov.dx4 = "E119")
 or (ov.dx5 = "E119")
 or (ov.pdx = "E129")
 or (ov.dx0 = "E129")
 or (ov.dx1 = "E129")
 or (ov.dx2 = "E129")
 or (ov.dx3 = "E129")
 or (ov.dx4 = "E129")
 or (ov.dx5 = "E129")
 or (ov.pdx = "E139")
 or (ov.dx0 = "E139")
 or (ov.dx1 = "E139")
 or (ov.dx2 = "E139")
 or (ov.dx3 = "E139")
 or (ov.dx4 = "E139")
 or (ov.dx5 = "E139")
 or (ov.pdx = "E149")
 or (ov.dx0 = "E149")
 or (ov.dx1 = "E149")
 or (ov.dx2 = "E149")
 or (ov.dx3 = "E149")
 or (ov.dx4 = "E149")
 or (ov.dx5 = "E149")  )
group by ov.hn
order by pt.moopart,pt.hn


อยากทราบว่าคำสั่งนี้สามารถใช้ได้ไหมครับ เพราะว่ามีบางคนที่เป็นเบาหวานแต่ยังไม่ได้ลงในทะเบียนคลีนิคเบาหวานอีก ก็เลยอยากดึงจากผลวินิจฉัยที่แพทย์สรุป  และอยากทราบคำสั่งที่ใช้ในการดึงกับผู้ป่วยเบาหวานที่มีภาวพแทรกซ้อน
นักวิชาการคอมพิวเตอร์ โรงพยาบาลระแงะ  จังหวัดนราธิวาส
www.rangaehospital.com

เริ่มใช้งานระบบ 1 ตุลาคม 2550
Server     :  HP Proliant DL180G6 RAM 16Gb. 
Replicate  : DELL PowerEdge 1800   RAM 16 Gb.
MySQL 5.5.31
OS CentOS 5 64bit
HOSxP Version : 3.59.4.27(ตาม Version ที่ออกใหม่ล่าสุด)