BCKI$G(PSOBEDT)W$C(7),$C(7)SVALMSG="Invalid Action at this time !",VALMBCK=""Q
NPSODISPSPSORPLRX=$P(PSOLST(ORN),"^",2)
I$$LMREJ^PSOREJU1(PSORPLRX,,.VALMSG,.VALMBCK)Q
DPSOL^PSSLOCK(PSORPLRX)I'$G(PSOMSG)SVALMSG=$S($P($G(PSOMSG),"^",2)'="":$P($G(PSOMSG),"^",2),1:"Another person is editing this order."),VALMBCK=""KPSOMSGQ
I$P($G(^PSRX(RX,"OR1")),"^",5)=$G(PSOZAF)SVALMBCK="",VALMSG="This reprint option is not available for Autofinshed Rxs",QFLG=1KPSOZAFDULR,KILLQ;vfah
;
I$P(^PSRX(RX,"STA"),"^")=14SVALMBCK="",VALMSG="Cannot Reprint! Discontinued by Provider.",QFLG=1DULR,KILLQ
I$P(^PSRX(RX,"STA"),"^")=15SVALMBCK="",VALMSG="Cannot Reprint! Discontinued due to editing.",QFLG=1DULR,KILLQ
I$P(^PSRX(RX,"STA"),"^")=16SVALMBCK="",VALMSG="Cannot Reprint! Placed on HOLD by Provider.",QFLG=1DULR,KILLQ
IDT>$P(^PSRX(RX,2),"^",6)DGPAUSE
.W!,$C(7),"Medication Expired on "_$E($P(^PSRX(RX,2),"^",6),4,5)_"-"_$E($P(^(2),"^",6),6,7)_"-"_$E($P(^(2),"^",6),2,3)I$P(^PSRX(DA,"STA"),"^")<11S$P(^PSRX(DA,"STA"),"^")=11D
..SCOMM="Medication Expired on "_$E($P(^PSRX(RX,2),"^",6),4,5)_"-"_$E($P(^(2),"^",6),6,7)_"-"_$E($P(^(2),"^",6),2,3)DEN^PSOHLSN1(DA,"SC","ZE",COMM)KCOMM
ISTA=4W!?3,"Prescription is Pending Due to Drug Interactions"GPAUSE
ISTA=12W!?3,"Prescription is Discontinued"GPAUSE
SCOPIES=$S($P(PDA,"^",18)]"":$P(PDA,"^",18),1:1)
KDIRSDIR("A")="Number of Copies? ",DIR("B")=COPIES,DIR(0)="N^1:99:0",DIR("?")="Enter the number of copies you want (1 to 99)"
D^DIRKDIRI$D(DIRUT)DULRGKILL
SCOPIES=Y
KDIRSDIR("A")="Print adhesive portion of label only? ",DIR(0)="Y",DIR("B")="No",DIR("?",1)="If entire label, including trailers are to print press RETURN for default."
SDIR("?")="Else if only bottle and mailing labels are to print enter Y or YES."D^DIRKDIRI$D(DUOUT)DULR,KILLGPAUSE
PAUSEKRX,PPL,ZD(+$G(DA)),DAI$G(POERR)KDIR,DIRUT,DUOUT,DTOUTSDIR(0)="E",DIR("A",1)=" ",DIR("A")="Press Return to Continue"D^DIRKDIR,DIRUT,DUOUT,DTOUTSVALMBCK="R"
DULRKPSORPLRX
Q
;
ACTKDIRSDIR("A")="Comments: ",DIR(0)="FA^5:60",DIR("?")="5-60 characters input required for activity log."S:$G(PCOMX)]""DIR("B")=$G(PCOMX)