LACOLTSE ; IHS/DIR/FJE - COULTER STACK S VER. 1E SOFTWARE DATA PROCESSING 8/16/90 14:0 ;
;;5.2;LA;;NOV 01, 1997
;;5.2;AUTOMATED LAB INSTRUMENTS;;Sep 27, 1994
;CROSS LINK BY ID = SAMPLE #,IDE=BAR CODED NUMBER
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 TEST("CASS/POS")="",TEST("ID1")="IDE",TEST("ID2")="ID",I=0
F S I=$O(TC(I)) Q:I<1 S TEST(TC(I,4))=TC(I,1)
LA2 K Y,TV,ID,IDE S (A,TOUT)=0 D IN G QUIT:TOUT,LA2:$E(IN,1,8)'="--------"
;
C2 S TOUT=0 D IN G QUIT:TOUT,SAVE:$E(IN,1,8)="--------"
C3 S V=$P(IN," ",1) D NUM S TEST=V G C2:TEST="",C2:'$D(TEST(TEST))
I TEST="ID1"!(TEST="ID2") S V=$E(IN,4,15) D NUM S @TEST(TEST)=+V G C2
I TEST="CASS/POS" S V=$E(IN,10,16) D NUM S TRAY=+$P(V,"/",1),CUP=+$P(V,"/",2) G C2
I TEST="HGB" D IN,IN S V=$E(IN,3,9) D NUM G C4
S V=$E(IN,5,12) D NUM
C4 S V=$S("-----:::::?????.....+++++*"[V:"",1:V) S:V]"" @TEST(TEST)=+V G C2
SAVE I $D(IDE),IDE>0 S ID=IDE
G LA2:'$D(ID),LA2:+ID<1
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
Q
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),^TMP($J),^TMP("LA",$J)
Q
TRAP D ^LABERR S T=TSK D SET^LAB G @("LA2^"_LANM) ;ERROR TRAP
LACOLTSE ; IHS/DIR/FJE - COULTER STACK S VER. 1E SOFTWARE DATA PROCESSING 8/16/90 14:0 ;
+1 ;;5.2;LA;;NOV 01, 1997
+2 ;;5.2;AUTOMATED LAB INSTRUMENTS;;Sep 27, 1994
+3 ;CROSS LINK BY ID = SAMPLE #,IDE=BAR CODED NUMBER
LA1 IF $DATA(ZTQUEUED)
SET ZTREQ="@"
SET LANM=$TEXT(+0)
SET TSK=$ORDER(^LAB(62.4,"C",LANM,0))
SET U="^"
IF TSK<1
QUIT
+1 IF '$DATA(^LA(TSK,"I",0))
QUIT
DO ^LASET
IF 'TSK
QUIT
SET X="TRAP^"_LANM
SET @^%ZOSF("TRAP")
+2 SET TEST("CASS/POS")=""
SET TEST("ID1")="IDE"
SET TEST("ID2")="ID"
SET I=0
+3 FOR
SET I=$ORDER(TC(I))
IF I<1
QUIT
SET TEST(TC(I,4))=TC(I,1)
LA2 KILL Y,TV,ID,IDE
SET (A,TOUT)=0
DO IN
IF TOUT
GOTO QUIT
IF $EXTRACT(IN,1,8)'="--------"
GOTO LA2
+1 ;
C2 SET TOUT=0
DO IN
IF TOUT
GOTO QUIT
IF $EXTRACT(IN,1,8)="--------"
GOTO SAVE
C3 SET V=$PIECE(IN," ",1)
DO NUM
SET TEST=V
IF TEST=""
GOTO C2
IF '$DATA(TEST(TEST))
GOTO C2
+1 IF TEST="ID1"!(TEST="ID2")
SET V=$EXTRACT(IN,4,15)
DO NUM
SET @TEST(TEST)=+V
GOTO C2
+2 IF TEST="CASS/POS"
SET V=$EXTRACT(IN,10,16)
DO NUM
SET TRAY=+$PIECE(V,"/",1)
SET CUP=+$PIECE(V,"/",2)
GOTO C2
+3 IF TEST="HGB"
DO IN
DO IN
SET V=$EXTRACT(IN,3,9)
DO NUM
GOTO C4
+4 SET V=$EXTRACT(IN,5,12)
DO NUM
C4 SET V=$SELECT("-----:::::?????.....+++++*"[V:"",1:V)
IF V]""
SET @TEST(TEST)=+V
GOTO C2
SAVE IF $DATA(IDE)
IF IDE>0
SET ID=IDE
+1 IF '$DATA(ID)
GOTO LA2
IF +ID<1
GOTO LA2
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)
+2 GOTO LA2
+3 QUIT
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),^TMP($JOB),^TMP("LA",$JOB)
+1 QUIT
TRAP ;ERROR TRAP
DO ^LABERR
SET T=TSK
DO SET^LAB
GOTO @("LA2^"_LANM)