1 | RAO7SCH ;HISC/FPT,GJC-Scheduled Request from Rad to OE/RR! ;9/5/97 08:54
|
---|
2 | ;;5.0;Radiology/Nuclear Medicine;**10,18**;Mar 16, 1998
|
---|
3 | ;;last modification by SS JUN 19,2000 for P18
|
---|
4 | EN1(RAOIFN) ; 'RAOIFN' is the ien in file 75.1
|
---|
5 | ; New vars & define the following variables: RAECH, RAECH array & RAHLFS
|
---|
6 | N RAREG S RAREG=0 S:$D(RAOPT("REG"))#2!($D(RAOPT("ADDEXAM"))#2) RAREG=1
|
---|
7 | N RA,RA0,RACPT,RACTIVDT,RAECH,RAEXAMID,RAHLFS,RAPROCDR,RASCH,RATAB,RAVAR
|
---|
8 | S RATAB=1 D EN1^RAO7UTL S RA0=$G(^RAO(75.1,RAOIFN,0)) Q:RA0']""
|
---|
9 | S RAVAR="RATMP(",RAVARBLE="RATMP"
|
---|
10 | ; msh
|
---|
11 | S @(RAVAR_RATAB_")")=$$MSH^RAO7UTL("ORM^O01") ;P18 event type added
|
---|
12 | ; pid
|
---|
13 | S RATAB=RATAB+1,@(RAVAR_RATAB_")")=$$PID^RAO7UTL(RA0)
|
---|
14 | ; orc
|
---|
15 | I RAREG D
|
---|
16 | . ; if registering a patient
|
---|
17 | . S RAEXAMID=RAECH(2)_RADTI_RAECH(2)_RACNI
|
---|
18 | . Q
|
---|
19 | S RATAB=RATAB+1,@(RAVAR_RATAB_")")="ORC"_RAHLFS_"SC"_RAHLFS_$P(RA0,U,7)_RAECH(1)_"OR"_RAHLFS_RAOIFN_$S(RAREG:RAEXAMID,1:"")_RAECH(1)_"RA"_$$STR^RAO7UTL(2)_$S(RAREG:"ZR",1:"")_$$STR^RAO7UTL(7)_$P(RA0,U,14)
|
---|
20 | ; RAREG is defined based on RAOPT("REG") set in the entry action
|
---|
21 | ; of RA REG. A full SC order control message is sent to OE when the
|
---|
22 | ; order is scheduled. A modified SC order control message is sent when
|
---|
23 | ; the order is registered (the 'ORC' segment is modified).
|
---|
24 | S RAPROCDR(0)=$G(^RAMIS(71,+$P(RA0,U,2),0)),RAPROCDR(9)=+$P(RAPROCDR(0),U,9)
|
---|
25 | S RACPT(0)=$$NAMCODE^RACPTMSC(RAPROCDR(9),DT)
|
---|
26 | S RASCH=$$HLDATE^HLFNC($P(RA0,U,23),"TS")
|
---|
27 | S RACTIVDT=$$HLDATE^HLFNC($P(RA0,U,18),"TS"),RA("STATUS")="P"
|
---|
28 | I RAREG D Q
|
---|
29 | . ; build 'OBR' segment when the order is registered (patch 3 logic)
|
---|
30 | . S RA("OBR",4)=$P(RACPT(0),U)_U_$P(RACPT(0),U,2)_U_"CPT4"_U_+$P(RA0,U,2)_U_$P(RAPROCDR(0),U)_"^99RAP"
|
---|
31 | . S RATAB=RATAB+1,@(RAVAR_RATAB_")")="OBR"_$$STR^RAO7UTL(4)_RA("OBR",4)
|
---|
32 | . D SHIP
|
---|
33 | . Q
|
---|
34 | ; obr
|
---|
35 | S RA("OBR",4)=$P(RACPT(0),U)_U_$P(RACPT(0),U,2)_U_"CPT4"_U_+$P(RA0,U,2)_U_$P(RAPROCDR(0),U)_"^99RAP"
|
---|
36 | S RATAB=RATAB+1,@(RAVAR_RATAB_")")="OBR"_$$STR^RAO7UTL(4)_RA("OBR",4)_$$STR^RAO7UTL(18)_RACTIVDT_$$STR^RAO7UTL(3)_RA("STATUS")_$$STR^RAO7UTL(11)_RASCH
|
---|
37 | SHIP ; ship message to MSG^RAO7UTL which fires of the HL7 message to CPRS
|
---|
38 | D MSG^RAO7UTL("RA EVSEND OR",.@RAVARBLE)
|
---|
39 | Q
|
---|