Produced by Araxis Merge on 9/25/2018 2:12:59 PM Central Daylight Time. See www.araxis.com for information about Merge. This report uses XHTML and CSS2, and is best viewed with a modern standards-compliant browser. For optimum results when printing this report, use landscape orientation and enable printing of background images and colours in your browser.
# | Location | File | Last Modified |
---|---|---|---|
1 | build 3.zip\build 3\MHLTH_YS_137_Source\Delphi\MHA_AUX | uMHA_AUX_VAMSTA_A.pas | Thu Sep 6 11:30:34 2018 UTC |
2 | build 3.zip\build 3\MHLTH_YS_137_Source\Delphi\MHA_AUX | uMHA_AUX_VAMSTA_A.pas | Wed Sep 12 16:03:54 2018 UTC |
Description | Between Files 1 and 2 |
|
---|---|---|
Text Blocks | Lines | |
Unchanged | 5 | 868 |
Changed | 5 | 10 |
Inserted | 0 | 0 |
Removed | 0 | 0 |
Whitespace | |
---|---|
Character case | Differences in character case are significant |
Line endings | Differences in line endings (CR and LF characters) are ignored |
CR/LF characters | Not shown in the comparison detail |
No regular expressions were active.
1 | unit uMHA_ AUX_ DN S A_A; | |
2 | ||
3 | interface | |
4 | ||
5 | uses | |
6 | DateUtil s, | |
7 | SysUtils ; | |
8 | ||
9 | (*function DefaultAn swers_ DN S A_A_Form( | |
10 | Instrume ntName, | |
11 | UserName , | |
12 | StationC ode, | |
13 | StationS uffix, | |
14 | PatientN ame, | |
15 | PatientS SN, | |
16 | PatientD OB, | |
17 | PatientS ex, | |
18 | AnswerSt ring: stri ng): strin g;*) | |
19 | ||
20 | function V erify_ DN S A_A_Form(I nstrumentN ame, | |
21 | PatientN ame, | |
22 | PatientD OB, | |
23 | PatientS ex, | |
24 | AnswerSt ring: stri ng): strin g; | |
25 | ||
26 | ||
27 | implementa tion | |
28 | ||
29 | uses | |
30 | uMHA_AUX _Const, | |
31 | fIA_dial ogs, | |
32 | uMHA_AUX _Utils; | |
33 | ||
34 | (*function Increment Check(Inpu t: string) : string; | |
35 | var | |
36 | TempInt : integer; | |
37 | begin | |
38 | Result : = 'OK'; | |
39 | ||
40 | if (Inpu t = NOT_AS KED) or | |
41 | (Input = SKIPPED ) or | |
42 | (Input = CHOICE_ ID_OF_SKIP PED_MULTIP LE_CHOICE_ QUESTION) or | |
43 | (Input = CHOICE_ ID_OF_SKIP PED_BY_RUL E_MC_QUEST ION) or | |
44 | (Input = CHOICE_ ID_OF_SKIP PED_REQUIR ED_ANSWER) then | |
45 | Exit; | |
46 | ||
47 | TempInt := StrToIn t(Input); | |
48 | ||
49 | if ((Tem pInt > 100 ) or (Temp Int < 0)) then | |
50 | begin | |
51 | Resu lt := 'For questions 10 and 11 , the numb er must be in range of 0% to 1 00%, in ' + | |
52 | 'i ncrements of 10%, li ke 20% or 60%. (You do not hav e to ' + | |
53 | 'e nter the p ercent sig n.)'; | |
54 | Exit ; | |
55 | end; | |
56 | ||
57 | if TempI nt mod 10 <> 0 then | |
58 | begin | |
59 | Resu lt := 'For questions 10 and 11 , the numb er must be in increm ents of 10 %, like 20 % or 60%. ' + | |
60 | '( You do not have to e nter the p ercent sig n.)'; | |
61 | Exit ; | |
62 | end; | |
63 | ||
64 | end;*) | |
65 | ||
66 | ||
67 | function C onvertStrD ateToTDate (DateIn: s tring): TD ateTime; | |
68 | // DateIn is in Form at: JUL 01 , 1934 | |
69 | var | |
70 | TempDate , | |
71 | TempSt r, | |
72 | TempMo : string; | |
73 | begin | |
74 | TempDate := DateIn ; | |
75 | Result : = StrToDat e('01/01/1 700'); // Default as error | |
76 | ||
77 | if Lengt h(DateIn) < 12 then | |
78 | Exit; | |
79 | ||
80 | TempMo : = Copy(Tem pDate, 1, 3); | |
81 | TempStr := '01/'; | |
82 | if TempM o = 'FEB' then | |
83 | TempSt r := '02/' ; | |
84 | if TempM o = 'MAR' then | |
85 | TempSt r := '03/' ; | |
86 | if TempM o = 'APR' then | |
87 | TempSt r := '04/' ; | |
88 | if TempM o = 'MAY' then | |
89 | TempSt r := '05/' ; | |
90 | if TempM o = 'JUN' then | |
91 | TempSt r := '06/' ; | |
92 | if TempM o = 'JUL' then | |
93 | TempSt r := '07/' ; | |
94 | if TempM o = 'AUG' then | |
95 | TempSt r := '08/' ; | |
96 | if TempM o = 'SEP' then | |
97 | TempSt r := '09/' ; | |
98 | if TempM o = 'OCT' then | |
99 | TempSt r := '10/' ; | |
100 | if TempM o = 'NOV' then | |
101 | TempSt r := '11/' ; | |
102 | if TempM o = 'DEC' then | |
103 | TempSt r := '12/' ; | |
104 | ||
105 | TempStr := TempStr + Copy(Te mpDate, 5, 2) + '/' + Copy(Tem pDate, 9, 4); | |
106 | Result : = StrToDat e(TempStr) ; | |
107 | end; | |
108 | ||
109 | (*function DefaultAn swers_PTSD _Status_Fo rm( | |
110 | Instrume ntName, | |
111 | UserName , | |
112 | StationC ode, | |
113 | StationS uffix, | |
114 | PatientN ame, | |
115 | PatientS SN, | |
116 | PatientD OB, | |
117 | PatientS ex, | |
118 | AnswerSt ring: stri ng): strin g; | |
119 | var | |
120 | i, Count : Integer; | |
121 | TempResu lt : string; | |
122 | begin | |
123 | ||
124 | Result : = AnswerSt ring; | |
125 | Count := NumberOfP ieces(Resu lt, V); | |
126 | ||
127 | if Count < 1 then | |
128 | Exit; | |
129 | ||
130 | for i := 1 to Coun t do | |
131 | begin | |
132 | // C linician's name and Data enter ed by | |
133 | if ( i = 1) or (i = 2) th en | |
134 | be gin | |
135 | TempResult := Piece( Result, V, i); | |
136 | TempResult := Piece( TempResult , EQ, 1) + EQ + | |
137 | UserName + U + Pie ce(TempRes ult, U, 2) + U; | |
138 | SetPiece(R esult, V, i, TempRes ult); | |
139 | en d; | |
140 | ||
141 | ||
142 | (* | |
143 | // S tation Cod e | |
144 | if i = 3 then | |
145 | be gin | |
146 | TempResult := Piece( Result, V, i); | |
147 | TempResult := Piece( TempResult , EQ, 1) + EQ + | |
148 | StationC ode + U + Piece(Temp Result, U, 2) + U; | |
149 | SetPiece(R esult, V, i, TempRes ult); | |
150 | en d; | |
151 | // S tation Suf fix | |
152 | if i = 4 then | |
153 | be gin | |
154 | TempResult := Piece( Result, V, i); | |
155 | TempResult := Piece( TempResult , EQ, 1) + EQ + | |
156 | StationS uffix + U + Piece(Te mpResult, U, 2) + U; | |
157 | SetPiece(R esult, V, i, TempRes ult); | |
158 | en d; | |
159 | // 1 . Veteran' s name | |
160 | if i = 5 then | |
161 | be gin | |
162 | TempResult := Piece( Result, V, i); | |
163 | TempResult := Piece( TempResult , EQ, 1) + EQ + | |
164 | PatientN ame + U + Piece(Temp Result, U, 2) + U; | |
165 | SetPiece(R esult, V, i, TempRes ult); | |
166 | en d; | |
167 | // 2 . Veteran' s SSN | |
168 | if i = 6 then | |
169 | be gin | |
170 | TempResult := Piece( Result, V, i); | |
171 | TempResult := Piece( TempResult , EQ, 1) + EQ + | |
172 | PatientS SN + U + P iece(TempR esult, U, 2) + U; | |
173 | SetPiece(R esult, V, i, TempRes ult); | |
174 | en d; | |
175 | // 3 . Veteran' s DOB | |
176 | if i = 7 then | |
177 | be gin | |
178 | TempResult := Piece( Result, V, i); | |
179 | TempResult := Piece( TempResult , EQ, 1) + EQ + | |
180 | DateTime ToStr(Conv ertStrDate ToTDate(Pa tientDOB)) + | |
181 | U + Piec e(TempResu lt, U, 2) + U; | |
182 | SetPiece(R esult, V, i, TempRes ult); | |
183 | en d; | |
184 | // 4 . Veteran' s gender | |
185 | if i = 8 then | |
186 | be gin | |
187 | TempResult := Piece( Result, V, i); | |
188 | if Patient Sex = 'F' then | |
189 | TempResult := Piece( TempResult , EQ, 1) + EQ + | |
190 | '1' + U + Piece(Te mpResult, U, 2) + U | |
191 | else | |
192 | TempResu lt := Piec e(TempResu lt, EQ, 1) + EQ + | |
193 | '0' + U + Piece(Te mpResult, U, 2) + U; | |
194 | SetPiece(R esult, V, i, TempRes ult); | |
195 | en d; | |
196 | ||
197 | end; / / for i | |
198 | end; *) | |
199 | ||
200 | (*function GroomAnsw ers_ DN S A_A_Form(I nstrumentN ame, | |
201 | PatientN ame, | |
202 | PatientD OB, | |
203 | PatientS ex, | |
204 | AnswerSt ring: stri ng): strin g; | |
205 | var | |
206 | i, Count : Integer; | |
207 | Previous Ans7, | |
208 | Previo usAns8, | |
209 | Previo usAns9, | |
210 | TempAn swer, | |
211 | //Temp AnswerText , | |
212 | TempRe sult : string; | |
213 | ||
214 | begin | |
215 | // AnswerS tring is i n this for mat: | |
216 | // Answer String := AnswerStri ng + | |
217 | // TAnswe r(Instrume nt.ListOfA nswers[i]) .QuestionI D + EQ + | |
218 | // TAnswe r(Instrume nt.ListOfA nswers[i]) .AnswerVal ue + U + | |
219 | // TAnswe r(Instrume nt.ListOfA nswers[i]) .AnswerTex t + U + | |
220 | // TAnswe r(Instrume nt.ListOfA nswers[i]) .AnswerID + RECORD_E ND; | |
221 | ||
222 | Result : = AnswerSt ring; | |
223 | Count := NumberOfP ieces(Resu lt, V); | |
224 | ||
225 | if Count < 1 then | |
226 | Exit; | |
227 | ||
228 | for i := 1 to Coun t do | |
229 | begin | |
230 | Temp Result := Piece(Resu lt, V, i); | |
231 | // 10. For Psych iatric (in cluding PT SD) | |
232 | // 11. For Physi cal | |
233 | // Cha nge answer to 000 fo r blank, 0 . | |
234 | // If Answer is disabled ( 1156) then make the answer an "N" | |
235 | if i = 7 then | |
236 | be gin | |
237 | ||
238 | PreviousAn s7 := Piec e(Piece(Te mpResult, EQ, 2), U, 1); | |
239 | en d; | |
240 | if i = 8 then | |
241 | be gin | |
242 | ||
243 | PreviousAn s8 := Piec e(Piece(Te mpResult, EQ, 2), U, 1); | |
244 | en d; | |
245 | if i = 9 then | |
246 | be gin | |
247 | ||
248 | PreviousAn s9 := Piec e(Piece(Te mpResult, EQ, 2), U, 1); | |
249 | en d; | |
250 | if ( i = 10) or (i = 11) then | |
251 | be gin | |
252 | ||
253 | TempAnswer := Piece( Piece(Temp Result, EQ , 2), U, 2 ); | |
254 | ||
255 | if (TempAn swer = '0' ) or (Temp Answer = ' 00') or | |
256 | (TempAns wer = '000 ') or (Tem pAnswer = ' ') or | |
257 | (TempAns wer = '') then | |
258 | begin | |
259 | TempRe sult := Pi ece(TempRe sult, EQ, 1) + EQ + | |
260 | '0' + U + '000 '; | |
261 | SetPie ce(Result, V, i, Tem pResult); | |
262 | end; | |
263 | ||
264 | if (TempAn swer = '11 56') then | |
265 | begin | |
266 | TempRe sult := Pi ece(TempRe sult, EQ, 1) + EQ + | |
267 | CHOI CE_ID_OF_S KIPPED_BY_ RULE_MC_QU ESTION + U + | |
268 | CHOI CE_ID_OF_S KIPPED_BY_ RULE_MC_QU ESTION + U + | |
269 | Piec e(Piece(Te mpResult, EQ, 2), U, 3); | |
270 | ||
271 | //CHO ICE_ID_OF_ SKIPPED_BY _RULE_MC_Q UESTION; | |
272 | SetPie ce(Result, V, i, Tem pResult); | |
273 | end; | |
274 | ||
275 | if (Previo usAns7 = S KIPPED) an d (Previou sAns8 = SK IPPED) and (i = 10) then | |
276 | begin | |
277 | TempRe sult := Pi ece(TempRe sult, EQ, 1) + EQ + | |
278 | //' ' + U + ' ' + U + | |
279 | SKIPP ED + U + S KIPPED + U + | |
280 | Piece (Piece(Tem pResult, E Q, 2), U, 3); | |
281 | SetPie ce(Result, V, i, Tem pResult); | |
282 | end; | |
283 | if (Previo usAns9 = S KIPPED) an d (i = 11) then | |
284 | begin | |
285 | TempRe sult := Pi ece(TempRe sult, EQ, 1) + EQ + | |
286 | //' ' + U + Pie ce(TempRes ult, U, 2) ; | |
287 | SKIPP ED + U + S KIPPED + U + | |
288 | Piece (Piece(Tem pResult, E Q, 2), U, 3); | |
289 | SetPie ce(Result, V, i, Tem pResult); | |
290 | end; | |
291 | en d; | |
292 | end; / / Designat or 10, 11 | |
293 | end; *) | |
294 | ||
295 | ||
296 | function V erify_ DN S A_A_Form( | |
297 | Instrume ntName, | |
298 | PatientN ame, | |
299 | PatientD OB, | |
300 | PatientS ex, | |
301 | AnswerSt ring: stri ng): strin g; | |
302 | var | |
303 | Count, i : Integer; | |
304 | GotPersi anGulf : Boolean; | |
305 | TempStr, | |
306 | TempRe sult, | |
307 | TempAn swer : string; | |
308 | ThisYear , ThisMont h, ThisDay : Word; | |
309 | VetDOB : TDateTim e; | |
310 | ||
311 | begin | |
312 | // Answe rString Fo rmat: | |
313 | // 83=1^1330~ | |
314 | // 84=0^214~. .. | |
315 | // | |
316 | // '83' is Questio nID, | |
317 | // '1' i s ItemInde x for radi o group, b ut can be text from edit field | |
318 | // '1130 ' is Choic eID | |
319 | ||
320 | Result : = ''; // D efault: me ans no pro blems | |
321 | // Remeb er to add a "~" to r esult if t here is a message fo r user. Th is | |
322 | // separ ates multi ple messag es. | |
323 | Count := NumberOfP ieces(Answ erString, RECORD_END ); | |
324 | GotPersi anGulf := False; | |
325 | ||
326 | if Count < 1 then | |
327 | Exit; | |
328 | ||
329 | for i := 1 to Coun t - 1 do | |
330 | begin | |
331 | if ( i = 11) an d (Patient DOB <> '') then | |
332 | be gin | |
333 | TempStr := Piece(Ans werString, RECORD_EN D, i); | |
334 | VetDOB := ConvertStr DateToTDat e(PatientD OB); | |
335 | if DateToS tr(VetDOB) <> '01/01 /1700' the n | |
336 | begin | |
337 | // Tem pAnswer is in format : 100000 | |
338 | TempAn swer := Pi ece(Piece( TempStr, E Q, 2), U, 1); | |
339 | if Len gth(TempAn swer) = 8 then | |
340 | begi n | |
341 | (* if TempAns wer[1] = ' 1' then // Pre WW II | |
342 | if VetDOB > StrToDat e('09/15/1 924') then | |
343 | begin | |
344 | Result := 'This veteran ma y not be o ld enough for servic e ' + | |
345 | 'pri or to Worl d War II ( 1939-1945) . Please v erify ' + | |
346 | 'the birth dat e.'; | |
347 | Exit; | |
348 | end;*) | |
349 | if TempAnswe r[1] = '1' then // W W II | |
350 | if VetDOB > StrToDat e('07/25/1 931') then | |
351 | begin | |
352 | Result := Result + | |
353 | 'Thi s veteran may not be old enoug h for serv ice ' + | |
354 | 'dur ing World War II (19 39-1945). Please ver ify ' + | |
355 | 'the birth dat e.' + RECO RD_END; | |
356 | end; | |
357 | if TempAnswe r[2] = '1' then // P re Korea 2 6, 6, 1950 -16, | |
358 | if VetDOB > StrToDat e('06/26/1 934') then | |
359 | begin | |
360 | Result := Result + | |
361 | 'Thi s veteran may not be old enoug h for serv ice ' + | |
362 | 'pri or to Kore an War (19 50-1953). Please ver ify ' + | |
363 | 'the birth dat e.' + RECO RD_END; | |
364 | end; | |
365 | if TempAnswe r[3] = '1' then // K orea 31, 1, 1955-16 | |
366 | if VetDOB > StrToDat e('01/31/1 939') then | |
367 | begin | |
368 | Result := Result + | |
369 | 'Thi s veteran may not be old enoug h for serv ice ' + | |
370 | 'dur ing the Ko rean War ( 1950-1953) . Please v erify ' + | |
371 | 'the birth dat e.' + RECO RD_END; | |
372 | end; | |
373 | if TempAnswe r[4] = '1' then // B etween Kor ea & Vietn am 4, 8, 1 964-16 | |
374 | if VetDOB > StrToDat e('08/04/1 948') then | |
375 | begin | |
376 | Result := Result + | |
377 | 'Thi s veteran may not be old enoug h for serv ice ' + | |
378 | 'bet ween Korea n War (195 0-1953) an d Vietnam War (1965- 1973). Ple ase verify ' + | |
379 | 'the birth dat e.' + RECO RD_END; | |
380 | end; | |
381 | if TempAnswe r[5] = '1' then // V ietnam 7, 5, 1975-1 6 | |
382 | if VetDOB > StrToDat e('05/07/1 959') then | |
383 | begin | |
384 | Result := Result + | |
385 | 'Thi s veteran may not be old enoug h for serv ice ' + | |
386 | 'in Vietnam Wa r (1965-19 73). Pleas e verify ' + | |
387 | 'the birth dat e.' + RECO RD_END; | |
388 | end; | |
389 | if TempAnswe r[6] = '1' then // P ost Vietna m 31, 7, 1 990-16 | |
390 | if VetDOB > StrToDat e('07/31/1 974') then | |
391 | begin | |
392 | Result := Result + | |
393 | 'Thi s veteran may not be old enoug h for serv ice ' + | |
394 | 'aft er Vietnam War (1965 -1973). Pl ease verif y ' + | |
395 | 'the birth dat e.' + RECO RD_END; | |
396 | end; | |
397 | // The Persi an War is used as th e catch-al l category for | |
398 | // recent ve ts. There should be no lower a ge limit e xcept for | |
399 | // 16, and y ounger. | |
400 | if TempAnswe r[7] = '1' then // P ersian Gul f | |
401 | begin | |
402 | GotPersi anGulf := True; | |
403 | DecodeDa te(Now, Th isYear, Th isMonth, T hisDay); | |
404 | if VetDO B > StrToD ate(IntToS tr(ThisMon th) + '/' + | |
405 | IntToS tr(ThisDay ) + '/' + | |
406 | IntToS tr(ThisYea r - 16)) t hen | |
407 | begin | |
408 | Resu lt := Resu lt + | |
409 | 'T his vetera n may not be old eno ugh for se rvice ' + | |
410 | 'i n Persian Gulf War ( 1991) or a fterwards. Please ve rify ' + | |
411 | 't he birth d ate.' + RE CORD_END; | |
412 | end; | |
413 | end; | |
414 | end; | |
415 | end; | |
416 | en d; // if i = 15 | |
417 | ||
418 | if ( i = 17) or (i = 18) then | |
419 | be gin | |
420 | if not Got PersianGul f then | |
421 | begin | |
422 | TempRe sult := Pi ece(Answer String, RE CORD_END, i); | |
423 | TempAn swer := Pi ece(Piece( TempResult , U, 1), E Q, 2); | |
424 | if Tem pAnswer = '1' then | |
425 | begi n | |
426 | Re sult := Re sult + | |
427 | 'For consi stency, if the veter an served in Iraq or ' + | |
428 | 'Afghanist an, Questi on 13 must have the item, "8. Persian Gu lf War" ch ecked. ' + | |
429 | 'Please ma ke that ch ange.' + R ECORD_END; | |
430 | Ex it; | |
431 | end; | |
432 | end; | |
433 | en d; | |
434 | end; / / for i | |
435 | end; | |
436 | ||
437 | end. | |
438 | ||
439 |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.