RMPFEB ;DDC/KAW-CLOSE TRANSMISSION BATCH; [ 06/16/95 3:06 PM ]
;;2.0;REMOTE ORDER/ENTRY SYSTEM;;JUN 16, 1995
RMPFSET I '$D(RMPFMENU) D MENU^RMPFUTL I '$D(RMPFMENU) W !!,$C(7),"*** A MENU SELECTION MUST BE MADE ***" Q ;;RMPFMENU must be defined
I '$D(RMPFSTAN)!'$D(RMPFDAT)!'$D(RMPFSYS) D ^RMPFUTL Q:'$D(RMPFSTAN)!'$D(RMPFDAT)!'$D(RMPFSYS)
W @IOF,!!,"CLOSE TRANSMISSION BATCH"
START W !!,"Currently Open Batch:",! F I=1:1:21 W "-"
A0 S RMPFBT=0
A1 F S RMPFBT=$O(^RMPF(791812,"C",1,RMPFBT)) Q:'RMPFBT I $D(^RMPF(791812,RMPFBT,0)) S S0=^(0),M=$P(S0,U,9) S:M M=$P($G(^RMPF(791810.5,M,0)),U,2) S:M="" M=0 I $P(S0,U,8)=RMPFSTAP,M=RMPFMENU Q
I 'RMPFBT D MSG1 G END
S S0=^RMPF(791812,RMPFBT,0)
G A1:$P(S0,U,2)'=1 S Y=$P(S0,U,1) D DD^%DT
S D=Y,N=$P(S0,U,4) W !!,"Date/Time Opened: ",D
W !?1,"Number in Batch: ",N
A4 W !!,"Display batch entries? YES// " D READ G END:$D(RMPFOUT)
A41 I $D(RMPFQUT) W !!,"Type <Y> or <RETURN> to display entries in the batch or <N> to continue." G A4
S:Y="" Y="Y" I "YyNn"'[Y S RMPFQUT="" G A41
G MSG:"Nn"[Y
A42 D ^RMPFDB1
MSG W !!,"By closing this batch, you will make the batch available for transmission",!,"to the VA Denver Distribution Center."
A6 W !!,"Close this batch? NO// " D READ
G END:$D(RMPFOUT)
A61 I $D(RMPFQUT) W !!,"Enter <Y> to close the batch, <N> or <RETURN> to exit." G MSG
S:Y="" Y="N" I "YyNn"'[Y S RMPFQUT="" G A61
G END:"Nn"[Y
CLOSE S X="NOW",%DT="T" D ^%DT
L ^RMPF(791812,RMPFBT)
S $P(^RMPF(791812,RMPFBT,0),U,2)=2,$P(^(0),U,3)=Y,$P(^(0),U,5)=DUZ
S ^RMPF(791812,"C",2,RMPFBT)="" K ^RMPF(791812,"C",1,RMPFBT)
L
W:'$D(ZTSK) !!?29,"*** BATCH CLOSED ***"
A7 D AUTOQ^RMPFQT
END K RMPFBT,RMPFBJ,RMPFB,%DT,SG,S0,D,I,N,X,Y
K %,T,D,D0,DA,DI,DIC,DIE,DQ,DR,II,N,XMINST Q
MSG1 W !!,"*** NO OPEN BATCH ***" Q
DELETE ;;input: RMPFB
;;output: None
W !!,"Enter Order Numbers Separated by Commas: "
D READ G DELETEE:$D(RMPFOUT)
DELE I $D(RMPFQUT) W !!,"Select the number(s) to the left of the orders you wish to delete.",!,"Separate numbers with commas." G DELETE
G DELETEE:Y=""
F I=1:1 S X=$P(Y,",",I) Q:X="" I '$D(RMPFB(X)) S RMPFQUT="" Q
G DELE:$D(RMPFQUT) S SG=Y W !!
F I=1:1 S RX=$P(SG,",",I) Q:RX="" I $D(RMPFB(RX)) S RMPFBJ=RMPFB(RX) I $D(^RMPF(791812,RMPFBT,101,RMPFBJ,0)) S RMPFX=$P(^(0),U,1) D DEL^RMPFER
DELETEE K RMPFQUT,SG,RX,I,X,Y,RMPFB Q
READ K RMPFOUT,RMPFQUT
R Y:DTIME I '$T W $C(7) R Y:5 G READ:Y="." S:'$T Y=U
I Y?1"^".E S (RMPFOUT,Y)="" Q
S:Y?1"?".E (RMPFQUT,Y)=""
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HRMPFEB 2505 printed Oct 16, 2024@18:36:48 Page 2
RMPFEB ;DDC/KAW-CLOSE TRANSMISSION BATCH; [ 06/16/95 3:06 PM ]
+1 ;;2.0;REMOTE ORDER/ENTRY SYSTEM;;JUN 16, 1995
RMPFSET ;;RMPFMENU must be defined
IF '$DATA(RMPFMENU)
DO MENU^RMPFUTL
IF '$DATA(RMPFMENU)
WRITE !!,$CHAR(7),"*** A MENU SELECTION MUST BE MADE ***"
QUIT
+1 IF '$DATA(RMPFSTAN)!'$DATA(RMPFDAT)!'$DATA(RMPFSYS)
DO ^RMPFUTL
if '$DATA(RMPFSTAN)!'$DATA(RMPFDAT)!'$DATA(RMPFSYS)
QUIT
+2 WRITE @IOF,!!,"CLOSE TRANSMISSION BATCH"
START WRITE !!,"Currently Open Batch:",!
FOR I=1:1:21
WRITE "-"
A0 SET RMPFBT=0
A1 FOR
SET RMPFBT=$ORDER(^RMPF(791812,"C",1,RMPFBT))
if 'RMPFBT
QUIT
IF $DATA(^RMPF(791812,RMPFBT,0))
SET S0=^(0)
SET M=$PIECE(S0,U,9)
if M
SET M=$PIECE($GET(^RMPF(791810.5,M,0)),U,2)
if M=""
SET M=0
IF $PIECE(S0,U,8)=RMPFSTAP
IF M=RMPFMENU
QUIT
+1 IF 'RMPFBT
DO MSG1
GOTO END
+2 SET S0=^RMPF(791812,RMPFBT,0)
+3 if $PIECE(S0,U,2)'=1
GOTO A1
SET Y=$PIECE(S0,U,1)
DO DD^%DT
+4 SET D=Y
SET N=$PIECE(S0,U,4)
WRITE !!,"Date/Time Opened: ",D
+5 WRITE !?1,"Number in Batch: ",N
A4 WRITE !!,"Display batch entries? YES// "
DO READ
if $DATA(RMPFOUT)
GOTO END
A41 IF $DATA(RMPFQUT)
WRITE !!,"Type <Y> or <RETURN> to display entries in the batch or <N> to continue."
GOTO A4
+1 if Y=""
SET Y="Y"
IF "YyNn"'[Y
SET RMPFQUT=""
GOTO A41
+2 if "Nn"[Y
GOTO MSG
A42 DO ^RMPFDB1
MSG WRITE !!,"By closing this batch, you will make the batch available for transmission",!,"to the VA Denver Distribution Center."
A6 WRITE !!,"Close this batch? NO// "
DO READ
+1 if $DATA(RMPFOUT)
GOTO END
A61 IF $DATA(RMPFQUT)
WRITE !!,"Enter <Y> to close the batch, <N> or <RETURN> to exit."
GOTO MSG
+1 if Y=""
SET Y="N"
IF "YyNn"'[Y
SET RMPFQUT=""
GOTO A61
+2 if "Nn"[Y
GOTO END
CLOSE SET X="NOW"
SET %DT="T"
DO ^%DT
+1 LOCK ^RMPF(791812,RMPFBT)
+2 SET $PIECE(^RMPF(791812,RMPFBT,0),U,2)=2
SET $PIECE(^(0),U,3)=Y
SET $PIECE(^(0),U,5)=DUZ
+3 SET ^RMPF(791812,"C",2,RMPFBT)=""
KILL ^RMPF(791812,"C",1,RMPFBT)
+4 LOCK
+5 if '$DATA(ZTSK)
WRITE !!?29,"*** BATCH CLOSED ***"
A7 DO AUTOQ^RMPFQT
END KILL RMPFBT,RMPFBJ,RMPFB,%DT,SG,S0,D,I,N,X,Y
+1 KILL %,T,D,D0,DA,DI,DIC,DIE,DQ,DR,II,N,XMINST
QUIT
MSG1 WRITE !!,"*** NO OPEN BATCH ***"
QUIT
DELETE ;;input: RMPFB
+1 ;;output: None
+2 WRITE !!,"Enter Order Numbers Separated by Commas: "
+3 DO READ
if $DATA(RMPFOUT)
GOTO DELETEE
DELE IF $DATA(RMPFQUT)
WRITE !!,"Select the number(s) to the left of the orders you wish to delete.",!,"Separate numbers with commas."
GOTO DELETE
+1 if Y=""
GOTO DELETEE
+2 FOR I=1:1
SET X=$PIECE(Y,",",I)
if X=""
QUIT
IF '$DATA(RMPFB(X))
SET RMPFQUT=""
QUIT
+3 if $DATA(RMPFQUT)
GOTO DELE
SET SG=Y
WRITE !!
+4 FOR I=1:1
SET RX=$PIECE(SG,",",I)
if RX=""
QUIT
IF $DATA(RMPFB(RX))
SET RMPFBJ=RMPFB(RX)
IF $DATA(^RMPF(791812,RMPFBT,101,RMPFBJ,0))
SET RMPFX=$PIECE(^(0),U,1)
DO DEL^RMPFER
DELETEE KILL RMPFQUT,SG,RX,I,X,Y,RMPFB
QUIT
READ KILL RMPFOUT,RMPFQUT
+1 READ Y:DTIME
IF '$TEST
WRITE $CHAR(7)
READ Y:5
if Y="."
GOTO READ
if '$TEST
SET Y=U
+2 IF Y?1"^".E
SET (RMPFOUT,Y)=""
QUIT
+3 if Y?1"?".E
SET (RMPFQUT,Y)=""
+4 QUIT