VistA-FOIAVistA/r/AUTOMATED_LAB_INSTRUMENTS-LA/LABINIT.m

19 lines
826 B
Mathematica

LABINIT ;SLC/RWF - LAB INIT RUNTIME ;8/16/90 10:18 ;
;;5.2;AUTOMATED LAB INSTRUMENTS;;Sep 27, 1994
INIT S U="^",IOP=$P(^LAB(62.4,HOME,0),U,2) G:IOP="" H^XUS
S IOP=IOP_";255",%ZIS="" D ^%ZIS G:POP H^XUS U IO X ^%ZOSF("TYPE-AHEAD"),^%ZOSF("LABOFF")
S U="^",OUT=1,TOUT=5,ASK=-2,ACK="A",NAK="N",DUZ=$S($D(DUZ):DUZ,1:.5)
F IX=BASE:0 S IX=$O(^LA(IX)) Q:IX<HOME!(BASE+10<IX) D CHECK S T=IX IF $D(^LAB(62.4,IX,2)) X ^(2)
S:'$D(^LA("Q"))#2 ^LA("Q")=0,^("Q",0)=0 S T=HOME
I '$D(^LA(T,"ENV")) D GETENV^%ZOSV S ^LA(T,"ENV")=Y
;^LA(T,"ENV")=UCI^VOLUME SET^VAX NODE
S:'$D(^LA(T,"Q"))#2 ^LA(T,"Q")=0
S:'$D(^LA(T,"I"))#2 ^LA(T,"I")=0,^("I",0)=0
S:'$D(^LA(T,"O"))#2 ^LA(T,"O")=0,^("O",0)=0
S ^LA("LOCK",HOME)=$J,T=HOME,OUT=1
S LR=HOME D AC2^LA1103
Q
CHECK Q:'$D(^LA(IX))
I $D(^LA(IX,"I"))[0!($D(^LA(IX,"I",0))[0) K ^LA(IX)
Q