source: WorldVistAEHR/trunk/r/REGISTRATION-DGQE-DG-DPT-GRPX-VAD-VAF-VAS-VAT-VAU--VA-VIC--DGBT--DGJ--DGYA--VALM/VAFCMG01.m@ 1046

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

initial load of WorldVistAEHR

File size: 8.8 KB
Line 
1VAFCMG01 ;ALB/JRP,LTL-DEMOGRAPHIC MERGE SCREEN ;18-OCT-1996
2 ;;5.3;Registration;**149**;Aug 13, 1993
3 ;
4 ;NOTE: This routine contains line tags used to implement a
5 ; List Manager user interface
6 ;
7EN(VAFCDFN,VAFCARR,VAFCFROM,VAFCEVDT) ;Main entry point
8 ; - calls List Manager interface
9 ;
10 ;Input : VAFCDFN - Pointer to entry in PATIENT file (#2) to merge
11 ; data into
12 ; VAFCARR - Array contain data to merge (full global reference)
13 ; Defaults to ^TMP("VAFC-MERGE-FROM",$J)
14 ; VAFCARR() should be set as follows:
15 ; VAFCARR(File,Field) = Value
16 ; Where File = File number Value is from
17 ; Field = Field number Value is from
18 ; Value = Info to merge
19 ; Notes: Dates must be in FileMan format
20 ; : Special considerations for Value
21 ; "@" - Displays <DELETE> and deletes
22 ; local value if merged
23 ; "^text" - Displays text and ignores
24 ; field if merged
25 ; NULL - Displays <UNSPECIFIED> and
26 ; ignores field if merged
27 ; Doesn't exist - Displays <UNSPECIFIED>
28 ; and ignores field
29 ; if merged
30 ; VAFCFROM - Text denoting where merge data came from (1-35)
31 ; Example: ALBANY VAMC
32 ; Example: CIRN
33 ; Defaults to local facility name
34 ; VAFCEVDT - Date/time merge data was instantiated (FileMan)
35 ; Example: Date/time data changed at remote site
36 ; Defaults to current date/time
37 ;Output : -21 - User exited via '^^' and differences exits
38 ; -20 - User exited via '^^' and no differences
39 ; -11 - User exited via '^' and differences exits
40 ; -10 - User exited via '^' and no differences
41 ; -1 - Error occurred / bad input
42 ; 0 - User quit and no differences
43 ; 1 - User quit and differences exist
44 ; 10 - User done and no differences
45 ; 11 - User done and differences exist
46 ; 20 - User rejected data and no differences
47 ; 21 - User rejected data and differences exist
48 ;
49 ;Notes : File 2 is the only file currently supported (i.e. multiples
50 ; are not supported)
51 ; : The following fields are the only fields currently supported
52 ; .01, .02, .03, .05, .08, .09, .111, .1112, .112, .113
53 ; .114, .115, .117, .131, .132, .211, .219, .2403, .301
54 ; .302, .31115, .323, .351, 391, 1901
55 ;
56 ;Check input
57 S VAFCDFN=+$G(VAFCDFN)
58 Q:('VAFCDFN) -1
59 Q:('$D(^DPT(VAFCDFN))) -1
60 S VAFCARR=$G(VAFCARR)
61 S:(VAFCARR="") VAFCARR="^TMP(""VAFC-MERGE-FROM"","_$J_")"
62 Q:('$O(@VAFCARR@(2,0))) -1
63 S VAFCEVDT=+$G(VAFCEVDT)
64 S:('VAFCEVDT) VAFCEVDT=$$NOW^VAFCMGU0(1)
65 S VAFCFROM=$G(VAFCFROM)
66 S:(VAFCFROM="") VAFCFROM=$P($$SITE^VASITE(),"^",2)
67 S VAFCFROM=$E(VAFCFROM,1,35)
68 ;Declare variables
69 N VAFCDONE,VAFCDIFF,VAFCRJCT,VAFCEXIT,FRSTDGT,LASTDGT,OUTPUT
70 ;Initialize 'Done' flag
71 S VAFCDONE=0
72 ;Initialize 'Differences' flag
73 S VAFCDIFF=0
74 ;Initialize 'Reject' flag
75 S VAFCRJCT=0
76 ;Initialize 'Exit' flag
77 S VAFCEXIT=0
78 ;Call List Manager interface
79 D EN^VALM("VAFC EXCPT MERGE SCREEN")
80 ;Determine last digit of output
81 ;No differences
82 S LASTDGT=0
83 ;Differences exist
84 S:(VAFCDIFF) LASTDGT=1
85 ;Determine first digit of output
86 ;User quit
87 S FRSTDGT=0
88 ;User done
89 S:(VAFCDONE) FRSTDGT=1
90 ;User rejected data
91 S:(VAFCRJCT) FRSTDGT=2
92 ;User aborted via up arrow
93 S:(VAFCEXIT) FRSTDGT=0-VAFCEXIT
94 ;Combine digits of output
95 S OUTPUT=FRSTDGT_LASTDGT
96 ;Done
97 Q OUTPUT
98 ;
99HEADER ;Entry point to build header
100 ;
101 ;Input : VAFCDFN - Pointer to entry in PATIENT file (#2) data is
102 ; being merged into
103 ; VAFCFROM - Text denoting where merge data came from
104 ; VAFCEVDT - Date/time merge data was instantiated (FileMan)
105 ; All variables set by List Manager interface
106 ;Output : Header to use for List Manager interface
107 ;Notes : Existance/validity of input variables is assumed
108 ;
109 ;Declare variables
110 N DATA,LINE,IENS,PATDATA,ERRDATA
111 ;Get patient info needed to build header
112 D GETDATA^VAFCMGU0(VAFCDFN,1,"PATDATA","ERRDATA")
113 ;Build patient portion of header
114 S IENS=VAFCDFN_","
115 ;Add name
116 S DATA=$G(PATDATA(2,IENS,.01))
117 S:(DATA="") DATA="PATIENT NAME NOT ON FILE"
118 S LINE=DATA
119 ;Add last four of SSN
120 S DATA=$E($G(PATDATA(2,IENS,.09)),6,10)
121 S:(DATA="") DATA="????"
122 S DATA=" ("_DATA_")"
123 S LINE=LINE_DATA
124 ;Add date of birth
125 S DATA=$G(PATDATA(2,IENS,.03))
126 I (DATA'="") D
127 .S DATA=$$EX2INDT^VAFCMGU0(DATA)
128 .S DATA=$$IN2EXDT^VAFCMGU0($P(DATA,".",1))
129 S:(DATA="") DATA="UNKNOWN"
130 S DATA="DOB: "_DATA
131 S LINE=$$INSERT^VAFCMGU0(DATA,LINE,44)
132 ;Add date of death
133 S DATA=$G(PATDATA(2,IENS,.351))
134 I (DATA'="") D
135 .S DATA=$$EX2INDT^VAFCMGU0(DATA)
136 .S DATA=$$IN2EXDT^VAFCMGU0($P(DATA,".",1))
137 S:(DATA="") DATA="N/A"
138 S DATA="DOD: "_DATA
139 S LINE=$$INSERT^VAFCMGU0(DATA,LINE,63)
140 S VALMHDR(1)=LINE
141 ;Build remote portion of header
142 ;Add where data came from
143 ;S LINE="Data From: "_VAFCFROM
144 ;Last local edit, check for audit
145 S (DATA,LINE)="" D:$O(^DIA(2,"B",VAFCDFN,0))
146 .S DATA=$P($G(^DIA(2,0)),U,3)+1
147 .S DATA=$O(^DIA(2,"B",VAFCDFN,DATA),-1)
148 .S DATA=$$FMTE^XLFDT($P($G(^DIA(2,DATA,0)),U,2),"2P")
149 ;if no audit, check pivot file
150 D:DATA']""&($O(^VAT(391.71,"C",VAFCDFN,0)))
151 .S DATA=$P($G(^VAT(391.71,0)),U,3)+1
152 .S DATA=$O(^VAT(391.71,"C",VAFCDFN,DATA),-1)
153 .S DATA=$$FMTE^XLFDT($P($G(^VAT(391.71,DATA,0)),U),"2P")
154 S DATA="Last Local Edit: "_$S(DATA]"":DATA,1:"Unknown")
155 S LINE=$$INSERT^VAFCMGU0(DATA,LINE,0)
156 ;Add event date/time
157 S DATA=$E(VAFCFROM,1,28)_" Event Date: "_$$IN2EXDT^VAFCMGU0($P(VAFCEVDT,".",1))
158 S LINE=$$INSERT^VAFCMGU0(DATA,LINE,40)
159 S VALMHDR(2)=LINE
160 ;Done
161 Q
162 ;
163INITSCRN ;Entry point to build screen
164 ;
165 ;Input : VAFCDFN - Pointer to entry in PATIENT file (#2) to merge
166 ; data into
167 ; VAFCARR - Array contain data to merge (full global reference)
168 ; VAFCARR() should be set as follows:
169 ; VAFCARR(File,Field) = Value
170 ; Where File = File number Value is from
171 ; Field = Field number Value is from
172 ; Value = Info to merge
173 ; Notes: Dates must be in FileMan format
174 ; : Special considerations for Value
175 ; "@" - Displays <DELETE> and deletes
176 ; local value if merged
177 ; "^text" - Displays text and ignores
178 ; field if merged
179 ; NULL - Displays <UNSPECIFIED> and
180 ; ignores field if merged
181 ; Doesn't exist - Displays <UNSPECIFIED>
182 ; and ignores field
183 ; if merged
184 ; VAFCFROM - Text denoting where merge data came from (1-35)
185 ; VAFCEVDT - Date/time merge data was instantiated (FileMan)
186 ; All variables set by List Manager Interface
187 ;Output : Display area and variables required List Manager interface
188 ; Display
189 ; VALMAR(Line,0) = Line of text in display
190 ; Indexes
191 ; VALMAR("IDX",Line,Entry) = ""
192 ; VALMAR("E2F",Entry,N) = File^Field
193 ; N => Allows for multiple fields per entry (starts with 1)
194 ; VALMAR("E2G",Entry) = Group entry is contained in
195 ; VALMAR("GRP",Group) = First line of group in display
196 ; Note: The E2F and E2G indexes are only set if the data
197 ; to merge does not match the local data
198 ;Notes : Existance/validity of input variables is assumed
199 ;
200 ;Declare variables
201 D CHGCAP^VALM("VAFLOCAL",$P($$SITE^VASITE(),U,2))
202 D CHGCAP^VALM("REMOTE",$G(VAFCFROM))
203 N VAFCDOTS
204 S VAFCDOTS=1
205 ;Initialize global locations
206 K @VALMAR,^TMP("VAFC-UNDO")
207 ;Build entire display
208 S VALMCNT=1
209 D BLDALL^VAFCMGB
210 ;No differences found
211 S:('$D(@VALMAR@("E2F"))) VALMSG="** No differences found **"
212 ;Done
213 S VALMCNT=VALMCNT-1
214 S VALMBG=1
215 Q
216 ;
217CLEANUP ;Entry point to clean up
218 ;
219 ;Input : All variables set by List Manager interface
220 ;Output : None
221 ;
222 ;Up arrow out ?
223 I (Y=-1) D
224 .;Single up arrow
225 .S VAFCEXIT=1
226 .;Double up arrow
227 .S:($E(X,1,2)="^^") VAFCEXIT=2
228 ;Differences exist ?
229 S:($D(@VALMAR@("E2F"))) VAFCDIFF=1
230 ;Clean up global locations used
231 K @VALMAR,^TMP("VAFC-UNDO")
232 ;Switch to full screen
233 D FULL^VALM1
234 ;Done
235 Q
Note: See TracBrowser for help on using the repository browser.