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