source: WorldVistAEHR/trunk/r/AUTOMATED_LAB_INSTRUMENTS-LA/LAEPXD.m@ 1279

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

initial load of WorldVistAEHR

File size: 2.2 KB
Line 
1LAEPXD ;SLC/DLG - ABBOTT EPX BUILD DOWNLOAD FILE. ;7/20/90 08:20 ;
2 ;;5.2;AUTOMATED LAB INSTRUMENTS;;Sep 27, 1994
3 ;Call with LRLL = load list to build
4 ;Call with LRTRAY1 = Starting tray number
5 ;Call with LRLL = Auto Instrument pointer
6 ;Call with LRFORCE=1 if send tray and cup.
7A S:$D(ZTQUEUED) ZTREQ="@" S T=LRINST D SET S LRECORD="100010#",F=1 D SEN S LRECORD="140011A#",F=1 D SEN ;TEST LIST BY NAME AND AUTO SEND
8 F LRTRAY=LRTRAY1:0 D:$D(^LRO(68.2,LRLL,1,LRTRAY)) TRAY S LRTRAY=$O(^LRO(68.2,LRLL,1,LRTRAY)) Q:LRTRAY'>0 S LRCUP1=1
9 S LREND=1 Q
10TRAY I LRCUP1=1 S LRECORD="120013C"_$E(100+LRTRAY,2,3)_"#",F=1 D SEN ;CLEAR TRAY INFORMATION
11 F LRCUP=LRCUP1-1:0 S LRCUP=$O(^LRO(68.2,LRLL,1,LRTRAY,1,LRCUP)) Q:LRCUP'>0 D SAMPLE S LRECORD=""
12 Q
13SAMPLE S STAT="N",LRL=^LRO(68.2,LRLL,1,LRTRAY,1,LRCUP,0),LRAA=+LRL,LRAD=$P(LRL,"^",2),LRAN=$P(LRL,"^",3) D PNM,TEST S L=NT*8+97
14 S LRECORD="11"_$E(10000+L,2,5)_$E(LRAN_" ",1,20)_STAT_"N"
15 S LRECORD=LRECORD_$E(SSN_" ",1,20)_" "_$E(100+LRTRAY,2,3)_$E(100+LRCUP,2,3)_" "_$E(1000+NT,2,4)
16 I X]"" S F=1 F I=1:1:NT S L=$L(LRECORD)+8 S:L<255 LRECORD=LRECORD_$E($P(X,"^",I)_" ",1,8) I L>252 D SEN S LRECORD="",F=0
17 S LRECORD=LRECORD_"#" D SEN ;SEND DATA
18 Q
19TEST S NT=0,X="" F LRTEST=0:0 S LRTEST=$O(^LRO(68.2,LRLL,1,LRTRAY,1,LRCUP,1,LRTEST)) Q:LRTEST'>0 S STAT=$S($P(^(LRTEST,0),U,2)=1:"Y",1:"N") D T2
20 Q
21T2 Q:'$D(^TMP($J,LRTEST)) F I=0:0 S I=$O(^TMP($J,LRTEST,I)) Q:I'>0 S Y=^(I) S:X'[Y NT=NT+1,$P(X,"^",NT)=Y ;Don't repete a test
22 Q
23PNM ;Get patient name and last 4 from an accession.
24 S PNM="" Q:'$D(^LRO(68,LRAA,1,LRAD,1,LRAN,0)) S X=^(0),X=^LR(+X,0) I $P(X,"^",2)=2 S DFN=$P(X,"^",3) D PT^LRX S SSN=$E(SSN,1,3)_$E(SSN,5,6)_$E(SSN,8,11)
25 Q
26SEN S:F=1 SUM=$A(LRECORD,1) F II=$S(F:2,1:1):1:$L(LRECORD) S M=SUM,N=$A(LRECORD,II),B=64,SUM=0 X "F JJ=1:1:7 S K=M\B,L=N\B,O=$S(K=L:0,1:1),SUM=SUM*2+O,M=M#B,N=N#B,B=B\2"
27 Q:$E(LRECORD,$L(LRECORD))'="#"
28 S SUM=SUM#128,X=SUM\16 D HEX S LRECORD=LRECORD_X,X=SUM#16 D HEX S LRECORD=LRECORD_X
29 L ^LA(LRINST,"O") S (Q,^LA(LRINST,"O"))=^LA(LRINST,"O")+1,^("O",Q)=LRECORD L
30 Q
31HEX S X=$E("0123456789ABCDEF",(X+1)) Q
32SET S:'$D(^LA(T,"O"))#2 ^LA(T,"O")=0,^("O",0)=0 Q
Note: See TracBrowser for help on using the repository browser.