source: FOIAVistA/trunk/r/RADIOLOGY_NUCLEAR_MEDICINE-RA/RAO7PC4.m@ 1683

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

initial load of FOIAVistA 6/30/08 version

File size: 6.4 KB
Line 
1RAO7PC4 ;HISC/SWM-utilities ;11/19/01 10:23
2 ;;5.0;Radiology/Nuclear Medicine;**28,32,31,45,77**;Mar 16, 1998;Build 7
3 ;08/10/2006 BAY/KAM Remedy Call 134839 Subscript Error
4 Q
5EN1 ; api for CPRS notification alert #67
6 Q:'$D(XQADATA)
7 D SET1 ; set up ^TMP nodes
8 D DISP1 ; convert and display ^TMP nodes
9 D KIL1 ; kill ^TMP nodes
10 Q
11SET1 N RADFN,RADTI,RACNI,RAPROC1,RAPROC2,RAPHY1,RAPHY2,RAPMOD1,RAPMOD2,RAACNT
12 N RAPATNAM,RASSN,RASTR,I,J,RACMU
13 ; 08/10/2006 BAY/KAM Remedy Call 134839/RA*5*77 - Added next line
14 Q:$G(XQADATA)=""
15 S RADFN=$P(XQADATA,"/") ; ien patient
16 S RAACNT=0 ; counter
17 S RADTI=$P(XQADATA,"/",2) ; inverse date of exam
18 S RACNI=$P(XQADATA,"/",3) ; ien case
19 S RAPROC1=$P(XQADATA,"/",4) ; ien 71, before
20 S RAPROC2=$P(XQADATA,"/",5) ; ien 71, after
21 S RAPHY1=$P(XQADATA,"/",6) ; ien 200 requesting physician, before
22 S RAPHY2=$P(XQADATA,"/",7) ; ien 200 requesting physician, after
23 S RAPMOD1=$P(XQADATA,"/",8) ;string of proc mod iens, before
24 S RAPMOD2=$P(XQADATA,"/",9) ;string of proc mod iens, after
25 K ^TMP($J,"RAE4")
26 Q:'$D(^DPT(RADFN,0))
27 S RAPATNAM=$P(^DPT(RADFN,0),"^") S RASSN=$$SSN^RAUTL() S:RASSN="" RASSN="Unkn"
28 S RACMU=$S(+$O(^RADPT(RADFN,"DT",RADTI,"P",RACNI,"CM",0))>0:" (CM w/exam)",1:"")
29 S ^TMP($J,"RAE4",1)="Imaging Exam for "_RAPATNAM_" ("_RASSN_") changed:"
30 I 'RAPROC2,RAPROC1 D
31 .S ^TMP($J,"RAE4",$$INCR^RAUTL4(RAACNT))=" "
32 .S ^TMP($J,"RAE4",$$INCR^RAUTL4(RAACNT))="For procedure "_$E($P(^RAMIS(71,RAPROC1,0),"^"),1,53)_RACMU
33 .S ^TMP($J,"RAE4",$$INCR^RAUTL4(RAACNT))=" "
34 I RAPROC2 D
35 .S ^TMP($J,"RAE4",$$INCR^RAUTL4(RAACNT))=" Procedure changed"
36 .S ^TMP($J,"RAE4",$$INCR^RAUTL4(RAACNT))=" From: "_$E($P(^RAMIS(71,RAPROC1,0),"^"),1,53)
37 .S ^TMP($J,"RAE4",$$INCR^RAUTL4(RAACNT))=" To: "_$E($P(^RAMIS(71,RAPROC2,0),"^"),1,53)_RACMU
38 .S ^TMP($J,"RAE4",$$INCR^RAUTL4(RAACNT))=""
39 I RAPHY2 D
40 .S ^TMP($J,"RAE4",$$INCR^RAUTL4(RAACNT))=" Requesting Physician changed"
41 .S ^TMP($J,"RAE4",$$INCR^RAUTL4(RAACNT))=" From: "_$$GET1^DIQ(200,RAPHY1,.01)
42 .S ^TMP($J,"RAE4",$$INCR^RAUTL4(RAACNT))=" To: "_$$GET1^DIQ(200,RAPHY2,.01)
43 I RAPMOD2!(('RAPMOD2)&(RAPMOD1)) D
44 .S ^TMP($J,"RAE4",$$INCR^RAUTL4(RAACNT))=" Procedure Modifier changed"
45 .S RASTR=""
46 .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
47 .S RASTR=$E(RASTR,1,$L(RASTR)-2) ;rid trailing comma and blank
48 .S ^TMP($J,"RAE4",$$INCR^RAUTL4(RAACNT))=" From: "_RASTR
49 .S RASTR=""
50 .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
51 .S RASTR=$E(RASTR,1,$L(RASTR)-2) ;rid trailing comma
52 .S ^TMP($J,"RAE4",$$INCR^RAUTL4(RAACNT))=" To: "_RASTR
53 Q
54DISP1 N RARRAY
55 MERGE RARRAY=^TMP($J,"RAE4")
56 D EN^DDIOL(.RARRAY)
57 Q
58KIL1 K ^TMP($J,"RAE4")
59 Q
60 ;
61SETALERT ;
62 Q:'$D(RASTRING)
63 N RAPHY1,RAPHY2,RAPNAM,RAPSSN
64 S RADFN=$P(RASTRING,"/") ; ien patient
65 S RAPNAM=$$GET1^DIQ(70,+RADFN,.01) S:RAPNAM="" RAPNAM="UNKNOWN"
66 S RAPSSN=$$GET1^DIQ(70,+RADFN,.09) S:RAPSSN="" RAPSSN="UNKNOWN"
67 S RAPHY1=$P(RASTRING,"/",6) ; ien 200 requesting physician, before
68 S RAPHY2=$P(RASTRING,"/",7) ; ien 200 requesting physician, after
69 ;
70 S XQA(RAPHY1)="",XQAID=$J_","_$H S:$G(RAPHY2)]"" XQA(RAPHY2)=""
71 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:"")
72 S:$E(XQAMSG,($L(XQAMSG)-1))="," XQAMSG=$E(XQAMSG,1,($L(XQAMSG)-2))
73 S XQADATA=RASTRING
74 S XQAROU="ZZ^RAO7PC4(XQADATA)"
75 D SETUP^XQALERT
76 Q
77 ;
78ZZ(RASTRING) ; Additional text for display when processing alert.
79 ;
80 N RADFN,RADTI,RACMU,RACNI,RAPROC1,RAPROC2,RAPHY1,RAPHY2,RAPMOD1,RAPMOD2
81 N RAPNAM,RAPSSN,I,RAPRFR,RAPRTO,RAPHYFR,RAPHYTO,RASTR
82 S RADFN=$P(RASTRING,"/") ; ien patient
83 S RADTI=$P(RASTRING,"/",2) ; inverse date of exam
84 S RACNI=$P(RASTRING,"/",3) ; ien case
85 S RAPROC1=$P(RASTRING,"/",4) ; ien 71, before
86 S RAPROC2=$P(RASTRING,"/",5) ; ien 71, after
87 S RAPHY1=$P(RASTRING,"/",6) ; ien 200 requesting physician, before
88 S RAPHY2=$P(RASTRING,"/",7) ; ien 200 requesting physician, after
89 S RAPMOD1=$P(RASTRING,"/",8) ;string of proc mod iens, before
90 S RAPMOD2=$P(RASTRING,"/",9) ;string of proc mod iens, after
91 ;
92 S RAPNAM=$$GET1^DIQ(70,+RADFN,.01) S:RAPNAM="" RAPNAM="UNKNOWN"
93 S RAPSSN=$$GET1^DIQ(70,+RADFN,.09) S:RAPSSN="" RAPSSN="UNKNOWN"
94 D EN^DDIOL("Imaging Exam For "_$E(RAPNAM,1,30)_" ("_RAPSSN_") Changed:",,"!!?4")
95 ;
96 S RACMU=$S(+$O(^RADPT(RADFN,"DT",RADTI,"P",RACNI,"CM",0))>0:" (CM w/exam)",1:"")
97 I 'RAPROC2,RAPROC1 D
98 .S RAPRFR=$E($$GET1^DIQ(71,+RAPROC1,.01),1,50) S:RAPRFR="" RAPRFR="UNKNOWN"
99 .S RAPRFR=RAPRFR_RACMU D EN^DDIOL("For procedure "_RAPRFR_RACMU,,"!?4")
100 .D EN^DDIOL(" ",,"!")
101 .Q
102 I RAPROC2 D
103 .S RAPRFR=$E($$GET1^DIQ(71,+RAPROC1,.01),1,53) S:RAPRFR="" RAPRFR="UNKNOWN"
104 .S RAPRTO=$E($$GET1^DIQ(71,+RAPROC2,.01),1,53) S:RAPRTO="" RAPRTO="UNKNOWN"
105 .D EN^DDIOL("Procedure changed",,"!?4")
106 .D EN^DDIOL("From: "_RAPRFR,,"!?8")
107 .D EN^DDIOL("To: "_RAPRTO_RACMU,,"!?8")
108 .Q
109 I RAPHY2 D
110 .S RAPHYFR=$$GET1^DIQ(200,RAPHY1,.01) S:RAPHYFR="" RAPHYFR="UNKNOWN"
111 .S RAPHYTO=$$GET1^DIQ(200,RAPHY2,.01) S:RAPHYTO="" RAPHYTO="UNKNOWN"
112 .D EN^DDIOL("Requesting Physician changed",,"!?4")
113 .D EN^DDIOL("From: "_RAPHYFR,,"!?8")
114 .D EN^DDIOL("To: "_RAPHYTO,,"!?8")
115 .Q
116 I RAPMOD2!('(RAPMOD2)&(RAPMOD1)) D
117 .D EN^DDIOL("Procedure Modifier changed",,"!?4")
118 .S RASTR=""
119 .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
120 .S RASTR=$E(RASTR,1,$L(RASTR)-2) ;rid trailing comma
121 .D EN^DDIOL("From: "_RASTR,,"!?8")
122 .S RASTR=""
123 .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
124 .S RASTR=$E(RASTR,1,$L(RASTR)-2) ;rid trailing comma
125 .D EN^DDIOL("To: "_RASTR,,"!?8")
126 .Q
127 Q
128 ;
129SETNOTIF(RAIEN751) ; called by RAO7XX if patch OR*3.0*112 is installed
130 ;so that the CPRS notification system can be used to set the alert
131 Q:'$D(RASTRING)
132 ;RASTRING is : dfn^invdt^caseien^befproc^aftproc^befphy^aftphy
133 ; ^befpmodA,pmodF,etc^aftpmodF,pmodH,etc
134 N RAREQPHY
135 S:+$P(RASTRING,"/",6) RAREQPHY(+$P(RASTRING,"/",6))=""
136 S:+$P(RASTRING,"/",7) RAREQPHY(+$P(RASTRING,"/",7))=""
137 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:"")
138 S:$E(RAMSG,$L(RAMSG)-1)="," RAMSG=$E(RAMSG,1,($L(RAMSG)-2))
139 D EN^ORB3(67,+RASTRING,RAIEN751,.RAREQPHY,RAMSG,RASTRING)
140 ;ORN mustbe 67,dfn,ienfile75.1,reqphys,messagetitle,string for api
141 Q
Note: See TracBrowser for help on using the repository browser.