Existing store procedure untuk get graph, body, data table
This commit is contained in:
23
sp_rpt_executive_summary_tabel_gender_v2.txt
Normal file
23
sp_rpt_executive_summary_tabel_gender_v2.txt
Normal file
@@ -0,0 +1,23 @@
|
||||
begin
|
||||
SELECT count(Mcu_OrderT_OrderHeaderID) into @peserta
|
||||
FROM one_etl.mgm_mcu
|
||||
join one_etl.mcu_order on Mcu_OrderMgm_McuID = Mgm_McuID
|
||||
where Mgm_McuID = PID ;
|
||||
|
||||
select
|
||||
"A" as Kode,
|
||||
"Gender" as Groups ,
|
||||
M_SexName as Nama ,
|
||||
count(Mcu_OrderT_OrderHeaderID) as total ,
|
||||
Round((count(Mcu_OrderT_OrderHeaderID) / @peserta * 100 ),2) as Persen
|
||||
|
||||
|
||||
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'
|
||||
left join m_sex ON M_PatientM_SexID = M_SexID AND M_SexIsActive = 'Y'
|
||||
|
||||
where Mcu_OrderMgm_McuID = PID
|
||||
group by M_SexID ;
|
||||
|
||||
end
|
||||
Reference in New Issue
Block a user