AGREPRT ; IHS/ASDS/EFG - QUE DAILY REGISTRATION ACTIVITY REPORT ;
;;7.1;PATIENT REGISTRATION;**5**;AUG 25,2005
I '$D(DT) S %DT="",X="T" D ^%DT S DT=Y
K %DT S AG("FD")="W !!,*7,""Do not use future dates."""
A2 W !!,"Enter the BEGINNING DATE for this report: " D READ^AG Q:$D(DUOUT)!$D(DFOUT)!$D(DTOUT)!$D(DLOUT) S:$D(DQOUT) Y="?" S DTIME=300,X=Y,%DT="XEP" D ^%DT G A2:Y<1 S AG("B")=Y I Y>DT X AG("FD") G A2
A3 W !!,"Enter the ENDING DATE for this report: " D READ^AG Q:$D(DFOUT)!$D(DTOUT)!$D(DLOUT) G A2:$D(DUOUT) S:$D(DQOUT) Y="?" S DTIME=300,X=Y,%DT="XEP" D ^%DT G A3:Y<1 S AG("E")=Y I Y>DT X AG("FD") G A3
G A44:AG("B")'>AG("E") W !!,*7,"INVALID ENTRY - The END is before the BEGINNING." G A2
A44 ;
S AGB=$$FMTE^XLFDT(AG("B"),5),AGE=$$FMTE^XLFDT(AG("E"),5)
A5 W !!!,"Which type of report do you wish? (1,2 ,3 or 4)",!!
W " 1... `NEW, EDITED, REMOVED` Statistics only",!!
W " 2... `NEW, EDITED, REMOVED` Statistics and patient names",!!
W " 3... `NEW / REGISTERED` Statistics from ",AGB," To ",AGE,!!
W " 4... `NEW / REGISTERED` Statistics and Patients from ",AGB," To ",AGE,!!,"Enter: "
D READ^AG G A3:$D(DUOUT) Q:$D(DTOUT)!$D(DFOUT)!$D(DLOUT) I Y<1!(Y>4) W !!,*7,"Please Enter only ""1"" ,""2"",""3"" or ""4""." G A5
S AG("TYPE")=Y S AGIO=IO,AG("HAT")=""
DEV S %ZIS="OPQ" D ^%ZIS I POP S IOP=ION D ^%ZIS Q
G:'$D(IO("Q")) ^AGREPRT1 K IO("Q") I $D(IO("S"))!($E(IOST)'="P") W *7,!,"Please queue to system printers." D ^%ZISC G DEV
X ^%ZOSF("UCI") S ZTRTN="^AGREPRT1",ZTUCI=Y,ZTDESC="REGISTRATION ACTIVITY REPORT for "_$P(^AUTTLOC(DUZ(2),0),U,2)_", "_AGB_" to "_AGE_"." F G="AG(""TYPE"")","AG(""B"")","AG(""E"")" S ZTSAVE(G)=""
S ZTSAVE("AGB")="",ZTSAVE("AGE")="" ;AG*7.1*5 H4512
D ^%ZTLOAD G:'$D(ZTSK) DEV K AG,AGB,AGE,AGIO,G,ZTDESC,ZTRTN,ZTSAVE,ZTSK,ZTUCI D ^%ZISC
Q
AGREPRT ; IHS/ASDS/EFG - QUE DAILY REGISTRATION ACTIVITY REPORT ;
+1 ;;7.1;PATIENT REGISTRATION;**5**;AUG 25,2005
+2 IF '$DATA(DT)
SET %DT=""
SET X="T"
DO ^%DT
SET DT=Y
+3 KILL %DT
SET AG("FD")="W !!,*7,""Do not use future dates."""
A2 WRITE !!,"Enter the BEGINNING DATE for this report: "
DO READ^AG
IF $DATA(DUOUT)!$DATA(DFOUT)!$DATA(DTOUT)!$DATA(DLOUT)
QUIT
IF $DATA(DQOUT)
SET Y="?"
SET DTIME=300
SET X=Y
SET %DT="XEP"
DO ^%DT
IF Y<1
GOTO A2
SET AG("B")=Y
IF Y>DT
XECUTE AG("FD")
GOTO A2
A3 WRITE !!,"Enter the ENDING DATE for this report: "
DO READ^AG
IF $DATA(DFOUT)!$DATA(DTOUT)!$DATA(DLOUT)
QUIT
IF $DATA(DUOUT)
GOTO A2
IF $DATA(DQOUT)
SET Y="?"
SET DTIME=300
SET X=Y
SET %DT="XEP"
DO ^%DT
IF Y<1
GOTO A3
SET AG("E")=Y
IF Y>DT
XECUTE AG("FD")
GOTO A3
+1 IF AG("B")'>AG("E")
GOTO A44
WRITE !!,*7,"INVALID ENTRY - The END is before the BEGINNING."
GOTO A2
A44 ;
+1 SET AGB=$$FMTE^XLFDT(AG("B"),5)
SET AGE=$$FMTE^XLFDT(AG("E"),5)
A5 WRITE !!!,"Which type of report do you wish? (1,2 ,3 or 4)",!!
+1 WRITE " 1... `NEW, EDITED, REMOVED` Statistics only",!!
+2 WRITE " 2... `NEW, EDITED, REMOVED` Statistics and patient names",!!
+3 WRITE " 3... `NEW / REGISTERED` Statistics from ",AGB," To ",AGE,!!
+4 WRITE " 4... `NEW / REGISTERED` Statistics and Patients from ",AGB," To ",AGE,!!,"Enter: "
+5 DO READ^AG
IF $DATA(DUOUT)
GOTO A3
IF $DATA(DTOUT)!$DATA(DFOUT)!$DATA(DLOUT)
QUIT
IF Y<1!(Y>4)
WRITE !!,*7,"Please Enter only ""1"" ,""2"",""3"" or ""4""."
GOTO A5
+6 SET AG("TYPE")=Y
SET AGIO=IO
SET AG("HAT")=""
DEV SET %ZIS="OPQ"
DO ^%ZIS
IF POP
SET IOP=ION
DO ^%ZIS
QUIT
+1 IF '$DATA(IO("Q"))
GOTO ^AGREPRT1
KILL IO("Q")
IF $DATA(IO("S"))!($EXTRACT(IOST)'="P")
WRITE *7,!,"Please queue to system printers."
DO ^%ZISC
GOTO DEV
+2 XECUTE ^%ZOSF("UCI")
SET ZTRTN="^AGREPRT1"
SET ZTUCI=Y
SET ZTDESC="REGISTRATION ACTIVITY REPORT for "_$PIECE(^AUTTLOC(DUZ(2),0),U,2)_", "_AGB_" to "_AGE_"."
FOR G="AG(""TYPE"")","AG(""B"")","AG(""E"")"
SET ZTSAVE(G)=""
+3 ;AG*7.1*5 H4512
SET ZTSAVE("AGB")=""
SET ZTSAVE("AGE")=""
+4 DO ^%ZTLOAD
IF '$DATA(ZTSK)
GOTO DEV
KILL AG,AGB,AGE,AGIO,G,ZTDESC,ZTRTN,ZTSAVE,ZTSK,ZTUCI
DO ^%ZISC
+5 QUIT