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