BMS-HOSxP Community
HOSxP => แจ้งปัญหา / ขอความช่วยเหลือ => ข้อความที่เริ่มโดย: nksawan2011 ที่ ตุลาคม 11, 2011, 13:44:43 PM
-
อยากแก้เงื่อนไขครับ คือ
1.เลือกช่วงวันที่ (ตามเดิม)
2.เลือกสิทธิ์ เปลี่ยนเป็น เลือกตามจังหวัด (จากตาราง chwpart.hospcode)
3.เลือก รพ. เปลี่ยนเป็น เลือกตามอำเภอ (จากตาราง amppart.hospcode)
ต้องแก้ไขตรงไหนบ้างครับ ตอนนี้กำลังงมหาอยู่ครับรบกวนด้วยครับ
GetDateRangeDialog(date1, date2);
ds1:=formatdatetime('yyyy-mm-dd',date1);
ds2:=formatdatetime('yyyy-mm-dd',date2);
pttype_list := getsqlsubquerydata('select distinct pttype from vn_stat where vstdate between "'+ds1+'" and "'+ds2+'" ');
pttype_list :=getpickuplist('select concat(pttype,":",name) as pttype_name from pttype where pttype in ('+pttype_list+') order by pttype ');
hospcode_list:=getsqlsubquerydata('select distinct hospmain from vn_stat where pttype in ('+copy(pttype_list,1,2)+') and vstdate between "'+ds1+'" and "'+ds2+'" ');
hospcode_list := getpickuplist('select concat(hospcode,":",hosptype," ",name) as name from hospcode where hospcode in ('+hospcode_list+')order by hospcode ');
ChangeReportSQL('select v.* from vn_stat v left outer join ovst o on o.vn = v.vn where v.pttype in ('+copy(pttype_list,1,2)+') and v.vstdate between "'+ds1+'" and "'+ds2+'" and v.hospmain="'+copy(hospcode_list,1,5)+'" and o.an is null order by v.vn ');
-
ลองส่งรายงานขึ้นมาครับ แต่จากที่อ่าน
จากที่อ่านแสดงว่าไม่เอา pttype ไปจับใช่ไหมครับ
โรงพยาบาลก็ไม่เอา
งั้นน่าจะใช้ vn_stat.aid มาจับได้นะครับ
หรือไม่ก็จัดเต็มที่
http://hosxp.net/index.php?option=com_smf&Itemid=28&topic=22755.msg198314#new
-
ใช่ครับ เลือกวันแล้วเลือกจังหวัดจาก โรงพยาบาลหลักในตาราง hospcode และอำเภอในตาราง hospcode
รพ.เรียกเก็บรายอำเภอครับ
ขอเพิ่มอีกนิดครับเลือกแบบ ALL ได้ด้วยนะครับ
ลองส่งรายงานขึ้นมาครับ แต่จากที่อ่าน
จากที่อ่านแสดงว่าไม่เอา pttype ไปจับใช่ไหมครับ
โรงพยาบาลก็ไม่เอา
งั้นน่าจะใช้ vn_stat.aid มาจับได้นะครับ
หรือไม่ก็จัดเต็มที่
http://hosxp.net/index.php?option=com_smf&Itemid=28&topic=22755.msg198314#new
-
ช่วยชี้แนวทางด้วยครับ ??? ::) :'(
-
ยังกดAccept answerไม่ได้ ยังทำไม่สำเร็จ
GetDateRangeDialog(date1, date2);
ds1:=formatdatetime('yyyy-mm-dd',date1);
ds2:=formatdatetime('yyyy-mm-dd',date2);
pttype_list := getsqlsubquerydata('select distinct pttype from vn_stat where vstdate between "'+ds1+'" and "'+ds2+'" ');
pttype_list :=getpickuplist('select concat(pttype,":",name) as pttype_name from pttype where pttype in ('+pttype_list+') order by pttype '); hospcode_list:=getsqlsubquerydata('select distinct hospmain from vn_stat where pttype in ('+copy(pttype_list,1,2)+') and vstdate between "'+ds1+'" and "'+ds2+'" ');
hospcode_list := getpickuplist('select concat(hospcode,":",hosptype," ",name) as name from hospcode where hospcode in ('+hospcode_list+')order by hospcode ');
ChangeReportSQL('select v.* from vn_stat v left outer join ovst o on o.vn = v.vn where v.pttype in ('+copy(pttype_list,1,2)+') and v.vstdate between "'+ds1+'" and "'+ds2+'" and v.hospmain="'+copy(hospcode_list,1,5)+'" and o.an is null order by v.vn ');