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

LAH747.m

Go to the documentation of this file.
LAH747 ; IHS/DIR/FJE - HITACHI 747 15:41 ; [ 8/15/92 ]
 ;;5.2;LA;;NOV 01, 1997
 ;;5.2;AUTOMATED LAB INSTRUMENTS;;Sep 27, 1994
 ;CROSS LINK BY ID
LA1 S:$D(ZTQUEUED) ZTREQ="@" S LANM=$T(+0),TSK=$O(^LAB(62.4,"C",LANM,0)) Q:TSK<1
 Q:'$D(^LA(TSK,"I",0))
 D ^LASET Q:'TSK  S X="TRAP^"_LANM,@^%ZOSF("TRAP")
 K TEST S J="" F  S J=$O(TC(J)) Q:J=""  S TEST(TC(J,4))=J
LA2 K TV,Y S TOUT=0,A=1,CTRL="" D IN G QUIT:TOUT,LA2:CTRL'="B" S TOUT=0 D IN G QUIT:TOUT,LA2:$E(IN,2)'="A"&($E(IN,2)'="G") D QC
 F A=2:1 Q:CTRL="C"  S TOUT=0 D IN   G QUIT:TOUT D QC
 S TOUT=0 D IN G QUIT:TOUT S CKSUM=IN S (TRAY,ID,IDE,CUP)=0 S V=$E(Y(1),4,7) D NUM S TRAY=+V,V=$E(Y(1),8,12) D NUM S IDE=+V,CUP=+$E(Y(1),13),V=$E(Y(1),14,26) D NUM S ID=+V
 S V=$E(Y(1),27,28) D NUM S NT=+V G:'NT LA2
 S Y(1)=$E(Y(1),29,255) F I=1:1:NT Q:'$L(Y(1))  S Y=$E(Y(1),1,9),Y(1)=$E(Y(1),10,255) I $E(Y,9)="@" S V=$E(Y,1,2) D NUM S TEST=+V,V=$E(Y,3,8) D NUM S VAL=+V D LA4
LA3 X LAGEN G LA2:'ISQN ;Can be changed by the cross-link code
 F I=0:0 S I=$O(TV(I)) Q:I<1  S:TV(I,1)]"" ^LAH(LWL,1,ISQN,I)=TV(I,1)
 G LA2
LA4 Q:'$D(TEST(TEST))  I VAL S II=TEST(TEST),@TC(II,1)=VAL D
 .I $L($G(TC(II,2))) X TC(II,2) S @TC(II,1)=V,VAL=V
 Q
QC ;
 S Y(A)=IN Q
IN S CNT=^LA(TSK,"I",0)+1 IF '$D(^(CNT)) S TOUT=TOUT+1 Q:TOUT>9  H 5 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 JJ=1:1:$L(V) S:$A(V,JJ)>32 X=X_$E(V,JJ)
 S V=X Q
 Q
OUT S CNT=^LA(TSK,"O")+1,^("O")=CNT,^("O",CNT)=OUT
 LOCK ^LA("Q") S Q=^LA("Q")+1,^("Q")=Q,^("Q",Q)=TSK LOCK
 Q
QUIT G:^LA(TSK,"I")>^LA(TSK,"I",0) LA2 I $D(^LA(TSK,"O"))#2 G:^LA(TSK,"O")>^LA(TSK,"O",0) LA2
 K ^LA(TSK,"O") S ^LA(TSK,"O")=0,^("O",0)=0
 LOCK ^LA(TSK) H 1 K ^LA(TSK,"I"),^LA("LOCK",TSK),A,CKSUM,CNT,CTRL D
 .K CUP,I,ID,IDE,II,IN,ISQN,J,JJ,LAGEN,LANM,LWL,NT,OUT,Q,T,TC,TEST
 .K TOUT,TRAY,TSK,TV,V,VAL,X,Y
 Q
TRAP D ^LABERR S T=TSK D SET^LAB G @("LA2^"_LANM) ; ERROR TRAP