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