AGSSRA ; IHS/ASDS/EFG - REPORT WRITER #1 ;
;;7.1;PATIENT REGISTRATION;;AUG 25,2005
;
K AGSSDT
Q:'$D(AGSSP("A")) ;this report not indicated
;crossreferences used
LOAD ;EP - load crossreference into ^AGSTEMP
;gather dfns from "AS" cross reference(s) "*":2 "A":3
K ^AGSTEMP(AGSS("JOBID"),"RA")
S DFN=0,AGSSC("A")=0 F S DFN=$O(^AUPNPAT("AS",2,DFN)) Q:'DFN I $D(^DPT(DFN)) S AGSSC("A")=AGSSC("A")+1 I AGSSP("A")="C" D
.S AGSCREC=$G(^AGSSTEMP(AGSSITE,"RA",DFN)),^AGSTEMP(AGSS("JOBID"),"RA",$P(^DPT(DFN,0),U),DFN)=AGSCREC
S ^AGSTEMP(AGSS("JOBID"),"RA")=AGSSC("A")
Q
PRINT ;EP -
Q:'$D(AGSSP("A"))
I '$D(AGSSC("A")) S AGSSC("A")=$G(^AGSTEMP(AGSS("JOBID"),"RA"))
S AGSLVC="A",AGSSPG=1,AGSGLO="RA"
S AGSSHDR="SSNs added to the data base" D AGSSHDR^AGSSPRT
W !!,"The number of ",AGSSHDR," is ",$G(^AGSSTEMP(AGSSITE,"TOT","RA")),!
Q:(AGSSP("A")'="C")!(AGSSC("A")=0)
D AGSSHD^AGSSPRT
D ^AGSSPRT
Q
AGSSRA ; IHS/ASDS/EFG - REPORT WRITER #1 ;
+1 ;;7.1;PATIENT REGISTRATION;;AUG 25,2005
+2 ;
+3 KILL AGSSDT
+4 ;this report not indicated
IF '$DATA(AGSSP("A"))
QUIT
+5 ;crossreferences used
LOAD ;EP - load crossreference into ^AGSTEMP
+1 ;gather dfns from "AS" cross reference(s) "*":2 "A":3
+2 KILL ^AGSTEMP(AGSS("JOBID"),"RA")
+3 SET DFN=0
SET AGSSC("A")=0
FOR
SET DFN=$ORDER(^AUPNPAT("AS",2,DFN))
IF 'DFN
QUIT
IF $DATA(^DPT(DFN))
SET AGSSC("A")=AGSSC("A")+1
IF AGSSP("A")="C"
Begin DoDot:1
+4 SET AGSCREC=$GET(^AGSSTEMP(AGSSITE,"RA",DFN))
SET ^AGSTEMP(AGSS("JOBID"),"RA",$PIECE(^DPT(DFN,0),U),DFN)=AGSCREC
End DoDot:1
+5 SET ^AGSTEMP(AGSS("JOBID"),"RA")=AGSSC("A")
+6 QUIT
PRINT ;EP -
+1 IF '$DATA(AGSSP("A"))
QUIT
+2 IF '$DATA(AGSSC("A"))
SET AGSSC("A")=$GET(^AGSTEMP(AGSS("JOBID"),"RA"))
+3 SET AGSLVC="A"
SET AGSSPG=1
SET AGSGLO="RA"
+4 SET AGSSHDR="SSNs added to the data base"
DO AGSSHDR^AGSSPRT
+5 WRITE !!,"The number of ",AGSSHDR," is ",$GET(^AGSSTEMP(AGSSITE,"TOT","RA")),!
+6 IF (AGSSP("A")'="C")!(AGSSC("A")=0)
QUIT
+7 DO AGSSHD^AGSSPRT
+8 DO ^AGSSPRT
+9 QUIT