select case
when month(er.vstdate)='10' then 'ตุลาคม'
when month(er.vstdate)='11' then 'พฤศจิกายน'
when month(er.vstdate)='12' then 'ธันวาคม'
when month(er.vstdate)='1' then 'มกราคม'
when month(er.vstdate)='2' then 'กุมภาพันธ์'
when month(er.vstdate)='3' then 'มีนาคม'
when month(er.vstdate)='4' then 'เมษายน'
when month(er.vstdate)='5' then 'พฤษภาคม'
when month(er.vstdate)='6' then 'มิถุนายน'
when month(er.vstdate)='7' then 'กรกฎาคม'
when month(er.vstdate)='8' then 'สิงหาคม'
when month(er.vstdate)='9' then 'กันยายน'
end as month,
count(er.vn) as total,sum(er_pt_type =1) as 'emergency',sum(er_pt_type =2) as 'accident'
,sum(er_pt_type =3) as 'genaral',sum(er_pt_type =4) as 'other'
from er_regist er
left outer join vn_stat vn on vn.vn=er.vn
left outer join patient p on p.hn=vn.hn
where er.vstdate between '-1-10-01' and '-09-30'
group by MONTH(er.vstdate)
order by er.vstdate
;
$this->Widget('booster.widgets.TbHighCharts', array(
'options' => array(
'title' => array('text' => 'กราฟจำนวนผู้ป่วยประเภทต่างๆในห้องอุบัติเหตุแยกรายเดือนประจำปีงบประมาณ', ),
'chart' => array(
'type' => 'line'
),
'xAxis' => array(
categories => array('ต.ค', 'พ.ย', 'ธ.ค', 'ม.ค', 'ก.พ', 'มี.ค', 'เม.ย', 'พ.ค', 'มิ.ย', 'ก.ค', 'ส.ค', 'ก.ย')
),
'yAxis' => array(
title => array(
text => 'จำนวน'
),
),
'plotOptions' => array(
'line' => array(
'dataLabels' => array(
'enabled' => true
)),
),
'series' => array(array(
name => 'ทั้งหมด(ราย)',
data => $total
),
array(
name => 'ฉุกเฉิน(ราย)',
data => $emergency
),
array(
name => 'อุบัติเหตู(ราย)',
data => $accident
),
array(
name => 'ทั่วไป(ราย)',
data => $genaral
),
array(
name => 'ประเภทอื่นๆ',
data => $other
),
)
)
));
?>
เดือน | จำนวนทั้งหมด | ฉุกเฉิน | อุบัติเหตุ | ผู้ป่วยท้วไป | ประเภทอื่นๆ |
---|---|---|---|---|---|
No results found. |