source: FOIAVistA/tag/r/LAB_SERVICE-LR-LS/LR7OFA3.m@ 636

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

initial load of FOIAVistA 6/30/08 version

File size: 1.7 KB
Line 
1LR7OFA3 ;slc/dcm - Process OBR messages from OE/RR for AP ;8/11/97
2 ;;5.2;LAB SERVICE;**121,187**;Sep 27, 1994
3 ;
4OBR ;Process OBR part of MSG array
5 ;TEST= Ptr to test in file 60
6 ;TESTN= Test Name
7 ;TYPE= Collection Sample Type
8 ;SAMP= Ptr to Collection sample in file 62
9 ;URG= Urgency
10 I '$O(LRXMSG(0)) D
11 . S TEST=+$P($P(LRXMSG,"|",5),"^",4),TESTN=$P($P(LRXMSG,"|",5),"^",6),TYPE=$$LRACTCOD^LR7OU0($P(LRXMSG,"|",12)),SPEC=$S($P($P($P(LRXMSG,"|",5),"^",4),"~",2):$P($P($P(LRXMSG,"|",5),"^",4),"~",2),1:$$LRSPEC^LR7OU0($P(LRXMSG,"|",16)))
12 . S URG=$$LRURG^LR7OU0($P($P(LRXMSG,"|",28),"^",6))
13 I $O(LRXMSG(0)) D
14 . N I,J,X1,CTR
15 . F CTR=1:1:$L(LRXMSG,"|") S X1(CTR)=$P(LRXMSG,"|",CTR)
16 . S J=0 F S J=$O(LRXMSG(J)) Q:J<1 D
17 .. S I=1 I $E(LRXMSG(J))'="|" S X1(CTR)=X1(CTR)_$P(LRXMSG,"|"),I=I+1
18 .. F I=I:1:$L(LRXMSG(J),"|") S CTR=CTR+1,X1(CTR)=$P(LRXMSG(J),"|",I)
19 . S TEST=$P(X1(5),"^",4),TESTN=$P(X1(5),"^",6),TYPE=$$LRACTCOD^LR7OU0(X1(12)),SPEC=$S($P($P(X1(5),"^",4),"~",2):$P($P(X1(5),"^",4),"~",2),1:$$LRSPEC^LR7OU0(X1(16)))
20 . S URG=$$LRURG^LR7OU0($P(X1(28),"^",6))
21 I '$L(TEST) D ACK^LR7OF0("DE",LRXORC,"TEST pointer not sent in message") S LREND=1 Q
22 I '$L(TESTN) D ACK^LR7OF0("DE",LRXORC,"Test Name not sent in message") S LREND=1 Q
23 I '$L(TYPE) D ACK^LR7OF0("DE",LRXORC,"Collection type not sent in message") S LREND=1 Q
24 I '$L(SAMP) D ACK^LR7OF0("DE",LRXORC,"Sample pointer not sent in message") S LREND=1 Q
25 I '$L(URG) D ACK^LR7OF0("DE",LRXORC,"Urgency not sent in message") S LREND=1 Q
26 I LRXTYPE="NW" D ST Q ;New order request
27 Q
28ST S LRSX=LRSX+1 I $D(^TMP("OR",$J,"LROT",STARTDT,TYPE,SAMP,LRSX)) G ST
29 S ^TMP("OR",$J,"LROT",STARTDT,TYPE,SAMP,0)=ORIFN
30 S ^TMP("OR",$J,"LROT",STARTDT,TYPE,SAMP,LRSX)=TEST
31 S ^TMP("OR",$J,"LROT",STARTDT,TYPE,SAMP,LRSX,1)=URG
32 Q
Note: See TracBrowser for help on using the repository browser.