1 | LABCX4B ;SLC/DLG - BECKMAN CX4 AND CX5 UNI AND BIDIRECTIONAL ;7/20/90 07:25 ;
|
---|
2 | ;;5.2;AUTOMATED LAB INSTRUMENTS;;Sep 27, 1994
|
---|
3 | ;CROSS LINK BY ID OR IDE
|
---|
4 | LA1 S:$D(ZTQUEUED) ZTREQ="@"
|
---|
5 | S LANM=$T(+0),TSK=$O(^LAB(62.4,"C",LANM,0)) Q:TSK<1
|
---|
6 | Q:'$D(^LA(TSK,"I",0))
|
---|
7 | K LATOP D ^LASET Q:'TSK S X="TRAP^"_LANM,@^%ZOSF("TRAP")
|
---|
8 | S I=0 F J=0:0 S I=$O(TC(I)) Q:I<1 S:$D(TC(I,4))#2 TEST(TC(I,4))=I
|
---|
9 | LA2 K TV,Y S (TRAY,CUP,ID,IDE,RMK)="",TOUT=0,A=1 D IN G QUIT:TOUT,LA2:$P(IN,",",2)'="402"
|
---|
10 | I $P(IN,",",3)="01" D QC,IN,QC,HDR G LA3
|
---|
11 | I $P(IN,",",3)="03" D QC,RES G LA3
|
---|
12 | I $P(IN,",",3)="11" D QC,RES1 G LA3
|
---|
13 | G LA2
|
---|
14 | LA3 G:ID="" LA2 X LAGEN G LA2:'ISQN ;Can be changed by the cross-link code
|
---|
15 | F I=0:0 S I=$O(TV(I)) Q:I<1 S:TV(I,1)]"" ^LAH(LWL,1,ISQN,I)=TV(I,1)
|
---|
16 | I $D(RMK),$L(RMK) D RMK^LASET
|
---|
17 | G LA2
|
---|
18 | QC ;QC TESTING HERE; S BAD=1 IF DONT STORE
|
---|
19 | S Y(A)=IN,A=A+1 Q
|
---|
20 | HDR S V=$P(Y(1),",",6) D NUM S IDE=+V,V=$P(Y(1),",",15) D NUM S ID=+V,V=$P(Y(1),",",8) D NUM S TRAY=V,V=$P(Y(1),",",9) D NUM S CUP=V
|
---|
21 | S RMK=$P(Y(1),",",16)_$P(Y(1),",",17)_$P(Y(1),",",27) S:$L(RMK)<110 RMK=RMK_$P(Y(2),",",1) F I=$L(RMK):-1:1 Q:$E(RMK,I)'=" " S RMK=$E(RMK,1,I-1)
|
---|
22 | Q
|
---|
23 | RES S V=$P(Y(1),",",6) D NUM S IDE=+V,V=$P(Y(1),",",8) D NUM S TRAY=+V,V=$P(Y(1),",",9) D NUM S CUP=+V,V=$P(Y(1),",",10)
|
---|
24 | D NUM S TEST=V,V=$P(Y(1),",",15) D NUM S:V="" V=$P(Y(1),",",23) D NUM S:"*#"[V V="" I V]"",($D(TEST(TEST))#2) S @TC(TEST(TEST),1)=+V
|
---|
25 | F S J=$O(^LAH(LWL,1,"B",TRAY_";"_CUP,0)) I J>0 S ID=$P(^LAH(LWL,1,J,0),"^",5)
|
---|
26 | Q
|
---|
27 | RES1 S V=$P(Y(1),",",6) D NUM S IDE=+V,V=$P(Y(1),",",7) D NUM S TRAY=+V,V=$P(Y(1),",",8) D NUM S CUP=+V,V=$P(Y(1),",",10)
|
---|
28 | D NUM S TEST=V,V=$P(Y(1),",",12) D NUM S:"*"[V V="" I V]"",($D(TEST(TEST))#2),($P(Y(1),",",11)="OK") S @TC(TEST(TEST),1)=+V
|
---|
29 | G F
|
---|
30 | NUM S X="" F JJ=1:1:$L(V) S:$A(V,JJ)>32 X=X_$E(V,JJ)
|
---|
31 | S V=X Q
|
---|
32 | IN S CNT=^LA(TSK,"I",0)+1 IF '$D(^(CNT)) S TOUT=TOUT+1 Q:TOUT>9 H 5 G IN
|
---|
33 | S ^LA(TSK,"I",0)=CNT,IN=^(CNT),TOUT=0
|
---|
34 | S:IN["~" CTRL=$P(IN,"~",2),IN=$P(IN,"~",1)
|
---|
35 | Q
|
---|
36 | OUT S CNT=^LA(TSK,"O")+1,^("O")=CNT,^("O",CNT)=OUT
|
---|
37 | LOCK ^LA("Q") S Q=^LA("Q")+1,^("Q")=Q,^("Q",Q)=TSK LOCK
|
---|
38 | Q
|
---|
39 | QUIT LOCK ^LA(TSK) H 1 K ^LA(TSK),^LA("LOCK",TSK)
|
---|
40 | Q
|
---|
41 | TRAP D ^LABERR S T=TSK D SET^LAB G @("LA2^"_LANM) ;ERROR TRAP
|
---|