source: WorldVistAEHR/trunk/r/AUTOMATED_LAB_INSTRUMENTS-LA/LAACA.m@ 1226

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

initial load of WorldVistAEHR

File size: 1.5 KB
RevLine 
[613]1LAACA ;SLC/RWF/CJS - 'ACA3' ROUTINE FOR AUTOMATED DATA ;8/16/90 14:52 ;
2 ;;5.2;AUTOMATED LAB INSTRUMENTS;;Sep 27, 1994
3 ;CROSS LINK BY IDE = CARD READER DATA, ID = SAMPLE SEQUENCE #
4LA1 S LANM=$T(+0),TSK=$O(^LAB(62.4,"C",LANM,0)) Q:TSK<1 S X=^LAB(62.4,TSK,0),U="^"
5 Q:'$D(^LA(TSK,"I",0))
6 S IDT=0 K LRTOP D ^LASET Q:'TSK S (PID,PSPEC,TP)=0,SS="CH",X="TRAP^"_LANM,@^%ZOSF("TRAP")
7LA2 S TOUT=0,BAD=0 F A=1 D IN S Y(1)=IN D QC G QUIT:TOUT
8 I BAD G LA2
9 K TV
10 S ACA=+$E(Y(1),31,32),TC=$S($D(^LAB(62.4,TSK,3,ACA,0)):^(1),1:"TV(1,1)")
11 S V=$S($E(Y(1),42)]" ":+$E(Y(1),42,49),1:+$E(Y(1),43,49)),DIL=+$E(Y(1),18)_$E(Y(1),19) S:DIL>1 V=V*DIL
12 S @TC=$S(TC["99,":"TEST NOT FOUND "_$E(Y(1),34,37)_" ",1:"")_V
13 S IDE=+$E(Y(1),21,29),ID=+$E(Y(1),6,9),CUP=ID,TRAY=1,SPEC=$P(^LAB(69.9,1,1),U,3),RT=NOW
14LA3 I (IDE'=PID)!(PSPEC'=SPEC) X LAGEN S PID=IDE,PSPEC=SPEC
15 F I=0:0 S I=$O(TV(I)) Q:I<1 D LA4
16 G LA2
17LA4 S R=$S($D(TV(I,1)):TV(I,1),1:"") S:R]"" ^LAH(LWL,1,ISQN,I)=R
18 Q
19QC ;QC TESTING HERE; S BAD=1 IF DONT STORE
20 S:$E(Y(1),51,52)]" " BAD=1 S:$E(Y(1),17)]" " BAD=1
21 S:$L(Y(1))'=60 BAD=1 Q
22IN S CNT=^LA(TSK,"I",0)+1 IF '$D(^(CNT)) S TOUT=TOUT+1 Q:TOUT>9 H 5 G IN
23 S ^LA(TSK,"I",0)=CNT,IN=^(CNT),TOUT=0
24 S:IN["~" CTRL=$P(IN,"~",2),IN=$P(IN,"~",1)
25 Q
26OUT S CNT=^LA(TSK,"O")+1,^("O")=CNT,^("O",CNT)=OUT
27 LOCK ^LA("Q") S Q=^LA("Q")+1,^("Q")=Q,^("Q",Q)=TSK LOCK
28 Q
29QUIT LOCK ^LA(TSK) H 1 K ^LA(TSK),^LA("LOCK",TSK),^TMP($J),^TMP("LA",$J) S:$D(ZTQUEUED) ZTREQ="@"
30 Q
31TRAP D ^LABERR S T=TSK D SET^LAB G @("LA2^"_LANM) ;ERROR TRAP
Note: See TracBrowser for help on using the repository browser.