PSDRFU ;BIR/JPW,LTL-Nurse RF Delayed Dispensing Liquid ;8 Aug 94
;;3.0; CONTROLLED SUBSTANCES ;**50**;13 Feb 97
QTY S DIR(0)="NA^.01:"_OQTY_":2",DIR("A")="Amount given: "
W ! D ^DIR K DIR G:Y'>0 END S (PSDQ,OQTY)=Y
WASTE I PSDQ#1 D G:$G(PSDOUT) END
.S DIR(0)="Y",DIR("A")="Will you be wasting any of this dose"
.W ! D ^DIR K DIR S:$D(DIRUT) PSDOUT=1 Q:Y'=1
.W ?44,"Amount to be wasted: ",1-PSDQ#1,! S WQTY=1-PSDQ#1
WIT .S NUR2=$$WITNESS^XUVERIFY("WITNESS")
.I NUR2=DUZ W !!,"Wait a minute, you can't witness yourself!",$C(7) G WIT
.I NUR2'>0 S PSDOUT=1 Q
.W !!,"Thank you, ",$S($P($G(^VA(200,NUR2,.1)),U,4)]"":$P($G(^(.1)),U,4),1:$P($G(^VA(200,NUR2,0)),U))
.S PSDQ=PSDQ+WQTY ;S DUZ=PSDUZ
S %DT="AEPRX",%DT(0)="-NOW",%DT("A")="Date/time given: "
W ! D ^%DT K %DT G:Y<1 END S PSDT=Y
S DIC="^VA(200,",DIC(0)="AEMQ",DIC("A")="Nurse that signed out dose: "
; PSD*3*50 RJS - MODIFY TO CHECK SIGN OUT NURSE AGAINST WITNESS
ADMN W ! D ^DIC K DIC G:Y<1 END S NUR1=+Y,NUR1(1)=DUZ
I $D(NUR2),NUR1=NUR2 W !,"Witness and Sign Out Nurse can not be the same person" G:NUR1=NUR2 ADMN
W !!,"Remaining Balance: ",$P(PSDR(1),U,4)-PSDQ," ",$P(PSDR(1),U,8)
D UPDAT^PSDRFT G DRUG^PSDRFS
END W:$G(PSDOUT) !!,"No dose signed out.",$C(7),!! K %,%DT,%H,%I,CNT,CNT1,DA,DIC,DIE,DINUM,DIR,DIROUT,DIRUT,DIWF,DIWL,DIWR,DR,DTOUT,DUOUT,LN,MSG,MSG1
K NAOU,NAOUN,NBKU,NPKG,OK,OKTYP,ORD,PSDA,PSDEM,PSDOUT,PSDQTY,PSDRD,PSDR,PSDRN,PSDS,PSDT,PSDUZ,PSDUZN,REQD,TEXT,TYPE,WORD,X,Y
Q
MSG ;display error message
W $C(7),!!,?10,"Contact your Pharmacy Coordinator.",!,?10,"This "_$S(MSG=2:"Dispensing Site",MSG=1:"NAOU",1:"Drug")_" is missing "
W $S(MSG1=1:"Primary Disp. Site",MSG1=2:"stocked drugs",MSG1=3:"narcotic breakdown unit",MSG1=4:"narcotic package size",1:"data")_".",!
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HPSDRFU 1788 printed Dec 13, 2024@01:48:43 Page 2
PSDRFU ;BIR/JPW,LTL-Nurse RF Delayed Dispensing Liquid ;8 Aug 94
+1 ;;3.0; CONTROLLED SUBSTANCES ;**50**;13 Feb 97
QTY SET DIR(0)="NA^.01:"_OQTY_":2"
SET DIR("A")="Amount given: "
+1 WRITE !
DO ^DIR
KILL DIR
if Y'>0
GOTO END
SET (PSDQ,OQTY)=Y
WASTE IF PSDQ#1
Begin DoDot:1
+1 SET DIR(0)="Y"
SET DIR("A")="Will you be wasting any of this dose"
+2 WRITE !
DO ^DIR
KILL DIR
if $DATA(DIRUT)
SET PSDOUT=1
if Y'=1
QUIT
+3 WRITE ?44,"Amount to be wasted: ",1-PSDQ#1,!
SET WQTY=1-PSDQ#1
WIT SET NUR2=$$WITNESS^XUVERIFY("WITNESS")
+1 IF NUR2=DUZ
WRITE !!,"Wait a minute, you can't witness yourself!",$CHAR(7)
GOTO WIT
+2 IF NUR2'>0
SET PSDOUT=1
QUIT
+3 WRITE !!,"Thank you, ",$SELECT($PIECE($GET(^VA(200,NUR2,.1)),U,4)]"":$PIECE($GET(^(.1)),U,4),1:$PIECE($GET(^VA(200,NUR2,0)),U))
+4 ;S DUZ=PSDUZ
SET PSDQ=PSDQ+WQTY
End DoDot:1
if $GET(PSDOUT)
GOTO END
+5 SET %DT="AEPRX"
SET %DT(0)="-NOW"
SET %DT("A")="Date/time given: "
+6 WRITE !
DO ^%DT
KILL %DT
if Y<1
GOTO END
SET PSDT=Y
+7 SET DIC="^VA(200,"
SET DIC(0)="AEMQ"
SET DIC("A")="Nurse that signed out dose: "
+8 ; PSD*3*50 RJS - MODIFY TO CHECK SIGN OUT NURSE AGAINST WITNESS
ADMN WRITE !
DO ^DIC
KILL DIC
if Y<1
GOTO END
SET NUR1=+Y
SET NUR1(1)=DUZ
+1 IF $DATA(NUR2)
IF NUR1=NUR2
WRITE !,"Witness and Sign Out Nurse can not be the same person"
if NUR1=NUR2
GOTO ADMN
+2 WRITE !!,"Remaining Balance: ",$PIECE(PSDR(1),U,4)-PSDQ," ",$PIECE(PSDR(1),U,8)
+3 DO UPDAT^PSDRFT
GOTO DRUG^PSDRFS
END if $GET(PSDOUT)
WRITE !!,"No dose signed out.",$CHAR(7),!!
KILL %,%DT,%H,%I,CNT,CNT1,DA,DIC,DIE,DINUM,DIR,DIROUT,DIRUT,DIWF,DIWL,DIWR,DR,DTOUT,DUOUT,LN,MSG,MSG1
+1 KILL NAOU,NAOUN,NBKU,NPKG,OK,OKTYP,ORD,PSDA,PSDEM,PSDOUT,PSDQTY,PSDRD,PSDR,PSDRN,PSDS,PSDT,PSDUZ,PSDUZN,REQD,TEXT,TYPE,WORD,X,Y
+2 QUIT
MSG ;display error message
+1 WRITE $CHAR(7),!!,?10,"Contact your Pharmacy Coordinator.",!,?10,"This "_$SELECT(MSG=2:"Dispensing Site",MSG=1:"NAOU",1:"Drug")_" is missing "
+2 WRITE $SELECT(MSG1=1:"Primary Disp. Site",MSG1=2:"stocked drugs",MSG1=3:"narcotic breakdown unit",MSG1=4:"narcotic package size",1:"data")_".",!
+3 QUIT