LABINIT ; IHS/DIR/FJE - LAB INIT RUNTIME 8/16/90 10:18 ;
;;5.2;LA;;NOV 01, 1997
;;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
LABINIT ; IHS/DIR/FJE - LAB INIT RUNTIME 8/16/90 10:18 ;
+1 ;;5.2;LA;;NOV 01, 1997
+2 ;;5.2;AUTOMATED LAB INSTRUMENTS;;Sep 27, 1994
INIT SET U="^"
SET IOP=$PIECE(^LAB(62.4,HOME,0),U,2)
IF IOP=""
GOTO H^XUS
+1 SET IOP=IOP_";255"
SET %ZIS=""
DO ^%ZIS
IF POP
GOTO H^XUS
USE IO
XECUTE ^%ZOSF("TYPE-AHEAD")
XECUTE ^%ZOSF("LABOFF")
+2 SET U="^"
SET OUT=1
SET TOUT=5
SET ASK=-2
SET ACK="A"
SET NAK="N"
SET DUZ=$SELECT($DATA(DUZ):DUZ,1:.5)
+3 FOR IX=BASE:0
SET IX=$ORDER(^LA(IX))
IF IX<HOME!(BASE+10<IX)
QUIT
DO CHECK
SET T=IX
IF $DATA(^LAB(62.4,IX,2))
XECUTE ^(2)
+4 IF '$DATA(^LA("Q"))#2
SET ^LA("Q")=0
SET ^("Q",0)=0
SET T=HOME
+5 IF '$DATA(^LA(T,"ENV"))
DO GETENV^%ZOSV
SET ^LA(T,"ENV")=Y
+6 ;^LA(T,"ENV")=UCI^VOLUME SET^VAX NODE
+7 IF '$DATA(^LA(T,"Q"))#2
SET ^LA(T,"Q")=0
+8 IF '$DATA(^LA(T,"I"))#2
SET ^LA(T,"I")=0
SET ^("I",0)=0
+9 IF '$DATA(^LA(T,"O"))#2
SET ^LA(T,"O")=0
SET ^("O",0)=0
+10 SET ^LA("LOCK",HOME)=$JOB
SET T=HOME
SET OUT=1
+11 SET LR=HOME
DO AC2^LA1103
+12 QUIT
CHECK IF '$DATA(^LA(IX))
QUIT
+1 IF $DATA(^LA(IX,"I"))[0!($DATA(^LA(IX,"I",0))[0)
KILL ^LA(IX)
+2 QUIT