BMS-HOSxP Community

HOSxP => Report Exchange => ข้อความที่เริ่มโดย: Terminator2015 ที่ มีนาคม 20, 2012, 10:37:35 AM

หัวข้อ: แจกรายงาน Unit Cost ที่กำลังร้อน (hot) ณ ขณะนี้
เริ่มหัวข้อโดย: 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 หลัก)
หัวข้อ: Re: แจกรายงาน Unit Cost ที่กำลังร้อน (hot) ณ ขณะนี้
เริ่มหัวข้อโดย: Terminator2015 ที่ มีนาคม 20, 2012, 11:08:33 AM
 ;D แนบภาพรายงานมาให้ดูด้วย
หัวข้อ: Re: แจกรายงาน Unit Cost ที่กำลังร้อน (hot) ณ ขณะนี้
เริ่มหัวข้อโดย: jeab101 ที่ มีนาคม 20, 2012, 11:14:59 AM
สุดยอดมาก ขอบคุณมากครับ   ;D
หัวข้อ: Re: แจกรายงาน Unit Cost ที่กำลังร้อน (hot) ณ ขณะนี้
เริ่มหัวข้อโดย: socker ที่ มีนาคม 21, 2012, 14:38:16 PM
ขอบคุณครับ
หัวข้อ: Re: แจกรายงาน Unit Cost ที่กำลังร้อน (hot) ณ ขณะนี้
เริ่มหัวข้อโดย: nahos ที่ เมษายน 12, 2012, 10:09:22 AM
แจ่ม  ;D ;D ;D ;D
หัวข้อ: Re: แจกรายงาน Unit Cost ที่กำลังร้อน (hot) ณ ขณะนี้
เริ่มหัวข้อโดย: jameborn ที่ เมษายน 12, 2012, 10:47:26 AM
กำลังวุ่นกันอยู่ครับพี่ ขอบคุณครับ   :-* :-*
หัวข้อ: Re: แจกรายงาน Unit Cost ที่กำลังร้อน (hot) ณ ขณะนี้
เริ่มหัวข้อโดย: patipan27 ที่ เมษายน 12, 2012, 10:48:13 AM
ขอบคุณครับ ;D ;D ;D
หัวข้อ: Re: แจกรายงาน Unit Cost ที่กำลังร้อน (hot) ณ ขณะนี้
เริ่มหัวข้อโดย: xycop ที่ เมษายน 12, 2012, 11:05:53 AM
ขอบคุณครับ
หัวข้อ: Re: แจกรายงาน Unit Cost ที่กำลังร้อน (hot) ณ ขณะนี้
เริ่มหัวข้อโดย: thatako ที่ เมษายน 12, 2012, 11:14:09 AM
Error 'MSVCR70.DLL'
หัวข้อ: Re: แจกรายงาน Unit Cost ที่กำลังร้อน (hot) ณ ขณะนี้
เริ่มหัวข้อโดย: Terminator2015 ที่ เมษายน 12, 2012, 12:30:50 PM
 ;) UnitCost ประชุมใหม่ล่าสุด ให้ IT ดึงข้อมูล IPD OPD เข้าในฐาน Data.mdb (Access2007 หรือ Access2010)  ลองเอา Script ตัวใหม่ไปดูนะครับ ผิดถูกอย่างไร ก็แนะนำบ้างนะครับ
หัวข้อ: Re: แจกรายงาน Unit Cost ที่กำลังร้อน (hot) ณ ขณะนี้
เริ่มหัวข้อโดย: nahos ที่ เมษายน 12, 2012, 13:28:39 PM
ค่า RW เป็น 0 เกิดจากสาเหตุใดได้บ้างครับ
หัวข้อ: Re: แจกรายงาน Unit Cost ที่กำลังร้อน (hot) ณ ขณะนี้
เริ่มหัวข้อโดย: เกื้อกูล ครับ.. ที่ เมษายน 12, 2012, 13:44:51 PM
ค่า RW เป็น 0 เกิดจากสาเหตุใดได้บ้างครับ

1. ตรวจสอบ  TGruper  For DRG 4.0.45 หรือยังครับ
2. รายดังกล่าว ทำ Discharge สมบูรณ์หรือยัง ให้รหัส Pdx หรือยัง ครับ
หัวข้อ: Re: แจกรายงาน Unit Cost ที่กำลังร้อน (hot) ณ ขณะนี้
เริ่มหัวข้อโดย: nahos ที่ เมษายน 13, 2012, 09:26:05 AM
ค่า RW เป็น 0 เกิดจากสาเหตุใดได้บ้างครับ

1. ตรวจสอบ  TGruper  For DRG 4.0.45 หรือยังครับ
2. รายดังกล่าว ทำ Discharge สมบูรณ์หรือยัง ให้รหัส Pdx หรือยัง ครับ

1.TGruper เป็นตัวที่มากับ HOSXP Full setup ครับ
2.ลง PDx เรียบร้อยครับ

เป็นบางเคสครับ
หัวข้อ: Re: แจกรายงาน Unit Cost ที่กำลังร้อน (hot) ณ ขณะนี้
เริ่มหัวข้อโดย: เกื้อกูล ครับ.. ที่ เมษายน 13, 2012, 09:52:09 AM
เท่าที่เจอ  สลับ PDX ผิดพลาด หรือวันจำหน่ายกำหนดผิดน้อยกว่าวัน รับ admit และบางกรณีลืมใส่น้ำหนักครับ....เจอจาก Human Error เป็นส่วนใหญ่คัรบ...

ทางแก้ที่ดีคือลบข้อมูล D/C ทางหน้าจอโปรแกรมแล้วบันทึกใหม่ เพื่อทวนสอบว่ากรอกช่องใดพลาด ( บางทีมันเป็นม่านบังสายตาครับ )...เรื่องจริงจากประสบการณ์...
หัวข้อ: Re: แจกรายงาน Unit Cost ที่กำลังร้อน (hot) ณ ขณะนี้
เริ่มหัวข้อโดย: mslangu ที่ เมษายน 18, 2012, 10:23:17 AM
ขอบคุณมากครับ น่าจะตรงนะครับ ส่วนฟิลด์ IncDrug ต้องดึงจากตารางไหนมาครับ
หัวข้อ: Re: แจกรายงาน Unit Cost ที่กำลังร้อน (hot) ณ ขณะนี้
เริ่มหัวข้อโดย: mslangu ที่ เมษายน 24, 2012, 15:12:11 PM
ขอดันฟิลด์สุดท้าย หน่อยครับ ใช่ฟิลด์ inc_drug หรือเปล่าครับ
หัวข้อ: Re: แจกรายงาน Unit Cost ที่กำลังร้อน (hot) ณ ขณะนี้
เริ่มหัวข้อโดย: thatako ที่ พฤษภาคม 08, 2012, 10:39:13 AM
ขอแบบแยกฝ่ายบ้างครับ ห้องคลอด/ER ครับ อ.Terminator2012 
 
 
หัวข้อ: Re: แจกรายงาน Unit Cost ที่กำลังร้อน (hot) ณ ขณะนี้
เริ่มหัวข้อโดย: Terminator2015 ที่ พฤษภาคม 08, 2012, 11:22:09 AM
ขอแบบแยกฝ่ายบ้างครับ ห้องคลอด/ER ครับ อ.Terminator2012 
 
 


 ::) unitcost ตัวใหม่ ไม่มีนะครับ มีแต่ นำเข้า ipd กับ opd เท่านั้น 
หัวข้อ: Re: แจกรายงาน Unit Cost ที่กำลังร้อน (hot) ณ ขณะนี้
เริ่มหัวข้อโดย: thatako ที่ พฤษภาคม 08, 2012, 12:05:33 PM
ขอแบบแยกฝ่ายบ้างครับ ห้องคลอด/ER ครับ อ.Terminator2012 
 
 


 ::) unitcost ตัวใหม่ ไม่มีนะครับ มีแต่ นำเข้า ipd กับ opd เท่านั้น 

Update ข้อมูลเมื่อไรครับจะได้เอาไปยืนยันกับหัวหน้าพยาบาล
หัวข้อ: Re: แจกรายงาน Unit Cost ที่กำลังร้อน (hot) ณ ขณะนี้
เริ่มหัวข้อโดย: nongyaihos ที่ พฤษภาคม 08, 2012, 14:39:46 PM
Thank a lot
หัวข้อ: Re: แจกรายงาน Unit Cost ที่กำลังร้อน (hot) ณ ขณะนี้
เริ่มหัวข้อโดย: mslangu ที่ พฤษภาคม 14, 2012, 14:19:45 PM
อยากทราบในส่วนของ IPD เราจะดึงข้อมูล incdrug จากส่วนไหนหรือครับ จากที่ดูข้อมูล ตาราง an_stat ไม่มีฟิลด์นี้เหมือนกับตาราง vn_stat ครับ หรือเอาไปเชื่อมโยงกลับไปที่ vn_stat โดยผูกกับ ฟิลด์ vn ครับผม ยังงๆอยู่ครับ ขอบคุณมากครับ
หัวข้อ: Re: แจกรายงาน Unit Cost ที่กำลังร้อน (hot) ณ ขณะนี้
เริ่มหัวข้อโดย: mslangu ที่ พฤษภาคม 21, 2012, 16:03:25 PM
ดันอีกรอบครับ ใกล้ส่งแล้ว
หัวข้อ: Re: แจกรายงาน Unit Cost ที่กำลังร้อน (hot) ณ ขณะนี้
เริ่มหัวข้อโดย: โรงพยาบาลหนองแค ที่ พฤษภาคม 21, 2012, 22:48:51 PM
ขอบคุณมากครับ
กำลังจะไปประชุมจัดทำ unitcostเลย
หัวข้อ: Re: แจกรายงาน Unit Cost ที่กำลังร้อน (hot) ณ ขณะนี้
เริ่มหัวข้อโดย: kungkung ที่ พฤษภาคม 22, 2012, 09:10:18 AM
ขอบคุณครับ  กำลังเหนื่อยกับเรื่องนี้จริง ๆ  ดีหน่อยที่ไม่ได้เป็น รพ.นำร่องของจังหวัด
หัวข้อ: Re: แจกรายงาน Unit Cost ที่กำลังร้อน (hot) ณ ขณะนี้
เริ่มหัวข้อโดย: kalakachang ที่ พฤษภาคม 31, 2012, 12:05:37 PM
แล้ว in01,in02,in03...in17 ใน โปรแกรมที่ใช้ทำ unit cost  ไม่ได้กำหนดตรงกับตัวที่เป็น income_group ในhosxpไม่ใช่เหรอครับ แล้วถ้าดึงจาก an_stat ,vn_stat จะได้ตรงกับที่ในโปรแกรม กำหนดหรือครับ.
หัวข้อ: Re: แจกรายงาน Unit Cost ที่กำลังร้อน (hot) ณ ขณะนี้
เริ่มหัวข้อโดย: supakorn_hos ที่ พฤษภาคม 31, 2012, 12:50:51 PM
ต้อง group เองครับ จัดให้ตรงกัน
หัวข้อ: Re: แจกรายงาน Unit Cost ที่กำลังร้อน (hot) ณ ขณะนี้
เริ่มหัวข้อโดย: Terminator2015 ที่ พฤษภาคม 31, 2012, 13:43:04 PM
 ;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'
หัวข้อ: Re: แจกรายงาน Unit Cost ที่กำลังร้อน (hot) ณ ขณะนี้
เริ่มหัวข้อโดย: oiler_27 ที่ พฤษภาคม 31, 2012, 15:40:38 PM
รบกวนขอสอบถามเรื่อง CCRatio ของIPD/OPD ตัวนี้ดึงออกมาแล้วยอดต้องไปเท่ากับตัว ChargeIPD/OPDใช่หรือไม่คะ
หัวข้อ: Re: แจกรายงาน Unit Cost ที่กำลังร้อน (hot) ณ ขณะนี้
เริ่มหัวข้อโดย: Bond_007 ที่ พฤษภาคม 31, 2012, 16:14:21 PM
มีคู่มือโปรแกรมด้วยไหมครับ  ;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'
หัวข้อ: Re: แจกรายงาน Unit Cost ที่กำลังร้อน (hot) ณ ขณะนี้
เริ่มหัวข้อโดย: Terminator2015 ที่ พฤษภาคม 31, 2012, 16:51:01 PM
มีคู่มือโปรแกรมด้วยไหมครับ  ;D

 ;D เอางั้นเลยเหรอ ถ้างั้นรอแป๊บนะ
หัวข้อ: Re: แจกรายงาน Unit Cost ที่กำลังร้อน (hot) ณ ขณะนี้
เริ่มหัวข้อโดย: โรงพยาบาลหนองแค ที่ พฤษภาคม 31, 2012, 17:45:52 PM
คู่มือ unitcost ดาวน์โหลดที่หน้า Web ครับ

http://cost.cfo.in.th

หัวข้อ: Re: แจกรายงาน Unit Cost ที่กำลังร้อน (hot) ณ ขณะนี้
เริ่มหัวข้อโดย: monalisa ที่ มิถุนายน 01, 2012, 11:22:35 AM
ขอบคุณครับพี่ทัศน์
ผมเองก็ทำขึ้นมาเหมือนกันครับ แต่ใช้การดึงค่าใช้จ่ายทั้ง 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 แทน ครับ


หัวข้อ: Re: แจกรายงาน Unit Cost ที่กำลังร้อน (hot) ณ ขณะนี้
เริ่มหัวข้อโดย: k_toedkiets ที่ มิถุนายน 01, 2012, 14:11:19 PM
มันขึ้น error ครับ...แก้ตรงไหนครับ
หัวข้อ: Re: แจกรายงาน Unit Cost ที่กำลังร้อน (hot) ณ ขณะนี้
เริ่มหัวข้อโดย: Terminator2015 ที่ มิถุนายน 01, 2012, 14:29:26 PM
มันขึ้น error ครับ...แก้ตรงไหนครับ

นำเข้าตาราง drg ในหน้าแรก ครับ
หัวข้อ: Re: แจกรายงาน Unit Cost ที่กำลังร้อน (hot) ณ ขณะนี้
เริ่มหัวข้อโดย: k_toedkiets ที่ มิถุนายน 01, 2012, 15:37:05 PM
;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 ได้ไหมครับ
หัวข้อ: Re: แจกรายงาน Unit Cost ที่กำลังร้อน (hot) ณ ขณะนี้
เริ่มหัวข้อโดย: najaxp ที่ มิถุนายน 04, 2012, 22:01:12 PM
ดันกระทู้คุณ 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'
หัวข้อ: Re: แจกรายงาน Unit Cost ที่กำลังร้อน (hot) ณ ขณะนี้
เริ่มหัวข้อโดย: SrWooD ที่ มิถุนายน 13, 2012, 08:39:28 AM
;D ;D ;D
หัวข้อ: Re: แจกรายงาน Unit Cost ที่กำลังร้อน (hot) ณ ขณะนี้
เริ่มหัวข้อโดย: pattapong007 ที่ มิถุนายน 13, 2012, 11:33:04 AM
ตอนนี้ทางพยาบาลแจ้งมาว่าให้เอา ตาราง ward โชว์ด้วยนะครับ ช่วยด้วยนะครับ
หัวข้อ: Re: แจกรายงาน Unit Cost ที่กำลังร้อน (hot) ณ ขณะนี้
เริ่มหัวข้อโดย: golf_win ที่ มิถุนายน 13, 2012, 12:04:56 PM
ตอนนี้ทางพยาบาลแจ้งมาว่าให้เพื่อ ตาราง ward ด้วยนะครับ ช่วยด้วยนะครับ
??? ??? ??? ???
หัวข้อ: Re: แจกรายงาน Unit Cost ที่กำลังร้อน (hot) ณ ขณะนี้
เริ่มหัวข้อโดย: pattapong007 ที่ มิถุนายน 13, 2012, 13:22:47 PM
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'
หัวข้อ: Re: แจกรายงาน Unit Cost ที่กำลังร้อน (hot) ณ ขณะนี้
เริ่มหัวข้อโดย: kongkrit ที่ มิถุนายน 15, 2012, 09:40:38 AM
ขอบคุณครับ
หัวข้อ: Re: แจกรายงาน Unit Cost ที่กำลังร้อน (hot) ณ ขณะนี้
เริ่มหัวข้อโดย: artit_TON ที่ มิถุนายน 17, 2012, 12:09:02 PM
เทพมากๆเลยคับพี่
หัวข้อ: Re: แจกรายงาน Unit Cost ที่กำลังร้อน (hot) ณ ขณะนี้
เริ่มหัวข้อโดย: panus_t ที่ มิถุนายน 26, 2012, 13:51:39 PM
ค่า ต้องคำนวน DRG ใหม่ใช้หรือเปล่าครับ ถ้าใช่แสดงว่าต้องส่งเป็น DRG V.5 ทั้งหมด
แล้วมันจะมีผลในเดือนที่ส่งรายงาน CMI ไปแล้วที่ใช่ DRG V.4 อย่างไรหรือเปล่าครับ

 ??? ???
หัวข้อ: Re: แจกรายงาน Unit Cost ที่กำลังร้อน (hot) ณ ขณะนี้
เริ่มหัวข้อโดย: Terminator2015 ที่ กรกฎาคม 02, 2012, 16:17:00 PM
 ;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'


หัวข้อ: Re: แจกรายงาน Unit Cost ที่กำลังร้อน (hot) ณ ขณะนี้
เริ่มหัวข้อโดย: วีระวัฒน์ (เอก) ที่ กรกฎาคม 02, 2012, 21:15:25 PM
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
หัวข้อ: Re: แจกรายงาน Unit Cost ที่กำลังร้อน (hot) ณ ขณะนี้
เริ่มหัวข้อโดย: gigog ที่ กรกฎาคม 06, 2012, 09:28:57 AM
ขอบคุณมากครับ  :)
หัวข้อ: Re: แจกรายงาน Unit Cost ที่กำลังร้อน (hot) ณ ขณะนี้
เริ่มหัวข้อโดย: วีระวัฒน์ (เอก) ที่ กรกฎาคม 11, 2012, 16:05:17 PM
ปรับแก้ จาก กระทู้ข้างบน จะได้ผล นำไปทดสอบนะครับ เอามาจาก opitemrece โดยตรง ถ้าเอามาจาก Vn_stat an_stat จะได้ไม่ครบและปนกันบางหมวด โดยเฉพาะ หมวด 13,14,15

เอาตัวนี้ไปใช้ ผ่าน 100 %  ไม่ต้องแก้ code ใด ๆ ใช้ได้ทุก รพ. ขอให้จัดหมวด สิทธิการรักษามาตราฐานให้ตรงเท่านั้น ตามคู่มือ

หัวข้อ: Re: แจกรายงาน Unit Cost ที่กำลังร้อน (hot) ณ ขณะนี้
เริ่มหัวข้อโดย: somza007 ที่ ธันวาคม 22, 2012, 13:37:11 PM
สุดยอดเลยครับ ขอบพระคุณมากครับ
หัวข้อ: Re: แจกรายงาน Unit Cost ที่กำลังร้อน (hot) ณ ขณะนี้
เริ่มหัวข้อโดย: doitao ที่ กรกฎาคม 15, 2013, 12:02:07 PM
ตาม script ดึงข้อมูล Unit cost ที่ให้มา เมื่อนำเข้าในโปรแกรม DATA แล้วตรงหัวฟิลด์ ward name ของแผนกผู้ป่วยนอก จะออกเป็น OPD หมด ช่วยแก้ไข script ให้แสดงข้อมูลในแต่ละแผนกของผู้ป่วยนอก เช่น ER ทันกรรม คลินิกพิเศษ เวช ฯลฯ ได้ไหมครับ
หัวข้อ: Re: แจกรายงาน Unit Cost ที่กำลังร้อน (hot) ณ ขณะนี้
เริ่มหัวข้อโดย: nano ที่ กรกฎาคม 16, 2013, 14:25:30 PM
อาจารย์ครับถ้าผมแยกตาม คลินิก แบบนี้ถูกไหมครับ
คือมีพี่พยาบาลให้ทำของคลินิกครับ