ผู้เขียน หัวข้อ: ช่วยแก้ code หน่อยครับ  (อ่าน 2393 ครั้ง)

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

ออฟไลน์ ploykot

  • Sr. Member
  • ****
  • กระทู้: 446
  • Respect: 0
    • ดูรายละเอียด
    • www.lkbh.go.th
ช่วยแก้ code หน่อยครับ
« เมื่อ: ตุลาคม 01, 2012, 15:45:43 PM »
0
select
p.pcucode,
p.`name`,
p.lname,
p.cid,
2012-year(p.birth),
p.changwat,
d.diagcode
from person p inner join diag d on p.pid = d.pid and p.pcucode = d.pcucode
where d.diagcode like 'F32%' or d.diagcode like 'F33%' or d.diagcode like 'F34%' or d.diagcode like 'F38%' or d.diagcode like 'F39%'
and p.cid not in (SELECT death.cid from death)
GROUP BY p.cid

พอดีจะดึงข้อมุลโรคซึมเศร้า ให้เว็บ วัดศรีมหาโพธิ์ แล้วมัน error ครับ ขอบคุณครับ
โรงพยาบาลลานกระบือ อำเภอลานกระบือ จังหวัดกำแพงเพชร ครับ
ขึ้นระบบประมาณเดือนสิงหาคม 54
เฟสบุ๊ค
http://www.facebook.com/kotnarak
เว็บไซต์
www.lkbh.go.th
ฝากตัวด้วยครับ ไม่ค่อยรู้เรื่องระบบท่าไร ต้องการคำแนะนำมากครับ ขอบคุณครับ

ออฟไลน์ nutsuanplu

  • Full Member
  • ***
  • กระทู้: 157
  • Respect: +3
    • ดูรายละเอียด
    • ฝากผลงาน web รายงานผล lab ด้วยครับ
Re: ช่วยแก้ code หน่อยครับ
« ตอบกลับ #1 เมื่อ: ตุลาคม 01, 2012, 15:56:42 PM »
0
select
p.pcucode,
p.`name`,
p.lname,
p.cid,
2012-year(p.birth),
p.changwat,
d.diagcode
from person p inner join diag d on p.pid = d.pid and p.pcucode = d.pcucode
where d.diagcode like 'F32%' or d.diagcode like 'F33%' or d.diagcode like 'F34%' or d.diagcode like 'F38%' or d.diagcode like 'F39%'
and p.cid not in (SELECT death.cid from death)
GROUP BY p.cid

พอดีจะดึงข้อมุลโรคซึมเศร้า ให้เว็บ วัดศรีมหาโพธิ์ แล้วมัน error ครับ ขอบคุณครับ

hosxp ไม่มีตาราง diag ลองไล่ดูใหม่ครับ
ณัฐวุฒิ วงษ์แพทย์
นักวิชาการคอมพิวเตอร์
โรงพยาบาลอู่ทอง จังหวัดสุพรรณบุรี

ออฟไลน์ เกื้อกูล ครับ..

  • Hero Member
  • *****
  • กระทู้: 12,611
  • Respect: +169
    • ดูรายละเอียด
    • โรงพยาบาลปากท่อ
Re: ช่วยแก้ code หน่อยครับ
« ตอบกลับ #2 เมื่อ: ตุลาคม 01, 2012, 23:00:12 PM »
0
select
p.pcucode,
p.`name`,
p.lname,
p.cid,
2012-year(p.birth),
p.changwat,
d.diagcode
from person p inner join diag d on p.pid = d.pid and p.pcucode = d.pcucode
where d.diagcode like 'F32%' or d.diagcode like 'F33%' or d.diagcode like 'F34%' or d.diagcode like 'F38%' or d.diagcode like 'F39%'
and p.cid not in (SELECT death.cid from death)
GROUP BY p.cid

พอดีจะดึงข้อมุลโรคซึมเศร้า ให้เว็บ วัดศรีมหาโพธิ์ แล้วมัน error ครับ ขอบคุณครับ

นั่นสิครับ..ตารางชื่อ diag  มาจากไหนครับ..มีแต่ ovstdiag  หรือ iptdiag  หรือจะหาจาก vn-stat ครับ
Implement  HOSxP  Start 2548 ---> NOW!
Station : 130 Client   V.3 Version  3.67.1.XX
Server  : CENTOS  +MySQL maria 10.x.x

ออฟไลน์ ploykot

  • Sr. Member
  • ****
  • กระทู้: 446
  • Respect: 0
    • ดูรายละเอียด
    • www.lkbh.go.th
Re: ช่วยแก้ code หน่อยครับ
« ตอบกลับ #3 เมื่อ: ตุลาคม 02, 2012, 08:32:20 AM »
0
ขอบคุณครับ
โรงพยาบาลลานกระบือ อำเภอลานกระบือ จังหวัดกำแพงเพชร ครับ
ขึ้นระบบประมาณเดือนสิงหาคม 54
เฟสบุ๊ค
http://www.facebook.com/kotnarak
เว็บไซต์
www.lkbh.go.th
ฝากตัวด้วยครับ ไม่ค่อยรู้เรื่องระบบท่าไร ต้องการคำแนะนำมากครับ ขอบคุณครับ