ตรวจสอบ คัดกรอง NCD ซ้ำ

Update Delete

ID29
Parent ID18
Table Namerep_ncd_mutiple
Titleตรวจสอบ คัดกรอง NCD ซ้ำ
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
ncdpersonscreenall.pcucode AS สถานบริการ,
@rep_year year,
ncdpersonscreenall.pid,
CONCAT(ncd_person.`name`,' ',ncd_person.lname) ptname,
count(ncdpersonscreenall.pid) AS total
FROM ncdpersonscreenall
JOIN ncd_person ON ncd_person.pcucode=ncdpersonscreenall.pcucode AND ncd_person.pid=ncdpersonscreenall.pid
WHERE screen_date BETWEEN CONCAT((@rep_year-1),'-10-01') AND CONCAT(@rep_year,'-09-30')
GROUP BY ncdpersonscreenall.pid
HAVING count(ncdpersonscreenall.pid) > 1;


;

#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

FROM

WHERE

;

#PROVIDER2_SQL#
Script Cron
Force Script Cron0
Active1
Client Office Type
Create Date2015-06-12 12:55:37
Last Update2015-06-12 02:20:46