1 | LAPERD ;SLC/DLG - AMERICAN MONITOR PERSPECTIVE BUILD DOWNLOAD FILE. ;7/20/90 09:58 ;
|
---|
2 | ;;5.2;AUTOMATED LAB INSTRUMENTS;;Sep 27, 1994
|
---|
3 | ;Call with LRLL = load list to build
|
---|
4 | ;Call with LRTRAY = 'A'll or a tray number
|
---|
5 | ;Call with LRINST = Auto Instrument pointer
|
---|
6 | ;Call with LRFORCE=1 if send tray and cup.
|
---|
7 | I '$D(^LA(LRINST,"I")) S T=LRINST D SET^LASET
|
---|
8 | A S:$D(ZTQUEUED) ZTREQ="@" I LRTRAY D TRAY G Q
|
---|
9 | F LRTRAY=0:0 S LRTRAY=$O(^LRO(68.2,LRLL,1,LRTRAY)) Q:LRTRAY'>0 D TRAY
|
---|
10 | Q S LREND=0 L ^LA("Q") S Q=^LA("Q")+1,^("Q")=Q,^("Q",Q)=LRINST L
|
---|
11 | Q
|
---|
12 | TRAY S LRECORD="+" F LRCUP=0:0 S LRCUP=$O(^LRO(68.2,LRLL,1,LRTRAY,1,LRCUP)) Q:LRCUP'>0 D SAMPLE S LRECORD="+"
|
---|
13 | Q
|
---|
14 | SAMPLE S LRL=^LRO(68.2,LRLL,1,LRTRAY,1,LRCUP,0),LRAA=+LRL,LRAD=$P(LRL,"^",2),LRAN=$P(LRL,"^",3) D PNM S LRECORD=LRECORD_PNM_" 10 9 11 12" D SEN
|
---|
15 | S LRECORD=$E(10000+LRAN,2,5) D SEN
|
---|
16 | D TEST S LRECORD=X D SEN S LRECORD=LRTRAY D SEN S LRECORD=LRCUP D SEN
|
---|
17 | Q
|
---|
18 | TEST S X="" F LRTEST=0:0 S LRTEST=$O(^LRO(68.2,LRLL,1,LRTRAY,1,LRCUP,1,LRTEST)) Q:LRTEST'>0 D T2
|
---|
19 | S:$E(X,$L(X))=" " X=$E(X,1,($L(X)-1)) Q
|
---|
20 | T2 Q:'$D(^TMP($J,LRTEST)) F I=0:0 S I=$O(^TMP($J,LRTEST,I)) Q:I'>0 S X=X_^(I)_" "
|
---|
21 | Q
|
---|
22 | PNM ;Get patient ssn for sample id.
|
---|
23 | S X=^LRO(68,LRAA,1,LRAD,1,LRAN,0),X=^LR(+X,0),PNM="" S:$P(X,"^",2)=2 DFN=$P(X,"^",3) D:DFN]"" PT^LRX S:PNM="" PNM=$S(LRCUP=1:"0302",LRCUP=2:"0303",1:"111111111")
|
---|
24 | Q
|
---|
25 | SEN S CNT=^LA(LRINST,"O")+1,^("O")=CNT,^("O",CNT)=LRECORD Q
|
---|
26 | ACK I $D(NCNT),NCNT>3 K NCNT Q ;TO MANY ERRORS JUST QUIT
|
---|
27 | I IN[$C(6)!IN["~F" S O=^LA(LRINST,"O",0)+1,^(0)=O,OUT=^(O),T=T-BASE K NCNT
|
---|
28 | E S O=^LA(T,"O",0),OUT=^(O),T=T-BASE S:'$D(NCNT) NCNT=0 S NCNT=NCNT+1
|
---|
29 | I $D(^LA("TP")) L ^LA("TP") S O=^LA("TP",0)+1,^(0)=O,^(O)="SENT: "_LRINST_"^"_OUT L
|
---|
30 | Q
|
---|