BMS-HOSxP Community
HOSxP => Report Exchange => ข้อความที่เริ่มโดย: Terminator2015 ที่ มีนาคม 20, 2012, 10:37:35 AM
-
;D จากกระทู้นี้
http://hosxp.net/index.php?option=com_smf&Itemid=28&topic=24655.0
;D ลองทำดู 3 รายงานหลักๆ ที่จำเป็น โดยมีเงื่อนไข ดังนี้
1. นำเข้าตาราง drg.sql ตามไฟล์แนบ เพื่อออกรายงานเป็น drg ได้ (ทำตาม ภาพที่ 1 โดยใช้ Navicat ก็ได้)
2. ต้องคำนวณ DRG ทั้งหมดในช่วงที่ต้องการ เพื่อให้ได้ค่า adjrw จึงจะได้รายงานที่สมบูรณ์ยิ่งขึ้น (ตามภาพ ใช้ระบบผู้ป่วยใน > Check DRG ใช้แบบเมนูเก่าครับ)
(ปล. ท่านใดเอาไปก่อนหน้านี้ โหลดใหม่นะครับ ผมปรับใช้ adjrw ให้คำนวณทศนิยม 4 หลัก)
-
;D แนบภาพรายงานมาให้ดูด้วย
-
สุดยอดมาก ขอบคุณมากครับ ;D
-
ขอบคุณครับ
-
แจ่ม ;D ;D ;D ;D
-
กำลังวุ่นกันอยู่ครับพี่ ขอบคุณครับ :-* :-*
-
ขอบคุณครับ ;D ;D ;D
-
ขอบคุณครับ
-
Error 'MSVCR70.DLL'
-
;) UnitCost ประชุมใหม่ล่าสุด ให้ IT ดึงข้อมูล IPD OPD เข้าในฐาน Data.mdb (Access2007 หรือ Access2010) ลองเอา Script ตัวใหม่ไปดูนะครับ ผิดถูกอย่างไร ก็แนะนำบ้างนะครับ
-
ค่า RW เป็น 0 เกิดจากสาเหตุใดได้บ้างครับ
-
ค่า RW เป็น 0 เกิดจากสาเหตุใดได้บ้างครับ
1. ตรวจสอบ TGruper For DRG 4.0.45 หรือยังครับ
2. รายดังกล่าว ทำ Discharge สมบูรณ์หรือยัง ให้รหัส Pdx หรือยัง ครับ
-
ค่า RW เป็น 0 เกิดจากสาเหตุใดได้บ้างครับ
1. ตรวจสอบ TGruper For DRG 4.0.45 หรือยังครับ
2. รายดังกล่าว ทำ Discharge สมบูรณ์หรือยัง ให้รหัส Pdx หรือยัง ครับ
1.TGruper เป็นตัวที่มากับ HOSXP Full setup ครับ
2.ลง PDx เรียบร้อยครับ
เป็นบางเคสครับ
-
เท่าที่เจอ สลับ PDX ผิดพลาด หรือวันจำหน่ายกำหนดผิดน้อยกว่าวัน รับ admit และบางกรณีลืมใส่น้ำหนักครับ....เจอจาก Human Error เป็นส่วนใหญ่คัรบ...
ทางแก้ที่ดีคือลบข้อมูล D/C ทางหน้าจอโปรแกรมแล้วบันทึกใหม่ เพื่อทวนสอบว่ากรอกช่องใดพลาด ( บางทีมันเป็นม่านบังสายตาครับ )...เรื่องจริงจากประสบการณ์...
-
ขอบคุณมากครับ น่าจะตรงนะครับ ส่วนฟิลด์ IncDrug ต้องดึงจากตารางไหนมาครับ
-
ขอดันฟิลด์สุดท้าย หน่อยครับ ใช่ฟิลด์ inc_drug หรือเปล่าครับ
-
ขอแบบแยกฝ่ายบ้างครับ ห้องคลอด/ER ครับ อ.Terminator2012
-
ขอแบบแยกฝ่ายบ้างครับ ห้องคลอด/ER ครับ อ.Terminator2012
::) unitcost ตัวใหม่ ไม่มีนะครับ มีแต่ นำเข้า ipd กับ opd เท่านั้น
-
ขอแบบแยกฝ่ายบ้างครับ ห้องคลอด/ER ครับ อ.Terminator2012
::) unitcost ตัวใหม่ ไม่มีนะครับ มีแต่ นำเข้า ipd กับ opd เท่านั้น
Update ข้อมูลเมื่อไรครับจะได้เอาไปยืนยันกับหัวหน้าพยาบาล
-
Thank a lot
-
อยากทราบในส่วนของ IPD เราจะดึงข้อมูล incdrug จากส่วนไหนหรือครับ จากที่ดูข้อมูล ตาราง an_stat ไม่มีฟิลด์นี้เหมือนกับตาราง vn_stat ครับ หรือเอาไปเชื่อมโยงกลับไปที่ vn_stat โดยผูกกับ ฟิลด์ vn ครับผม ยังงๆอยู่ครับ ขอบคุณมากครับ
-
ดันอีกรอบครับ ใกล้ส่งแล้ว
-
ขอบคุณมากครับ
กำลังจะไปประชุมจัดทำ unitcostเลย
-
ขอบคุณครับ กำลังเหนื่อยกับเรื่องนี้จริง ๆ ดีหน่อยที่ไม่ได้เป็น รพ.นำร่องของจังหวัด
-
แล้ว in01,in02,in03...in17 ใน โปรแกรมที่ใช้ทำ unit cost ไม่ได้กำหนดตรงกับตัวที่เป็น income_group ในhosxpไม่ใช่เหรอครับ แล้วถ้าดึงจาก an_stat ,vn_stat จะได้ตรงกับที่ในโปรแกรม กำหนดหรือครับ.
-
ต้อง group เองครับ จัดให้ตรงกัน
-
;D คำสั่งที่ให้ group ให้ตรงตามโปรแกรม unit cost แล้วครับ เอาไปใหม่อีกนิดครับ สำหรับข้อมูล OPD ผมแยกค่ายากับค่าบริการ ออกจากกันให้ด้วยแล้ว ส่วน IPD ไม่รู้ว่าจะใช้คำสั่งไหนแยก ใครทำได้ช่วยแจกด้วยนะครับ (โปรแกรม CostPresentation Update 28 พ.ค.2555 ล่าสุด) โหลดตามไฟล์แนบครับ แตกไฟล์ไว้ D: และต้องเปิดด้วย MsOffice2010 เท่านั้นครับ
SELECT "11056" as hcode,a.vn,p.hn,a.cid,p.pname,p.fname,p.lname,p.birthday,p.sex,a.vstdate,s.name as pttypename,a.pdx,
a.dx0,a.dx1,a.dx2,a.dx3,a.dx4,a.dx5,a.op0,a.op1,a.op2,a.op3,a.op4,a.op5,a.inc16 as inc01,a.inc08 as inc02 ,inc_drug as inc03,0 as inc04,inc_nondrug as inc05,a.inc02 as inc06,a.inc01 as inc07,a.inc04 as inc08,a.inc05 as inc09,a.inc09 as inc10,a.inc06 as inc11,a.inc14 as inc12,a.inc11 as inc13,a.inc13 as inc14,0 as inc15,a.inc17 as inc16,0 as inc17
from vn_stat a
left JOIN patient p on p.hn=a.hn
LEFT JOIN pttype pty on pty.pttype=a.pttype
left JOIN pcode s on s.code=pty.pcode
WHERE a.vstdate BETWEEN '2010-10-01' and '2011-09-30'
-
รบกวนขอสอบถามเรื่อง CCRatio ของIPD/OPD ตัวนี้ดึงออกมาแล้วยอดต้องไปเท่ากับตัว ChargeIPD/OPDใช่หรือไม่คะ
-
มีคู่มือโปรแกรมด้วยไหมครับ ;D
;D คำสั่งที่ให้ group ให้ตรงตามโปรแกรม unit cost แล้วครับ เอาไปใหม่อีกนิดครับ สำหรับข้อมูล OPD ผมแยกค่ายากับค่าบริการ ออกจากกันให้ด้วยแล้ว ส่วน IPD ไม่รู้ว่าจะใช้คำสั่งไหนแยก ใครทำได้ช่วยแจกด้วยนะครับ (โปรแกรม CostPresentation Update 28 พ.ค.2555 ล่าสุด) โหลดตามไฟล์แนบครับ แตกไฟล์ไว้ D: และต้องเปิดด้วย MsOffice2010 เท่านั้นครับ
SELECT "11056" as hcode,a.vn,p.hn,a.cid,p.pname,p.fname,p.lname,p.birthday,p.sex,a.vstdate,s.name as pttypename,a.pdx,
a.dx0,a.dx1,a.dx2,a.dx3,a.dx4,a.dx5,a.op0,a.op1,a.op2,a.op3,a.op4,a.op5,a.inc16 as inc01,a.inc08 as inc02 ,inc_drug as inc03,0 as inc04,inc_nondrug as inc05,a.inc02 as inc06,a.inc01 as inc07,a.inc04 as inc08,a.inc05 as inc09,a.inc09 as inc10,a.inc06 as inc11,a.inc14 as inc12,a.inc11 as inc13,a.inc13 as inc14,0 as inc15,a.inc17 as inc16,0 as inc17
from vn_stat a
left JOIN patient p on p.hn=a.hn
LEFT JOIN pttype pty on pty.pttype=a.pttype
left JOIN pcode s on s.code=pty.pcode
WHERE a.vstdate BETWEEN '2010-10-01' and '2011-09-30'
-
มีคู่มือโปรแกรมด้วยไหมครับ ;D
;D เอางั้นเลยเหรอ ถ้างั้นรอแป๊บนะ
-
คู่มือ unitcost ดาวน์โหลดที่หน้า Web ครับ
http://cost.cfo.in.th
-
ขอบคุณครับพี่ทัศน์
ผมเองก็ทำขึ้นมาเหมือนกันครับ แต่ใช้การดึงค่าใช้จ่ายทั้ง 17 หมวดหมู่จากจากตาราง opitemrece แยกตามหมวดหมู่ของ income และ income_group ครับ แต่จะมีปัญหาก็คือเรื่องของยานอกบัญชีและในบัญชี เพราะผมเช็คไม่ได้ว่าฟิลด์ ed กับ ned ดูจากไหน เลยให้เภสัชเขาเอาชื่อยานอกบัญชีทั้งหมดมาแล้วผมก็จัดการนับตาม icode แทนครับ ตามตัวอย่างครับ
OPD
==============
set @hosp = '11053';
set @start_date = '2010-10-01';
set @end_date = '2011-09-30';
select @hosp as hcode,
v.vn, v.hn, pt.cid, pt.pname, pt.fname, pt.lname,
pt.birthday,
pt.sex,
v.vstdate,
pttype.name as pttypename,
v.pdx, v.dx0, v.dx1, v.dx2, v.dx3, v.dx4, v.dx5,
v.op0, v.op1, v.op2, v.op3, v.op4, v.op5,
(select IFNULL(sum(sum_price), '0.00') from opitemrece where income in ('01', '02','32','33','34','35','44') and vn=v.vn) as inc01,
(select IFNULL(sum(sum_price), '0.00') from opitemrece where income in ('30', '18', '24') and vn=v.vn) as inc02,
(select IFNULL(sum(sum_price), '0.00') from opitemrece where income = '03' and icode not in ('1000035', '1000054', '1000205', '1500603', '1480505', '1460004','1460010','1000053','1000039', '1000134', '1480504', '1000262', '1511001', '1430506', '1450001', '1450002', '1450505', '1481004', '1000013', '1000014', '1490508', '1000010', '1490504', '1000051', '1450020','1450001', '1450002', '1440505', '1440101') and vn=v.vn and item_type <> 'H') as inc03,
(select IFNULL(sum(sum_price), '0.00') from opitemrece where income = '03' and vn=v.vn and item_type='H') as inc04,
(select IFNULL(sum(sum_price), '0.00') from opitemrece where income = '19' and vn=v.vn) as inc05,
(select IFNULL(sum(sum_price), '0.00') from opitemrece where income = '26' and vn=v.vn) as inc06,
(select IFNULL(sum(sum_price), '0.00') from opitemrece where income in ('05', '27') and vn=v.vn) as inc07,
(select IFNULL(sum(sum_price), '0.00') from opitemrece where income in ('04', '06') and vn=v.vn) as inc08,
(select IFNULL(sum(sum_price), '0.00') from opitemrece where income in ('07', '23', '48', '50') and vn=v.vn) as inc09,
(select IFNULL(sum(sum_price), '0.00') from opitemrece where income = '24' and vn=v.vn) as inc10,
(select IFNULL(sum(sum_price), '0.00') from opitemrece where income in ('08', '10', '11') and vn=v.vn) as inc11,
(select IFNULL(sum(sum_price), '0.00') from opitemrece where income in ('13', '14', '15', '17','20','21','22','36','37','45','51','53','54','55') and vn=v.vn) as inc12,
(select IFNULL(sum(sum_price), '0.00') from opitemrece where income = '16' and vn=v.vn) as inc13,
(select IFNULL(sum(sum_price), '0.00') from opitemrece where income = '09' and vn=v.vn) as inc14,
(select IFNULL(sum(sum_price), '0.00') from opitemrece where income = '21' and vn=v.vn) as inc15,
(select IFNULL(sum(sum_price), '0.00') from opitemrece where income = '00' and vn=v.vn) as inc16,
(select IFNULL(sum(sum_price), '0.00') from opitemrece where icode in ('1000035', '1000054', '1000205', '1500603', '1480505', '1460004','1460010','1000053','1000039', '1000134', '1480504', '1000262', '1511001', '1430506', '1450001', '1450002', '1450505', '1481004', '1000013', '1000014', '1490508', '1000010', '1490504', '1000051', '1450020','1450001', '1450002', '1440505', '1440101') and vn=v.vn) as inc17
from vn_stat v
left join patient pt on pt.hn=v.hn
left join pttype on pttype.pttype=v.pttype
where v.vstdate between @start_date and @end_date
--- limit 10
IPD
=================
set @hosp = '11053';
set @start_date = '2010-10-01';
set @end_date = '2011-09-30';
select @hosp as hcode,
ipt.hn, ipt.an, ipt.vn, pt.pname, pt.fname, pt.lname,
pt.birthday,
pt.sex,
ipt.regdate,
ward.name as wardname, pttype.name as pttypename,
ipt.dchdate,
an_stat.pdx, an_stat.dx0, an_stat.dx1, an_stat.dx2, an_stat.dx3, an_stat.dx4, an_stat.dx5,
an_stat.op0, an_stat.op1, an_stat.op2, an_stat.op3, an_stat.op4, an_stat.op5, an_stat.op6,
(select sum(sum_price) from opitemrece where income in ('01', '02','32','33','34','35','44') and an=ipt.an) as inc01,
(select IFNULL(sum(sum_price), '0.00') from opitemrece where income in ('30', '18', '24') and an=ipt.an) as inc02,
(select IFNULL(sum(sum_price), '0.00') from opitemrece where income = '03' and icode not in ('1000035', '1000054', '1000205', '1500603', '1480505', '1460004','1460010','1000053','1000039', '1000134', '1480504', '1000262', '1511001', '1430506', '1450001', '1450002', '1450505', '1481004', '1000013', '1000014', '1490508', '1000010', '1490504', '1000051', '1450020','1450001', '1450002', '1440505', '1440101') and an=ipt.an and item_type <> 'H') as inc03,
(select IFNULL(sum(sum_price), '0.00') from opitemrece where income = '03' and an=ipt.an and item_type='H') as inc04,
(select IFNULL(sum(sum_price), '0.00') from opitemrece where income = '19' and an=ipt.an) as inc05,
(select IFNULL(sum(sum_price), '0.00') from opitemrece where income = '26' and an=ipt.an) as inc06,
(select IFNULL(sum(sum_price), '0.00') from opitemrece where income in ('05', '27') and an=ipt.an) as inc07,
(select IFNULL(sum(sum_price), '0.00') from opitemrece where income in ('04', '06') and an=ipt.an) as inc08,
(select IFNULL(sum(sum_price), '0.00') from opitemrece where income in ('07', '23', '48', '50') and an=ipt.an) as inc09,
(select IFNULL(sum(sum_price), '0.00') from opitemrece where income = '24' and an=ipt.an) as inc10,
(select IFNULL(sum(sum_price), '0.00') from opitemrece where income in ('08', '10', '11') and an=ipt.an) as inc11,
(select IFNULL(sum(sum_price), '0.00') from opitemrece where income in ('13', '14', '15', '17','20','21','22','36','37','45','51','53','54','55') and an=ipt.an) as inc12,
(select IFNULL(sum(sum_price), '0.00') from opitemrece where income = '16' and an=ipt.an) as inc13,
(select IFNULL(sum(sum_price), '0.00') from opitemrece where income = '09' and an=ipt.an) as inc14,
(select IFNULL(sum(sum_price), '0.00') from opitemrece where income = '21' and an=ipt.an) as inc15,
(select IFNULL(sum(sum_price), '0.00') from opitemrece where income = '00' and an=ipt.an) as inc16,
(select IFNULL(sum(sum_price), '0.00') from opitemrece where icode in ('1000035', '1000054', '1000205', '1500603', '1480505', '1460004','1460010','1000053','1000039', '1000134', '1480504', '1000262', '1511001', '1430506', '1450001', '1450002', '1450505', '1481004', '1000013', '1000014', '1490508', '1000010', '1490504', '1000051', '1450020','1450001', '1450002', '1440505', '1440101') and an=ipt.an) as inc17,
-- (select IFNULL(sum(sum_price), '0.00') from opitemrece where income = '03' and an=ipt.an) as drug,
an_stat.admdate as los, ipt.drg, ipt.rw, ipt.adjrw
from ipt
left join patient pt on pt.hn=ipt.hn
left join ward on ward.ward=ipt.ward
left join an_stat on an_stat.an=ipt.an
left join pttype on pttype.pttype=an_stat.pttype
where ipt.dchdate between @start_date and @end_date
-- limit 10
ผมก็ยังสงสัยว่า los มันคือค่าอะไรเพราะใน an_stat ผมมันว่าง ผมเลยเดาเอาว่าน่าจะเป็นวันนอน เลยดึงเอา admdate แทน ครับ
-
มันขึ้น error ครับ...แก้ตรงไหนครับ
-
มันขึ้น error ครับ...แก้ตรงไหนครับ
นำเข้าตาราง drg ในหน้าแรก ครับ
-
;D จากกระทู้นี้
http://hosxp.net/index.php?option=com_smf&Itemid=28&topic=24655.0
;D ลองทำดู 3 รายงานหลักๆ ที่จำเป็น โดยมีเงื่อนไข ดังนี้
1. นำเข้าตาราง drg.sql ตามไฟล์แนบ เพื่อออกรายงานเป็น drg ได้ (ทำตาม ภาพที่ 1 โดยใช้ Navicat ก็ได้)
2. ต้องคำนวณ DRG ทั้งหมดในช่วงที่ต้องการ เพื่อให้ได้ค่า adjrw จึงจะได้รายงานที่สมบูรณ์ยิ่งขึ้น (ตามภาพ ใช้ระบบผู้ป่วยใน > Check DRG ใช้แบบเมนูเก่าครับ)
(ปล. ท่านใดเอาไปก่อนหน้านี้ โหลดใหม่นะครับ ผมปรับใช้ adjrw ให้คำนวณทศนิยม 4 หลัก)
ผมใช้ Navicat ไม่เป็นครับ ใช้ SSH Secure Shell Client ได้ไหมครับ
-
ดันกระทู้คุณ Monalisa ครับ
ผมลองทดสอบและปรับใหม่ ตามบริบทโรงพยาบาลแล้ว โอเคเลยครับ
ส่วนฟิลด์ IncDrug ไม่ต้องส่งมาก็ได้ เพราะแฟ้ม Data ของ อ.สุกิจ จะรวมให้เอง (inco3+inc04+inc17)
แนบที่ปรับครับ
++++++++++++++OPD
set @hosp = '10948';
set @start_date = '2011-10-01';
set @end_date = '2012-03-31';
select @hosp as hcode,
v.vn, v.hn, pt.pname, pt.fname, pt.lname,
pt.birthday,
pt.sex,
v.vstdate,
pty.name as pttypename,
v.pdx, v.dx0, v.dx1, v.dx2, v.dx3, v.dx4, v.dx5,
v.op0, v.op1, v.op2, v.op3, v.op4, v.op5,
(select IFNULL(sum(sum_price), '0.00') from opitemrece op where op.income in ('01') and op.vn=v.vn) as inc01,
(select IFNULL(sum(sum_price), '0.00') from opitemrece op where op.income in ('02') and op.vn=v.vn) as inc02,
(select IFNULL(sum(sum_price), '0.00') from opitemrece op where op.icode like('1%') and op.vn=v.vn) as inc03,
(select IFNULL(sum(sum_price), '0.00') from opitemrece op where op.icode like('0%') and op.vn=v.vn) as inc04,
(select IFNULL(sum(sum_price), '0.00') from opitemrece op where op.income = '05' and op.vn=v.vn) as inc05,
(select IFNULL(sum(sum_price), '0.00') from opitemrece op where op.income = '06' and op.vn=v.vn) as inc06,
(select IFNULL(sum(sum_price), '0.00') from opitemrece op where op.income in ('07') and op.vn=v.vn) as inc07,
(select IFNULL(sum(sum_price), '0.00') from opitemrece op where op.income in ('08') and op.vn=v.vn) as inc08,
(select IFNULL(sum(sum_price), '0.00') from opitemrece op where op.income in ('09') and op.vn=v.vn) as inc09,
(select IFNULL(sum(sum_price), '0.00') from opitemrece op where op.income = '10' and op.vn=v.vn) as inc10,
(select IFNULL(sum(sum_price), '0.00') from opitemrece op where op.income in ('11') and op.vn=v.vn) as inc11,
(select IFNULL(sum(sum_price), '0.00') from opitemrece op where op.income in ('12') and op.icode not in('3000976','3000977','3903762','3908398','3900441','3904537','3904538','3904538','3904539','3908311','3908313','39083127','3908386')and op.vn=v.vn) as inc12,
(select IFNULL(sum(sum_price), '0.00') from opitemrece op where op.income = '13' and op.vn=v.vn) as inc13,
(select IFNULL(sum(sum_price), '0.00') from opitemrece op where op.income = '14' and op.vn=v.vn) as inc14,
(select IFNULL(sum(sum_price), '0.00') from opitemrece op where op.income = '15' and op.vn=v.vn) as inc15,
(select IFNULL(sum(sum_price), '0.00') from opitemrece op where op.icode in('3000976','3000977','3903762','3908398','3900441','3904537','3904538','3904538','3904539','3908311','3908313','39083127','3908386') and op.vn=v.vn) as inc16,
(select IFNULL(sum(sum_price), '0.00') from opitemrece op where op.icode like('1%**') and op.vn=v.vn) as inc17,
(select IFNULL(sum(sum_price), '0.00') from opitemrece op where op.icode like('1%') and op.vn=v.vn) as incDrug
from vn_stat v
left JOIN patient pt on pt.hn=v.hn
left join pttype pty on pty.pttype=v.pttype
left join doctor dc on dc.code=v.dx_doctor
where v.vstdate between @start_date and @end_date
and v.income<>'0.00'
++++++++++++++++++++IPD
set @hosp = '10948';
set @start_date = '2011-10-01';
set @end_date = '2012-03-31';
select @hosp as hcode,
i.vn, i.hn,pt.pname, pt.fname, pt.lname,
pt.birthday,
pt.sex,
pty.name as pttypename,i.regdate,i.dchdate,w.name as wardname,a.los,i.drg,i.rw,i.adjrw,
a.pdx, a.dx0, a.dx1, a.dx2, a.dx3, a.dx4, a.dx5,
a.op0, a.op1, a.op2, a.op3, a.op4, a.op5,
(select IFNULL(sum(sum_price), '0.00') from opitemrece op where op.income in ('01') and op.an=i.an) as inc01,
(select IFNULL(sum(sum_price), '0.00') from opitemrece op where op.income in ('02') and op.an=i.an) as inc02,
(select IFNULL(sum(sum_price), '0.00') from opitemrece op where op.icode like('1%') and op.item_type <> 'H' and op.an=i.an) as inc03,
(select IFNULL(sum(sum_price), '0.00') from opitemrece op where op.icode like('1%') and op.item_type = 'H' and op.an=i.an) as inc04,
(select IFNULL(sum(sum_price), '0.00') from opitemrece op where op.income = '05' and op.an=i.an) as inc05,
(select IFNULL(sum(sum_price), '0.00') from opitemrece op where op.income = '06' and op.an=i.an) as inc06,
(select IFNULL(sum(sum_price), '0.00') from opitemrece op where op.income in ('07') and op.an=i.an) as inc07,
(select IFNULL(sum(sum_price), '0.00') from opitemrece op where op.income in ('08') and op.an=i.an) as inc08,
(select IFNULL(sum(sum_price), '0.00') from opitemrece op where op.income in ('09') and op.an=i.an) as inc09,
(select IFNULL(sum(sum_price), '0.00') from opitemrece op where op.income = '10' and op.an=i.an) as inc10,
(select IFNULL(sum(sum_price), '0.00') from opitemrece op where op.income in ('11') and op.an=i.an) as inc11,
(select IFNULL(sum(sum_price), '0.00') from opitemrece op where op.income in ('12') and op.icode not in('3000976','3000977','3903762','3908398','3900441','3904537','3904538','3904538','3904539','3908311','3908313','39083127','3908386')and op.an=i.an) as inc12,
(select IFNULL(sum(sum_price), '0.00') from opitemrece op where op.income = '13' and op.an=i.an) as inc13,
(select IFNULL(sum(sum_price), '0.00') from opitemrece op where op.income = '14' and op.an=i.an) as inc14,
(select IFNULL(sum(sum_price), '0.00') from opitemrece op where op.income = '15' and op.an=i.an) as inc15,
(select IFNULL(sum(sum_price), '0.00') from opitemrece op where op.icode in('3000976','3000977','3903762','3908398','3900441','3904537','3904538','3904538','3904539','3908311','3908313','39083127','3908386') and op.an=i.an) as inc16,
(select IFNULL(sum(sum_price), '0.00') from opitemrece op where op.icode like('1%**') and op.an=i.an) as inc17,
(select IFNULL(sum(sum_price), '0.00') from opitemrece op where op.icode like('1%') and op.an=i.an) as incDrug
from ipt i
left join patient pt on pt.hn=i.hn
left join ward w on w.ward=i.ward
left join an_stat a on a.an=i.an
left join pttype pty on pty.pttype=i.pttype
where i.regdate between @start_date and @end_date
and a.income<>'0.00'
-
;D ;D ;D
-
ตอนนี้ทางพยาบาลแจ้งมาว่าให้เอา ตาราง ward โชว์ด้วยนะครับ ช่วยด้วยนะครับ
-
ตอนนี้ทางพยาบาลแจ้งมาว่าให้เพื่อ ตาราง ward ด้วยนะครับ ช่วยด้วยนะครับ
??? ??? ??? ???
-
SELECT 10786 AS hcode, v.vn, v.hn, v.cid, pt.pname, pt.fname, pt.lname,
pt.birthday, pt.sex, ward.name, v.vstdate, pty.name AS pttypename, v.pdx,
v.dx0, v.dx1, v.dx2, v.dx3, v.dx4, v.dx5, v.op0, v.op1, v.op2, v.op3, v.op4,
v.op5, (SELECT IfNull(Sum(op.sum_price), '0.00') FROM opitemrece op
WHERE op.income IN ('01') AND
op.vn = v.vn) AS inc01, (SELECT IfNull(Sum(op.sum_price), '0.00')
FROM opitemrece op
WHERE op.income IN ('02') AND
op.vn = v.vn) AS inc02, (SELECT IfNull(Sum(op.sum_price), '0.00')
FROM opitemrece op
WHERE op.icode LIKE ('1%') AND op.vn = v.vn) AS inc03, (SELECT
IfNull(Sum(op.sum_price), '0.00') FROM opitemrece op
WHERE op.icode LIKE ('0%') AND op.vn = v.vn) AS inc04, (SELECT
IfNull(Sum(op.sum_price), '0.00') FROM opitemrece op
WHERE op.income = '05' AND
op.vn = v.vn) AS inc05, (SELECT IfNull(Sum(op.sum_price), '0.00')
FROM opitemrece op
WHERE op.income = '06' AND
op.vn = v.vn) AS inc06, (SELECT IfNull(Sum(op.sum_price), '0.00')
FROM opitemrece op
WHERE op.income IN ('07') AND
op.vn = v.vn) AS inc07, (SELECT IfNull(Sum(op.sum_price), '0.00')
FROM opitemrece op
WHERE op.income IN ('08') AND
op.vn = v.vn) AS inc08, (SELECT IfNull(Sum(op.sum_price), '0.00')
FROM opitemrece op
WHERE op.income IN ('09') AND
op.vn = v.vn) AS inc09, (SELECT IfNull(Sum(op.sum_price), '0.00')
FROM opitemrece op
WHERE op.income = '10' AND
op.vn = v.vn) AS inc10, (SELECT IfNull(Sum(op.sum_price), '0.00')
FROM opitemrece op
WHERE op.income IN ('11') AND
op.vn = v.vn) AS inc11, (SELECT IfNull(Sum(op.sum_price), '0.00')
FROM opitemrece op
WHERE op.icode LIKE ('1%**') AND op.vn = v.vn) AS inc17, (SELECT
IfNull(Sum(op.sum_price), '0.00') FROM opitemrece op
WHERE op.income IN ('12') AND op.icode NOT IN ('3000976', '3000977',
'3903762', '3908398', '3900441', '3904537', '3904538', '3904538', '3904539',
'3908311', '3908313', '39083127', '3908386') AND op.vn = v.vn) AS inc12,
(SELECT IfNull(Sum(op.sum_price), '0.00') FROM opitemrece op
WHERE op.income = '13' AND
op.vn = v.vn) AS inc13, (SELECT IfNull(Sum(op.sum_price), '0.00')
FROM opitemrece op
WHERE op.income = '14' AND
op.vn = v.vn) AS inc14, (SELECT IfNull(Sum(op.sum_price), '0.00')
FROM opitemrece op
WHERE op.icode IN ('3000976', '3000977', '3903762', '3908398', '3900441',
'3904537', '3904538', '3904538', '3904539', '3908311', '3908313',
'39083127', '3908386') AND
op.vn = v.vn) AS inc16, (SELECT IfNull(Sum(op.sum_price), '0.00')
FROM opitemrece op
WHERE op.income = '15' AND
op.vn = v.vn) AS inc15, (SELECT IfNull(Sum(op.sum_price), '0.00')
FROM opitemrece op WHERE op.icode LIKE ('1%') AND op.vn = v.vn) AS incDrug
FROM vn_stat v LEFT JOIN
patient pt ON pt.hn = v.hn LEFT JOIN
pttype pty ON pty.pttype = v.pttype LEFT JOIN
doctor dc ON dc.code = v.dx_doctor, ward
WHERE v.vstdate BETWEEN '2010-10-01' AND '2010-10-31' AND v.income <> '0.00'
-
ขอบคุณครับ
-
เทพมากๆเลยคับพี่
-
ค่า ต้องคำนวน DRG ใหม่ใช้หรือเปล่าครับ ถ้าใช่แสดงว่าต้องส่งเป็น DRG V.5 ทั้งหมด
แล้วมันจะมีผลในเดือนที่ส่งรายงาน CMI ไปแล้วที่ใช่ DRG V.4 อย่างไรหรือเปล่าครับ
??? ???
-
;D update ให้ใหม่ล่าสุดก็แล้วกันครับ ยังมีถามๆ เข้ามาเยอะครับ ปรับให้แยก เวชภัณฑ์ และยา ออกจากกันทั้ง IPD และ OPD แล้วครับ
Script ดึง IPD Data
SELECT "11056" as hcode,a.an,p.hn,a.vn,p.pname,p.fname,p.lname,p.birthday,p.sex,a.regdate,a.dchdate,w.name as wardname,s.name as pttypename,a.los,i.drg,i.rw,i.adjrw,a.pdx,
a.dx0,a.dx1,a.dx2,a.dx3,a.dx4,a.dx5,a.op0,a.op1,a.op2,a.op3,a.op4,a.op5,a.op6,a.inc16 as inc01,a.inc08 as inc02 ,iis.uinc_drug as inc03,0 as inc04,iis.uinc_nondrug as inc05,a.inc02 as
inc06,a.inc01 as inc07,a.inc04 as inc08,a.inc05 as inc09,a.inc09 as inc10,a.inc06 as inc11,a.inc14 as inc12,a.inc11 as inc13,a.inc13 as inc14,0 as inc15,a.inc17 as inc16,0 as inc17 from an_stat
a
left JOIN patient p on p.hn=a.hn
left join inc_ipd_stat iis on iis.an=a.an
left JOIN ward w on w.ward=a.ward
LEFT JOIN pttype pty on pty.pttype=a.pttype
left JOIN pcode s on s.code=pty.pcode
LEFT JOIN ipt i ON i.an=a.an
WHERE a.dchdate BETWEEN '2011-10-01' and '2012-03-31'
Script ดึง OPD Data
SELECT "11056" as hcode,a.vn,p.hn,a.cid,p.pname,p.fname,p.lname,p.birthday,p.sex,a.vstdate,s.name as pttypename,a.pdx,
a.dx0,a.dx1,a.dx2,a.dx3,a.dx4,a.dx5,a.op0,a.op1,a.op2,a.op3,a.op4,a.op5,a.inc16 as inc01,a.inc08 as inc02 ,inc_drug as inc03,0 as inc04,inc_nondrug as inc05,a.inc02 as inc06,a.inc01 as
inc07,a.inc04 as inc08,a.inc05 as inc09,a.inc09 as inc10,a.inc06 as inc11,a.inc14 as inc12,a.inc11 as inc13,a.inc13 as inc14,0 as inc15,a.inc17 as inc16,0 as inc17
from vn_stat a
left JOIN patient p on p.hn=a.hn
LEFT JOIN pttype pty on pty.pttype=a.pttype
left JOIN pcode s on s.code=pty.pcode
WHERE a.vstdate BETWEEN '2010-10-01' and '2011-09-30'
-
Script ดึง OPD Data
SELECT "11056" as hcode,a.vn,p.hn,a.cid,p.pname,p.fname,p.lname,p.birthday,p.sex,a.vstdate,s.name as pttypename,a.pdx,
a.dx0,a.dx1,a.dx2,a.dx3,a.dx4,a.dx5,a.op0,a.op1,a.op2,a.op3,a.op4,a.op5,a.inc16 as inc01,a.inc08 as inc02 ,inc_drug as inc03,0 as inc04,inc_nondrug as inc05,a.inc02 as inc06,a.inc01 as
inc07,a.inc04 as inc08,a.inc05 as inc09,a.inc09 as inc10,a.inc06 as inc11,a.inc14 as inc12,a.inc11 as inc13,a.inc13 as inc14,0 as inc15,a.inc17 as inc16,0 as inc17
inc15,inc17 น่าจะไม่เป็น ศูนย์ บาท
s.name as pttypename น่าจะเป็น 01 ถึง 11
-
ขอบคุณมากครับ :)
-
ปรับแก้ จาก กระทู้ข้างบน จะได้ผล นำไปทดสอบนะครับ เอามาจาก opitemrece โดยตรง ถ้าเอามาจาก Vn_stat an_stat จะได้ไม่ครบและปนกันบางหมวด โดยเฉพาะ หมวด 13,14,15
เอาตัวนี้ไปใช้ ผ่าน 100 % ไม่ต้องแก้ code ใด ๆ ใช้ได้ทุก รพ. ขอให้จัดหมวด สิทธิการรักษามาตราฐานให้ตรงเท่านั้น ตามคู่มือ
-
สุดยอดเลยครับ ขอบพระคุณมากครับ
-
ตาม script ดึงข้อมูล Unit cost ที่ให้มา เมื่อนำเข้าในโปรแกรม DATA แล้วตรงหัวฟิลด์ ward name ของแผนกผู้ป่วยนอก จะออกเป็น OPD หมด ช่วยแก้ไข script ให้แสดงข้อมูลในแต่ละแผนกของผู้ป่วยนอก เช่น ER ทันกรรม คลินิกพิเศษ เวช ฯลฯ ได้ไหมครับ
-
อาจารย์ครับถ้าผมแยกตาม คลินิก แบบนี้ถูกไหมครับ
คือมีพี่พยาบาลให้ทำของคลินิกครับ