refer_S9250

Update Delete

ID35
Parent ID12
Table Namerefer_S9250
Titlerefer_S9250
Description
Script#SQL_OPTIONS#
PROVIDERS=2
PROVIDER1=JHCIS
PROVIDER2=HOSXP
PROVIDER1_VALIDATE_TABLES=visitanc,visitancpregnancy,visit
PROVIDER2_VALIDATE_TABLES=person_anc_service,ovst,ovst_seq
SCRIPT_FLOW=SQL
#SQL_OPTIONS#

#PROVIDER1_SQL#
SET @provcode = :provcode;
SET @rep_year = :rep_year;
SET @hoscode = :hoscode;
SET @hosname = :hosname;
SET @hostype = :hostype;
SET @address = :address;
SET @subdistcode = :subdistcode;
SET @distcode = :distcode;
SET @level_service = :level_service;


SELECT

FROM

WHERE

;

#PROVIDER1_SQL#


#PROVIDER2_SQL#
SET @provcode = :provcode;
SET @rep_year = :rep_year;
SET @hoscode = :hoscode;
SET @hosname = :hosname;
SET @hostype = :hostype;
SET @address = :address;
SET @subdistcode = :subdistcode;
SET @distcode = :distcode;
SET @level_service = :level_service;


select @hoscode as hospcode ,
count(v.vn) as c_vn,count(o.o_refer_number) as c_refer, @rep_year as refer_year
from vn_stat v
left outer join ovst o on o.vn=v.vn
where (v.vstdate between concat((@rep_year-1),'-10-10') and concat((@rep_year),'-09-30') )
and ( (v.pdx = 'S9250')
or (v.dx0 = 'S9250')
or (v.dx1 = 'S9250')
or (v.dx2 = 'S9250')
or (v.dx3 = 'S9250')
or (v.dx4 = 'S9250')
or (v.dx5 = 'S9250')
)
;

#PROVIDER2_SQL#
Script Cron
Force Script Cron0
Active1
Client Office Type
Create Date2015-06-12 01:12:07
Last Update2015-06-12 01:15:59