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

LACOAGX2.m

Go to the documentation of this file.
LACOAGX2 ;SLC/RWF - ROUTINE FOR COAGAMATE X2 ;7/20/90  07:51 ;
 ;;5.2;AUTOMATED LAB INSTRUMENTS;;Sep 27, 1994
 ;RUN BY TRAY CUP
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))
 K LATOP D ^LASET Q:'TSK  S X="TRAP^"_LANM,@^%ZOSF("TRAP"),SKIP=0 I $P(^LRO(68.2,LWL,0),U,2),$P(^LAB(62.07,$P(^LRO(68.2,LWL,0),U,2),0),U)="SKIP" S SKIP=1
LA2 K TV S TOUT=0 D IN G QUIT:TOUT,LA2:$E(IN,1,5)'="DATE:" F A=1:1:2 S TOUT=0 D IN G QUIT:TOUT
 G LA2:IN'["END TEST" S LASTCUP=$E(IN,26,27) S TOUT=0 D IN G QUIT:TOUT
 F A=0:0 D LA2A Q:CUP=LASTCUP  S TOUT=0 D IN G QUIT:TOUT
 G LA2
LA2A S TOUT=0 D IN G QUIT:TOUT S (ID,IDE,CUP)=+$E(IN,3,4),V=$E(IN,6,8) D NUM S TEST(1)=V,V(1)=+$E(IN,10,14),V=$E(IN,20,22) D NUM S TEST(2)=V,V(2)=+$E(IN,24,28)
 I SKIP,CUP#2 S V(11)=V(1),V(22)=V(2) S TOUT=0 D IN G QUIT:TOUT G LA2A
 I SKIP,'(CUP#2) S V(111)=V(1)-V(11),V(1)=V(1)+V(11)/2,V(1)=$J(V(1),0,1),V(222)=V(2)-V(22),V(2)=V(2)+V(22)/2,V(2)=$J(V(2),0,1) S:V(111)<0 V(111)=-V(111) S:V(222)<0 V(222)=-V(222)
 F I=0:0 S I=$O(TC(I)) Q:I<1  F II=1:1:2 I TC(I,4)=TEST(II) S:'SKIP!('$L(TC(I,3))) @TC(I,1)=V(II) I SKIP,$L(TC(I,3)) S LIMIT=TC(I,3)/100,DELTA=$S(II=1:V(111),1:V(222)),@TC(I,1)=$S(V(II)=0:0,DELTA/V(II)>LIMIT:"",1:V(II))
LA3 S:SKIP CUP=CUP-1 X LAGEN Q:'ISQN  ;Can be changed by the cross-link code
 S:SKIP CUP=CUP+1 F I=0:0 S I=$O(TV(I)) Q:I<1  S:TV(I,1)]"" ^LAH(LWL,1,ISQN,I)=TV(I,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
IN S CNT=^LA(TSK,"I",0)+1 IF '$D(^(CNT)) S TOUT=TOUT+1 Q:TOUT>9  H 20 G IN
 S ^LA(TSK,"I",0)=CNT,IN=^(CNT),TOUT=0
 S:IN["~" CTRL=$P(IN,"~",2),IN=$P(IN,"~",1)
 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