source: WorldVistAEHR/trunk/r/RADIOLOGY_NUCLEAR_MEDICINE-RA/RAO7OKS.m@ 699

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

initial load of WorldVistAEHR

File size: 1.8 KB
Line 
1RAO7OKS ;HISC/GJC-Accept/reject OE/RR request ;9/5/97 09:33
2 ;;5.0;Radiology/Nuclear Medicine;**18,57**;Mar 16, 1998
3 ;Last modified for P18 Oct 24 by SS
4ACC(Y1,Y2,Y3,Y4,Y5) ; Rad accepts OE/RR request
5 ; Y1-> order control Y2-> universal service ID
6 ; Y3-> results rpt./stat. change DT Y4-> result status
7 ; Y5-> scheduled date/time
8 ;
9 ; PFSS 1B Project Account Referance Number
10 ; If the order status is "NEW", call to set up a new account number.
11 I RAORD="NW" D FB^RABWIBB(+RAORC3) ; Requirement 1, 5
12 ; If the order status is "DISCONTINUE", call to set up a discontinue event
13 I RAORD="DC" D DC^RABWIBB(+RAORC3) ; Requirement 8
14 ;
15 N MSG S MSG(1)=$$MSH^RAO7UTL("ORR")
16 S MSG(2)=$$MSA^RAO7UTL(+RAORC2,"AA") ;P18 add MSA segment with accept AA
17 S MSG(3)="PID"_$$STR^RAO7UTL(3)_$G(RAPID3)_$$STR^RAO7UTL(2)_$G(RAPID5) ;P18
18 ; Add PV1 Segment for PFSS Project
19 ; PFSS 1B project define new field: PV1-50 Alternate Visit ID
20 S MSG(4)=$$PV1^RAO7UTL($G(^RAO(75.1,+RAORC3,0)))
21 S MSG(5)="ORC"_RAHLFS_Y1_RAHLFS_$G(RAORC2)_RAHLFS_$G(RAORC3) ;P18
22 I Y2]""!(Y3]"")!(Y4]"")!(Y5]"") D ; include if order is scheduled
23 . S MSG(6)="OBR"_$$STR^RAO7UTL(4)_Y2_$$STR^RAO7UTL(18)_Y3
24 . S MSG(6)=MSG(6)_$$STR^RAO7UTL(2)_Y4_$$STR^RAO7UTL(12)_Y5
25 . Q
26 ;
27 D SHIP ; send HL7 message on its way to CPRS
28 Q
29 ;
30REJ(Y1,Y2) ; Rad rejects OE/RR request
31 ; Y1-> order control Y2-> order control reason
32 N MSG S MSG(1)=$$MSH^RAO7UTL("ORR")
33 S MSG(2)=$$MSA^RAO7UTL(+RAORC2,"AR") ;P18 add MSA segment with reject AR
34 S MSG(3)="PID"_$$STR^RAO7UTL(3)_$G(RAPID3)_$$STR^RAO7UTL(2)_$G(RAPID5) ;P18
35 S MSG(4)="ORC"_RAHLFS_Y1_RAHLFS_$G(RAORC2)_RAHLFS_$G(RAORC3) ;P18
36 S:Y2]"" MSG(4)=MSG(4)_$$STR^RAO7UTL(13)_RAECH(1)_Y2_RAECH(1)
37SHIP ; ship message to MSG^RAO7UTL which fires of the HL7 message to CPRS
38 D MSG^RAO7UTL("RA EVSEND OR",.MSG)
39 Q
Note: See TracBrowser for help on using the repository browser.