source: WorldVistAEHR/trunk/r/AUTOMATED_LAB_INSTRUMENTS-LA/LAH747.m@ 1042

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

initial load of WorldVistAEHR

File size: 1.8 KB
Line 
1LAH747 ;SLC/FHS/RAF - HITACHI 747 ;8/15/92 15:41
2 ;;5.2;AUTOMATED LAB INSTRUMENTS;;Sep 27, 1994
3 ;CROSS LINK BY ID
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 D ^LASET Q:'TSK S X="TRAP^"_LANM,@^%ZOSF("TRAP")
7 K TEST S J="" F S J=$O(TC(J)) Q:J="" S TEST(TC(J,4))=J
8LA2 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
9 F A=2:1 Q:CTRL="C" S TOUT=0 D IN G QUIT:TOUT D QC
10 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
11 S V=$E(Y(1),27,28) D NUM S NT=+V G:'NT LA2
12 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
13LA3 X LAGEN G LA2:'ISQN ;Can be changed by the cross-link code
14 F I=0:0 S I=$O(TV(I)) Q:I<1 S:TV(I,1)]"" ^LAH(LWL,1,ISQN,I)=TV(I,1)
15 G LA2
16LA4 Q:'$D(TEST(TEST)) I VAL S II=TEST(TEST),@TC(II,1)=VAL D
17 .I $L($G(TC(II,2))) X TC(II,2) S @TC(II,1)=V,VAL=V
18 Q
19QC ;
20 S Y(A)=IN Q
21IN S CNT=^LA(TSK,"I",0)+1 IF '$D(^(CNT)) S TOUT=TOUT+1 Q:TOUT>9 H 5 G IN
22 S ^LA(TSK,"I",0)=CNT,IN=^(CNT),TOUT=0
23 S:IN["~" CTRL=$P(IN,"~",2),IN=$P(IN,"~",1)
24 Q
25NUM ;
26 S X="" F JJ=1:1:$L(V) S:$A(V,JJ)>32 X=X_$E(V,JJ)
27 S V=X Q
28 Q
29OUT S CNT=^LA(TSK,"O")+1,^("O")=CNT,^("O",CNT)=OUT
30 LOCK ^LA("Q") S Q=^LA("Q")+1,^("Q")=Q,^("Q",Q)=TSK LOCK
31 Q
32QUIT G:^LA(TSK,"I")>^LA(TSK,"I",0) LA2 I $D(^LA(TSK,"O"))#2 G:^LA(TSK,"O")>^LA(TSK,"O",0) LA2
33 K ^LA(TSK,"O") S ^LA(TSK,"O")=0,^("O",0)=0
34 LOCK ^LA(TSK) H 1 K ^LA(TSK,"I"),^LA("LOCK",TSK),A,CKSUM,CNT,CTRL D
35 .K CUP,I,ID,IDE,II,IN,ISQN,J,JJ,LAGEN,LANM,LWL,NT,OUT,Q,T,TC,TEST
36 .K TOUT,TRAY,TSK,TV,V,VAL,X,Y
37 Q
38TRAP D ^LABERR S T=TSK D SET^LAB G @("LA2^"_LANM) ; ERROR TRAP
Note: See TracBrowser for help on using the repository browser.