LALBG3 ; IHS/DIR/FJE - IL BG3 Blood Gas Analyzer interface 9/2/94 14:33 ;
;;5.2;LA;;NOV 01, 1997
;;5.2;AUTOMATED LAB INSTRUMENTS;;Sep 27, 1994
LA1 S:$D(ZTQUEUED) ZTREQ="@"
S LANM=$T(+0),TSK=$O(^LAB(62.4,"C",LANM,0)),U="^" Q:TSK<1
Q:'$D(^LA(TSK,"I",0)) D ^LASET Q:'TSK S X="TRAP^"_LANM,@^%ZOSF("TRAP")
S I=0 F S I=$O(TC(I)) Q:'I S TEST(TC(I,4))=TC(I,1),FIX(TC(I,4))=TC(I,2)
LA2 K TV,ID,IDE,TRAY,CUP S TOUT=0 D IN G QUIT:TOUT,LA2:IN'["BG3"
D IN,IN S V=$G(IN) D NUM S (ID,IDE,CUP)=+V,TRAY=1 D
.F I=0:0 D IN Q:IN["COMMENT" D:IN["TEMP" TEMP S V=$E(IN,1,6) D NUM S TEST=V,V=$E(IN,7,14) D NUM,FIX I $D(TEST(TEST)) S @TEST(TEST)=+V
LA3 .X LAGEN G LA2:ISQN<1
.F I=0:0 S I=$O(TV(I)) Q:I<1 I $D(TV(I,1)),TV(I,1)]"" S ^LAH(LWL,1,ISQN,I)=TV(I,1)
G LA2
IN S CNT=^LA(TSK,"I",0)+1 IF '$D(^(CNT)) S TOUT=TOUT+1 Q:TOUT>9 H 9 G IN
S ^LA(TSK,"I",0)=CNT,IN=^(CNT),TOUT=0
S:IN["~" CTRL=$P(IN,"~",2),IN=$P(IN,"~",1)
Q
NUM S X="" F I=1:1:$L(V) S:$A(V,I)-32 X=X_$E(V,I)
S V=X Q
QUIT LOCK ^LA(TSK) H 1 K ^LA(TSK),^LA("LOCK",TSK) D
.K CNT,CTRL,CUP,FIX,I,ID,IDE,IN,ISQN,LAGEN,LANM,LWL,T,TC,TEST
.K TOUT,TRAY,TSK,TV,U,V,X
Q
TRAP D ^LABERR S T=TSK D SET^LAB G @("LA2^"_LANM) ;ERROR TRAP
Q
TEMP ;extracts the FIO2 test value from the temp line
S IN=$E($P(IN,"xF",2),1,15)
Q
FIX ;allows site to utilize param 1 for result manipulation
I $L($G(FIX(TEST))) X FIX(TEST)
Q
LALBG3 ; IHS/DIR/FJE - IL BG3 Blood Gas Analyzer interface 9/2/94 14:33 ;
+1 ;;5.2;LA;;NOV 01, 1997
+2 ;;5.2;AUTOMATED LAB INSTRUMENTS;;Sep 27, 1994
LA1 IF $DATA(ZTQUEUED)
SET ZTREQ="@"
+1 SET LANM=$TEXT(+0)
SET TSK=$ORDER(^LAB(62.4,"C",LANM,0))
SET U="^"
IF TSK<1
QUIT
+2 IF '$DATA(^LA(TSK,"I",0))
QUIT
DO ^LASET
IF 'TSK
QUIT
SET X="TRAP^"_LANM
SET @^%ZOSF("TRAP")
+3 SET I=0
FOR
SET I=$ORDER(TC(I))
IF 'I
QUIT
SET TEST(TC(I,4))=TC(I,1)
SET FIX(TC(I,4))=TC(I,2)
LA2 KILL TV,ID,IDE,TRAY,CUP
SET TOUT=0
DO IN
IF TOUT
GOTO QUIT
IF IN'["BG3"
GOTO LA2
+1 DO IN
DO IN
SET V=$GET(IN)
DO NUM
SET (ID,IDE,CUP)=+V
SET TRAY=1
Begin DoDot:1
+2 FOR I=0:0
DO IN
IF IN["COMMENT"
QUIT
IF IN["TEMP"
DO TEMP
SET V=$EXTRACT(IN,1,6)
DO NUM
SET TEST=V
SET V=$EXTRACT(IN,7,14)
DO NUM
DO FIX
IF $DATA(TEST(TEST))
SET @TEST(TEST)=+V
LA3 XECUTE LAGEN
IF ISQN<1
GOTO LA2
+1 FOR I=0:0
SET I=$ORDER(TV(I))
IF I<1
QUIT
IF $DATA(TV(I,1))
IF TV(I,1)]""
SET ^LAH(LWL,1,ISQN,I)=TV(I,1)
End DoDot:1
+2 GOTO LA2
IN SET CNT=^LA(TSK,"I",0)+1
IF '$DATA(^(CNT))
SET TOUT=TOUT+1
IF TOUT>9
QUIT
HANG 9
GOTO IN
+1 SET ^LA(TSK,"I",0)=CNT
SET IN=^(CNT)
SET TOUT=0
+2 IF IN["~"
SET CTRL=$PIECE(IN,"~",2)
SET IN=$PIECE(IN,"~",1)
+3 QUIT
NUM SET X=""
FOR I=1:1:$LENGTH(V)
IF $ASCII(V,I)-32
SET X=X_$EXTRACT(V,I)
+1 SET V=X
QUIT
QUIT LOCK ^LA(TSK)
HANG 1
KILL ^LA(TSK),^LA("LOCK",TSK)
Begin DoDot:1
+1 KILL CNT,CTRL,CUP,FIX,I,ID,IDE,IN,ISQN,LAGEN,LANM,LWL,T,TC,TEST
+2 KILL TOUT,TRAY,TSK,TV,U,V,X
End DoDot:1
+3 QUIT
TRAP ;ERROR TRAP
DO ^LABERR
SET T=TSK
DO SET^LAB
GOTO @("LA2^"_LANM)
+1 QUIT
TEMP ;extracts the FIO2 test value from the temp line
+1 SET IN=$EXTRACT($PIECE(IN,"xF",2),1,15)
+2 QUIT
FIX ;allows site to utilize param 1 for result manipulation
+1 IF $LENGTH($GET(FIX(TEST)))
XECUTE FIX(TEST)
+2 QUIT