BMS-HOSxP Community
HOSxP => แจ้งปัญหา / ขอความช่วยเหลือ => ข้อความที่เริ่มโดย: tom_007 ที่ ตุลาคม 11, 2011, 10:32:23 AM
-
พอดีกำลังจะทำรายงาน ข้อมูลนะครับ แต่ไม่รู้ว่าเกิดอะไรขึ้น พอใช่คำสั่ง or an_stat.dx0 ถึง dx5 เข้าไป
เกี่ยวกับการกรองสิทธิ์การรักษา กับไม่ทำงาน ออกมาทุกสิทธิเลยครับ รบกวน อาจารย์หน่อยน่ะครับ
ผมไม่รู้ว่าผิดตรงไหน พึ่งหัดน่ะครับ
ChangeReportSQL('SELECT Count(DISTINCT an_stat.hn) AS hn1, an_stat.hn, patient.cid, '+
' an_stat.pdx,an_stat.an, concat(patient.pname,patient.fname," ",patient.lname) as nnn ,patient.pttype '+
' FROM an_stat '+
' INNER JOIN '+
' patient ON an_stat.hn = patient.hn '+
' WHERE an_stat.regdate BETWEEN "'+ds1+'" AND "'+ds2+'" AND '+
' patient.pttype in ("73","61","75","76","81","82","71","80","72","77","74","89","60","70","67","87","88","90","99") '+
' and an_stat.pdx IN ("N179", "N180", "N188", "N189", "N19") '+
'or an_stat.dx0 IN ("N179", "N180", "N188", "N189", "N19") '+
'or an_stat.dx1 IN ("N179", "N180", "N188", "N189", "N19") '+
'or an_stat.dx2 IN ("N179", "N180", "N188", "N189", "N19") '+
'or an_stat.dx3 IN ("N179", "N180", "N188", "N189", "N19") '+
'or an_stat.dx4 IN ("N179", "N180", "N188", "N189", "N19") '+
'or an_stat.dx5 IN ("N179", "N180", "N188", "N189", "N19") '+
' GROUP BY an_stat.hn '+
' order by patient.pttype DESC');
-
น่าจะเป็นแบบนี้ครับ
ChangeReportSQL('SELECT Count(DISTINCT an_stat.hn) AS hn1, an_stat.hn, patient.cid, '+
' an_stat.pdx,an_stat.an, concat(patient.pname,patient.fname," ",patient.lname) as nnn ,patient.pttype '+
' FROM an_stat '+
' INNER JOIN '+
' patient ON an_stat.hn = patient.hn '+
' WHERE an_stat.regdate BETWEEN "'+ds1+'" AND "'+ds2+'" AND '+
' patient.pttype in ("73","61","75","76","81","82","71","80","72","77","74","89","60","70","67","87","88","90","99") '+
' and an_stat.pdx IN ("N179", "N180", "N188", "N189", "N19") '+
' or an_stat.dx0 IN ("N179", "N180", "N188", "N189", "N19") '+
' and ( an_stat.dx1 IN ("N179", "N180", "N188", "N189", "N19") '+
' or an_stat.dx2 IN ("N179", "N180", "N188", "N189", "N19") '+
' or an_stat.dx3 IN ("N179", "N180", "N188", "N189", "N19") '+
' or an_stat.dx4 IN ("N179", "N180", "N188", "N189", "N19") '+
' or an_stat.dx5 IN ("N179", "N180", "N188", "N189", "N19") ) '+
' GROUP BY an_stat.hn '+
' order by patient.pttype DESC');
-
ลอง RUN ดูแล้ว ก้อออกตามปกติ นะครับ :D :D
-
ขอบคุณครับอาจารย์ ที่ชี้แนะ เดี๋ยวผมลองปรับดูก่อนน่ะครับ เเล้วจะมารายงานผล
ขอบคุณครับ
-
ยังไม่ได้เลยครับอาจารย์ คือ Run ข้อมูลออกปกติครับ
แต่ปัญหาคือ
คำสั่งนี้ไม่ทำงานครับ
patient.pttype in ("73","61","75","76","81","82","71","80","72","77","74","89","60","70","67","87","88","90","99") '+
คือ รายงานออกมาทุกสิทธิเลยครับ
แต่พอตัดคำสั่งนี้ออก
'or an_stat.dx0 IN ("N179", "N180", "N188", "N189", "N19") '+
'or an_stat.dx1 IN ("N179", "N180", "N188", "N189", "N19") '+
'or an_stat.dx2 IN ("N179", "N180", "N188", "N189", "N19") '+
'or an_stat.dx3 IN ("N179", "N180", "N188", "N189", "N19") '+
'or an_stat.dx4 IN ("N179", "N180", "N188", "N189", "N19") '+
'or an_stat.dx5 IN ("N179", "N180", "N188", "N189", "N19") '+
คำสั่งกรองสิทธิการรักษาข้างต้น กับทำงานปกติครับ รบกวนอาจารย์ด้วยครับ ต้องการด่วนจริง ๆ
-
เมื่อกี้ลองแก้ตามอาจารย์ pop_hosxp แต่ก็ยังไม่ได้ครับ
รบกวนอาจารย์อีกรอบครับ
-
ส่งตัวรายงานขึ้นมาครับ
-
ตามนี้เลยครับ
-
RUN แล้วก้อออกตามปกติครับ :) :)
-
ปัญหาคือ ตรง pttype น่ะครับ คือ อย่าได้แค่
patient.pttype IN ("73", "61", "75", "76", "81", "82", "71", "80", "72", "77",
"74", "89", "60", "70", "67", "87", "88", "90", "99")
แต่สิทธิมันออกมาหมด เลย เช่น 00 ,20,21,22,35 ซึ่งมันไม่มีในคำสั่งคำ ตอนนี้งงมากครับ
รบกวนอาจารย์ด้วยครับ
-
SELECT Count(DISTINCT an_stat.hn) AS hn1, an_stat.hn, patient.cid,
an_stat.pdx,an_stat.an, concat(patient.pname,patient.fname," ",patient.lname) as nnn ,patient.pttype
FROM an_stat
INNER JOIN
patient ON an_stat.hn = patient.hn and patient.pttype in ("73","61","75","76","81","82","71","80","72","77","74","89","60","70","67","87","88","90","99")
WHERE an_stat.regdate BETWEEN "2011-09-10" AND "2011-09-30"
and an_stat.pdx IN ("N179", "N180", "N188", "N189", "N19")
or an_stat.dx0 IN ("N179", "N180", "N188", "N189", "N19")
or an_stat.dx1 IN ("N179", "N180", "N188", "N189", "N19")
or an_stat.dx2 IN ("N179", "N180", "N188", "N189", "N19")
or an_stat.dx3 IN ("N179", "N180", "N188", "N189", "N19")
or an_stat.dx4 IN ("N179", "N180", "N188", "N189", "N19")
or an_stat.dx5 IN ("N179", "N180", "N188", "N189", "N19")
GROUP BY an_stat.hn
order by patient.pttype DESC
-
ต้องเขียนแบบอ. nahos ครับ ;D
-
:oได้เเล้วครับ ขอบคุณ อาจารย์ทุกๆ ๆท่านครับ ที่เข้ามาช่วยเหลือ :D
นี้เป็นรายงานเล็ก ๆ อาจไม่สำคัญคัญ แต่ก็อยากแชร์ครับ รายงานผู้ป่วยไตวายน่ะครับ
เสร็จสมบูรณ์ โดยท่านอาจารย์ทั้งหลายที่ช่วยชี้เเนะ ขอบคุณครับ จะได้ส่งงานเเล้ว เย้ ๆ