source: WorldVistAEHR/trunk/r/AUTOMATED_LAB_INSTRUMENTS-LA/LASTRA.m@ 1240

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

initial load of WorldVistAEHR

File size: 1.8 KB
Line 
1LASTRA ;SLC/RWF - ASTRA 4,6,8,8E,IDEAL,CX3 (NON-CALCULATING) ;8/16/90 13:53 ;
2 ;;5.2;AUTOMATED LAB INSTRUMENTS;;Sep 27, 1994
3 ;CROSS LINK ID=TRAY_CUP, IDE = ENTERED IDENT.
4 S:$D(ZTQUEUED) ZTREQ="@" S LANM=$T(+0),TSK=+$O(^LAB(62.4,"C",LANM,0)) Q:'$D(^LA(TSK,"I",0))
5 S SS="CH",IDT=0 D ^LASET Q:TSK<1 S X="TRAP^"_LANM,@^%ZOSF("TRAP")
6 F I=0:0 S I=$O(TC(I)) Q:I'>0 S LA(TC(I,4))=TC(I,1)
7 S TOUT=0,ID=0,ERR=0,SAM="S"
8LA2 ;NEEDED TO MAKE TRAP CALL CONSISTENT WITH OTHER INSTRUMENT ROUTINES
9LA1 D IN G QUIT:TOUT,LA9:IN'?1"[".ANP1"]".AN
10 S TAG=+$E(IN,2,3) G NEW:TAG=1,DATA:TAG=2,ET:TAG=99,DATA:TAG=3,LA1
11DATA D CS S ERR=ERR+ER
12DA2 S TEST=$P(IN,",",2) IF '$D(LA(TEST)) G LA1
13 S X=$P(IN,",",3) D PACK S X=$S(X="0000":"*",X="T.O":"*",1:+X),@LA(TEST)=X G LA1
14CALC S IN=$P(IN,"]",1) G DA2 ;PROCESS SAME AS DATA
15NEW S PT=$E(IN,5,6),X=$E(IN,8,16),ERR=0 D PACK S IDE=+X
16 F I=0:0 S I=$O(TC(I)) Q:I'>0 S @TC(I,1)=""
17 S TRAY=+$E(IN,30,31),CUP=+$E(IN,33,34),TYPE=$E(IN,36,37),SAM=$E(IN,39),ID=TRAY_CUP
18IDQC D CS S ERR=ERR+ER
19 S:TYPE="CO" CTRL=1 G LA1
20ET IF ERR>1!('ID) G LA9
21 S SPEC=$S(SAM="S":$P(^LAB(69.9,1,1),U,3),1:$P(^LAB(69.9,1,1),U,2))
22 X LAGEN
23 F I=0:0 S I=$O(TV(I)) Q:I<1 D LA4
24LA9 S REC="",IDE=0,ID=0 G LA1
25LA4 S R=$S($D(TV(I,1)):TV(I,1),1:"")
26 S:R]"" ^LAH(LWL,1,ISQN,I)=R Q
27 Q
28 Q
29CS S CS=0,Y=$L(IN)-1 F I=1:1:Y-1 S CS=$A(IN,I)+CS
30 S X=$A(IN,Y)-48 S:X>9 X=X-7 S ER=X*16,X=$A(IN,Y+1)-48 S:X>9 X=X-7 S X=X+ER
31 S ER=CS+X#256
32 Q
33PACK S Y=X,X="" F I=1:1:$L(Y) S:$A(Y,I)-32 X=X_$E(Y,I)
34 Q:X="" S:X'?.P1N.NP X="*" Q
35IN S CNT=^LA(TSK,"I",0)+1 IF '$D(^(CNT)) Q:TOUT>9 S TOUT=TOUT+1 H 9 G IN
36 S IN=^(CNT),^(0)=CNT,TOUT=0
37 S:IN["~" CTRL=$P(IN,"~",2),IN=$P(IN,"~",1)
38 Q
39QUIT LOCK ^LA(TSK) H 1 K ^LA(TSK),^LA("LOCK",TSK),^TMP($J),^TMP("LA",$J)
40 Q
41TRAP D ^LABERR S T=TSK D SET^LAB G @("LA2^"_LANM) ;ERROR TRAP
42 ;
Note: See TracBrowser for help on using the repository browser.