BMS-HOSxP Community
HOSxP => แจ้งปัญหา / ขอความช่วยเหลือ => ข้อความที่เริ่มโดย: โรงพยาบาลอัมพวา ที่ เมษายน 25, 2012, 10:27:52 AM
-
พอดีห้องยา ขอรายงาน มาผม ทำรันออกแล้ว แต่ ไม่เข้าใจนิด1อะ ครับ
ช่อง inc01 มันคือ รายการค่าห้องค่า ผมรันvn_stat มันเป้นผู่ป่วยนอกทำไม มันถึง ขึ้นอ่ะครับ
select vn.hcode,vn.vn,vn.hn,vn.cid,pt.pname,pt.fname,pt.lname,pt.birthday,pt.sex
,vn.vstdate,p.name as pttypename,vn.pdx,vn.dx0,vn.dx1,vn.dx2,vn.dx3,vn.dx4,vn.dx5
,vn.op0,vn.op1,vn.op2,vn.op3,vn.op4,vn.op5
,inc01,inc02,inc03,inc04,inc05,inc06,inc07,inc08,inc09,inc10,inc11
,inc12,inc13,inc14,inc15,inc16,inc17
from vn_stat vn
left outer join pttype p on vn.pttype = p.pttype
left outer join patient pt on vn.hn = pt.hn
where vn.vstdate between '2011-08-22' and '2011-08-22'
-
จัดหมวดรายการผิด ไหม หละครับ :)
-
inc01-inc17 ใน vn_stat ตรวจสอบตาม income_group คับ
-
พอดีห้องยา ขอรายงาน มาผม ทำรันออกแล้ว แต่ ไม่เข้าใจนิด1อะ ครับ
ช่อง inc01 มันคือ รายการค่าห้องค่า ผมรันvn_stat มันเป้นผู่ป่วยนอกทำไม มันถึง ขึ้นอ่ะครับ
select vn.hcode,vn.vn,vn.hn,vn.cid,pt.pname,pt.fname,pt.lname,pt.birthday,pt.sex
,vn.vstdate,p.name as pttypename,vn.pdx,vn.dx0,vn.dx1,vn.dx2,vn.dx3,vn.dx4,vn.dx5
,vn.op0,vn.op1,vn.op2,vn.op3,vn.op4,vn.op5
,inc01,inc02,inc03,inc04,inc05,inc06,inc07,inc08,inc09,inc10,inc11
,inc12,inc13,inc14,inc15,inc16,inc17
from vn_stat vn
left outer join pttype p on vn.pttype = p.pttype
left outer join patient pt on vn.hn = pt.hn
where vn.vstdate between '2011-08-22' and '2011-08-22'
inc01 -- ผู้ป่วยนอก นั่นหมายถึง ค่า LAB นะครับท่าน
-
ครับ niyomstd งั้น คือผมทำถูกแล้วใช้ป่าว ครับ
-
ครับ niyomstd งั้น คือผมทำถูกแล้วใช้ป่าว ครับ
-
พี่ครับ ผมสงสัยครับ ตาม คำสั่ง inc01-inc16 อยากให้ืมันออกตาม ตาราง income ต้องทำไง อ่ะครับ
ผู้ป่วยใน
select vn.hcode,an.an,an.hn,vn.vn,pt.pname,pt.fname,pt.lname,pt.birthday,pt.sex
,an.regdate,an.dchdate,w.name as wardname,p.name as pttypename ,an.pdx
,an.dx0,an.dx1,an.dx2,an.dx3,an.dx4,an.dx5
,an.op0,an.op1,an.op2,an.op3,an.op4,an.op5,an.op6
,an.inc01,an.inc02,an.inc03,an.inc04,an.inc05,an.inc06,an.inc07,an.inc08,an.inc09
,an.inc10,an.inc11,an.inc12,an.inc13,an.inc14,an.inc15,an.inc16,an.inc17
,an.admdate as los,i.drg,i.rw,i.adjrw
from an_stat an
left outer join pttype p on an.pttype = an.pttype
left outer join patient pt on an.hn = pt.hn
left outer join vn_stat vn on an.hn =vn.vn
left outer join ipt i on an.an = i.an
left outer join ward w on i.ward = w.ward
left outer join income ic on an.
where an.regdate between '2012-04-01' and '2012-04-30'
group by an.an
ผู้ป่วยนอก
select vn.hcode,vn.vn,vn.hn,vn.cid,pt.pname,pt.fname,pt.lname,pt.birthday,pt.sex
,vn.vstdate,p.name as pttypename,vn.pdx,vn.dx0,vn.dx1,vn.dx2,vn.dx3,vn.dx4,vn.dx5
,vn.op0,vn.op1,vn.op2,vn.op3,vn.op4,vn.op5
,inc01,inc02,inc03,inc04,inc05,inc06,inc07,inc08,inc09,inc10,inc11
,inc12,inc13,inc14,inc15,inc16,inc17
from vn_stat vn
left outer join pttype p on vn.pttype = p.pttype
left outer join patient pt on vn.hn = pt.hn
where vn.vstdate between '2011-08-22' and '2011-08-22'
-
inc01-inc17 ที่คุณต้องการคืออะไร
เป็น incomce_group หรือ drg_group หรือ อื่นๆที่คุณกำหนดไว้
-
income คือรายการค่ารักษาพยาบาลปลีกย่อย ส่วน
an_stat,vn_sat เป็นการสรุปค่ารักษาตามหมวดบัญชีครับ..(อ้างอิงตามรหัสใน income_group) ถ้าต้องการรายละเอียดปลีกย่อย ต้องไปดึงจาก opitemrece คอลัมน์ income ครับ จะตรงกับตาราง income
-
inc01-inc17 อยากให้ ออก ตามหมวดการรักษาของตาราง income ครับ
ครับพี่เกื้อเด๋วลองเขียนใหม่ดูก่อนนะครับ คือ ห้องยา เค้าของ เอาไปทำ unitcost ส่ง มันทำไม่ทุก รพ. อ่ะครับ
-
แน่ใจเหรอคับ ว่า income มีค่าอยู่แค่นั้น
select v.hcode,v.vn,v.hn,v.cid,pt.pname,pt.fname,pt.lname,pt.birthday,pt.sex
,v.vstdate,p.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
,sum(if(o.income='01',o.sum_price,0)) 'inc01'
,sum(if(o.income='02',o.sum_price,0)) 'inc02'
...
...
,sum(if(o.income='17',o.sum_price,0)) 'inc17'
from vn_stat v
left join pttype p on v.pttype = p.pttype
left join patient pt on v.hn = pt.hn
left join opitemrece o on o.vn=v.vn
where v.vstdate between '2011-08-22' and '2011-08-22'
group by v.vn
หรือจะใช้ income_group2
-
;D ถ้า unitcost แบบใหม่ผมเขียนแบบนี้ครับ จึงจะตรงตามต้องการตามโปรแกรมครับ (เปลี่ยนรหัส รพ.เอานะครับ)
- 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 ,a.inc12 as inc03,0 as inc04,0 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 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 '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 ,a.inc12 as inc03,0 as inc04,0 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'
-
ขอบคุณครับ ท่าน ลองปรับนิดหน่อย ใช้ได้ครับ
-
ท่าน ครับ opd มันยังไม่ได้ครับ ตามคำสั่งข้างล่าง หมวดเค้าบังคับ มาให้เข้าหมวดในรูปครับ มันเป้น unitcost รพไหนทำบ้าง ครับ
SELECT "11307" 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 ,
a.inc12 as inc03,
0 as inc04,
0 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 '2011-10-01' and '2012-03-31'
-
คนไข้นอก ทุก visit ไม่มีทางมีหมวดค่ารักษาครบ ทั้ง 17 หมวดรายการครับ...
อย่างมากก็ไม่เกิน 7 หมวด ต่อ visit ที่แน่ ๆ คือ ไม่มีค่าห้อง ค่าอาหาร ค่าบริการให้เลือด ครับ...และอื่นๆ อีกมากมาย บางรายก็ไม่จำเป็นต้องกายภาพหรือเอกซเรย์ สรุปถ้าเอารวม OPD ทุกรายในช่วงเดือนที่กำหนด ก็แสดงผลแค่เพียงบางบัญชีค่ารักษาครับ.น้อง
-
แล้วถ้าเอารายงานตัวนี้มาทำให้ออกดังรูปจะได้เหมือนกันไหมครับ
-
ในส่วนนี้ สมารถนำไป วิเคราะต้นทุนได้เลยมั้ยครับ .. พี่ Termenator2012
-
input เป็นวันที่หรือ VN หรือ AN ครับ
-
vn ครับ พี่ รพ.ดำเนินก็ทำนิครับพี่ พี่ทำยังไงอ่ะครับ
-
ในส่วนนี้ สมารถนำไป วิเคราะต้นทุนได้เลยมั้ยครับ .. พี่ Termenator2012
คงจะไม่สามารถวิเคราะได้ครับ เป็นเพียงส่วนหนึ่งที่ IT ต้องทำให้การเงินครับ
อีกอย่าง ตามพี่เกื้อบอกนะครับ ของมูลคงจะมีไม่ครบทั้ง 17 รายการหรอกนะครับ ตามที่เขากำหนด
แต่มีแค่ไหนก็เอาเท่านั้นละครับ เขาไม่ได้บังคับว่าต้องมีทุกรายการครับ
อีกอย่าง ตามภาพของ โรงพยาบาลอัมพวา ผู้ป่วยนอก ความผิดปกติของข้อมูล ทันตกรรม ครับ เพราะว่าผู้ป่วยนอกทุกโรงพยาบาลควรจะมีตัวเลขตรงนี้ครับ ไม่ควรจะเป็น 0 แบบนี้ แสดงว่ามีการกำหนดค่าผิดหมวดครับ ใน hosxp
ให้ตรวจสอบดูตาราง income ในรายการของทันตกรรม แก้ไขฟิวล์ income_group ให้เป็น 11 ครับ (ของท่านไม่ใช่แน่นอน) แต่คงไม่เสร็จแค่นี้ครับ เพราะข้อมูลเดิมที่บันทึกผ่านมาไม่มีข้อมูลใน vn_stat ในช่อง inc11 เลยจะมีอยู่ในช่อง รหัสที่ท่านกำหนดก่อนหน้านี้ ซึ่งน่าจะไปปนกับหมดอื่นอยู่แน่นอน จะทำอย่างไร?
::) เท่าที่ผมคิดออก ควรทำดังนี้ (ไม่ทราบว่าถูกหรือเปล่านะ) หลักการดังนี้
- ตรวจดูใน spclty ว่า ทันตกรรม เป็น รหัสใด จดไว้
- Run Script เพื่อให้เอาค่าจาก incxx ที่กำหนดไว้ก่อนหน้านี้ ไปใส่ใน inc11 แทนครับ เฉพาะ spclty='ทันตกรรม'
- Run Script เพื่อเอาค่า incxx ให้เท่ากับ 0 เพราะเราย้ายไปไว้ใน inc11 แล้ว เฉพาะ spclty='ทันตกรรม'
-
ทันตกรรม หมวด 14 ครับ ท่าน
-
ทันตกรรม หมวด 14 ครับ ท่าน
ลองดูในตาราง income_group ดูนะครับ ว่าเป็นเลขอะไร
-
ทันตกรรม ผม เช็ค แล้ว มัน ออก ในincome _group ออก inc14 ครับ ใน vn_stat ผมลองเขียนใหม่แต่มันยังมี error อยู่ ช่วยดูให้ที ครับ
SELECT "11307" 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,
(select rcptamt from incoth where income = "01") as inc01,
(select rcptamt from incoth where income = "02") as inc02 ,
(select rcptamt from incoth where income = "03") as inc03,
(select rcptamt from incoth where income = "04") as inc04,
(select rcptamt from incoth where income = "05") as inc05,
(select rcptamt from incoth where income = "06") as inc06,
(select rcptamt from incoth where income = "07") as inc07,
(select rcptamt from incoth where income = "08") as inc08,
(select rcptamt from incoth where income = "09") as inc09,
(select rcptamt from incoth where income = "10") as inc10,
(select rcptamt from incoth where income = "11") as inc11,
(select rcptamt from incoth where income = "12") as inc12,
(select rcptamt from incoth where income = "13") as inc13,
(select rcptamt from incoth where income = "14") as inc14,
(select rcptamt from incoth where income = "15") as inc15,
(select rcptamt from incoth where income = "16") as inc16,
(select rcptamt from incoth where income = "17") 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
left join incoth c on a.vn =c.vn
WHERE a.vstdate BETWEEN '2012-04-01' and '2012-04-31'
group by a.vn
-
เบื้องต้น ทวนสอบความเชื่อมโยง ค่าบริการทางทันตกรรม ครับ.. ว่าอยู่ในกลุ่มค่ารักษาใดบ้าง..
-
เอาข้อมูลที่เป็นลูกหนี้หรือค่าใช้จ่ายทั้งหมดหรือที่เก็บเิงินเท่านั้นครับ
-
พี่เกื้อผมตรวจสอบหมดแล้วครับ แต่ผมอยากให้ออกตามตาราง income ผมจะต้องทำอย่างไร
คำสั่งคิวรี่ที่ผมเขียนมันผิดช่วงไหนอ่ะครับ
-
พี่เกื้อผมตรวจสอบหมดแล้วครับ แต่ผมอยากให้ออกตามตาราง income ผมจะต้องทำอย่างไร
คำสั่งคิวรี่ที่ผมเขียนมันผิดช่วงไหนอ่ะครับ
ลอง group by income ,vn
ก่อนขณะออกแบบรายงาน เพราะต้องการหน้าตารางงานแบบที่โพสต์....
และถ้าต้องการพิมพ์รายคนและทุกคนมีทุกหมวด income และ income มีมากกว่าหรือเท่ากับ income_group เพราะอย่างที่บอก แทบจะไม่มีคนไข้รายไหนเลย ที่มีค่าใช้จ่ายครบทุก income หรือ ทุก income_group
-
หน้าตาที่ออกถูกแล้ว ครับ พี่ ผิด ตรง inc01-inc17 หมด มันต้องตามตาราง income ครับ เค้าไม่ได้ระบุว่าต้องถึง vn_satat แต่ผมทำเอง จะถึงจาก opitemrece ได้ไหม ครับ
แต่คำสั่งด้านบน ผม run แล้วขัึ้น error ดังรูปครับ
-
;) incxx จะต้อง map กับ income_group ครับ
ฉะนั้น incxx จะไม่ตรงกับ income นะครับ
-
select i.income,i.name,ifnull(sum_price,0.00) sum_price
from income i
left join (select o.income,sum(o.sum_price) sum_price
from opitemrece o
left join pttype p on o.pttype = p.pttype
where o.vstdate between '2011-08-22' and '2011-08-22'
group by o.income) a on i.income=a.income
ส่วนจำนวน กับ Drug all คงต้องใช้ variable เอา
-
;) incxx จะต้อง map กับ income_group ครับ
ฉะนั้น incxx จะไม่ตรงกับ income นะครับ
incxx ใน vn_stat มันไม่ตรงกันกับincome อันนี้ผมเข้าใจ ครับ แต่ที่ผมอยากได้ ตามตัวแอย่างอ่ะครับ หมวดการรักษา inc01-inc17 ออกตามตาราง income ข้อมูลข้างบนลืมๆมันไปอ่ะครับ ผมอาจอธิบายไม่เข้าใจ ดูตามตารางครับท่าน
-
ตัวอย่าง inc01-inc17 ตามรายงานการเงินอ่ะครับ แต่ ผมจะใช้คิวรี่ ตาม excel ด้านบน ครับ
-
ลองเขียนใหม่ก็ยังออกไม่ถูก อ่ะครับ
SELECT "11307" 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,
sum(if(o.income='01',o.sum_price,0)) as inc01,
sum(if(o.income='02',o.sum_price,0)) as inc02,
sum(if(o.income='03',o.sum_price,0)) as inc03,
sum(if(o.income='04',o.sum_price,0)) as inc04,
sum(if(o.income='05',o.sum_price,0)) as inc05,
sum(if(o.income='06',o.sum_price,0)) as inc06,
sum(if(o.income='07',o.sum_price,0)) as inc07,
sum(if(o.income='08',o.sum_price,0)) as inc08,
sum(if(o.income='09',o.sum_price,0)) as inc09,
sum(if(o.income='010',o.sum_price,0)) as inc10,
sum(if(o.income='011',o.sum_price,0)) as inc11,
sum(if(o.income='012',o.sum_price,0)) as inc12,
sum(if(o.income='013',o.sum_price,0)) as inc13,
sum(if(o.income='014',o.sum_price,0)) as inc14,
sum(if(o.income='015',o.sum_price,0)) as inc15,
sum(if(o.income='016',o.sum_price,0)) as inc16,
sum(if(o.income='017',o.sum_price,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
left join incoth c on a.vn = c.vn
left join opitemrece o on a.vn = o.vn
WHERE a.vstdate BETWEEN '2012-04-01' and '2012-04-31'
group by a.vn
-
income ของคุณประกอบด้วยอะไรบ้าง
01-09 คงปกติ
แต่ 010-017 เป็นอะไรแน่
เป็น 10-17 รึป่าว
ตรวจสอบดูคับ
-
ผมอยากให้ออกให้ income เฉยๆ อ่ะครับอันข้างล่าง นี้หมวดตรงแล้ว ครับ แต่ค่าให้จ่าย ยังผิดอยู่คับ
SELECT "11307" 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,
sum(if(c.income='01',c.rcptamt,0)) as inc01,
sum(if(c.income='02',c.rcptamt,0)) as inc02,
sum(if(c.income='03',c.rcptamt,0)) as inc03,
sum(if(c.income='04',c.rcptamt,0)) as inc04,
sum(if(c.income='05',c.rcptamt,0)) as inc05,
sum(if(c.income='06',c.rcptamt,0)) as inc06,
sum(if(c.income='07',c.rcptamt,0)) as inc07,
sum(if(c.income='08',c.rcptamt,0)) as inc08,
sum(if(c.income='09',c.rcptamt,0)) as inc09,
sum(if(c.income='10',c.rcptamt,0)) as inc10,
sum(if(c.income='11',c.rcptamt,0)) as inc11,
sum(if(c.income='12',c.rcptamt,0)) as inc12,
sum(if(c.income='13',c.rcptamt,0)) as inc13,
sum(if(c.income='14',c.rcptamt,0)) as inc14,
sum(if(c.income='15',c.rcptamt,0)) as inc15,
sum(if(c.income='16',c.rcptamt,0)) as inc16,
sum(if(c.income='17',c.rcptamt,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
left join incoth c on a.vn = c.vn
left join opitemrece o on a.vn = o.vn
WHERE a.vstdate BETWEEN '2012-04-01' and '2012-04-31'
group by a.vn
-
ค่าผิดพลาดตรงไหนคับ
ลอง
select income
from opitemrece
where vstdate between '2012-04-01' and '2012-04-31'
and an is null
group by income
ว่ามีค่าอยู่แค่ 01-17 หรือไม่?
ถ้ามีมากกว่านั้น ก้อคงต้องตรวจสอบกันหน่อย
-
ลองก่อนนะครับ
ได้มาแบบ นี้อ่ะครับ
-
::) เหมือนที่ผมบอกครับ ตั้งค่าทันตกรรมผิดหมวด
-
ลองตรวจสอบการจัดหมวดค่ารักษาใหม่ดูนะคะ เพราะอาจมีผลต่อตาราง BG4Charge ในcost ได้นะคะ