PSDLBLR ;BIR/JPW-CS Label Reprint for CS Disp Drug ; 29 Aug 94
;;3.0; CONTROLLED SUBSTANCES ;**69**;13 Feb 97;Build 13
;References to ^PSD(58.8, covered by DBIA2711
;
I '$D(PSDSITE) D ^PSDSET Q:'$D(PSDSITE)
S OK=$S($D(^XUSEC("PSJ RPHARM",DUZ)):1,$D(^XUSEC("PSJ PHARM TECH",DUZ)):1,$D(^XUSEC("PSD TECH ADV",DUZ)):1,1:0)
I 'OK W $C(7),!!,?9,"** Please contact your Pharmacy Coordinator for access to",!,?12,"print CS dispensing labels.",!!,"PSJ RPHARM, PSJ PHARM TECH or PSD TECH ADV security key required.",! K OK Q
W !!,"Green Sheets/Transactions that have a status of FILLED - NOT DELIVERED",!,"or DELIVERED - ACTIVELY ON NAOU will be reprinted for a given number range.",!!
GS ;ask disp number range
S PSDS=$P(PSDSITE,U,3),PSDSN=$P(PSDSITE,U,4)
G:$P(PSDSITE,U,5) GS1
K DIC,DA S DIC=58.8,DIC(0)="QEAZ",DIC("S")="I $P(^(0),""^"",3)=+PSDSITE,$S($P(^(0),""^"",2)[""M"":1,$P(^(0),""^"",2)[""S"":1,1:0)"
S DIC("A")="Select Primary Dispensing Site: ",DIC("B")=PSDSN
D ^DIC K DIC G:Y<0 END
S PSDS=+Y,PSDSN=$P(Y,"^",2),$P(PSDSITE,U,3)=+Y,$P(PSDSITE,U,4)=PSDSN
GS1 ;
W !!,"You may enter a Dispensing Number list and/or a Dispensing Number range.",!
W "NOTE: This response must be a list or range, e.g., 1,3,5 or 2-4,8.",!
K DA,DIR,DIRUT S DIR(0)="LOA^0:999999999",DIR("A")="Select Dispensing Number(s): "
D ^DIR K DIR G:$D(DIRUT) END
S PSD1="" F S PSD1=$O(Y(PSD1)) Q:PSD1="" S:$D(Y(PSD1)) PSD1(PSD1)=Y(PSD1) K Y(PSD1)
DEV ;ask device and queue info
S DIR(0)="Y",DIR("A")="Would you like to try printing these on PIN FED labels",DIR("B")="No" D ^DIR K DIR Q:$D(DIRUT) G:Y=1 ^PSDLBLR1
W $C(7),!!,?3,"WARNING: The printing of these labels requires the use of a sheet fed",!,?12,"laser printer setup to create Controlled Substances",!,?12,"barcodes.",!
W !,?12,"*** Check printer for LABEL paper before printing! ***",!
W !!,"This report is designed for a 3 column label format.",!,"You may queue this report to print at a later time.",!!
S Y=$P($G(^PSD(58.8,+PSDS,2)),"^",10),C=$P(^DD(58.8,24,0),"^",2) D Y^DIQ S PSDEV=Y
K %ZIS,IOP,IO("Q"),POP S %ZIS="QM",%ZIS("B")=PSDEV D ^%ZIS I POP W !,"NO DEVICE SELECTED OR REPORT PRINTED!" G END
I $D(IO("Q")) K IO("Q"),ZTSAVE,ZTDTH,ZTSK S ZTRTN="START^PSDLBLR0",ZTDESC="Print Dispensing Labels for CS PHARM" D SAVE,^%ZTLOAD,HOME^%ZIS K ZTSK G END
U IO D ^PSDLBLR0
END ;kill variables and exit
K %,%DT,%H,%I,%ZIS,C,DA,DIC,DIE,DIR,DIROUT,DIRUT,DR,DRUG,DTOUT,DUOUT,JJ,JLP1,LIQ,NAOU,NAOUN,NODE,OK
K POP,PSD,PSD1,PSDA,PSDBAR0,PSDBAR1,PSDCNT,PSDEV,PSDJ,PSDN,PSDPN,PSDOUT,PSDR,PSDRG,PSDPRT,PSDRN,PSDS,PSDSN,PSDT,PSDX1,PSDX2
K QTY,STAT,TEMP,TEST,TEXT,X,Y,ZTDESC,ZTIO,ZTRTN,ZTSAVE,ZTSK
K ^TMP("PSDLBLR",$J)
D ^%ZISC S:$D(ZTQUEUED) ZTREQ="@"
Q
SAVE ;save queued variables
S (ZTSAVE("PSDS"),ZTSAVE("PSDSN"))=""
S ZTSAVE("PSD1(")=""
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HPSDLBLR 2832 printed Dec 13, 2024@01:46:37 Page 2
PSDLBLR ;BIR/JPW-CS Label Reprint for CS Disp Drug ; 29 Aug 94
+1 ;;3.0; CONTROLLED SUBSTANCES ;**69**;13 Feb 97;Build 13
+2 ;References to ^PSD(58.8, covered by DBIA2711
+3 ;
+4 IF '$DATA(PSDSITE)
DO ^PSDSET
if '$DATA(PSDSITE)
QUIT
+5 SET OK=$SELECT($DATA(^XUSEC("PSJ RPHARM",DUZ)):1,$DATA(^XUSEC("PSJ PHARM TECH",DUZ)):1,$DATA(^XUSEC("PSD TECH ADV",DUZ)):1,1:0)
+6 IF 'OK
WRITE $CHAR(7),!!,?9,"** Please contact your Pharmacy Coordinator for access to",!,?12,"print CS dispensing labels.",!!,"PSJ RPHARM, PSJ PHARM TECH or PSD TECH ADV security key required.",!
KILL OK
QUIT
+7 WRITE !!,"Green Sheets/Transactions that have a status of FILLED - NOT DELIVERED",!,"or DELIVERED - ACTIVELY ON NAOU will be reprinted for a given number range.",!!
GS ;ask disp number range
+1 SET PSDS=$PIECE(PSDSITE,U,3)
SET PSDSN=$PIECE(PSDSITE,U,4)
+2 if $PIECE(PSDSITE,U,5)
GOTO GS1
+3 KILL DIC,DA
SET DIC=58.8
SET DIC(0)="QEAZ"
SET DIC("S")="I $P(^(0),""^"",3)=+PSDSITE,$S($P(^(0),""^"",2)[""M"":1,$P(^(0),""^"",2)[""S"":1,1:0)"
+4 SET DIC("A")="Select Primary Dispensing Site: "
SET DIC("B")=PSDSN
+5 DO ^DIC
KILL DIC
if Y<0
GOTO END
+6 SET PSDS=+Y
SET PSDSN=$PIECE(Y,"^",2)
SET $PIECE(PSDSITE,U,3)=+Y
SET $PIECE(PSDSITE,U,4)=PSDSN
GS1 ;
+1 WRITE !!,"You may enter a Dispensing Number list and/or a Dispensing Number range.",!
+2 WRITE "NOTE: This response must be a list or range, e.g., 1,3,5 or 2-4,8.",!
+3 KILL DA,DIR,DIRUT
SET DIR(0)="LOA^0:999999999"
SET DIR("A")="Select Dispensing Number(s): "
+4 DO ^DIR
KILL DIR
if $DATA(DIRUT)
GOTO END
+5 SET PSD1=""
FOR
SET PSD1=$ORDER(Y(PSD1))
if PSD1=""
QUIT
if $DATA(Y(PSD1))
SET PSD1(PSD1)=Y(PSD1)
KILL Y(PSD1)
DEV ;ask device and queue info
+1 SET DIR(0)="Y"
SET DIR("A")="Would you like to try printing these on PIN FED labels"
SET DIR("B")="No"
DO ^DIR
KILL DIR
if $DATA(DIRUT)
QUIT
if Y=1
GOTO ^PSDLBLR1
+2 WRITE $CHAR(7),!!,?3,"WARNING: The printing of these labels requires the use of a sheet fed",!,?12,"laser printer setup to create Controlled Substances",!,?12,"barcodes.",!
+3 WRITE !,?12,"*** Check printer for LABEL paper before printing! ***",!
+4 WRITE !!,"This report is designed for a 3 column label format.",!,"You may queue this report to print at a later time.",!!
+5 SET Y=$PIECE($GET(^PSD(58.8,+PSDS,2)),"^",10)
SET C=$PIECE(^DD(58.8,24,0),"^",2)
DO Y^DIQ
SET PSDEV=Y
+6 KILL %ZIS,IOP,IO("Q"),POP
SET %ZIS="QM"
SET %ZIS("B")=PSDEV
DO ^%ZIS
IF POP
WRITE !,"NO DEVICE SELECTED OR REPORT PRINTED!"
GOTO END
+7 IF $DATA(IO("Q"))
KILL IO("Q"),ZTSAVE,ZTDTH,ZTSK
SET ZTRTN="START^PSDLBLR0"
SET ZTDESC="Print Dispensing Labels for CS PHARM"
DO SAVE
DO ^%ZTLOAD
DO HOME^%ZIS
KILL ZTSK
GOTO END
+8 USE IO
DO ^PSDLBLR0
END ;kill variables and exit
+1 KILL %,%DT,%H,%I,%ZIS,C,DA,DIC,DIE,DIR,DIROUT,DIRUT,DR,DRUG,DTOUT,DUOUT,JJ,JLP1,LIQ,NAOU,NAOUN,NODE,OK
+2 KILL POP,PSD,PSD1,PSDA,PSDBAR0,PSDBAR1,PSDCNT,PSDEV,PSDJ,PSDN,PSDPN,PSDOUT,PSDR,PSDRG,PSDPRT,PSDRN,PSDS,PSDSN,PSDT,PSDX1,PSDX2
+3 KILL QTY,STAT,TEMP,TEST,TEXT,X,Y,ZTDESC,ZTIO,ZTRTN,ZTSAVE,ZTSK
+4 KILL ^TMP("PSDLBLR",$JOB)
+5 DO ^%ZISC
if $DATA(ZTQUEUED)
SET ZTREQ="@"
+6 QUIT
SAVE ;save queued variables
+1 SET (ZTSAVE("PSDS"),ZTSAVE("PSDSN"))=""
+2 SET ZTSAVE("PSD1(")=""
+3 QUIT