LREXECU ;SLC/RWF - EXECUTE CODE UTILITY ;8/11/97
;;5.2;LAB SERVICE;**121,200,362**;Sep 27, 1994;Build 11
TDM ;DRUG MONITORING
N DIR,DTOUT,DUOUT,DIRUT
;Set the DIR array for sample to be drawn question
S DIR(0)="SO^P:Peak;T:Trough;M:Mid;U:Unknown"
S DIR("A")="Please select"
S DIR("L",1)="Will (is) the sample to be drawn at"
S DIR("L")=" Peak, Trough, Mid, or Unknown"
S DIR("T")=60
S DIR("?",1)="Enter a 'P', 'T', 'M', 'U', or hit the Enter Key."
S DIR("?",2)="Hitting the Enter key will default to Unknown "
S DIR("?")="Entering ""^"" or a timeout will cancel the order."
D ^DIR K DIR ;Prompt for user selection
;Process user selection
I $D(DUOUT)!($D(DTOUT)) W !!!,$C(7),"ORDER CANCELED" S LRKIL=1 Q
I Y="" S Y(0)="Unknown" W !!!,$C(7),"Defaulted to Unknown"
E W !!!,$C(7),Y(0)_" has been selected."
S LRCCOM="~Dose is expected to be at "_Y(0)_" level."
I $$VER^LR7OU1>2.5 D TCOM^LRORD2(+LRTEST(LRTSTN),LRCCOM)
I $$VER^LR7OU1<3 D RCS^LRXO9 I '$D(ORACTION) D TCOM^LRORD2(+LRTEST(LRTSTN),LRCCOM) ;OE/RR 2.5
;Set DIR array for additional comment question
S DIR(0)="FO^1:250"
S DIR("A")="ADDITIONAL COMMENT"
S DIR("T")=60
S DIR("?")="This is a free text field, up to 250 characters in length."
D ^DIR K DIR
I $D(DUOUT)!($D(DTOUT)) S Y=""
S LRCCOM=Y
Q
DOSE ;DOSE/DRAW TIMES
EN ;
S %DT("A")="Enter the last dose time: ",%DT="AT" D ^%DT S LRDOSE=Y
I Y<1 W !,"Time unknown" S %=2 D YN^DICN S:%=1 LRDOSE="UNKNOWN" G:%'=1 EN
I Y>1,Y'["." W !,"You must enter a time, e.g. T@6AM" G EN
I LRDOSE["." S Y=LRDOSE D DD^LRX S LRDOSE=Y
DRAW W ! S %DT("A")="Enter draw time: ",%DT="AT" D ^%DT S LRDRAW=Y
I Y<1 W !,"Time unknown" S %=2 D YN^DICN S:%=1 LRDRAW="UNKNOWN" G:%'=1 DRAW
I Y>1,Y'["." W !,"You must enter a time, e.g. T@6AM" G DRAW
I LRDRAW["." S Y=LRDRAW D DD^LRX S LRDRAW=Y
S LRCCOM="~Last dose: "_LRDOSE_" draw time: "_LRDRAW W !,LRCCOM
W !,"OK" S %=1 D YN^DICN G EN:%'=1
K LRDOSE,LRDRAW,%DT Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HLREXECU 1975 printed Dec 13, 2024@02:14:44 Page 2
LREXECU ;SLC/RWF - EXECUTE CODE UTILITY ;8/11/97
+1 ;;5.2;LAB SERVICE;**121,200,362**;Sep 27, 1994;Build 11
TDM ;DRUG MONITORING
+1 NEW DIR,DTOUT,DUOUT,DIRUT
+2 ;Set the DIR array for sample to be drawn question
+3 SET DIR(0)="SO^P:Peak;T:Trough;M:Mid;U:Unknown"
+4 SET DIR("A")="Please select"
+5 SET DIR("L",1)="Will (is) the sample to be drawn at"
+6 SET DIR("L")=" Peak, Trough, Mid, or Unknown"
+7 SET DIR("T")=60
+8 SET DIR("?",1)="Enter a 'P', 'T', 'M', 'U', or hit the Enter Key."
+9 SET DIR("?",2)="Hitting the Enter key will default to Unknown "
+10 SET DIR("?")="Entering ""^"" or a timeout will cancel the order."
+11 ;Prompt for user selection
DO ^DIR
KILL DIR
+12 ;Process user selection
+13 IF $DATA(DUOUT)!($DATA(DTOUT))
WRITE !!!,$CHAR(7),"ORDER CANCELED"
SET LRKIL=1
QUIT
+14 IF Y=""
SET Y(0)="Unknown"
WRITE !!!,$CHAR(7),"Defaulted to Unknown"
+15 IF '$TEST
WRITE !!!,$CHAR(7),Y(0)_" has been selected."
+16 SET LRCCOM="~Dose is expected to be at "_Y(0)_" level."
+17 IF $$VER^LR7OU1>2.5
DO TCOM^LRORD2(+LRTEST(LRTSTN),LRCCOM)
+18 ;OE/RR 2.5
IF $$VER^LR7OU1<3
DO RCS^LRXO9
IF '$DATA(ORACTION)
DO TCOM^LRORD2(+LRTEST(LRTSTN),LRCCOM)
+19 ;Set DIR array for additional comment question
+20 SET DIR(0)="FO^1:250"
+21 SET DIR("A")="ADDITIONAL COMMENT"
+22 SET DIR("T")=60
+23 SET DIR("?")="This is a free text field, up to 250 characters in length."
+24 DO ^DIR
KILL DIR
+25 IF $DATA(DUOUT)!($DATA(DTOUT))
SET Y=""
+26 SET LRCCOM=Y
+27 QUIT
DOSE ;DOSE/DRAW TIMES
EN ;
+1 SET %DT("A")="Enter the last dose time: "
SET %DT="AT"
DO ^%DT
SET LRDOSE=Y
+2 IF Y<1
WRITE !,"Time unknown"
SET %=2
DO YN^DICN
if %=1
SET LRDOSE="UNKNOWN"
if %'=1
GOTO EN
+3 IF Y>1
IF Y'["."
WRITE !,"You must enter a time, e.g. T@6AM"
GOTO EN
+4 IF LRDOSE["."
SET Y=LRDOSE
DO DD^LRX
SET LRDOSE=Y
DRAW WRITE !
SET %DT("A")="Enter draw time: "
SET %DT="AT"
DO ^%DT
SET LRDRAW=Y
+1 IF Y<1
WRITE !,"Time unknown"
SET %=2
DO YN^DICN
if %=1
SET LRDRAW="UNKNOWN"
if %'=1
GOTO DRAW
+2 IF Y>1
IF Y'["."
WRITE !,"You must enter a time, e.g. T@6AM"
GOTO DRAW
+3 IF LRDRAW["."
SET Y=LRDRAW
DO DD^LRX
SET LRDRAW=Y
+4 SET LRCCOM="~Last dose: "_LRDOSE_" draw time: "_LRDRAW
WRITE !,LRCCOM
+5 WRITE !,"OK"
SET %=1
DO YN^DICN
if %'=1
GOTO EN
+6 KILL LRDOSE,LRDRAW,%DT
QUIT