source: WorldVistAEHR/trunk/r/ZZREGIONAL-A1C-A5C-CRHD-RGED-RGUT-RGWB-RG/RGRSBUL1.m@ 1407

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

revised back to 6/30/08 version

File size: 5.7 KB
Line 
1RGRSBUL1 ;ALB/RJS,CML-RGRSTEXT BULLETIN ROUTINE (PART 2) ;07/24/98
2 ;;1.0;CLINICAL INFO RESOURCE NETWORK;**1,3,19**;30 Apr 99
3SSNBULL(DFN,ARRAY,NAME,SSN,ICN,CMOR) ;
4 ;Entry point generates a bulletin to the RG CIRN DEMOGRAPHIC
5 ;ISSUES mail group about an SSN change for a given patient.
6 ;
7 ;Input: Required Variables
8 ;
9 ; DFN - IEN in the PATIENT file (#2)
10 ; ARRAY - Array of data containing sending sites station number
11 ; NAME - Patient's Name
12 ; SSN - Patient's SSN
13 ; ICN - Patient's ICN (Integration Control Number)
14 ; CMOR - Patient's CMOR (Coordinating Master of Record)
15 ;
16 Q:$G(DFN)=""!($G(ARRAY)="")
17 N LOCDATA,RGRSTEXT,INDEX,COUNTER
18 S RGRSTEXT(1)="The MPI/PD Package has received an SSN change from:"
19 S RGRSTEXT(2)=$$INST(@ARRAY@("SENDING SITE"))
20 S RGRSTEXT(3)=" "
21 S RGRSTEXT(4)="This change has been made in your local data base for:"
22 S RGRSTEXT(5)=NAME
23 S RGRSTEXT(6)=" "
24 S RGRSTEXT(7)="=> Local "_$P($$SITE^VASITE(),"^",2)_" data PRIOR to update:"
25 S RGRSTEXT(8)="NAME: "_NAME
26 S RGRSTEXT(9)="SSN: "_SSN
27 S RGRSTEXT(10)="ICN: "_ICN
28 S RGRSTEXT(11)="CMOR: "_CMOR
29 S RGRSTEXT(12)="--------------------------------------------------------"
30 S RGRSTEXT(13)="=> Update received from "_$P($$INST(@ARRAY@("SENDING SITE"))," -->")_":"
31 S RGRSTEXT(14)="SSN: "_@ARRAY@("SSN")
32 D BULL2^RGRSBULL("MPI/PD SSN CHANGE - "_NAME,"RGRSTEXT(")
33 Q
34 ;
35NOT2(ARRAY) ;
36 ;Entry point generates a bulletin to the RG CIRN DEMOGRAPHIC
37 ;ISSUES mail group about invalid subscription information for a given
38 ;patient.
39 ;
40 ;Input: Required Variables
41 ;
42 ; ARRAY - Array of information regarding the invalid subscription
43 ;
44 Q:($G(ARRAY)="")
45 N RGRSTEXT,INDEX,COUNTER
46 S RGRSTEXT(1)="The MPI/PD Package has received a message from:"
47 S RGRSTEXT(2)=$$INST(@ARRAY@("SENDING SITE"))
48 S RGRSTEXT(3)="This patient has your station as a subscriber, however"
49 S RGRSTEXT(4)="the patient was not found in your database."
50 S RGRSTEXT(5)="--------------------------------------------------------"
51 S RGRSTEXT(6)="Remote Data"
52 S RGRSTEXT(7)=" "
53 S INDEX=0,COUNTER=8
54 F S INDEX=$O(@ARRAY@("MESSAGE",INDEX)) Q:INDEX']"" D
55 . S RGRSTEXT(COUNTER)=@ARRAY@("MESSAGE",INDEX)
56 . S COUNTER=COUNTER+1
57 D BULL2^RGRSBULL("MPI/PD - PATIENT NOT FOUND","RGRSTEXT(")
58 Q
59 ;
60SENSTIVE(DFN,ARRAY,NAME) ;FIRES WHEN PT. IS FLAGGED AS SENSITIVE AT ANOTHER SITE
61 ;Entry point generates a bulletin to the RG CIRN DEMOGRAPHIC
62 ;ISSUES mail group when a given patient is flagged as sensitive at
63 ;another site.
64 ;
65 ;Input: Required Variables
66 ;
67 ; DFN - IEN in the PATIENT file (#2)
68 ; ARRAY - Array of data containing sending sites station number and SSN
69 ; NAME - Patient's name
70 ; CMOR - Coordinating Master of Record
71 ;
72 Q:($G(ARRAY)="")!($G(DFN)="")
73 N RGRSTEXT,INDEX,COUNTER,CMOR
74 S CMOR=$$CMOR2^MPIF001(DFN) I $P(CMOR,"^")<0 S CMOR="not assigned"
75 S RGRSTEXT(1)="The MPI/PD Package has received a message from:"
76 S RGRSTEXT(2)=$$INST(@ARRAY@("SENDING SITE"))
77 S RGRSTEXT(3)=" "
78 S RGRSTEXT(4)="This message indicates that patient "_NAME_" is flagged"
79 S RGRSTEXT(5)="as Sensitive at the other facility but is not flagged as"
80 S RGRSTEXT(6)="Sensitive at your facility."
81 S RGRSTEXT(7)=" "
82 S RGRSTEXT(8)="Remote Patient SSN: "_$S(@ARRAY@("SSN")="":"Not Available",1:@ARRAY@("SSN"))
83 S RGRSTEXT(9)="Remote User who Flagged the Patient as Sensitive: "_@ARRAY@("SENSITIVITY USER")
84 S RGRSTEXT(10)="Date/Time Remote User Flagged Patient Sensitive: "_$$FMTE^XLFDT(@ARRAY@("SENSITIVITY DATE"))
85 S RGRSTEXT(11)=" "
86 S RGRSTEXT(12)="CMOR Site: "_CMOR
87 D BULL2^RGRSBULL("Remote Sensitivity Indicated","RGRSTEXT(")
88 Q
89 ;
90RMTDOD(DFN,ARRAY,NAME,RDOD,LDOD) ;Fires when patient has a Date of Death at another site
91 ;Entry point generates a bulletin to the RG CIRN DEMOGRAPHIC
92 ;ISSUES mail group when a given patient has a Date of Death at
93 ;another site.
94 ;
95 ;Input: Required Variables
96 ;
97 ; DFN - IEN in the PATIENT file (#2)
98 ; ARRAY - Array of data containing sending sites station number and SSN
99 ; NAME - Patient's name
100 ; RDOD - Date of Death at remote site
101 ; LDOD - Date of Death at local site
102 ; CMOR - Coordinating Master of Record
103 ;
104 Q:($G(ARRAY)="")!($G(DFN)="")
105 Q:(RDOD=LDOD) ;If remote DOD and local DOD same, QUIT
106 N CMOR
107 S CMOR=$$CMOR2^MPIF001(DFN) I $P(CMOR,"^")<0 S CMOR="not assigned"
108 N RGRSTEXT
109 S RGRSTEXT(1)="The MPI/PD Package has received a message from:"
110 S RGRSTEXT(2)=$$INST(@ARRAY@("SENDING SITE"))
111 S RGRSTEXT(3)=" "
112 S RGRSTEXT(4)="This message indicates that patient "_NAME
113 I 'LDOD S RGRSTEXT(5)="has a date of death at the other facility but not at your facility." G RMTMSG
114 I LDOD,(LDOD'=RDOD) S RGRSTEXT(5)="has a different date of death at the other facility than at your facility."
115RMTMSG S RGRSTEXT(6)=" "
116 S RGRSTEXT(7)="Remote Patient SSN: "_$S(@ARRAY@("SSN")="":"Not Available",1:@ARRAY@("SSN"))
117 S RGRSTEXT(8)="Date of Death from other facility: "_$$FMTE^XLFDT(RDOD)
118 I LDOD,(LDOD'=RDOD) S RGRSTEXT(9)="Date of Death at your facility: "_$$FMTE^XLFDT(LDOD)
119 S RGRSTEXT(10)=" "
120 S RGRSTEXT(11)="CMOR site: "_CMOR
121 D BULL2^RGRSBULL("Remote Date of Death Indicated","RGRSTEXT(")
122 Q
123 ;
124INST(SITENUM) ;
125 N RETURN,IEN,DATA,NAME,NUMBER
126 S RETURN=""
127 Q:$G(SITENUM)="" RETURN
128 S IEN=$$LKUP^XUAF4(SITENUM)
129 I IEN>0 S DATA=$$NS^XUAF4(IEN)
130 I $G(DATA)]"" D
131 . S NAME=$P(DATA,"^",1),NUMBER=$P(DATA,"^",2)
132 . S RETURN=NAME_" --> Site Number: "_NUMBER
133 Q RETURN
134 ;
135FORMAT(DATA1,DATA2) ;
136 N SPACES,SPACENUM,LENGTH1,LENGTH2,RETURN
137 S SPACES=" "
138 S LENGTH1=$L(DATA1),LENGTH2=$L(DATA2)
139 I LENGTH1>23 S DATA1=$E(DATA1,1,23) S LENGTH1=23
140 I LENGTH2>22 S DATA2=$E(DATA2,1,22)
141 S SPACENUM=23-LENGTH1
142 S SPACES=$E(SPACES,1,SPACENUM)
143 S RETURN=DATA1_SPACES_" "_DATA2
144 Q $G(RETURN)
145 ;
146FREE(DATA) ;
147 Q:$G(DATA)="" ""
148 Q:$G(DATA)["@" ""
149 Q:$G(DATA)=HL("Q") ""
150 Q $G(DATA)
Note: See TracBrowser for help on using the repository browser.