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

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

initial load of WorldVistAEHR

File size: 5.7 KB
RevLine 
[613]1RGRSBULL ;ALB/RJS,CML-RGRSTEXT BULLETIN ROUTINE ;07/24/98
2 ;;1.0;CLINICAL INFO RESOURCE NETWORK;**19**;30 Apr 99
3BULL(XMB,XMTEXT) ;
4 ;Entry point generates a bulletin when a notification
5 ;from the MPI/PD package has been generated
6 ;
7 ;Input:Required variables
8 ;
9 ; XMB - Bulletin name e.g. ("RG CIRN DEMOGRAPHIC ISSUES")
10 ; XMTEXT - global or array root (EX. "^TMP("), location of
11 ; error message(s)
12 ;
13 ;If XMY is defined, the call to ^XMB will process accordingly.
14 ;XMY is used to pass additional recipients.
15 ;
16 Q:$G(XMB)=""!($G(XMTEXT)="")
17 D NOW^%DTC S XMDT=X K X
18 S XMDUZ="MPI/PD PACKAGE"
19 D ^XMB
20 K XMDT,XMDUZ
21 Q
22BULL2(XMSUB,XMTEXT) ;
23 N XMY,XMDUZ
24 S XMY("G.RG CIRN DEMOGRAPHIC ISSUES")=""
25 S XMDUZ="MPI/PD PACKAGE"
26 D ^XMD
27 Q
28 ;
29ADDRESS(DFN,NAME,LINE1,LINE2,LINE3,SENDSITE,CITY,COUNTY,STATE,ZIP) ;
30 ;Entry point generates a bulletin to the RG CIRN DEMOGRAPHIC
31 ;ISSUES mail group about changes to the address of a given patient.
32 ;
33 ;Input: Required Variables
34 ;
35 ; DFN - IEN in the PATIENT file (#2)
36 ; NAME - Patient's Name
37 ; LINE1,LINE2,LINE3 - Lines of the Address
38 ; SENDSITE- The station number of the site that initiated the change
39 ; CITY - city
40 ; COUNTY - county
41 ; STATE - state
42 ; ZIP - zip
43 ;
44 Q:$G(DFN)=""!($G(NAME)="")
45 Q:$G(^DPT(DFN,0))=""
46 N RGADRES,DA,DIC,DR,DIQ,ADDR1,ADDR11,ADDR2,ADDR22,ADDR3,ADDR33,LINE11,LINE22,LINE33,ADDR4,ADDR44,ADDR5,ADDR55,ADDR6,ADDR66,ADDR7,ADDR77,DELFLG
47 S DIC=2,DR=".111;.112;.113;.114;.115;.117;.1112",DA=DFN,DIQ="RGADRES",DIQ(0)="E" D EN^DIQ1
48 S ADDR1=$G(RGADRES(2,DFN,.111,"E")),ADDR2=$G(RGADRES(2,DFN,.112,"E")),ADDR3=$G(RGADRES(2,DFN,.113,"E")),ADDR4=$G(RGADRES(2,DFN,.114,"E")),ADDR5=$G(RGADRES(2,DFN,.115,"E")),ADDR6=$G(RGADRES(2,DFN,.117,"E")),ADDR7=$G(RGADRES(2,DFN,.1112,"E"))
49 ;
50 S ADDR6=$$COUNTY^RGRSPARS(ADDR5,ADDR6)
51 ;
52 ;Check for null or deleted address fields from remote site
53 ;
54 S DELFLG=0
55 ;
56 I $S(LINE1="@":1,LINE1="""@""":1,LINE1="""""":1,1:LINE1="") D
57 .I ADDR1'="" S DELFLG=1,LINE1="<<DELETED>>" Q
58 .S LINE1=""
59 ;
60 I $S(LINE2="@":1,LINE2="""@""":1,LINE2="""""":1,1:LINE2="") D
61 .I ADDR2'="" S LINE2="<<DELETED>>" Q
62 .S LINE2=""
63 ;
64 I $S(LINE3="@":1,LINE3="""@""":1,LINE3="""""":1,1:LINE3="") D
65 .I ADDR3'="" S LINE3="<<DELETED>>" Q
66 .S LINE3=""
67 ;
68 I $S(CITY="@":1,CITY="""@""":1,CITY="""""":1,1:CITY="") D
69 .I ADDR4'="" S DELFLG=1,CITY="<<DELETED>>" Q
70 .S CITY=""
71 ;
72 I $S(STATE="@":1,STATE="""@""":1,STATE="""""":1,1:STATE="") D
73 .I ADDR5'="" S DELFLG=1,STATE="<<DELETED>>" Q
74 .S STATE=""
75 ;
76 I $S(COUNTY="@":1,COUNTY="""@""":1,COUNTY="""""":1,1:COUNTY="") D
77 .I ADDR6'="" S DELFLG=1,COUNTY="<<DELETED>>" Q
78 .S COUNTY=""
79 ;
80 I $S(ZIP="@":1,ZIP="""@""":1,ZIP="""""":1,1:ZIP="") D
81 .I ADDR7'="" S DELFLG=1,ZIP="<<DELETED>>" Q
82 .S ZIP=""
83 ;
84 I DELFLG G SENDADD
85 ;
86EXITADD ;
87 Q
88SENDADD ;
89 N RGRSTEXT,XMSUB
90 S RGRSTEXT(1)="The MPI/PD Package has received a message from:"
91 S RGRSTEXT(2)=$$INST^RGRSBUL1(SENDSITE)
92 S RGRSTEXT(3)="This message deleted address information for Patient:"
93 S RGRSTEXT(4)=NAME
94 S RGRSTEXT(5)=" "
95 S RGRSTEXT(6)=" <<OLD ADDRESS>> <<NEW ADDRESS>>"
96 S RGRSTEXT(7)=" "
97 S RGRSTEXT(8)="STREET ADDRESS [LINE 1]: "_$$FORMAT^RGRSBUL1(ADDR1,LINE1)
98 S RGRSTEXT(9)="STREET ADDRESS [LINE 2]: "_$$FORMAT^RGRSBUL1(ADDR2,LINE2)
99 S RGRSTEXT(10)="STREET ADDRESS [LINE 3]: "_$$FORMAT^RGRSBUL1(ADDR3,LINE3)
100 S RGRSTEXT(11)=" CITY: "_$$FORMAT^RGRSBUL1(ADDR4,CITY)
101 S RGRSTEXT(12)=" COUNTY: "_$$FORMAT^RGRSBUL1(ADDR6,COUNTY)
102 S RGRSTEXT(13)=" STATE: "_$$FORMAT^RGRSBUL1(ADDR5,STATE)
103 S RGRSTEXT(14)=" ZIP+4: "_$$FORMAT^RGRSBUL1(ADDR7,ZIP)
104 D BULL2($P(NAME,",",1)_" **MPI/PD ADDRESS DELETION**","RGRSTEXT(")
105 G EXITADD
106 ;
107SKIPBULL(ARRAY) ;
108 ;Entry point generates a bulletin to the RG CIRN DEMOGRAPHIC
109 ;ISSUES mail group about missing required data for a given patient.
110 ;
111 ;Input: Required Variables
112 ;
113 ; ARRAY - Array of information regarding missing required data
114 ;
115 Q:'$D(@ARRAY)
116 N RGRSTEXT,INDEX,COUNTER
117 S RGRSTEXT(1)="The MPI/PD Package has received a message from:"
118 S RGRSTEXT(2)=$$INST^RGRSBUL1(@ARRAY@("SENDING SITE"))
119 S RGRSTEXT(3)="This message was missing required data"
120 S RGRSTEXT(4)=" "
121 S INDEX=0,COUNTER=5
122 F S INDEX=$O(@ARRAY@(INDEX)) Q:INDEX']"" D
123 . S RGRSTEXT(COUNTER)="FIELD: "_INDEX_" = "_@ARRAY@(INDEX)
124 . S COUNTER=COUNTER+1
125 D BULL2("MPI/PD - MISSING DATA","RGRSTEXT(")
126 Q
127 ;
128MTCHBULL(DFN,ARRAY,NAME,SSN,ICN,CMOR,BULSUB) ;
129 ;Entry point generates a bulletin to the RG CIRN DEMOGRAPHIC
130 ;ISSUES mail group about differences in the data of a given patient.
131 ;
132 ;Input: Required Variables
133 ;
134 ; DFN - IEN in the PATIENT file (#2)
135 ; ARRAY - Array of data containing sending sites station number
136 ; NAME - Patient's Name
137 ; SSN - Patient's SSN
138 ; ICN - Patient's ICN (Integration Control Number)
139 ; CMOR - Patient's CMOR (Coordinating Master of Record)
140 ; BULSUB - Bulletin subject (Ex. ICN)
141 ;
142 Q:$G(DFN)=""!($G(ARRAY)="")
143 N LOCDATA,RGRSTEXT,INDEX,COUNTER
144 S RGRSTEXT(1)="The MPI/PD Package has received a message from:"
145 S RGRSTEXT(2)=$$INST^RGRSBUL1(@ARRAY@("SENDING SITE"))
146 S RGRSTEXT(3)="This message contains "_$P(BULSUB,"(")_" data that is"
147 S RGRSTEXT(4)="inconsistent with your site's data."
148 S RGRSTEXT(5)=" "
149 S RGRSTEXT(6)="=> "_$P($$SITE^VASITE(),"^",2)_" local data:"
150 S RGRSTEXT(7)="NAME: "_NAME
151 S RGRSTEXT(8)="SSN: "_SSN
152 S RGRSTEXT(9)="ICN: "_ICN
153 S RGRSTEXT(10)="CMOR: "_CMOR
154 S RGRSTEXT(11)="--------------------------------------------------------"
155 S RGRSTEXT(12)="=> "_$P($$INST^RGRSBUL1(@ARRAY@("SENDING SITE"))," -->")_" data:"
156 S COUNTER=12
157 F INDEX="NAME","SSN","ICN","CMOR" D
158 . I $D(@ARRAY@(INDEX)) S COUNTER=COUNTER+1,RGRSTEXT(COUNTER)=INDEX_": "_@ARRAY@(INDEX)
159 D BULL2("MPI/PD - INCONSISTENT "_BULSUB,"RGRSTEXT(")
160 Q
Note: See TracBrowser for help on using the repository browser.