ผู้เขียน หัวข้อ: ตรวจสอบโค้ด รายงานการคัดกรองการซึมเศร้า ให้หน่อยครับ  (อ่าน 2929 ครั้ง)

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

ออฟไลน์ jobzaaclub

  • Jr. Member
  • **
  • กระทู้: 79
  • Respect: 0
    • ดูรายละเอียด
คือผมต้องการดึงรายงานว่าในแต่ละแผนก เช่น เบาหวาน, ความดัน, จุดซักประวัติ, คลีนิกฝากครรภ์ เป็นต้น
มีการคัดกรองการซึมเศร้ากี่ราย ผมเลยเขียนโค้ดแบบนี้
โค๊ด: [Select]
select o.vn,o.hn,o.vstdate,concat(p.pname,p.fname," ",p.lname) as pname,
case d.depression_screen_evaluate_id
     when 9 then "»¡µÔ"
     when 1 then "ÃдѺ¹éÍÂ"
     when 2 then "ÃдѺ»Ò¹¡ÅÒ"
     when 3 then "ÃдѺÃعáÃ"
end as depcase
from ovst o
inner join depression_screen d on (o.vn=d.vn)
inner join patient p on (o.hn=p.hn)
where o.vstdate between "2012-10-01" and "2012-10-31"
and o.main_dep = "002"
and o.hn != "000000001"
ไม่ทราบว่าถูกต้องไหมครับ ระบุฟิวแผนกเป็น main_dep หรือควรเป็น cur_dep หรือ last_dep ดีครับ
Mr.Siripat Ketsampaw (Job)
เบอร์ 0806314511
Devil_lucifer@hotmail.it

โรงพยาบาลมะขาม
039-361528-9 #160

Server
IBM X3100 M4
CPU Intel Xeon 4-Core E3-1220v2 3.1GHz
Ram 12G
HD 500G
OS CentsOS 6.2
MySQL
HosXp 3.56.4.9

Client
CPU intel G870 3.1
Ram 4G
HD 1T
OS Windows 7 Ultimate 32bit
HOSXP 3.56.3.19

ขึ้นระบบวันที่ 1 ตุลาคม 2555
BMS ขึ้นระบบ