RAO7PC4 ;HISC/SWM-utilities ;11/19/01 10:23
;;5.0;Radiology/Nuclear Medicine;**28,32,31,45,77**;Mar 16, 1998;Build 7
;08/10/2006 BAY/KAM Remedy Call 134839 Subscript Error
Q
EN1 ; api for CPRS notification alert #67
Q:'$D(XQADATA)
D SET1 ; set up ^TMP nodes
D DISP1 ; convert and display ^TMP nodes
D KIL1 ; kill ^TMP nodes
Q
SET1 N RADFN,RADTI,RACNI,RAPROC1,RAPROC2,RAPHY1,RAPHY2,RAPMOD1,RAPMOD2,RAACNT
N RAPATNAM,RASSN,RASTR,I,J,RACMU
; 08/10/2006 BAY/KAM Remedy Call 134839/RA*5*77 - Added next line
Q:$G(XQADATA)=""
S RADFN=$P(XQADATA,"/") ; ien patient
S RAACNT=0 ; counter
S RADTI=$P(XQADATA,"/",2) ; inverse date of exam
S RACNI=$P(XQADATA,"/",3) ; ien case
S RAPROC1=$P(XQADATA,"/",4) ; ien 71, before
S RAPROC2=$P(XQADATA,"/",5) ; ien 71, after
S RAPHY1=$P(XQADATA,"/",6) ; ien 200 requesting physician, before
S RAPHY2=$P(XQADATA,"/",7) ; ien 200 requesting physician, after
S RAPMOD1=$P(XQADATA,"/",8) ;string of proc mod iens, before
S RAPMOD2=$P(XQADATA,"/",9) ;string of proc mod iens, after
K ^TMP($J,"RAE4")
Q:'$D(^DPT(RADFN,0))
S RAPATNAM=$P(^DPT(RADFN,0),"^") S RASSN=$$SSN^RAUTL() S:RASSN="" RASSN="Unkn"
S RACMU=$S(+$O(^RADPT(RADFN,"DT",RADTI,"P",RACNI,"CM",0))>0:" (CM w/exam)",1:"")
S ^TMP($J,"RAE4",1)="Imaging Exam for "_RAPATNAM_" ("_RASSN_") changed:"
I 'RAPROC2,RAPROC1 D
.S ^TMP($J,"RAE4",$$INCR^RAUTL4(RAACNT))=" "
.S ^TMP($J,"RAE4",$$INCR^RAUTL4(RAACNT))="For procedure "_$E($P(^RAMIS(71,RAPROC1,0),"^"),1,53)_RACMU
.S ^TMP($J,"RAE4",$$INCR^RAUTL4(RAACNT))=" "
I RAPROC2 D
.S ^TMP($J,"RAE4",$$INCR^RAUTL4(RAACNT))=" Procedure changed"
.S ^TMP($J,"RAE4",$$INCR^RAUTL4(RAACNT))=" From: "_$E($P(^RAMIS(71,RAPROC1,0),"^"),1,53)
.S ^TMP($J,"RAE4",$$INCR^RAUTL4(RAACNT))=" To: "_$E($P(^RAMIS(71,RAPROC2,0),"^"),1,53)_RACMU
.S ^TMP($J,"RAE4",$$INCR^RAUTL4(RAACNT))=""
I RAPHY2 D
.S ^TMP($J,"RAE4",$$INCR^RAUTL4(RAACNT))=" Requesting Physician changed"
.S ^TMP($J,"RAE4",$$INCR^RAUTL4(RAACNT))=" From: "_$$GET1^DIQ(200,RAPHY1,.01)
.S ^TMP($J,"RAE4",$$INCR^RAUTL4(RAACNT))=" To: "_$$GET1^DIQ(200,RAPHY2,.01)
I RAPMOD2!(('RAPMOD2)&(RAPMOD1)) D
.S ^TMP($J,"RAE4",$$INCR^RAUTL4(RAACNT))=" Procedure Modifier changed"
.S RASTR=""
.F I=1:1:($L(RAPMOD1)/2) S J=$P(RAPMOD1,",",I) Q:J="" S RASTR=RASTR_$$GET1^DIQ(71.2,J,.01)_", " Q:$L(RASTR)>240
.S RASTR=$E(RASTR,1,$L(RASTR)-2) ;rid trailing comma and blank
.S ^TMP($J,"RAE4",$$INCR^RAUTL4(RAACNT))=" From: "_RASTR
.S RASTR=""
.F I=1:1:($L(RAPMOD2)/2) S J=$P(RAPMOD2,",",I) Q:J="" S RASTR=RASTR_$$GET1^DIQ(71.2,J,.01)_", " Q:$L(RASTR)>240
.S RASTR=$E(RASTR,1,$L(RASTR)-2) ;rid trailing comma
.S ^TMP($J,"RAE4",$$INCR^RAUTL4(RAACNT))=" To: "_RASTR
Q
DISP1 N RARRAY
MERGE RARRAY=^TMP($J,"RAE4")
D EN^DDIOL(.RARRAY)
Q
KIL1 K ^TMP($J,"RAE4")
Q
;
SETALERT ;
Q:'$D(RASTRING)
N RAPHY1,RAPHY2,RAPNAM,RAPSSN
S RADFN=$P(RASTRING,"/") ; ien patient
S RAPNAM=$$GET1^DIQ(70,+RADFN,.01) S:RAPNAM="" RAPNAM="UNKNOWN"
S RAPSSN=$$GET1^DIQ(70,+RADFN,.09) S:RAPSSN="" RAPSSN="UNKNOWN"
S RAPHY1=$P(RASTRING,"/",6) ; ien 200 requesting physician, before
S RAPHY2=$P(RASTRING,"/",7) ; ien 200 requesting physician, after
;
S XQA(RAPHY1)="",XQAID=$J_","_$H S:$G(RAPHY2)]"" XQA(RAPHY2)=""
S XQAMSG=$E(RAPNAM,1,9)_" ("_$E(RAPNAM,1)_$E(RAPSSN,6,9)_"): Imaging Exam Changed: "_$S($P(RASTRING,"/",5):"Proc., ",1:"")_$S($P(RASTRING,"/",7):"Rqstr, ",1:"")_$S($P(RASTRING,"/",9):"Proc Mod",1:"")
S:$E(XQAMSG,($L(XQAMSG)-1))="," XQAMSG=$E(XQAMSG,1,($L(XQAMSG)-2))
S XQADATA=RASTRING
S XQAROU="ZZ^RAO7PC4(XQADATA)"
D SETUP^XQALERT
Q
;
ZZ(RASTRING) ; Additional text for display when processing alert.
;
N RADFN,RADTI,RACMU,RACNI,RAPROC1,RAPROC2,RAPHY1,RAPHY2,RAPMOD1,RAPMOD2
N RAPNAM,RAPSSN,I,RAPRFR,RAPRTO,RAPHYFR,RAPHYTO,RASTR
S RADFN=$P(RASTRING,"/") ; ien patient
S RADTI=$P(RASTRING,"/",2) ; inverse date of exam
S RACNI=$P(RASTRING,"/",3) ; ien case
S RAPROC1=$P(RASTRING,"/",4) ; ien 71, before
S RAPROC2=$P(RASTRING,"/",5) ; ien 71, after
S RAPHY1=$P(RASTRING,"/",6) ; ien 200 requesting physician, before
S RAPHY2=$P(RASTRING,"/",7) ; ien 200 requesting physician, after
S RAPMOD1=$P(RASTRING,"/",8) ;string of proc mod iens, before
S RAPMOD2=$P(RASTRING,"/",9) ;string of proc mod iens, after
;
S RAPNAM=$$GET1^DIQ(70,+RADFN,.01) S:RAPNAM="" RAPNAM="UNKNOWN"
S RAPSSN=$$GET1^DIQ(70,+RADFN,.09) S:RAPSSN="" RAPSSN="UNKNOWN"
D EN^DDIOL("Imaging Exam For "_$E(RAPNAM,1,30)_" ("_RAPSSN_") Changed:",,"!!?4")
;
S RACMU=$S(+$O(^RADPT(RADFN,"DT",RADTI,"P",RACNI,"CM",0))>0:" (CM w/exam)",1:"")
I 'RAPROC2,RAPROC1 D
.S RAPRFR=$E($$GET1^DIQ(71,+RAPROC1,.01),1,50) S:RAPRFR="" RAPRFR="UNKNOWN"
.S RAPRFR=RAPRFR_RACMU D EN^DDIOL("For procedure "_RAPRFR_RACMU,,"!?4")
.D EN^DDIOL(" ",,"!")
.Q
I RAPROC2 D
.S RAPRFR=$E($$GET1^DIQ(71,+RAPROC1,.01),1,53) S:RAPRFR="" RAPRFR="UNKNOWN"
.S RAPRTO=$E($$GET1^DIQ(71,+RAPROC2,.01),1,53) S:RAPRTO="" RAPRTO="UNKNOWN"
.D EN^DDIOL("Procedure changed",,"!?4")
.D EN^DDIOL("From: "_RAPRFR,,"!?8")
.D EN^DDIOL("To: "_RAPRTO_RACMU,,"!?8")
.Q
I RAPHY2 D
.S RAPHYFR=$$GET1^DIQ(200,RAPHY1,.01) S:RAPHYFR="" RAPHYFR="UNKNOWN"
.S RAPHYTO=$$GET1^DIQ(200,RAPHY2,.01) S:RAPHYTO="" RAPHYTO="UNKNOWN"
.D EN^DDIOL("Requesting Physician changed",,"!?4")
.D EN^DDIOL("From: "_RAPHYFR,,"!?8")
.D EN^DDIOL("To: "_RAPHYTO,,"!?8")
.Q
I RAPMOD2!('(RAPMOD2)&(RAPMOD1)) D
.D EN^DDIOL("Procedure Modifier changed",,"!?4")
.S RASTR=""
.F I=1:1:($L(RAPMOD1)/2) S J=$P(RAPMOD1,",",I) Q:J="" S RASTR=RASTR_$$GET1^DIQ(71.2,J,.01)_", " Q:$L(RASTR)>240
.S RASTR=$E(RASTR,1,$L(RASTR)-2) ;rid trailing comma
.D EN^DDIOL("From: "_RASTR,,"!?8")
.S RASTR=""
.F I=1:1:($L(RAPMOD2)/2) S J=$P(RAPMOD2,",",I) Q:J="" S RASTR=RASTR_$$GET1^DIQ(71.2,J,.01)_", " Q:$L(RASTR)>240
.S RASTR=$E(RASTR,1,$L(RASTR)-2) ;rid trailing comma
.D EN^DDIOL("To: "_RASTR,,"!?8")
.Q
Q
;
SETNOTIF(RAIEN751) ; called by RAO7XX if patch OR*3.0*112 is installed
;so that the CPRS notification system can be used to set the alert
Q:'$D(RASTRING)
;RASTRING is : dfn^invdt^caseien^befproc^aftproc^befphy^aftphy
; ^befpmodA,pmodF,etc^aftpmodF,pmodH,etc
N RAREQPHY
S:+$P(RASTRING,"/",6) RAREQPHY(+$P(RASTRING,"/",6))=""
S:+$P(RASTRING,"/",7) RAREQPHY(+$P(RASTRING,"/",7))=""
S RAMSG="Imaging Exam Changed: "_$S($P(RASTRING,"/",5):"Proc., ",1:"")_$S($P(RASTRING,"/",7):"Rqstr, ",1:"")_$S($L($P(RASTRING,"/",8,9))>1:"Proc Mod",1:"")
S:$E(RAMSG,$L(RAMSG)-1)="," RAMSG=$E(RAMSG,1,($L(RAMSG)-2))
D EN^ORB3(67,+RASTRING,RAIEN751,.RAREQPHY,RAMSG,RASTRING)
;ORN mustbe 67,dfn,ienfile75.1,reqphys,messagetitle,string for api
Q
RAO7PC4 ;HISC/SWM-utilities ;11/19/01 10:23
+1 ;;5.0;Radiology/Nuclear Medicine;**28,32,31,45,77**;Mar 16, 1998;Build 7
+2 ;08/10/2006 BAY/KAM Remedy Call 134839 Subscript Error
+3 QUIT
EN1 ; api for CPRS notification alert #67
+1 IF '$DATA(XQADATA)
QUIT
+2 ; set up ^TMP nodes
DO SET1
+3 ; convert and display ^TMP nodes
DO DISP1
+4 ; kill ^TMP nodes
DO KIL1
+5 QUIT
SET1 NEW RADFN,RADTI,RACNI,RAPROC1,RAPROC2,RAPHY1,RAPHY2,RAPMOD1,RAPMOD2,RAACNT
+1 NEW RAPATNAM,RASSN,RASTR,I,J,RACMU
+2 ; 08/10/2006 BAY/KAM Remedy Call 134839/RA*5*77 - Added next line
+3 IF $GET(XQADATA)=""
QUIT
+4 ; ien patient
SET RADFN=$PIECE(XQADATA,"/")
+5 ; counter
SET RAACNT=0
+6 ; inverse date of exam
SET RADTI=$PIECE(XQADATA,"/",2)
+7 ; ien case
SET RACNI=$PIECE(XQADATA,"/",3)
+8 ; ien 71, before
SET RAPROC1=$PIECE(XQADATA,"/",4)
+9 ; ien 71, after
SET RAPROC2=$PIECE(XQADATA,"/",5)
+10 ; ien 200 requesting physician, before
SET RAPHY1=$PIECE(XQADATA,"/",6)
+11 ; ien 200 requesting physician, after
SET RAPHY2=$PIECE(XQADATA,"/",7)
+12 ;string of proc mod iens, before
SET RAPMOD1=$PIECE(XQADATA,"/",8)
+13 ;string of proc mod iens, after
SET RAPMOD2=$PIECE(XQADATA,"/",9)
+14 KILL ^TMP($JOB,"RAE4")
+15 IF '$DATA(^DPT(RADFN,0))
QUIT
+16 SET RAPATNAM=$PIECE(^DPT(RADFN,0),"^")
SET RASSN=$$SSN^RAUTL()
IF RASSN=""
SET RASSN="Unkn"
+17 SET RACMU=$SELECT(+$ORDER(^RADPT(RADFN,"DT",RADTI,"P",RACNI,"CM",0))>0:" (CM w/exam)",1:"")
+18 SET ^TMP($JOB,"RAE4",1)="Imaging Exam for "_RAPATNAM_" ("_RASSN_") changed:"
+19 IF 'RAPROC2
IF RAPROC1
Begin DoDot:1
+20 SET ^TMP($JOB,"RAE4",$$INCR^RAUTL4(RAACNT))=" "
+21 SET ^TMP($JOB,"RAE4",$$INCR^RAUTL4(RAACNT))="For procedure "_$EXTRACT($PIECE(^RAMIS(71,RAPROC1,0),"^"),1,53)_RACMU
+22 SET ^TMP($JOB,"RAE4",$$INCR^RAUTL4(RAACNT))=" "
End DoDot:1
+23 IF RAPROC2
Begin DoDot:1
+24 SET ^TMP($JOB,"RAE4",$$INCR^RAUTL4(RAACNT))=" Procedure changed"
+25 SET ^TMP($JOB,"RAE4",$$INCR^RAUTL4(RAACNT))=" From: "_$EXTRACT($PIECE(^RAMIS(71,RAPROC1,0),"^"),1,53)
+26 SET ^TMP($JOB,"RAE4",$$INCR^RAUTL4(RAACNT))=" To: "_$EXTRACT($PIECE(^RAMIS(71,RAPROC2,0),"^"),1,53)_RACMU
+27 SET ^TMP($JOB,"RAE4",$$INCR^RAUTL4(RAACNT))=""
End DoDot:1
+28 IF RAPHY2
Begin DoDot:1
+29 SET ^TMP($JOB,"RAE4",$$INCR^RAUTL4(RAACNT))=" Requesting Physician changed"
+30 SET ^TMP($JOB,"RAE4",$$INCR^RAUTL4(RAACNT))=" From: "_$$GET1^DIQ(200,RAPHY1,.01)
+31 SET ^TMP($JOB,"RAE4",$$INCR^RAUTL4(RAACNT))=" To: "_$$GET1^DIQ(200,RAPHY2,.01)
End DoDot:1
+32 IF RAPMOD2!(('RAPMOD2)&(RAPMOD1))
Begin DoDot:1
+33 SET ^TMP($JOB,"RAE4",$$INCR^RAUTL4(RAACNT))=" Procedure Modifier changed"
+34 SET RASTR=""
+35 FOR I=1:1:($LENGTH(RAPMOD1)/2)
SET J=$PIECE(RAPMOD1,",",I)
IF J=""
QUIT
SET RASTR=RASTR_$$GET1^DIQ(71.2,J,.01)_", "
IF $LENGTH(RASTR)>240
QUIT
+36 ;rid trailing comma and blank
SET RASTR=$EXTRACT(RASTR,1,$LENGTH(RASTR)-2)
+37 SET ^TMP($JOB,"RAE4",$$INCR^RAUTL4(RAACNT))=" From: "_RASTR
+38 SET RASTR=""
+39 FOR I=1:1:($LENGTH(RAPMOD2)/2)
SET J=$PIECE(RAPMOD2,",",I)
IF J=""
QUIT
SET RASTR=RASTR_$$GET1^DIQ(71.2,J,.01)_", "
IF $LENGTH(RASTR)>240
QUIT
+40 ;rid trailing comma
SET RASTR=$EXTRACT(RASTR,1,$LENGTH(RASTR)-2)
+41 SET ^TMP($JOB,"RAE4",$$INCR^RAUTL4(RAACNT))=" To: "_RASTR
End DoDot:1
+42 QUIT
DISP1 NEW RARRAY
+1 MERGE RARRAY=^TMP($JOB,"RAE4")
+2 DO EN^DDIOL(.RARRAY)
+3 QUIT
KIL1 KILL ^TMP($JOB,"RAE4")
+1 QUIT
+2 ;
SETALERT ;
+1 IF '$DATA(RASTRING)
QUIT
+2 NEW RAPHY1,RAPHY2,RAPNAM,RAPSSN
+3 ; ien patient
SET RADFN=$PIECE(RASTRING,"/")
+4 SET RAPNAM=$$GET1^DIQ(70,+RADFN,.01)
IF RAPNAM=""
SET RAPNAM="UNKNOWN"
+5 SET RAPSSN=$$GET1^DIQ(70,+RADFN,.09)
IF RAPSSN=""
SET RAPSSN="UNKNOWN"
+6 ; ien 200 requesting physician, before
SET RAPHY1=$PIECE(RASTRING,"/",6)
+7 ; ien 200 requesting physician, after
SET RAPHY2=$PIECE(RASTRING,"/",7)
+8 ;
+9 SET XQA(RAPHY1)=""
SET XQAID=$JOB_","_$HOROLOG
IF $GET(RAPHY2)]""
SET XQA(RAPHY2)=""
+10 SET XQAMSG=$EXTRACT(RAPNAM,1,9)_" ("_$EXTRACT(RAPNAM,1)_$EXTRACT(RAPSSN,6,9)_"): Imaging Exam Changed: "_$SELECT($PIECE(RASTRING,"/",5):"Proc., ",1:"")_$SELECT($PIECE(RASTRING,"/",7):"Rqstr, ",1:"")_$SELECT($PIECE(RASTRING,"/",9):"Proc Mod",1:"
")
+11 IF $EXTRACT(XQAMSG,($LENGTH(XQAMSG)-1))=","
SET XQAMSG=$EXTRACT(XQAMSG,1,($LENGTH(XQAMSG)-2))
+12 SET XQADATA=RASTRING
+13 SET XQAROU="ZZ^RAO7PC4(XQADATA)"
+14 DO SETUP^XQALERT
+15 QUIT
+16 ;
ZZ(RASTRING) ; Additional text for display when processing alert.
+1 ;
+2 NEW RADFN,RADTI,RACMU,RACNI,RAPROC1,RAPROC2,RAPHY1,RAPHY2,RAPMOD1,RAPMOD2
+3 NEW RAPNAM,RAPSSN,I,RAPRFR,RAPRTO,RAPHYFR,RAPHYTO,RASTR
+4 ; ien patient
SET RADFN=$PIECE(RASTRING,"/")
+5 ; inverse date of exam
SET RADTI=$PIECE(RASTRING,"/",2)
+6 ; ien case
SET RACNI=$PIECE(RASTRING,"/",3)
+7 ; ien 71, before
SET RAPROC1=$PIECE(RASTRING,"/",4)
+8 ; ien 71, after
SET RAPROC2=$PIECE(RASTRING,"/",5)
+9 ; ien 200 requesting physician, before
SET RAPHY1=$PIECE(RASTRING,"/",6)
+10 ; ien 200 requesting physician, after
SET RAPHY2=$PIECE(RASTRING,"/",7)
+11 ;string of proc mod iens, before
SET RAPMOD1=$PIECE(RASTRING,"/",8)
+12 ;string of proc mod iens, after
SET RAPMOD2=$PIECE(RASTRING,"/",9)
+13 ;
+14 SET RAPNAM=$$GET1^DIQ(70,+RADFN,.01)
IF RAPNAM=""
SET RAPNAM="UNKNOWN"
+15 SET RAPSSN=$$GET1^DIQ(70,+RADFN,.09)
IF RAPSSN=""
SET RAPSSN="UNKNOWN"
+16 DO EN^DDIOL("Imaging Exam For "_$EXTRACT(RAPNAM,1,30)_" ("_RAPSSN_") Changed:",,"!!?4")
+17 ;
+18 SET RACMU=$SELECT(+$ORDER(^RADPT(RADFN,"DT",RADTI,"P",RACNI,"CM",0))>0:" (CM w/exam)",1:"")
+19 IF 'RAPROC2
IF RAPROC1
Begin DoDot:1
+20 SET RAPRFR=$EXTRACT($$GET1^DIQ(71,+RAPROC1,.01),1,50)
IF RAPRFR=""
SET RAPRFR="UNKNOWN"
+21 SET RAPRFR=RAPRFR_RACMU
DO EN^DDIOL("For procedure "_RAPRFR_RACMU,,"!?4")
+22 DO EN^DDIOL(" ",,"!")
+23 QUIT
End DoDot:1
+24 IF RAPROC2
Begin DoDot:1
+25 SET RAPRFR=$EXTRACT($$GET1^DIQ(71,+RAPROC1,.01),1,53)
IF RAPRFR=""
SET RAPRFR="UNKNOWN"
+26 SET RAPRTO=$EXTRACT($$GET1^DIQ(71,+RAPROC2,.01),1,53)
IF RAPRTO=""
SET RAPRTO="UNKNOWN"
+27 DO EN^DDIOL("Procedure changed",,"!?4")
+28 DO EN^DDIOL("From: "_RAPRFR,,"!?8")
+29 DO EN^DDIOL("To: "_RAPRTO_RACMU,,"!?8")
+30 QUIT
End DoDot:1
+31 IF RAPHY2
Begin DoDot:1
+32 SET RAPHYFR=$$GET1^DIQ(200,RAPHY1,.01)
IF RAPHYFR=""
SET RAPHYFR="UNKNOWN"
+33 SET RAPHYTO=$$GET1^DIQ(200,RAPHY2,.01)
IF RAPHYTO=""
SET RAPHYTO="UNKNOWN"
+34 DO EN^DDIOL("Requesting Physician changed",,"!?4")
+35 DO EN^DDIOL("From: "_RAPHYFR,,"!?8")
+36 DO EN^DDIOL("To: "_RAPHYTO,,"!?8")
+37 QUIT
End DoDot:1
+38 IF RAPMOD2!('(RAPMOD2)&(RAPMOD1))
Begin DoDot:1
+39 DO EN^DDIOL("Procedure Modifier changed",,"!?4")
+40 SET RASTR=""
+41 FOR I=1:1:($LENGTH(RAPMOD1)/2)
SET J=$PIECE(RAPMOD1,",",I)
IF J=""
QUIT
SET RASTR=RASTR_$$GET1^DIQ(71.2,J,.01)_", "
IF $LENGTH(RASTR)>240
QUIT
+42 ;rid trailing comma
SET RASTR=$EXTRACT(RASTR,1,$LENGTH(RASTR)-2)
+43 DO EN^DDIOL("From: "_RASTR,,"!?8")
+44 SET RASTR=""
+45 FOR I=1:1:($LENGTH(RAPMOD2)/2)
SET J=$PIECE(RAPMOD2,",",I)
IF J=""
QUIT
SET RASTR=RASTR_$$GET1^DIQ(71.2,J,.01)_", "
IF $LENGTH(RASTR)>240
QUIT
+46 ;rid trailing comma
SET RASTR=$EXTRACT(RASTR,1,$LENGTH(RASTR)-2)
+47 DO EN^DDIOL("To: "_RASTR,,"!?8")
+48 QUIT
End DoDot:1
+49 QUIT
+50 ;
SETNOTIF(RAIEN751) ; called by RAO7XX if patch OR*3.0*112 is installed
+1 ;so that the CPRS notification system can be used to set the alert
+2 IF '$DATA(RASTRING)
QUIT
+3 ;RASTRING is : dfn^invdt^caseien^befproc^aftproc^befphy^aftphy
+4 ; ^befpmodA,pmodF,etc^aftpmodF,pmodH,etc
+5 NEW RAREQPHY
+6 IF +$PIECE(RASTRING,"/",6)
SET RAREQPHY(+$PIECE(RASTRING,"/",6))=""
+7 IF +$PIECE(RASTRING,"/",7)
SET RAREQPHY(+$PIECE(RASTRING,"/",7))=""
+8 SET RAMSG="Imaging Exam Changed: "_$SELECT($PIECE(RASTRING,"/",5):"Proc., ",1:"")_$SELECT($PIECE(RASTRING,"/",7):"Rqstr, ",1:"")_$SELECT($LENGTH($PIECE(RASTRING,"/",8,9))>1:"Proc Mod",1:"")
+9 IF $EXTRACT(RAMSG,$LENGTH(RAMSG)-1)=","
SET RAMSG=$EXTRACT(RAMSG,1,($LENGTH(RAMSG)-2))
+10 DO EN^ORB3(67,+RASTRING,RAIEN751,.RAREQPHY,RAMSG,RASTRING)
+11 ;ORN mustbe 67,dfn,ienfile75.1,reqphys,messagetitle,string for api
+12 QUIT