source: FOIAVistA/trunk/r/AUTOMATED_LAB_INSTRUMENTS-LA/LACOAGX2.m@ 1123

Last change on this file since 1123 was 628, checked in by George Lilly, 15 years ago

initial load of FOIAVistA 6/30/08 version

File size: 1.7 KB
Line 
1LACOAGX2 ;SLC/RWF - ROUTINE FOR COAGAMATE X2 ;7/20/90 07:51 ;
2 ;;5.2;AUTOMATED LAB INSTRUMENTS;;Sep 27, 1994
3 ;RUN BY TRAY CUP
4LA1 S:$D(ZTQUEUED) ZTREQ="@" S LANM=$T(+0),TSK=$O(^LAB(62.4,"C",LANM,0)) Q:TSK<1
5 Q:'$D(^LA(TSK,"I",0))
6 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
7LA2 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
8 G LA2:IN'["END TEST" S LASTCUP=$E(IN,26,27) S TOUT=0 D IN G QUIT:TOUT
9 F A=0:0 D LA2A Q:CUP=LASTCUP S TOUT=0 D IN G QUIT:TOUT
10 G LA2
11LA2A 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)
12 I SKIP,CUP#2 S V(11)=V(1),V(22)=V(2) S TOUT=0 D IN G QUIT:TOUT G LA2A
13 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)
14 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))
15LA3 S:SKIP CUP=CUP-1 X LAGEN Q:'ISQN ;Can be changed by the cross-link code
16 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)
17 Q
18NUM S X="" F JJ=1:1:$L(V) S:$A(V,JJ)>32 X=X_$E(V,JJ)
19 S V=X Q
20IN S CNT=^LA(TSK,"I",0)+1 IF '$D(^(CNT)) S TOUT=TOUT+1 Q:TOUT>9 H 20 G IN
21 S ^LA(TSK,"I",0)=CNT,IN=^(CNT),TOUT=0
22 S:IN["~" CTRL=$P(IN,"~",2),IN=$P(IN,"~",1)
23 Q
24QUIT LOCK ^LA(TSK) H 1 K ^LA(TSK),^LA("LOCK",TSK),^TMP($J),^TMP("LA",$J)
25 Q
26TRAP D ^LABERR S T=TSK D SET^LAB G @("LA2^"_LANM) ;ERROR TRAP
Note: See TracBrowser for help on using the repository browser.