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

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

initial load of WorldVistAEHR

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