AGSSRR ; IHS/ADC/PDW - REPORT WRITER #1 ;
;;7.1;PATIENT REGISTRATION;;AUG 25,2005
;
K AGSSDT
Q:'$D(AGSSP("R")) ;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"),"RR")
S DFN=0,AGSSC("R")=0 F S DFN=$O(^AUPNPAT("AS",2,DFN)) Q:'DFN I $D(^DPT(DFN)) S AGSSC("R")=AGSSC("R")+1 I AGSSP("R")="C" S ^AGSTEMP(AGSS("JOBID"),"RR",$P(^DPT(DFN,0),U),DFN)=""
S ^AGSTEMP(AGSS("JOBID"),"RR")=AGSSC("R")
Q
PRINT ;EP -
Q:'$D(AGSSP("R"))
I '$D(AGSSC("R")) S AGSSC("R")=$G(^AGSTEMP(AGSS("JOBID"),"RR"))
S AGSLVC="R",AGSSPG=1,AGSGLO="RR"
S AGSSHDR="Redundant 'adds'" D AGSSHDR^AGSSPRT
W !!,"The number of ",AGSSHDR," is ",$G(^AGSSTEMP(AGSSITE,"TOT","RR")),!
Q:(AGSSP("R")'="C")!(AGSSC("R")=0)
D AGSSHD^AGSSPRT
D ^AGSSPRT
Q
AGSSRR ; IHS/ADC/PDW - REPORT WRITER #1 ;
+1 ;;7.1;PATIENT REGISTRATION;;AUG 25,2005
+2 ;
+3 KILL AGSSDT
+4 ;this report not indicated
IF '$DATA(AGSSP("R"))
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"),"RR")
+3 SET DFN=0
SET AGSSC("R")=0
FOR
SET DFN=$ORDER(^AUPNPAT("AS",2,DFN))
IF 'DFN
QUIT
IF $DATA(^DPT(DFN))
SET AGSSC("R")=AGSSC("R")+1
IF AGSSP("R")="C"
SET ^AGSTEMP(AGSS("JOBID"),"RR",$PIECE(^DPT(DFN,0),U),DFN)=""
+4 SET ^AGSTEMP(AGSS("JOBID"),"RR")=AGSSC("R")
+5 QUIT
PRINT ;EP -
+1 IF '$DATA(AGSSP("R"))
QUIT
+2 IF '$DATA(AGSSC("R"))
SET AGSSC("R")=$GET(^AGSTEMP(AGSS("JOBID"),"RR"))
+3 SET AGSLVC="R"
SET AGSSPG=1
SET AGSGLO="RR"
+4 SET AGSSHDR="Redundant 'adds'"
DO AGSSHDR^AGSSPRT
+5 WRITE !!,"The number of ",AGSSHDR," is ",$GET(^AGSSTEMP(AGSSITE,"TOT","RR")),!
+6 IF (AGSSP("R")'="C")!(AGSSC("R")=0)
QUIT
+7 DO AGSSHD^AGSSPRT
+8 DO ^AGSSPRT
+9 QUIT