รายงานเกณฑ์คงค้างลูกหน้่
DateTime : 2011-06-19 14:04:50
Post By : chinaga
IP Address : 113.53.239.82
ทดสอบรายงานแล้วใช้งานได้ครับแต่ติดตรงที่ Hosmain ไม่แสดงแต่ส่งออกเป็น excel มีข้อมูลครับ
ท่านอืนลองหรือยังครับ
Message !!
หากต้องการตอบกระทู้ Webboard กรุณาเข้าใช้ระบบก่อนนะค่ะ..
กระทู้ตอบกลับ
บอกวิธีลงด้วยพี่ doramon.cds ใช่ปะ... ยังไม่ได้ลองเลย บอกวิธีด้วยคับ
Post โดย : huwko Date: 2011-06-19 14:08:19 ip: 118.175.76.231
ต้องแก้ไรบ้าง และตั้งค่าไรบ้างพี่น้องจาก รหัส รพ.
if item='1' then sql_txt:= select_opd + ' and vn.pttype in( "1111111111") ';
if item='2' then sql_txt:= select_opd + ' and vn.pttype in( "92") ';
if item='3' then sql_txt:= select_opd + ' and vn.pttype in( "1111111111") ';
if item='4' then sql_txt:= select_opd + ' and vn.pttype in( "1111111111") ';
if item='5' then sql_txt:= select_opd + ' and vn.pttype in( "1111111111") ';
if item='6' then sql_txt:= select_opd + ' and vn.pttype in( "1111111111") ';
if item='7' then sql_txt:= select_ipd + ' and vn.pttype in( "20") ';
if item='8' then sql_txt:= select_opd + ' and vn.pttype in( "71","75","72","73","88","44","74","77","76","89","82") ';
if item='9' then sql_txt:= select_ipd + ' and vn.pttype in( "71","75","72","73","88","44","74","77","76","89","82") ';
if item='10' then sql_txt:= select_opd + ' and vn.pttype in( "80","16","75","74") and hos.hospcode not in("10924","11494") ';
if item='11' then sql_txt:= select_ipd + ' and vn.pttype in( "80","16","75","74") and hos.hospcode not in("10924","11494") ';
if item='12' then sql_txt:= select_opd + ' and vn.pttype in( "11111111111")';
if item='13' then sql_txt:= select_ipd + ' and vn.pttype in( "79","15") and hos.hospcode not in("10924","11494") ';
if item='14' then sql_txt:= select_opd + ' and vn.pttype in( "02","80","16") and hos.hospcode="11494" ';
if item='15' then sql_txt:= select_ipd + ' and vn.pttype in( "01","02") ';
if item='16' then sql_txt:= select_opd + ' and vn.pttype in( "91","39","25","36","38") ';
if item='17' then sql_txt:= select_opd + ' and vn.pttype in ( "33","37","78","15","15","79","01") ';
if item='18' then sql_txt:= select_ipd + ' and ( vn.pttype in ( "36","38","33","37","13","78") or ( vn.pttype in ("75","15") and pt.chwpart="01"))';
if item='19' then sql_txt:= select_opd + ' and vn.pttype in ( "34") ';
if item='20' then sql_txt:= select_ipd + ' and vn.pttype in ( "34") ';
if item='21' then sql_txt:= select_opd + ' and vn.pttype in ( "35") ';
if item='22' then sql_txt:= select_ipd + ' and vn.pttype in ( "35") ';
if item='23' then sql_txt:= select_ipd + ' and vn.pttype in ( "11111111111") ';
if item='24' then sql_txt:= select_ipd + ' and vn.pttype in ( "11111111111") ';
if item='25' then sql_txt:= select_ipd + ' and vn.pttype in ( "11111111111") ';
if item='26' then sql_txt:= select_ipd + ' and vn.pttype in ( "11111111111") ';
if item='27' then sql_txt:= select_ipd + ' and vn.pttype in ( "11111111111") ';
if item='28' then sql_txt:= select_ipd + ' and vn.pttype in ( "11111111111") ';
if item='29' then sql_txt:= select_opd + ' and vn.pttype in ( "22") ';
if item='30' then sql_txt:= select_ipd + ' and vn.pttype in ( "22","19") ';
if item='31' then sql_txt:= select_opd + ' and vn.pttype in ( "09") ';
if item='32' then sql_txt:= select_ipd + ' and vn.pttype in ( "09") ';
if item='33' then sql_txt:= select_opd + ' and vn.pttype in ( "12") ';
if item='34' then sql_txt:= select_ipd + ' and vn.pttype in ( "12") ';
if item='35' then sql_txt:= select_ipd + ' and vn.pttype in ( "11111111111") ';
if item='36' then sql_txt:= select_opd + ' and vn.pttype in ( "10") and hos.hospcode not in("10924") and pt.chwpart ="32"';
if item='37' then sql_txt:= select_opd + ' and vn.pttype in ( "10") and pt.chwpart<>"32" ';
if item='38' then sql_txt:= select_ipd + ' and vn.pttype in ( "10") ';
if item='39' then sql_txt:= select_ipd + ' and vn.pttype in ( "11111111111") ';
if item='40' then sql_txt:= select_opd + ' and vn.pttype in ( "40","23","41","05","04","06","03","14","24","97","99") '
+ ' and paid_money>"0" and rcpt_money="0" union '
+ select_ipd + ' and vn.pttype in ( "40","23","41","05","04","06","03","14","24","97","99") '
+' and paid_money>"0" and rcpt_money="0" ';
if item='41' then sql_txt:= select_ipd + ' and vn.pttype in ( "11111111111") ';
if item='42' then sql_txt:= select_ipd + ' and vn.pttype in ( "11111111111") ';
if item='43' then sql_txt:= select_ipd + ' and vn.pttype in ( "11111111111") ';
if item='44' then sql_txt:= select_ipd + ' and vn.pttype in ( "11111111111") ';
if item='45' then sql_txt:= select_opd + ' and vn.pttype in ( "98","96","95","94","87","07") ';
if item='46' then sql_txt:= select_ipd + ' and vn.pttype in ( "98","96","95","94","87","07") ';
cds1.data:=hosxp_getdataset(sql_txt);
try
edit1.text:=getsqldata( select_count_visit + copy(sql_txt,pos('from',sql_txt),length(sql_txt)));
edit2.text:=getsqldata( select_count_patient + copy(sql_txt,pos('from',sql_txt),length(sql_txt)));
edit3.text:=getsqldata( select_sum_income + copy(sql_txt,pos('from',sql_txt),length(sql_txt)));
if getsqldata( select_sum_income + copy(sql_txt,pos('from',sql_txt),length(sql_txt))) = null then edit3.text:='0';
except
edit1.text:=getsqldata( ' select count(a.hn) from( '+ sql_txt +')as a ' );
edit2.text:=getsqldata( ' select count(distinct(a.hn)) from( '+ sql_txt +')as a ' );
edit3.text:=getsqldata( ' select sum(a.income) from( '+ sql_txt +')as a ' );
Post โดย : huwko Date: 2011-06-19 15:47:39 ip: 118.175.76.231
วิธีการลง ครับไปที่ สัญญลักษณ์ สายฟ้า เปิดตาราง doramon คลิกที่ run
เสร็จแล้วคลิกที่ open เลือกไฟล็ที่โหลดมาชื่อ doramon.cds เสร็จแล้วเลือกที่ Appen เป็นอันเสร็จครับ
การแก้ไขก็แก้แค่าตรงสิทธิครับ ว่า บัญชีลูกหนี่ของเราตรงกับเลขสิทธิอะไรของเรา ตามที่แระชุมมานั้นเหละครับ
แก้ไขตรงตัวหนังสือสีแดงครับ if item='1' then sql_txt:= select_opd + ' and vn.pttype in( "1111111111") ';
if item='45' then sql_txt:= select_opd + ' and vn.pttype in ( "98","96","95","94","87","07") ';
Post โดย : chinaga Date: 2011-06-19 22:44:53 ip: 113.53.239.82
แก้sql นิดหน่อยครับ ตั้งชื่อฟิวด์ ไม่ตรงกัน รหัสโรงพยาบาลเลยไม่ออกครับ
select_opd:=' select vn.vstdate as vstdate ,pt.hn as hn," - " as an,pt.cid as cid , '+
' concat(pt.pname,pt.fname, " " ,pt.lname)as ptname , '+
' vn.pttype as pttype,ty.name as pttypename,vn.hospmain as hospmain, '+
' concat(hos.hosptype," ",hos.name) as hosname,pt.chwpart as chwpart ,vn.income as income '+
' from vn_stat vn '+
' left outer join patient pt on pt.hn=vn.hn '+
' left outer join pttype ty on ty.pttype=vn.pttype '+
' left outer join hospcode hos on hos.hospcode=vn.hospmain '+
' where vn.income<>"0" and (vn.vstdate between "'+formatdatetime('YYYY-MM-DD',cxDateEdit1.date ) +
' " and "'+formatdatetime('YYYY-MM-DD',cxDateEdit2.date ) +'" ) ';
select_ipd:=' select vn.dchdate as vstdate ,pt.hn as hn,vn.an as an,pt.cid as cid , ' +
' concat(pt.pname,pt.fname, " " ,pt.lname)as ptname , '+
' vn.pttype as pttype,ty.name as pttypename,i.hospmain as hospmain , '+
' concat(hos.hosptype," ",hos.name) as hosname,pt.chwpart as chwpart ,vn.income as income '+
' from an_stat vn '+
' left outer join patient pt on pt.hn=vn.hn '+
' left outer join pttype ty on ty.pttype=vn.pttype '+
' left outer join ipt_pttype i on i.an=vn.an '+
' left outer join hospcode hos on hos.hospcode=i.hospmain '+
' where vn.income <>"0" and (vn.dchdate between "'+formatdatetime('YYYY-MM-DD',cxDateEdit1.date ) +
' " and "'+formatdatetime('YYYY-MM-DD',cxDateEdit2.date ) +'" ) ';
Post โดย : decepticons Date: 2011-06-20 08:51:40 ip: 203.113.118.78
ปุ่ม report เป็นปุ่มหลอกเน้อ 5555
Post โดย : decepticons Date: 2011-06-20 09:02:40 ip: 203.113.118.78
1111111111111 มันคือรหัสไรเชต
Post โดย : huwko Date: 2011-06-20 10:10:57 ip: 118.175.76.231
ไม่มีสิทธิ์นี้อยู่จริงหรอก แค่เขียนให้ถูกรูปแบบ sql เท่านั้น เพราะว่าไม่มีบันชีลูกหนี้นี้
Post โดย : decepticons Date: 2011-06-20 14:02:51 ip: 203.113.118.78
แก้ไข hosmain แล้วใช้งานได้แล้วครับหรือรายงานครับ เขียนเป็นแบบรางานสรุปเลยนะครับ จะได้พิมพ์ได้เลย
รูแบบหน้าจะตามที่ประชุมต้องการครับ
Post โดย : chinaga Date: 2011-06-20 18:15:18 ip: 180.180.162.80
remote มาทำให้เลย
Post โดย : huwko Date: 2011-06-20 18:25:58 ip: 118.175.76.231
พี่เหวย ส่งแบบตัวอย่างรายงานให้หน่อยครับ
Post โดย : decepticons Date: 2011-06-21 13:29:57 ip: 203.113.118.78