- PSAREVC ;BIR/LTL-Control Point Transaction Review ;7/23/97
- ;;3.0; DRUG ACCOUNTABILITY/INVENTORY INTERFACE;**15**; 10/24/97
- ;
- ;References to ^PSDRUG( are covered by IA #2095
- ;References to ^PRCS( are covered by IA #198
- ;
- W !!,"Because of the size of this file, look-ups of less than four characters",!!,"are NOT advised. Please enter either the entire transaction number,",!!,"Station-FY-QTR-Control Point-Sequence Number, or at least the four digit"
- W !!,"Sequence Number.",!!
- N DIC,DIR,DTOUT,DUOUT,PSACON,PSALOC,PSAOUT,X,Y
- S DIC="^PRCS(410,",DIC(0)="AEMQ",DIC("A")="Please select Control Point Transaction: ",DIC("S")="I $P($G(^(0)),U,2)=""O"",$P($G(^(3)),U,3)[822400",PSAOUT=1 D ^DIC K DIC G:$D(DTOUT)!($D(DUOUT))!(Y<1) END S PSACON=+Y
- I '$O(^PSD(58.81,"E",+PSACON,"")) W !!,"There are no receipts for this Transaction.",!! G END
- DEV ;asks device and queueing info
- K IO("Q"),PSALOC N %ZIS,IOP,POP S %ZIS="Q" D ^%ZIS I POP W !,"NO DEVICE SELECTED OR OUTPUT PRINTED!" Q
- I $D(IO("Q")) N ZTDESC,ZTIO,ZTRTN,ZTSAVE,ZTDTH,ZTSK S ZTRTN="START^PSAREVC",ZTDESC="Receipt transaction review",ZTSAVE("PSACON")="" D ^%ZTLOAD,HOME^%ZIS S PSAOUT=1 G END
- START ;compiles and prints output
- N %DT,PSALN,PSAR,PSAPG,PSARPDT S (PSAPG,PSAOUT)=0,Y=DT,PSAR="" X ^DD("DD") S PSARPDT=Y D HEADER
- LOOP F S PSAR=$O(^PSD(58.81,"E",+PSACON,PSAR)) G:'PSAR END D:$Y+5>IOSL HEADER G:PSAOUT END D
- .I '$D(PSALOC) S PSALOC=$P($G(^PSD(58.81,+PSAR,0)),U,3) W !,"Receiving Site: ",$P($G(^PSD(58.8,+PSALOC,0)),U),!
- .I $G(PSALOC)'=$P($G(^PSD(58.81,+PSAR,0)),U,3) S PSALOC=$P($G(^(0)),U,3) W !,"Receiving Site: ",$P($G(^PSD(58.8,+$P($G(^PSD(58.81,+PSAR,0)),U,3),0)),U),!
- .S Y=$P($G(^PSD(58.81,+PSAR,0)),U,4) X ^DD("DD") W !,Y," ",$E($P($G(^PSDRUG(+$P($G(^PSD(58.81,PSAR,0)),U,5),0)),U),1,25)," -> "
- .W $P($G(^PSD(58.81,+PSAR,0)),U,6)," rec'd by ",$E($P($G(^VA(200,+$P($G(^PSD(58.81,+PSAR,0)),U,7),0)),U),1,20),!
- END W:$E(IOST)'="C" @IOF
- I $E(IOST,1,2)="C-",'PSAOUT S DIR(0)="EA",DIR("A")="END OF REPORT! Press <RET> to return to the menu." D ^DIR
- D ^%ZISC S:$D(ZTQUEUED) ZTREQ="@" K IO("Q")
- Q
- I $E(IOST,1,2)'="P-",PSAPG S DIR(0)="E" D ^DIR K DIR I 'Y S PSAOUT=1 Q
- I $$S^%ZTLOAD W !!,"Task #",$G(ZTSK),", ",$G(ZTDESC)," was stopped by ",$P($G(^VA(200,+$G(DUZ),0)),U),"." S PSAOUT=1 Q
- W:$Y @IOF S $P(PSALN,"-",81)="",PSAPG=PSAPG+1 W !,"History of receipts for Transaction # ",$P($G(^PRCS(410,+PSACON,0)),U),?57,PSARPDT,?70,"PAGE: ",PSAPG,!,PSALN,!
- Q
- PSAREVC ;BIR/LTL-Control Point Transaction Review ;7/23/97
- +1 ;;3.0; DRUG ACCOUNTABILITY/INVENTORY INTERFACE;**15**; 10/24/97
- +2 ;
- +3 ;References to ^PSDRUG( are covered by IA #2095
- +4 ;References to ^PRCS( are covered by IA #198
- +5 ;
- +6 WRITE !!,"Because of the size of this file, look-ups of less than four characters",!!,"are NOT advised. Please enter either the entire transaction number,",!!,"Station-FY-QTR-Control Point-Sequence Number, or at least the four digit"
- +7 WRITE !!,"Sequence Number.",!!
- +8 NEW DIC,DIR,DTOUT,DUOUT,PSACON,PSALOC,PSAOUT,X,Y
- +9 SET DIC="^PRCS(410,"
- SET DIC(0)="AEMQ"
- SET DIC("A")="Please select Control Point Transaction: "
- SET DIC("S")="I $P($G(^(0)),U,2)=""O"",$P($G(^(3)),U,3)[822400"
- SET PSAOUT=1
- DO ^DIC
- KILL DIC
- IF $DATA(DTOUT)!($DATA(DUOUT))!(Y<1)
- GOTO END
- SET PSACON=+Y
- +10 IF '$ORDER(^PSD(58.81,"E",+PSACON,""))
- WRITE !!,"There are no receipts for this Transaction.",!!
- GOTO END
- DEV ;asks device and queueing info
- +1 KILL IO("Q"),PSALOC
- NEW %ZIS,IOP,POP
- SET %ZIS="Q"
- DO ^%ZIS
- IF POP
- WRITE !,"NO DEVICE SELECTED OR OUTPUT PRINTED!"
- QUIT
- +2 IF $DATA(IO("Q"))
- NEW ZTDESC,ZTIO,ZTRTN,ZTSAVE,ZTDTH,ZTSK
- SET ZTRTN="START^PSAREVC"
- SET ZTDESC="Receipt transaction review"
- SET ZTSAVE("PSACON")=""
- DO ^%ZTLOAD
- DO HOME^%ZIS
- SET PSAOUT=1
- GOTO END
- START ;compiles and prints output
- +1 NEW %DT,PSALN,PSAR,PSAPG,PSARPDT
- SET (PSAPG,PSAOUT)=0
- SET Y=DT
- SET PSAR=""
- XECUTE ^DD("DD")
- SET PSARPDT=Y
- DO HEADER
- LOOP FOR
- SET PSAR=$ORDER(^PSD(58.81,"E",+PSACON,PSAR))
- IF 'PSAR
- GOTO END
- IF $Y+5>IOSL
- DO HEADER
- IF PSAOUT
- GOTO END
- Begin DoDot:1
- +1 IF '$DATA(PSALOC)
- SET PSALOC=$PIECE($GET(^PSD(58.81,+PSAR,0)),U,3)
- WRITE !,"Receiving Site: ",$PIECE($GET(^PSD(58.8,+PSALOC,0)),U),!
- +2 IF $GET(PSALOC)'=$PIECE($GET(^PSD(58.81,+PSAR,0)),U,3)
- SET PSALOC=$PIECE($GET(^(0)),U,3)
- WRITE !,"Receiving Site: ",$PIECE($GET(^PSD(58.8,+$PIECE($GET(^PSD(58.81,+PSAR,0)),U,3),0)),U),!
- +3 SET Y=$PIECE($GET(^PSD(58.81,+PSAR,0)),U,4)
- XECUTE ^DD("DD")
- WRITE !,Y," ",$EXTRACT($PIECE($GET(^PSDRUG(+$PIECE($GET(^PSD(58.81,PSAR,0)),U,5),0)),U),1,25)," -> "
- +4 WRITE $PIECE($GET(^PSD(58.81,+PSAR,0)),U,6)," rec'd by ",$EXTRACT($PIECE($GET(^VA(200,+$PIECE($GET(^PSD(58.81,+PSAR,0)),U,7),0)),U),1,20),!
- End DoDot:1
- END IF $EXTRACT(IOST)'="C"
- WRITE @IOF
- +1 IF $EXTRACT(IOST,1,2)="C-"
- IF 'PSAOUT
- SET DIR(0)="EA"
- SET DIR("A")="END OF REPORT! Press <RET> to return to the menu."
- DO ^DIR
- +2 DO ^%ZISC
- IF $DATA(ZTQUEUED)
- SET ZTREQ="@"
- KILL IO("Q")
- +3 QUIT
- +1 IF $EXTRACT(IOST,1,2)'="P-"
- IF PSAPG
- SET DIR(0)="E"
- DO ^DIR
- KILL DIR
- IF 'Y
- SET PSAOUT=1
- QUIT
- +2 IF $$S^%ZTLOAD
- WRITE !!,"Task #",$GET(ZTSK),", ",$GET(ZTDESC)," was stopped by ",$PIECE($GET(^VA(200,+$GET(DUZ),0)),U),"."
- SET PSAOUT=1
- QUIT
- +3 IF $Y
- WRITE @IOF
- SET $PIECE(PSALN,"-",81)=""
- SET PSAPG=PSAPG+1
- WRITE !,"History of receipts for Transaction # ",$PIECE($GET(^PRCS(410,+PSACON,0)),U),?57,PSARPDT,?70,"PAGE: ",PSAPG,!,PSALN,!
- +4 QUIT