PSAVER1 ;BIR/JMB-Verify Invoices - CONT'D ;7/23/97
;;3.0; DRUG ACCOUNTABILITY/INVENTORY INTERFACE;**33**; 10/24/97
;This routine allows the user to edit processed invoices by selecting
;the invoice's line item number. If there are no errors after editing
;the line item is verified.
;
EDIT W @IOF,!?18,"<<< EDIT INVOICES TO BE VERIFIED SCREEN >>>",!!?2,"Choose the invoices from the list you want to edit.",!,PSASLN
S (PSA,PSACNT,PSASTOP)=0 F S PSA=+$O(PSAEDIT(PSA)) Q:'PSA D Q:PSASTOP
.I $Y+5>IOSL D HEADER Q:PSASTOP
.S PSAIEN=$P(PSAEDIT(PSA),"^"),PSAIEN1=$P(PSAEDIT(PSA),"^",2),PSAORD=$P(^PSD(58.811,PSAIEN,0),"^")
.S PSAINV=$P(^PSD(58.811,PSAIEN,1,PSAIEN1,0),"^"),PSAINVDT=+$P(^(0),"^",2),PSACNT=PSACNT+1
.W !?2,PSA_".",?6,"Order#: "_PSAORD_" Invoice#: "_PSAINV_" Invoice Date: "_$$FMTE^XLFDT(PSAINVDT)
K PSASTOP W !,PSASLN
S DIR(0)="LO^1:"_PSACNT,DIR("A")="Select invoices to edit",DIR("?",1)="Enter the number to the left of the invoice",DIR("?")="data to be verified or a range of numbers.",DIR("??")="^D SELHELP^PSAVER"
W ! D ^DIR K DIR Q:$G(DIRUT)
S PSASEL=Y
;
SEL ;Select line items to be edit
K PSAVBKG
F PSAPC=1:1 S PSA=$P(PSASEL,",",PSAPC) Q:'PSA D CORR Q:PSAOUT
I $O(PSAVBKG(0)) D
.K ZTSAVE S ZTDESC="Drug Acct. - Verify Prime Vendor Invoices",ZTIO="",ZTDTH=$H,ZTRTN="^PSAVER6",ZTSAVE("PSAVBKG(")="" D ^%ZTLOAD
Q
;
S PSASS=21-$Y F PSAKK=1:1:PSASS W !
S DIR(0)="E" D ^DIR K DIR I $G(DIRUT) S PSASTOP=1 Q
W @IOF,!?18,"<<< EDIT INVOICES TO BE VERIFIED SCREEN >>>",!!,PSASLN
Q
;
CORR S PSAIEN=$P(PSAEDIT(PSA),"^"),PSAIEN1=$P(PSAEDIT(PSA),"^",2)
S PSAIN=^PSD(58.811,PSAIEN,1,PSAIEN1,0),PSAINV=$P(^(0),"^"),PSAINVDT=$P(^(0),"^",2),PSAORD=$P(^PSD(58.811,PSAIEN,0),"^")
D HDR,RECD^PSAVER2 Q:PSAOUT S PSALOC=+$P(PSAIN,"^",5),PSAMV=+$P(PSAIN,"^",12)
I PSALOC!($P(PSAIN,"^",8)="S")!($P(PSAIN,"^",8)="N") D Q:PSAOUT
.D SITES^PSAUTL1 S PSALOCN=$S($G(PSALOC)'>0:"UNKNOWN",1:$P(^PSD(58.8,PSALOC,0),"^"))_PSACOMB
.W:$L(PSALOCN)>76 !!,$P(PSALOCN,"(IP)",1)_"(IP)",!?17,$P(PSALOCN,"(IP)",2) W:$L(PSALOCN)<77 !!,PSALOCN
.S DR=4 D PHARM^PSAVER2
I PSAMV!($P(PSAIN,"^",8)="S")!($P(PSAIN,"^",8)="A") W !!,$P($G(^PSD(58.8,PSAMV,0)),"^") S DR=13 D PHARM^PSAVER2 Q:PSAOUT
;
LINES F W ! S DIC="^PSD(58.811,"_PSAIEN_",1,"_PSAIEN1_",1,",DA(2)=PSAIEN,DA(1)=PSAIEN1,DIC(0)="QAEMZ",DIC("A")="Select Line#: " D ^DIC K DIC D Q:PSAOUT
.I $G(DTOUT)!($G(DUOUT))!(Y<1) S PSAOUT=1 Q
.S PSALINE=+Y,PSALINEN=$P(Y,"^",2)
.I '$D(^PSD(58.811,PSAIEN,1,PSAIEN1,1,PSALINE,0)) W !,"Invalid line number." Q
.S PSADATA=^PSD(58.811,PSAIEN,1,PSAIEN1,1,PSALINE,0),PSASUP=0
.S PSANDC=$P(PSADATA,"^",11),PSAVSN=$P(PSADATA,"^",12),PSALOC=$S(+$P(PSADATA,"^",10):+$P(PSAIN,"^",12),1:+$P(PSAIN,"^",5))
VIEW .D HDR,VERDISP^PSAUTL4 W PSASLN,!
.W "1. Drug",!,"2. Quantity Received",!,"3. Order Unit",!,"4. Dispense Units per Order Unit",! S PSACHO=4
.I $P($G(^PSD(58.8,PSALOC,0)),"^",14) W "5. Stock Level",!,"6. Reorder Level",! S PSACHO=6
.S DIR(0)="LO^1:"_PSACHO,DIR("A")="Edit fields",DIR("?")="Enter the number(s) of the data to be edited" S DIR("??")="^D DDQOR^PSAVER3"
.D ^DIR K DIR I $G(DTOUT)!($G(DUOUT)) S PSAOUT=1 Q
.Q:Y="" S PSAFLDS=Y,PSASET=0 D HDR,VERDISP^PSAUTL4 W PSASLN
FIELDS .F PSAPCF=1:1 S PSAFLD=$P(PSAFLDS,",",PSAPCF) Q:'PSAFLD!(PSAOUT) D
..I PSAFLD=1 D ASKDRUG^PSAVER2 Q
..I PSAFLD=2 D QTY^PSAVER2 Q
..I PSAFLD=3 D OU^PSAVER2 Q
..I PSAFLD=4,'PSASET S PSA50IEN=PSADRG D DUOU^PSAVER2 Q
..I PSAFLD=5 D STOCK^PSAVER2 Q
..I PSAFLD=6 D REORDER^PSAVER2
;
;Looks to see if all line items are processed.
PROCESS S (PSACS,PSAERR,PSALINE,PSALINES,PSALNCNT,PSALNSU,PSAOUT,PSASUP)=0
S PSAIN=$G(^PSD(58.811,PSAIEN,1,PSAIEN1,0)),PSAORD=$P($G(^PSD(58.811,PSAIEN,0)),"^")
F S PSALINE=$O(^PSD(58.811,PSAIEN,1,PSAIEN1,1,PSALINE)) Q:'PSALINE!(PSAOUT) D
.S PSADATA=^PSD(58.811,PSAIEN,1,PSAIEN1,1,PSALINE,0),PSALNERR=0,PSALNCNT=PSALNCNT+1
.D SETLINE^PSAVER3 Q:PSAOUT
.S:'+$G(PSALNERR) PSALINES=PSALINES+1 S PSADATA=^PSD(58.811,PSAIEN,1,PSAIEN1,1,PSALINE,0)
.S:+$P(PSADATA,"^",10) PSACS=PSACS+1
;
CHECK I PSALNCNT'=PSALINES K PSAHOLD(PSALOC,PSAIEN,PSAIEN1) W !!,"** The invoice has not been placed in a Verified status!" D END^PSAPROC D:+$G(PSAERR) PRINT^PSAVER3 Q
I +PSALNCNT,PSALNCNT=PSACS D
.S $P(^PSD(58.811,PSAIEN,1,PSAIEN1,0),"^",8)="A" W !,"All drugs on the invoice are marked as a controlled substance."
.D:'+$P($G(^PSD(58.811,PSAIEN,1,PSAIEN1,0)),"^",12) MASTER^PSAVER5
I PSACS,PSALNCNT'=PSACS S $P(^PSD(58.811,PSAIEN,1,PSAIEN1,0),"^",8)="S" D:'$P($G(^PSD(58.811,PSAIEN,1,PSAIEN1,0)),"^",5) GETLOC^PSAVER5
I 'PSACS S $P(^PSD(58.811,PSAIEN,1,PSAIEN1,0),"^",8)="N" D:'$P($G(^PSD(58.811,PSAIEN,1,PSAIEN1,0)),"^",5) GETLOC^PSAVER5
I +PSALNCNT,PSALNCNT=PSALINES D Q
.D CHG
.I PSALNCNT=PSASUP S $P(^PSD(58.811,PSAIEN,1,PSAIEN1,0),"^",13)=1 Q
.S $P(^PSD(58.811,PSAIEN,1,PSAIEN1,0),"^",13)=0
D END^PSAPROC D:+$G(PSAERR) PRINT^PSAVER3
Q
;
CHG ;Determines if the invoice's status should be changed to verified. If
;so, the status is changed and the new drugs to the location is listed.
W ! S DIR(0)="Y",DIR("A")="Do you want to change the invoice's status to Verified",DIR("?",1)="Enter YES to change the invoice's status to Verified.",DIR("?")="Enter NO to keep the invoice's status as Processed."
S DIR("??")="^D CHGYN^PSAVER1" D ^DIR K DIR
I $G(DIRUT)!('Y) S PSACHG=0 W !!,"** The invoice's status has not been changed to Verified!" K PSAHOLD(PSALOC,PSAIEN,PSAIEN1) Q
S PSACHG=Y,PSAVBKG(PSAIEN,PSAIEN1)=""
D STATUS^PSAVER3,NEWDRUG
W !!,"The invoice status has been changed to Verified!"
D END^PSAPROC
Q
;
NEWDRUG ;If this invoice will add new drugs to location/vault, store in an
;array the location/vault and drug name to be printed later.
K PSALND,PSALN0,PSALNP,PSALNV
S PSALINE=0,PSAPHARM=+$P($G(^PSD(58.811,PSAIEN,1,PSAIEN1,0)),"^",5),PSAMV=$P($G(^(0)),"^",12)
Q:'PSALOC
F S PSALINE=$O(^PSD(58.811,PSAIEN,1,PSAIEN1,1,PSALINE)) Q:'PSALINE D
.S PSALN0=+$P($G(^PSD(58.811,PSAIEN,1,PSAIEN1,1,PSALINE,0)),"^",2),PSALOC=$S($P($G(^PSD(58.811,PSAIEN,1,PSAIEN1,1,PSALINE,0)),"^",10):PSAMV,1:PSAPHARM)
.I $O(^PSD(58.811,PSAIEN,1,PSAIEN1,1,PSALINE,1,"D",0)) D
..S PSADJ=$O(^PSD(58.811,PSAIEN,1,PSAIEN1,1,PSALINE,1,"D",0))
..Q:'$D(^PSD(58.811,PSAIEN,1,PSAIEN1,1,PSALINE,1,PSADJ,0))
..S PSALNP=+$P(PSADJ,"^",2),PSALNV=+$P(PSADJ,"^",6)
.S PSADD=$S($G(PSALNV):PSALNV,$G(PSALNP):PSALNP,PSALN0:PSALN0,1:0)
.I PSADD,'$D(^PSD(58.8,PSALOC,1,PSADD,0)) S PSANEWD(PSALOC,$S($P($G(^PSDRUG(PSADD,0)),"^")'="":$P($G(^PSDRUG(PSADD,0)),"^"),1:"UNKNOWN"))=PSADD
Q
;
HDR ;Header for screen that displays invoice data to be edited.
W @IOF,!?18,"<<< EDIT INVOICES TO BE VERIFIED SCREEN >>>"
W !!,"Order#: "_PSAORD_" Invoice#: "_PSAINV_" Invoice Date: "_$$FMTE^XLFDT(PSAINVDT),!,PSASLN,!
Q
;
CHGYN ;Extended help for 'Do you want to change the invoice's status to Verified'
W !?5,"Enter YES if the invoice is completely correct. You will not be able",!?5,"to edit it again."
W !!?5,"Enter NO if you need to edit the invoice again. You can edit it again",!?5,"by selecting the Verify Orders option."
Q
PSAVER1 ;BIR/JMB-Verify Invoices - CONT'D ;7/23/97
+1 ;;3.0; DRUG ACCOUNTABILITY/INVENTORY INTERFACE;**33**; 10/24/97
+2 ;This routine allows the user to edit processed invoices by selecting
+3 ;the invoice's line item number. If there are no errors after editing
+4 ;the line item is verified.
+5 ;
EDIT WRITE @IOF,!?18,"<<< EDIT INVOICES TO BE VERIFIED SCREEN >>>",!!?2,"Choose the invoices from the list you want to edit.",!,PSASLN
+1 SET (PSA,PSACNT,PSASTOP)=0
FOR
SET PSA=+$ORDER(PSAEDIT(PSA))
IF 'PSA
QUIT
Begin DoDot:1
+2 IF $Y+5>IOSL
DO HEADER
IF PSASTOP
QUIT
+3 SET PSAIEN=$PIECE(PSAEDIT(PSA),"^")
SET PSAIEN1=$PIECE(PSAEDIT(PSA),"^",2)
SET PSAORD=$PIECE(^PSD(58.811,PSAIEN,0),"^")
+4 SET PSAINV=$PIECE(^PSD(58.811,PSAIEN,1,PSAIEN1,0),"^")
SET PSAINVDT=+$PIECE(^(0),"^",2)
SET PSACNT=PSACNT+1
+5 WRITE !?2,PSA_".",?6,"Order#: "_PSAORD_" Invoice#: "_PSAINV_" Invoice Date: "_$$FMTE^XLFDT(PSAINVDT)
End DoDot:1
IF PSASTOP
QUIT
+6 KILL PSASTOP
WRITE !,PSASLN
+7 SET DIR(0)="LO^1:"_PSACNT
SET DIR("A")="Select invoices to edit"
SET DIR("?",1)="Enter the number to the left of the invoice"
SET DIR("?")="data to be verified or a range of numbers."
SET DIR("??")="^D SELHELP^PSAVER"
+8 WRITE !
DO ^DIR
KILL DIR
IF $GET(DIRUT)
QUIT
+9 SET PSASEL=Y
+10 ;
SEL ;Select line items to be edit
+1 KILL PSAVBKG
+2 FOR PSAPC=1:1
SET PSA=$PIECE(PSASEL,",",PSAPC)
IF 'PSA
QUIT
DO CORR
IF PSAOUT
QUIT
+3 IF $ORDER(PSAVBKG(0))
Begin DoDot:1
+4 KILL ZTSAVE
SET ZTDESC="Drug Acct. - Verify Prime Vendor Invoices"
SET ZTIO=""
SET ZTDTH=$HOROLOG
SET ZTRTN="^PSAVER6"
SET ZTSAVE("PSAVBKG(")=""
DO ^%ZTLOAD
End DoDot:1
+5 QUIT
+6 ;
+1 SET PSASS=21-$Y
FOR PSAKK=1:1:PSASS
WRITE !
+2 SET DIR(0)="E"
DO ^DIR
KILL DIR
IF $GET(DIRUT)
SET PSASTOP=1
QUIT
+3 WRITE @IOF,!?18,"<<< EDIT INVOICES TO BE VERIFIED SCREEN >>>",!!,PSASLN
+4 QUIT
+5 ;
CORR SET PSAIEN=$PIECE(PSAEDIT(PSA),"^")
SET PSAIEN1=$PIECE(PSAEDIT(PSA),"^",2)
+1 SET PSAIN=^PSD(58.811,PSAIEN,1,PSAIEN1,0)
SET PSAINV=$PIECE(^(0),"^")
SET PSAINVDT=$PIECE(^(0),"^",2)
SET PSAORD=$PIECE(^PSD(58.811,PSAIEN,0),"^")
+2 DO HDR
DO RECD^PSAVER2
IF PSAOUT
QUIT
SET PSALOC=+$PIECE(PSAIN,"^",5)
SET PSAMV=+$PIECE(PSAIN,"^",12)
+3 IF PSALOC!($PIECE(PSAIN,"^",8)="S")!($PIECE(PSAIN,"^",8)="N")
Begin DoDot:1
+4 DO SITES^PSAUTL1
SET PSALOCN=$SELECT($GET(PSALOC)'>0:"UNKNOWN",1:$PIECE(^PSD(58.8,PSALOC,0),"^"))_PSACOMB
+5 IF $LENGTH(PSALOCN)>76
WRITE !!,$PIECE(PSALOCN,"(IP)",1)_"(IP)",!?17,$PIECE(PSALOCN,"(IP)",2)
IF $LENGTH(PSALOCN)<77
WRITE !!,PSALOCN
+6 SET DR=4
DO PHARM^PSAVER2
End DoDot:1
IF PSAOUT
QUIT
+7 IF PSAMV!($PIECE(PSAIN,"^",8)="S")!($PIECE(PSAIN,"^",8)="A")
WRITE !!,$PIECE($GET(^PSD(58.8,PSAMV,0)),"^")
SET DR=13
DO PHARM^PSAVER2
IF PSAOUT
QUIT
+8 ;
LINES FOR
WRITE !
SET DIC="^PSD(58.811,"_PSAIEN_",1,"_PSAIEN1_",1,"
SET DA(2)=PSAIEN
SET DA(1)=PSAIEN1
SET DIC(0)="QAEMZ"
SET DIC("A")="Select Line#: "
DO ^DIC
KILL DIC
Begin DoDot:1
+1 IF $GET(DTOUT)!($GET(DUOUT))!(Y<1)
SET PSAOUT=1
QUIT
+2 SET PSALINE=+Y
SET PSALINEN=$PIECE(Y,"^",2)
+3 IF '$DATA(^PSD(58.811,PSAIEN,1,PSAIEN1,1,PSALINE,0))
WRITE !,"Invalid line number."
QUIT
+4 SET PSADATA=^PSD(58.811,PSAIEN,1,PSAIEN1,1,PSALINE,0)
SET PSASUP=0
+5 SET PSANDC=$PIECE(PSADATA,"^",11)
SET PSAVSN=$PIECE(PSADATA,"^",12)
SET PSALOC=$SELECT(+$PIECE(PSADATA,"^",10):+$PIECE(PSAIN,"^",12),1:+$PIECE(PSAIN,"^",5))
VIEW DO HDR
DO VERDISP^PSAUTL4
WRITE PSASLN,!
+1 WRITE "1. Drug",!,"2. Quantity Received",!,"3. Order Unit",!,"4. Dispense Units per Order Unit",!
SET PSACHO=4
+2 IF $PIECE($GET(^PSD(58.8,PSALOC,0)),"^",14)
WRITE "5. Stock Level",!,"6. Reorder Level",!
SET PSACHO=6
+3 SET DIR(0)="LO^1:"_PSACHO
SET DIR("A")="Edit fields"
SET DIR("?")="Enter the number(s) of the data to be edited"
SET DIR("??")="^D DDQOR^PSAVER3"
+4 DO ^DIR
KILL DIR
IF $GET(DTOUT)!($GET(DUOUT))
SET PSAOUT=1
QUIT
+5 IF Y=""
QUIT
SET PSAFLDS=Y
SET PSASET=0
DO HDR
DO VERDISP^PSAUTL4
WRITE PSASLN
FIELDS FOR PSAPCF=1:1
SET PSAFLD=$PIECE(PSAFLDS,",",PSAPCF)
IF 'PSAFLD!(PSAOUT)
QUIT
Begin DoDot:2
+1 IF PSAFLD=1
DO ASKDRUG^PSAVER2
QUIT
+2 IF PSAFLD=2
DO QTY^PSAVER2
QUIT
+3 IF PSAFLD=3
DO OU^PSAVER2
QUIT
+4 IF PSAFLD=4
IF 'PSASET
SET PSA50IEN=PSADRG
DO DUOU^PSAVER2
QUIT
+5 IF PSAFLD=5
DO STOCK^PSAVER2
QUIT
+6 IF PSAFLD=6
DO REORDER^PSAVER2
End DoDot:2
End DoDot:1
IF PSAOUT
QUIT
+7 ;
+8 ;Looks to see if all line items are processed.
PROCESS SET (PSACS,PSAERR,PSALINE,PSALINES,PSALNCNT,PSALNSU,PSAOUT,PSASUP)=0
+1 SET PSAIN=$GET(^PSD(58.811,PSAIEN,1,PSAIEN1,0))
SET PSAORD=$PIECE($GET(^PSD(58.811,PSAIEN,0)),"^")
+2 FOR
SET PSALINE=$ORDER(^PSD(58.811,PSAIEN,1,PSAIEN1,1,PSALINE))
IF 'PSALINE!(PSAOUT)
QUIT
Begin DoDot:1
+3 SET PSADATA=^PSD(58.811,PSAIEN,1,PSAIEN1,1,PSALINE,0)
SET PSALNERR=0
SET PSALNCNT=PSALNCNT+1
+4 DO SETLINE^PSAVER3
IF PSAOUT
QUIT
+5 IF '+$GET(PSALNERR)
SET PSALINES=PSALINES+1
SET PSADATA=^PSD(58.811,PSAIEN,1,PSAIEN1,1,PSALINE,0)
+6 IF +$PIECE(PSADATA,"^",10)
SET PSACS=PSACS+1
End DoDot:1
+7 ;
CHECK IF PSALNCNT'=PSALINES
KILL PSAHOLD(PSALOC,PSAIEN,PSAIEN1)
WRITE !!,"** The invoice has not been placed in a Verified status!"
DO END^PSAPROC
IF +$GET(PSAERR)
DO PRINT^PSAVER3
QUIT
+1 IF +PSALNCNT
IF PSALNCNT=PSACS
Begin DoDot:1
+2 SET $PIECE(^PSD(58.811,PSAIEN,1,PSAIEN1,0),"^",8)="A"
WRITE !,"All drugs on the invoice are marked as a controlled substance."
+3 IF '+$PIECE($GET(^PSD(58.811,PSAIEN,1,PSAIEN1,0)),"^",12)
DO MASTER^PSAVER5
End DoDot:1
+4 IF PSACS
IF PSALNCNT'=PSACS
SET $PIECE(^PSD(58.811,PSAIEN,1,PSAIEN1,0),"^",8)="S"
IF '$PIECE($GET(^PSD(58.811,PSAIEN,1,PSAIEN1,0)),"^",5)
DO GETLOC^PSAVER5
+5 IF 'PSACS
SET $PIECE(^PSD(58.811,PSAIEN,1,PSAIEN1,0),"^",8)="N"
IF '$PIECE($GET(^PSD(58.811,PSAIEN,1,PSAIEN1,0)),"^",5)
DO GETLOC^PSAVER5
+6 IF +PSALNCNT
IF PSALNCNT=PSALINES
Begin DoDot:1
+7 DO CHG
+8 IF PSALNCNT=PSASUP
SET $PIECE(^PSD(58.811,PSAIEN,1,PSAIEN1,0),"^",13)=1
QUIT
+9 SET $PIECE(^PSD(58.811,PSAIEN,1,PSAIEN1,0),"^",13)=0
End DoDot:1
QUIT
+10 DO END^PSAPROC
IF +$GET(PSAERR)
DO PRINT^PSAVER3
+11 QUIT
+12 ;
CHG ;Determines if the invoice's status should be changed to verified. If
+1 ;so, the status is changed and the new drugs to the location is listed.
+2 WRITE !
SET DIR(0)="Y"
SET DIR("A")="Do you want to change the invoice's status to Verified"
SET DIR("?",1)="Enter YES to change the invoice's status to Verified."
SET DIR("?")="Enter NO to keep the invoice's status as Processed."
+3 SET DIR("??")="^D CHGYN^PSAVER1"
DO ^DIR
KILL DIR
+4 IF $GET(DIRUT)!('Y)
SET PSACHG=0
WRITE !!,"** The invoice's status has not been changed to Verified!"
KILL PSAHOLD(PSALOC,PSAIEN,PSAIEN1)
QUIT
+5 SET PSACHG=Y
SET PSAVBKG(PSAIEN,PSAIEN1)=""
+6 DO STATUS^PSAVER3
DO NEWDRUG
+7 WRITE !!,"The invoice status has been changed to Verified!"
+8 DO END^PSAPROC
+9 QUIT
+10 ;
NEWDRUG ;If this invoice will add new drugs to location/vault, store in an
+1 ;array the location/vault and drug name to be printed later.
+2 KILL PSALND,PSALN0,PSALNP,PSALNV
+3 SET PSALINE=0
SET PSAPHARM=+$PIECE($GET(^PSD(58.811,PSAIEN,1,PSAIEN1,0)),"^",5)
SET PSAMV=$PIECE($GET(^(0)),"^",12)
+4 IF 'PSALOC
QUIT
+5 FOR
SET PSALINE=$ORDER(^PSD(58.811,PSAIEN,1,PSAIEN1,1,PSALINE))
IF 'PSALINE
QUIT
Begin DoDot:1
+6 SET PSALN0=+$PIECE($GET(^PSD(58.811,PSAIEN,1,PSAIEN1,1,PSALINE,0)),"^",2)
SET PSALOC=$SELECT($PIECE($GET(^PSD(58.811,PSAIEN,1,PSAIEN1,1,PSALINE,0)),"^",10):PSAMV,1:PSAPHARM)
+7 IF $ORDER(^PSD(58.811,PSAIEN,1,PSAIEN1,1,PSALINE,1,"D",0))
Begin DoDot:2
+8 SET PSADJ=$ORDER(^PSD(58.811,PSAIEN,1,PSAIEN1,1,PSALINE,1,"D",0))
+9 IF '$DATA(^PSD(58.811,PSAIEN,1,PSAIEN1,1,PSALINE,1,PSADJ,0))
QUIT
+10 SET PSALNP=+$PIECE(PSADJ,"^",2)
SET PSALNV=+$PIECE(PSADJ,"^",6)
End DoDot:2
+11 SET PSADD=$SELECT($GET(PSALNV):PSALNV,$GET(PSALNP):PSALNP,PSALN0:PSALN0,1:0)
+12 IF PSADD
IF '$DATA(^PSD(58.8,PSALOC,1,PSADD,0))
SET PSANEWD(PSALOC,$SELECT($PIECE($GET(^PSDRUG(PSADD,0)),"^")'="":$PIECE($GET(^PSDRUG(PSADD,0)),"^"),1:"UNKNOWN"))=PSADD
End DoDot:1
+13 QUIT
+14 ;
HDR ;Header for screen that displays invoice data to be edited.
+1 WRITE @IOF,!?18,"<<< EDIT INVOICES TO BE VERIFIED SCREEN >>>"
+2 WRITE !!,"Order#: "_PSAORD_" Invoice#: "_PSAINV_" Invoice Date: "_$$FMTE^XLFDT(PSAINVDT),!,PSASLN,!
+3 QUIT
+4 ;
CHGYN ;Extended help for 'Do you want to change the invoice's status to Verified'
+1 WRITE !?5,"Enter YES if the invoice is completely correct. You will not be able",!?5,"to edit it again."
+2 WRITE !!?5,"Enter NO if you need to edit the invoice again. You can edit it again",!?5,"by selecting the Verify Orders option."
+3 QUIT