Existing store procedure untuk get graph, body, data table

This commit is contained in:
2024-07-30 09:43:23 +07:00
parent 4e0753f167
commit 702d668d07
8 changed files with 231 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
begin
select
IFNULL(M_PatientLocation, '-') as M_PatientLocation,
case
when left(T_OrderHeaderM_PatientAge,2) < '30' then "< 30 th"
when left(T_OrderHeaderM_PatientAge,2) >= '30' and left(T_OrderHeaderM_PatientAge,2) < '40' then "30 -< 40 th"
when left(T_OrderHeaderM_PatientAge,2) >= '40' and left(T_OrderHeaderM_PatientAge,2) < '50' then "40 - < 50 th"
when left(T_OrderHeaderM_PatientAge,2) >= '50' then "> 50 th" else ""
end as umur,
count(Mcu_OrderT_OrderHeaderID) as total,
concat('http://localhost/one-api/tools/mcu_chart/mcu003/',Mcu_OrderMgm_McuID) as Graph
from one_etl.mcu_order
join t_orderheader on Mcu_OrderT_OrderHeaderID = T_OrderHeaderID and T_OrderHeaderIsActive = 'Y'
left join m_patient ON T_OrderHeaderM_PatientID = M_PatientID AND M_PatientIsActive = 'Y'
where Mcu_OrderMgm_McuID = PID
group by M_PatientLocation,
case
when left(T_OrderHeaderM_PatientAge,2) < '30' then "< 30 th"
when left(T_OrderHeaderM_PatientAge,2) >= '30' and left(T_OrderHeaderM_PatientAge,2) < '40' then "30 -< 40 th"
when left(T_OrderHeaderM_PatientAge,2) >= '40' and left(T_OrderHeaderM_PatientAge,2) < '50' then "40 - < 50 th"
when left(T_OrderHeaderM_PatientAge,2) >= '50' then "> 50 th" else ""
end;
end