38 lines
2.1 KiB
Mathematica
38 lines
2.1 KiB
Mathematica
LAHTRK ;SLC/RWF/CJS - HEMATRAK 590 DIFF COUNTER ;8/16/90 14:18 ;
|
|
;;5.2;AUTOMATED LAB INSTRUMENTS;;Sep 27, 1994
|
|
LA S:$D(ZTQUEUED) ZTREQ="@" S LANM=$T(+0),TSK=$O(^LAB(62.4,"C","LAHTRK",0)) Q:TSK<1
|
|
Q:'$D(^LA(TSK,"I",0))
|
|
S U="^",SS="CH" D ^LASET Q:'TSK S X="TRAP^"_LANM,@^%ZOSF("TRAP")
|
|
S ZZ="3,9,9,6^6,1,1,1,2,4,4^14,3,3,3,3,3,3,3,3,3,3,3,3,3,4^35,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,3^2,4,3^4,3,3,3,3^"
|
|
S CNT=0,U="^"
|
|
LA2 S A=1,TOUT=0 D IN G QUIT:TOUT S Y(1)=IN,LOG=$E(IN,1,9) G LA2:LOG="" S LOG=+LOG
|
|
F A=2:1:6 D IN G QUIT:TOUT S Y(A)=IN
|
|
SAVE F A=1:1:6 D PIEC
|
|
S SPEC=$P(^LAB(69.9,1,1),U,1),METH="HTRAK"
|
|
LA3 X LAGEN G LA2:ISQN<1
|
|
S Z3="",Z4="",Z5="",Z=LRVAL K LRVAL
|
|
F I=12:1:17 S VAL=$P(Z,U,I)/10,Z3=Z3_$S(VAL=0:"",1:VAL)_U
|
|
F I=20:1:24 S VAL=$P(Z,U,I)/10,Z4=Z4_$S(VAL=0:"",1:VAL)_U
|
|
S VAL=+$P(Z,U,40),Z5=$S(VAL=1:"R",VAL=2:"A",VAL=3:"I",1:"")_U_U_U F I=28:1:33 S VAL=+$P(Z,U,I),Z5=Z5_$S(VAL=0:"",1:VAL-3)_U
|
|
S Z5=Z5_$S(+$P(Z,U,35)=0:"",1:+$P(Z,U,35)-3) S Z14=$S(+$P(Z,U,18)=0:"",1:+$P(Z,U,18)\10)_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
|
Q
|
|
TRAP D ^LABERR S T=TSK D SET^LAB G @("LA2^"_LANM) ;ERROR TRAP
|