BMS-HOSxP Community

HOSxP => แจ้งปัญหา / ขอความช่วยเหลือ => ข้อความที่เริ่มโดย: hk11227 ที่ มิถุนายน 16, 2011, 14:50:37 PM

หัวข้อ: อยากได้รายงานครับ
เริ่มหัวข้อโดย: hk11227 ที่ มิถุนายน 16, 2011, 14:50:37 PM
อยากรบกวนขอรายงาน สักตัวนีงครับ เป็นรายงาน ระยะเวลาการในการเข้ารับบริการ ที่แยกเป็นรายการ คนไข้ทั่วไป คนไข้เบาหวาน คนไข้ความดัน ที่มารับบริการในโรงพยาบาล ครับ    มีท่านใดพอจะมีบ้างไหมครับ  ;D ;D
หัวข้อ: Re: อยากได้รายงานครับ
เริ่มหัวข้อโดย: hk11227 ที่ มิถุนายน 17, 2011, 08:48:27 AM
พอจะมีกันบ้างไหม
หัวข้อ: Re: อยากได้รายงานครับ
เริ่มหัวข้อโดย: เกื้อกูล ครับ.. ที่ มิถุนายน 17, 2011, 08:54:03 AM
ลองดูครับ...ไปปรับแต่งตามต้องการ
หัวข้อ: Re: อยากได้รายงานครับ
เริ่มหัวข้อโดย: hk11227 ที่ มิถุนายน 17, 2011, 09:56:50 AM
thank ให้แล้วนะครับ
 ขอบคุณอย่างสูงครับ   :) :)
หัวข้อ: Re: อยากได้รายงานครับ
เริ่มหัวข้อโดย: hk11227 ที่ มิถุนายน 17, 2011, 10:03:45 AM
มีแบบที่แยก คลินิกได้บ้างไหมครับ
หัวข้อ: Re: อยากได้รายงานครับ
เริ่มหัวข้อโดย: เกื้อกูล ครับ.. ที่ มิถุนายน 17, 2011, 10:10:30 AM
มีแบบที่แยก คลินิกได้บ้างไหมครับ

อันนี้แหล่ะครับ..ไปแก้ใน variable ครับ..เพื่อ getpickuplist ครับ..จากตาราง clinic ก็ได้แล้วครับ..  เอา random ออกก็ได้..เอาช่วงเวลาออกก็ได้..อยู่ที่จะขอดูข้อมูลช่วงไหนของวันครับ...

s:=GetPickupList('select "All" union select "OPD" union select "ER" union select "OTHER"');
          if s='ALL'  then
          begin
          ChangeReportSQL('select a.vstdate,a.vn,a.hn,concat(pname,fname,"    ",lname) as ptname, '+
          'a.vsttime ,a.service4 ,a.service11 ,a.service5  ,a.service12,a.service16, '+
          'sec_to_time(time_to_sec(a.service11)-time_to_sec(a.vsttime)) as t1, '+
          'sec_to_time(time_to_sec(a.service12)-time_to_sec(a.service11)) as t2 , '+
          'sec_to_time(time_to_sec(a.service16)-time_to_sec(a.service12))as t3 , '+
          'sec_to_time(time_to_sec(a.service16)-time_to_sec(a.vsttime)) as t4 '+
          'from service_time a '+
          'left outer join patient b on a.hn=b.hn '+
          'left outer join ovst o on o.vn=a.vn '+
          'where a.vstdate between "'+d1+'" and "'+d2+'" and a.vstdate not in (select holiday_date from holiday) '+
          'and a.vn not in (select vn from lab_head) and a.vn not in (select vn from xray_head) '+
          'and a.vsttime between "08:30:00" and "10:30:00" '+
          'and a.service4>a.vsttime '+
          'and a.service12>a.service5 order by rand()limit 300');
     
หัวข้อ: Re: อยากได้รายงานครับ
เริ่มหัวข้อโดย: เกื้อกูล ครับ.. ที่ มิถุนายน 17, 2011, 10:15:30 AM
หรือเริ่มต้นตัวอย่างก็ประมาณนี้คัรบ..


select a.vstdate,a.vn,a.hn,concat(pname,fname,"    ",lname) as ptname,
a.vsttime as begintime,a.service4 as screen,sec_to_time(time_to_sec(a.service4)-time_to_sec(a.vsttime)) as watingtimescreen,
a.service11 as screentime,sec_to_time(time_to_sec(a.service11)-time_to_sec(a.service4)) as timescreen,
a.service5 as doctortime,sec_to_time(time_to_sec(a.service5)-time_to_sec(a.service11)) as waitingdoctortime,
a.service12 as doctorendtime,sec_to_time(time_to_sec(a.service12)-time_to_sec(a.service5)) as doctorwatingtime,
a.service6 as jadya,sec_to_time(time_to_sec(a.service6)-time_to_sec(a.service12)) as jadyawatingtime,
sec_to_time(time_to_sec(a.service6)-time_to_sec(a.vsttime)) as watingtime
from service_time a
left outer join patient b on a.hn=b.hn
left outer join ovst o on o.vn=a.vn
where a.vstdate between "2011-01-01" and "2011-01-31" and a.vstdate not in (select holiday_date from holiday)
and o.visit_type="I" and a.vsttime between "08:50:00" and "11:45:00" and a.vn not in (select vn from lab_head ) and a.vn not in (select vn from er_regist)
and a.service4_dep="010"
and a.service4>a.vsttime
and a.service6>a.service4
and a.service12>a.service5


เปลี่ยนเป็นรหัสคลินิก หรือแผนกตามต้องการคัรบ