PSOTALK3 ;BIR/EJW - SCRIPTALK UTILITIES ;11/05/17 19:22
;;7.0;OUTPATIENT PHARMACY;**135,200,268,502**;DEC 1997;Build 13
;External reference to ^PS(59.7 controlled subscription by DBIA 694
TTRANS ;RE-INITIALIZE SCRIPTALK PRINTER
D:'$D(PSOPAR) ^PSOLSET I '$D(PSOPAR) W $C(7),!!,"Pharmacy Division Must be Selected!",! Q
S ZTIO="`"_$P($G(^PS(59,PSOSITE,"STALK")),U)
I ZTIO="`" W !,"No ScripTalk printer defined for division." Q
S ZTDTH=$$NOW^XLFDT,ZTDESC="ScripTalk Printer Re-initialize"
S ZTRTN="TINIT^PSOTALK3",ZTSAVE("*")=""
D ^%ZTLOAD K ZTDTH,ZTRTN,ZTIO,ZTDESC
W:$D(ZTSK)&('$D(ZTQUEUED)) !!,"Task Queued !",!
Q
;
TINIT ;
W !,"^XA ^MD30 ^XZ"
W !,"^XA ^MD30 ^XZ"
W !,"^XA ~SD30 ^XZ"
W !,"^XA ^MFF,F ^XZ"
W !,"^XA ^LT20 ^XZ"
W !,"^XA ^MTT ^XZ"
W !,"^XA ^JUS ^XZ"
S:$D(ZTQUEUED) ZTREQ="@"
Q
;
TEST ;
I $G(PSOTEST)?."?" R !,"Enter a Zebra Print Language test command to be sent",!,"to the ScripTalk printer: ",PSOTEST:DTIME
I $G(PSOTEST)="" Q
D:'$D(PSOPAR) ^PSOLSET I '$D(PSOPAR) W $C(7),!!,"Pharmacy Division Must be Selected!",! Q
S ZTIO="`"_$P($G(^PS(59,PSOSITE,"STALK")),U),ZTDTH=$$NOW^XLFDT,ZTDESC="ScripTalk Interface Test"
I ZTIO="`" W !,"No ScripTalk printer defined for division." Q
S ZTRTN="TPUT^PSOTALK3",ZTSAVE("*")=""
D ^%ZTLOAD K ZTDTH,ZTRTN,ZTIO,ZTDESC
W:$D(ZTSK)&('$D(ZTQUEUED)) !!,"Task Queued !",!
K PSOTEST
Q
TPUT ;SET VARIABLE 'PSOTEST' TO OUTPUT STRING
W !,PSOTEST
S:$D(ZTQUEUED) ZTREQ="@"
Q
;
TESTLAB ;
D:'$D(PSOPAR) ^PSOLSET I '$D(PSOPAR) W $C(7),!!,"Pharmacy Division Must be Selected!",! Q
S ZTIO="`"_$P($G(^PS(59,PSOSITE,"STALK")),U),ZTDTH=$$NOW^XLFDT,ZTDESC="ScripTalk Sample Label"
I ZTIO="`" W !,"No ScripTalk printer defined for division." Q
S ZTRTN="TLABEL^PSOTALK3",ZTSAVE("*")=""
W !,"The following test data will be sent to the ScripTalk printer:",! D TLABEL W !
D ^%ZTLOAD K ZTDTH,ZTRTN,ZTIO,ZTDESC
W:$D(ZTSK)&('$D(ZTQUEUED)) !!,"Task Queued !",!
Q
TLABEL ;
W !,"^XA"
W !,"^FO250,700^XGE:RX.GRF^FS"
W !,"^FO250,700^XGE:RX.GRF^FS"
W !,"^AFR,20,10^FO531,50^FR^CI0^FD7305 N. MILITARY TRL Exp: January 01,2002^FS"
W !,"^AFR,20,10^FO503,50^FR^CI0^FDRX#82382787 January 01,2001 Fill 01 OF 01^FS"
W !,"^AFR,20,10^FO475,50^FR^CI0^FDJOE VETERAN^FS"
W !,"^AFR,20,10^FO447,50^FR^CI0^FDTAKE 1 CAPSULE THREE TIMES DAILY^FS"
W !,"^AFR,20,10^FO419,50^FR^CI0^FD^FS"
W !,"^AFR,20,10^FO391,50^FR^CI0^FD^FS"
W !,"^AFR,20,10^FO363,50^FR^CI0^FD^FS"
W !,"^AFR,20,10^FO335,50^FR^CI0^FDDr. BEN CASEY MD^FS"
W !,"^AFR,20,10^FO279,50^FR^CI0^FDQTY: 24 TABS^FS"
W !,"^AFR,20,10^FO251,50^FR^CI0^FDAMOXICILLIN 500MG CAP^FS"
W !,"^RX01,JOE VETERAN^FS"
W !,"^RX02,AMOXICILLIN 500MG CAP^FS"
W !,"^RX03,TAKE 1 CAPSULE THREE TIMES DAILY ^FS"
W !,"^RX04,010101^FS"
W !,"^RX05,00^FS"
W !,"^RX06,020000^FS"
W !,"^RX07,BEN CASEY^FS"
W !,"^RX08,2928993888^FS"
W !,"^RX09,82382787^FS"
W !,"^RX10, ^FS"
W !,"^PQ1,0,1,Y"
W !,"^XZ"
S:$D(ZTQUEUED) ZTREQ="@"
Q
;
STDEV ;Define ScripTalk printer for a Division or map another print device to the ScripTalk Printer
N PSOSITE,PSOTYPE
STDEV1 ;
W !!!
K DIC,DIR,DIE,DA,DR
S DIR(0)="SBO^D:Division;P:Printer",DIR("A")="Define ScripTalk Printer by (D)ivision or (P)rinter mapping?"
S DIR("?")=" "
S DIR("?",1)="Enter D to define ScripTalk printer by Division or enter P to tie a ScripTalk"
S DIR("?",2)="printer to regular Pharmacy label printer(s) to control where the ScripTalk"
S DIR("?",3)="labels print for multi-divisions."
S PSOSITE=""
D ^DIR G:$D(DIRUT)!(Y<0) STDEVQ S PSOTYPE=Y
D STDEVM:PSOTYPE="P"
D STDEVD:PSOTYPE="D"
G STDEV1
STDEVQ ;
K DIC,DIR,DIE,DA,DR,DIRUT,Y
Q
;
STDEVD ;Define ScripTalk device by division
W ! S DIC("A")="Division: ",DIC=59,DIC(0)="AEMQ"
S:$G(PSOVEX)'=1 DIC("S")="I $S('$D(^PS(59,+Y,""I"")):1,'^(""I""):1,DT'>^(""I""):1,1:0)"
D ^DIC K DIC Q:$D(DIRUT)!(Y<0)
Q:+Y<0
S PSOSITE=+Y
S DIE="^PS(59,",DA=PSOSITE,DR="107;107.1;107.2" D ^DIE
Q
;
STDEVM ;Map a printer to a ScripTalk printer
S DIE="^PS(59.7,",DA=1,DR="47" L +^PS(59.7,1,47):$S(+$G(^DD("DILOCKTM"))>0:+^DD("DILOCKTM"),1:3) D I $T D ^DIE L -^PS(59.7,1,47)
. I '$T W !?5,"Another user is editing this entry."
Q
;
STVLP ;Define VOIDED label print by division
W ! S DIC("A")="Division: ",DIC=59,DIC(0)="AEMQ"
S:$G(PSOVEX)'=1 DIC("S")="I $S('$D(^PS(59,+Y,""I"")):1,'^(""I""):1,DT'>^(""I""):1,1:0)"
D ^DIC K DIC Q:$D(DIRUT)!(Y<0)
Q:+Y<0
S PSOSITE=+Y
S DIE="^PS(59,",DA=PSOSITE,DR="107.3" D ^DIE
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HPSOTALK3 4537 printed Dec 13, 2024@02:35:43 Page 2
PSOTALK3 ;BIR/EJW - SCRIPTALK UTILITIES ;11/05/17 19:22
+1 ;;7.0;OUTPATIENT PHARMACY;**135,200,268,502**;DEC 1997;Build 13
+2 ;External reference to ^PS(59.7 controlled subscription by DBIA 694
TTRANS ;RE-INITIALIZE SCRIPTALK PRINTER
+1 if '$DATA(PSOPAR)
DO ^PSOLSET
IF '$DATA(PSOPAR)
WRITE $CHAR(7),!!,"Pharmacy Division Must be Selected!",!
QUIT
+2 SET ZTIO="`"_$PIECE($GET(^PS(59,PSOSITE,"STALK")),U)
+3 IF ZTIO="`"
WRITE !,"No ScripTalk printer defined for division."
QUIT
+4 SET ZTDTH=$$NOW^XLFDT
SET ZTDESC="ScripTalk Printer Re-initialize"
+5 SET ZTRTN="TINIT^PSOTALK3"
SET ZTSAVE("*")=""
+6 DO ^%ZTLOAD
KILL ZTDTH,ZTRTN,ZTIO,ZTDESC
+7 if $DATA(ZTSK)&('$DATA(ZTQUEUED))
WRITE !!,"Task Queued !",!
+8 QUIT
+9 ;
TINIT ;
+1 WRITE !,"^XA ^MD30 ^XZ"
+2 WRITE !,"^XA ^MD30 ^XZ"
+3 WRITE !,"^XA ~SD30 ^XZ"
+4 WRITE !,"^XA ^MFF,F ^XZ"
+5 WRITE !,"^XA ^LT20 ^XZ"
+6 WRITE !,"^XA ^MTT ^XZ"
+7 WRITE !,"^XA ^JUS ^XZ"
+8 if $DATA(ZTQUEUED)
SET ZTREQ="@"
+9 QUIT
+10 ;
TEST ;
+1 IF $GET(PSOTEST)?."?"
READ !,"Enter a Zebra Print Language test command to be sent",!,"to the ScripTalk printer: ",PSOTEST:DTIME
+2 IF $GET(PSOTEST)=""
QUIT
+3 if '$DATA(PSOPAR)
DO ^PSOLSET
IF '$DATA(PSOPAR)
WRITE $CHAR(7),!!,"Pharmacy Division Must be Selected!",!
QUIT
+4 SET ZTIO="`"_$PIECE($GET(^PS(59,PSOSITE,"STALK")),U)
SET ZTDTH=$$NOW^XLFDT
SET ZTDESC="ScripTalk Interface Test"
+5 IF ZTIO="`"
WRITE !,"No ScripTalk printer defined for division."
QUIT
+6 SET ZTRTN="TPUT^PSOTALK3"
SET ZTSAVE("*")=""
+7 DO ^%ZTLOAD
KILL ZTDTH,ZTRTN,ZTIO,ZTDESC
+8 if $DATA(ZTSK)&('$DATA(ZTQUEUED))
WRITE !!,"Task Queued !",!
+9 KILL PSOTEST
+10 QUIT
TPUT ;SET VARIABLE 'PSOTEST' TO OUTPUT STRING
+1 WRITE !,PSOTEST
+2 if $DATA(ZTQUEUED)
SET ZTREQ="@"
+3 QUIT
+4 ;
TESTLAB ;
+1 if '$DATA(PSOPAR)
DO ^PSOLSET
IF '$DATA(PSOPAR)
WRITE $CHAR(7),!!,"Pharmacy Division Must be Selected!",!
QUIT
+2 SET ZTIO="`"_$PIECE($GET(^PS(59,PSOSITE,"STALK")),U)
SET ZTDTH=$$NOW^XLFDT
SET ZTDESC="ScripTalk Sample Label"
+3 IF ZTIO="`"
WRITE !,"No ScripTalk printer defined for division."
QUIT
+4 SET ZTRTN="TLABEL^PSOTALK3"
SET ZTSAVE("*")=""
+5 WRITE !,"The following test data will be sent to the ScripTalk printer:",!
DO TLABEL
WRITE !
+6 DO ^%ZTLOAD
KILL ZTDTH,ZTRTN,ZTIO,ZTDESC
+7 if $DATA(ZTSK)&('$DATA(ZTQUEUED))
WRITE !!,"Task Queued !",!
+8 QUIT
TLABEL ;
+1 WRITE !,"^XA"
+2 WRITE !,"^FO250,700^XGE:RX.GRF^FS"
+3 WRITE !,"^FO250,700^XGE:RX.GRF^FS"
+4 WRITE !,"^AFR,20,10^FO531,50^FR^CI0^FD7305 N. MILITARY TRL Exp: January 01,2002^FS"
+5 WRITE !,"^AFR,20,10^FO503,50^FR^CI0^FDRX#82382787 January 01,2001 Fill 01 OF 01^FS"
+6 WRITE !,"^AFR,20,10^FO475,50^FR^CI0^FDJOE VETERAN^FS"
+7 WRITE !,"^AFR,20,10^FO447,50^FR^CI0^FDTAKE 1 CAPSULE THREE TIMES DAILY^FS"
+8 WRITE !,"^AFR,20,10^FO419,50^FR^CI0^FD^FS"
+9 WRITE !,"^AFR,20,10^FO391,50^FR^CI0^FD^FS"
+10 WRITE !,"^AFR,20,10^FO363,50^FR^CI0^FD^FS"
+11 WRITE !,"^AFR,20,10^FO335,50^FR^CI0^FDDr. BEN CASEY MD^FS"
+12 WRITE !,"^AFR,20,10^FO279,50^FR^CI0^FDQTY: 24 TABS^FS"
+13 WRITE !,"^AFR,20,10^FO251,50^FR^CI0^FDAMOXICILLIN 500MG CAP^FS"
+14 WRITE !,"^RX01,JOE VETERAN^FS"
+15 WRITE !,"^RX02,AMOXICILLIN 500MG CAP^FS"
+16 WRITE !,"^RX03,TAKE 1 CAPSULE THREE TIMES DAILY ^FS"
+17 WRITE !,"^RX04,010101^FS"
+18 WRITE !,"^RX05,00^FS"
+19 WRITE !,"^RX06,020000^FS"
+20 WRITE !,"^RX07,BEN CASEY^FS"
+21 WRITE !,"^RX08,2928993888^FS"
+22 WRITE !,"^RX09,82382787^FS"
+23 WRITE !,"^RX10, ^FS"
+24 WRITE !,"^PQ1,0,1,Y"
+25 WRITE !,"^XZ"
+26 if $DATA(ZTQUEUED)
SET ZTREQ="@"
+27 QUIT
+28 ;
STDEV ;Define ScripTalk printer for a Division or map another print device to the ScripTalk Printer
+1 NEW PSOSITE,PSOTYPE
STDEV1 ;
+1 WRITE !!!
+2 KILL DIC,DIR,DIE,DA,DR
+3 SET DIR(0)="SBO^D:Division;P:Printer"
SET DIR("A")="Define ScripTalk Printer by (D)ivision or (P)rinter mapping?"
+4 SET DIR("?")=" "
+5 SET DIR("?",1)="Enter D to define ScripTalk printer by Division or enter P to tie a ScripTalk"
+6 SET DIR("?",2)="printer to regular Pharmacy label printer(s) to control where the ScripTalk"
+7 SET DIR("?",3)="labels print for multi-divisions."
+8 SET PSOSITE=""
+9 DO ^DIR
if $DATA(DIRUT)!(Y<0)
GOTO STDEVQ
SET PSOTYPE=Y
+10 if PSOTYPE="P"
DO STDEVM
+11 if PSOTYPE="D"
DO STDEVD
+12 GOTO STDEV1
STDEVQ ;
+1 KILL DIC,DIR,DIE,DA,DR,DIRUT,Y
+2 QUIT
+3 ;
STDEVD ;Define ScripTalk device by division
+1 WRITE !
SET DIC("A")="Division: "
SET DIC=59
SET DIC(0)="AEMQ"
+2 if $GET(PSOVEX)'=1
SET DIC("S")="I $S('$D(^PS(59,+Y,""I"")):1,'^(""I""):1,DT'>^(""I""):1,1:0)"
+3 DO ^DIC
KILL DIC
if $DATA(DIRUT)!(Y<0)
QUIT
+4 if +Y<0
QUIT
+5 SET PSOSITE=+Y
+6 SET DIE="^PS(59,"
SET DA=PSOSITE
SET DR="107;107.1;107.2"
DO ^DIE
+7 QUIT
+8 ;
STDEVM ;Map a printer to a ScripTalk printer
+1 SET DIE="^PS(59.7,"
SET DA=1
SET DR="47"
LOCK +^PS(59.7,1,47):$SELECT(+$GET(^DD("DILOCKTM"))>0:+^DD("DILOCKTM"),1:3)
Begin DoDot:1
+2 IF '$TEST
WRITE !?5,"Another user is editing this entry."
End DoDot:1
IF $TEST
DO ^DIE
LOCK -^PS(59.7,1,47)
+3 QUIT
+4 ;
STVLP ;Define VOIDED label print by division
+1 WRITE !
SET DIC("A")="Division: "
SET DIC=59
SET DIC(0)="AEMQ"
+2 if $GET(PSOVEX)'=1
SET DIC("S")="I $S('$D(^PS(59,+Y,""I"")):1,'^(""I""):1,DT'>^(""I""):1,1:0)"
+3 DO ^DIC
KILL DIC
if $DATA(DIRUT)!(Y<0)
QUIT
+4 if +Y<0
QUIT
+5 SET PSOSITE=+Y
+6 SET DIE="^PS(59,"
SET DA=PSOSITE
SET DR="107.3"
DO ^DIE
+7 QUIT