AGNDX2 ; IHS/ASDS/EFG - PRINT ALL PATIENT'S INDEX CARDS ;
;;7.1;PATIENT REGISTRATION;;AUG 25,2005
SURE W !!!,"Are you sure you want to print index cards for ALL patients? (Y/N) Y// " D READ^AG S Y=$E(Y_"Y") I $D(DQOUT) W !!,"This routine will print an index card for EVERY patient on your data base!!!" G SURE
G END:("N"=Y)!$D(DTOUT)!$D(DFOUT)!$D(DUOUT) I "Y"'=Y D YN^AG G SURE
D ALIAS^AGNDXP
G END:$D(DTOUT)!$D(DFOUT)!$D(DUOUT)
DEV S %ZIS="OPQ" D ^%ZIS I POP S IOP=ION D ^%ZIS Q
G:'$D(IO("Q")) START 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="START^AGNDX2",ZTUCI=Y,ZTDESC="Print Index Cards, All Patients, for "_$P(^AUTTLOC(DUZ(2),0),U,2)_".",ZTSAVE="" S:$D(AGALIAS) ZTSAVE("AGALIAS")=""
D ^%ZTLOAD G:'$D(ZTSK) DEV K AG,AGALIAS,ZTDESC,ZTRTN,ZTSAVE,ZTSK,ZTUCI D ^%ZISC
Q
START ;EP - From TaskMan.
U IO S AGNAME=0 F I=0:0 S AGNAME=$O(^DPT("B",AGNAME)) Q:AGNAME="" F IEN=0:0 S IEN=$O(^DPT("B",AGNAME,IEN)) Q:IEN="" I $D(^(IEN))=1 S DFN=IEN D ^AGNDXP
D ^%ZISC
END K AG,AGALIAS,DFN,IEN,I,J,AGLINE,IEN,IOP,AGNAME,AGTOT,X,Y D:$D(ZTQUEUED) KILL^%ZTLOAD
Q
AGNDX2 ; IHS/ASDS/EFG - PRINT ALL PATIENT'S INDEX CARDS ;
+1 ;;7.1;PATIENT REGISTRATION;;AUG 25,2005
SURE WRITE !!!,"Are you sure you want to print index cards for ALL patients? (Y/N) Y// "
DO READ^AG
SET Y=$EXTRACT(Y_"Y")
IF $DATA(DQOUT)
WRITE !!,"This routine will print an index card for EVERY patient on your data base!!!"
GOTO SURE
+1 IF ("N"=Y)!$DATA(DTOUT)!$DATA(DFOUT)!$DATA(DUOUT)
GOTO END
IF "Y"'=Y
DO YN^AG
GOTO SURE
+2 DO ALIAS^AGNDXP
+3 IF $DATA(DTOUT)!$DATA(DFOUT)!$DATA(DUOUT)
GOTO END
DEV SET %ZIS="OPQ"
DO ^%ZIS
IF POP
SET IOP=ION
DO ^%ZIS
QUIT
+1 IF '$DATA(IO("Q"))
GOTO START
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="START^AGNDX2"
SET ZTUCI=Y
SET ZTDESC="Print Index Cards, All Patients, for "_$PIECE(^AUTTLOC(DUZ(2),0),U,2)_"."
SET ZTSAVE=""
IF $DATA(AGALIAS)
SET ZTSAVE("AGALIAS")=""
+3 DO ^%ZTLOAD
IF '$DATA(ZTSK)
GOTO DEV
KILL AG,AGALIAS,ZTDESC,ZTRTN,ZTSAVE,ZTSK,ZTUCI
DO ^%ZISC
+4 QUIT
START ;EP - From TaskMan.
+1 USE IO
SET AGNAME=0
FOR I=0:0
SET AGNAME=$ORDER(^DPT("B",AGNAME))
IF AGNAME=""
QUIT
FOR IEN=0:0
SET IEN=$ORDER(^DPT("B",AGNAME,IEN))
IF IEN=""
QUIT
IF $DATA(^(IEN))=1
SET DFN=IEN
DO ^AGNDXP
+2 DO ^%ZISC
END KILL AG,AGALIAS,DFN,IEN,I,J,AGLINE,IEN,IOP,AGNAME,AGTOT,X,Y
IF $DATA(ZTQUEUED)
DO KILL^%ZTLOAD
+1 QUIT