source: FOIAVistA/trunk/r/AUTOMATED_LAB_INSTRUMENTS-LA/LADMND.m@ 1780

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

initial load of FOIAVistA 6/30/08 version

File size: 1.6 KB
Line 
1LADMND ;SLC/RWF - DEMAND ANALYZER IN MODE 3 ;7/20/90 08:06 ;
2 ;;5.2;AUTOMATED LAB INSTRUMENTS;;Sep 27, 1994
3 ;CROSS LINK BY ID OR IDE
4 ;Internal entry # for CHEM TESTS field in auto instrument file must match the identifying # for each test.
5LA1 S:$D(ZTQUEUED) ZTREQ="@" S LANM=$T(+0),TSK=$O(^LAB(62.4,"C",LANM,0)) Q:TSK<1
6 Q:'$D(^LA(TSK,"I",0))
7 S LRTOP=$P(^LAB(69.9,1,1),"^",3) D ^LASET Q:'TSK S X="TRAP^"_LANM,@^%ZOSF("TRAP"),PSEQ=0,ID=0
8LA2 S TOUT=0,BAD=0 D IN G QUIT:TOUT,LA2:IN="",LA2:$E(IN,1)'="D" S SEQ=$E(IN,2,5) ;D SEND:SEQ'=PSEQ
9 F IX=17:13 S V=$E(IN,IX+2,IX+10),I=+$E(IN,IX,IX+1) Q:I<1 I $D(TC(I)) X TC(I,2) S @TC(I,1)=V ;V COULD BE MODIFIED ON THIS LINE
10 I PSEQ'=SEQ S ID=+$E(IN,2,5),TRAY=1,CUP=+ID,V=$E(IN,6,16),IDE=+V
11 D SAVE:ID S PSEQ=SEQ K TV G LA2
12SAVE I PSEQ'=SEQ X LAGEN
13 F I=0:0 S I=$O(TV(I)) Q:I<1 I TV(I,1)]"" S X=TV(I,1) D PACK S ^LAH(LWL,1,ISQN,I)=+X
14 Q
15QC ;QC TESTING HERE; S BAD=1 IF DONT STORE
16 F I=6:13 Q:I>$L(IN) S T=+$E(IN,I,I+1),X=$E(IN,I+2,I+10),F=$E(IN,I+11,I+12) D QC3:T=66,QC2
17 Q
18QC2 Q:'$D(TC(T)) S X="" F J=1:1:$L(V) S:$A(V,J)>32 X=X_$E(V,J)
19 S @TC(T,1)=V Q
20QC3 F K="L","I","H" F L=0:0 S L=$O(TC(L)) Q:L<1 I TC(L,2)="66"_K S T=L D QC2
21 S T=0 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)=TSK_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)
30 Q
31TRAP D ^LABERR S T=TSK D SET^LAB G @("LA2^"_LANM) ;ERROR TRAP
32 Q
33PACK S Y=X,X="" F J=1:1:$L(Y) S:$A(Y,J)-32 X=X_$E(Y,J)
34 Q:X="" W:X'?.P1N.NP X="*" Q
Note: See TracBrowser for help on using the repository browser.