จำนวนหญิงตั้งครรภ์ที่มาฝากครรครั้งแรก ครบ 4 ครั้ง (ตามเกณฑ์)
ID | 32 |
---|---|
Parent ID | 9 |
Table Name | anc_complete |
Title | จำนวนหญิงตั้งครรภ์ที่มาฝากครรครั้งแรก ครบ 4 ครั้ง (ตามเกณฑ์) |
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 year(anc_service_date) as yy, monthname(anc_service_date) as mm, sum(if((pt.chwpart = '27' and pt.amppart = '01' and pt.tmbpart = '01' and pt.nationality = '99'),1,0)) as tmb_sakeo, sum(if((pt.chwpart = '27' and pt.amppart = '01' and pt.tmbpart <> '01' and pt.nationality = '99'),1,0)) as amp_sakeo, sum(if((pt.chwpart = '27' and pt.amppart <> '01' and pt.nationality = '99'),1,0)) as out_amp_sakeo, sum(if((pt.nationality <> '99'),1,0)) as foreigner from person_anc_service pas left outer join person_anc pa on pa.person_anc_id=pas.person_anc_id left outer join person p on p.person_id=pa.person_id left outer join patient pt on pt.hn=p.patient_hn where pas.anc_service_date BETWEEN CONCAT((@rep_year-1),'-10-01') AND CONCAT(@rep_year,'-09-30') and pas.pa_week<=12 and pas.person_anc_id not in (select person_anc_id from person_anc_service where person_anc_id = pas.person_anc_id and anc_service_date < pas.anc_service_date and pa_week <=12 ) group by year(pas.anc_service_date), month(pas.anc_service_date) ; #PROVIDER2_SQL# |
Script Cron | |
Force Script Cron | 0 |
Active | 1 |
Client Office Type | |
Create Date | 2015-06-12 01:02:27 |
Last Update | 2015-06-12 01:13:37 |
- Home
- About
- Privacy Policy
- Terms of Use
- Contact Us
© 2015. All Rights Reserved.