Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: LREXECU

LREXECU.m

Go to the documentation of this file.
  1. LREXECU ;VA/SLC/RWF - EXECUTE CODE UTILITY ;8/11/97
  1. ;;5.2;LAB SERVICE;**1003,1013,1015,1031**;NOV 1, 1997
  1. ;
  1. ;;VA LR Patche(s): 121,200,362
  1. ;
  1. TDM ;DRUG MONITORING
  1. N DIR,DTOUT,DUOUT,DIRUT
  1. ;Set the DIR array for sample to be drawn question
  1. S DIR(0)="SO^P:Peak;T:Trough;M:Mid;U:Unknown"
  1. S DIR("A")="Please select"
  1. S DIR("L",1)="Will (is) the sample to be drawn at"
  1. S DIR("L")=" Peak, Trough, Mid, or Unknown"
  1. S DIR("T")=60
  1. S DIR("?",1)="Enter a 'P', 'T', 'M', 'U', or hit the Enter Key."
  1. S DIR("?",2)="Hitting the Enter key will default to Unknown "
  1. S DIR("?")="Entering ""^"" or a timeout will cancel the order."
  1. D ^DIR K DIR ;Prompt for user selection
  1. ;Process user selection
  1. I $D(DUOUT)!($D(DTOUT)) W !!!,$C(7),"ORDER CANCELED" S LRKIL=1 Q
  1. I Y="" S Y(0)="Unknown" W !!!,$C(7),"Defaulted to Unknown"
  1. E W !!!,$C(7),Y(0)_" has been selected."
  1. S LRCCOM="~Dose is expected to be at "_Y(0)_" level."
  1. I $$VER^LR7OU1>2.5 D TCOM^LRORD2(+LRTEST(LRTSTN),LRCCOM)
  1. I $$VER^LR7OU1<3 D RCS^LRXO9 I '$D(ORACTION) D TCOM^LRORD2(+LRTEST(LRTSTN),LRCCOM) ;OE/RR 2.5
  1. ;Set DIR array for additional comment question
  1. S DIR(0)="FO^1:250"
  1. S DIR("A")="ADDITIONAL COMMENT"
  1. S DIR("T")=60
  1. S DIR("?")="This is a free text field, up to 250 characters in length."
  1. D ^DIR K DIR
  1. I $D(DUOUT)!($D(DTOUT)) S Y=""
  1. S LRCCOM=Y
  1. Q
  1. DOSE ;DOSE/DRAW TIMES
  1. EN ;
  1. S %DT("A")="Enter the last dose time: ",%DT="AT" D ^%DT S LRDOSE=Y
  1. I Y<1 W !,"Time unknown" S %=2 D YN^DICN S:%=1 LRDOSE="UNKNOWN" G:%'=1 EN
  1. I Y>1,Y'["." W !,"You must enter a time, e.g. T@6AM" G EN
  1. I LRDOSE["." S Y=LRDOSE D DD^LRX S LRDOSE=Y
  1. DRAW W ! S %DT("A")="Enter draw time: ",%DT="AT" D ^%DT S LRDRAW=Y
  1. I Y<1 W !,"Time unknown" S %=2 D YN^DICN S:%=1 LRDRAW="UNKNOWN" G:%'=1 DRAW
  1. I Y>1,Y'["." W !,"You must enter a time, e.g. T@6AM" G DRAW
  1. I LRDRAW["." S Y=LRDRAW D DD^LRX S LRDRAW=Y
  1. S LRCCOM="~Last dose: "_LRDOSE_" draw time: "_LRDRAW W !,LRCCOM
  1. W !,"OK" S %=1 D YN^DICN G EN:%'=1
  1. K LRDOSE,LRDRAW,%DT Q