Produced by Araxis Merge on 3/31/2017 10:45:43 AM 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 | CPRS v31A.zip\CPRS v31A\VITL5_P34_src.zip\Source\VITALSDATAENTRY | mGMV_InputOne2.pas | Tue Dec 13 18:26:02 2016 UTC |
2 | CPRS v31A.zip\CPRS v31A\VITL5_P34_src.zip\Source\VITALSDATAENTRY | mGMV_InputOne2.pas | Fri Mar 31 15:01:35 2017 UTC |
Description | Between Files 1 and 2 |
|
---|---|---|
Text Blocks | Lines | |
Unchanged | 2 | 3334 |
Changed | 1 | 2 |
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 mGMV_ InputOne2; | |
2 | { | |
3 | ========== ========== ========== ========== ========== ========== ========== ========== | |
4 | * | |
5 | * Ap plication: Vitals | |
6 | * Re vision: $Revisio n: 1 $ $M odtime: 4/ 09/09 10:1 2a $ | |
7 | * De veloper: PII | |
8 | * Si te: Hines OI FO | |
9 | * | |
10 | * De scription: Frame to manage th e input of a single vital. | |
11 | * | |
12 | * No tes: | |
13 | * | |
14 | ========== ========== ========== ========== ========== ========== ========== ========== | |
15 | * $A rchive: /V itals/5.0 (Version 5 .0)/5.0.23 (Patch 23 )/VITALS_5 _0_23_8/So urce/VITAL SDATAENTRY /mGMV_Inpu tOne2.pas $ | |
16 | * | |
17 | * $History : mGMV_Inp utOne2.pas $ | |
18 | * | |
19 | * ******* ********** Version 1 ******* ********** | |
20 | * User: V haishandri a Date: 8/ 12/09 T ime: 8:29a | |
21 | * Created in $/Vita ls/5.0 (Ve rsion 5.0) /5.0.23 (P atch 23)/V ITALS_5_0_ 23_8/Sourc e/VITALSDA TAENTRY | |
22 | * | |
23 | * ******* ********** Version 1 ******* ********** | |
24 | * User: V haishandri a Date: 3/ 09/09 T ime: 3:39p | |
25 | * Created in $/Vita ls/5.0 (Ve rsion 5.0) /5.0.23 (P atch 23)/V ITALS_5_0_ 23_6/Sourc e/VITALSDA TAENTRY | |
26 | * | |
27 | * ******* ********** Version 1 ******* ********** | |
28 | * User: V haishandri a Date: 1/ 13/09 T ime: 1:26p | |
29 | * Created in $/Vita ls/5.0 (Ve rsion 5.0) /5.0.23 (P atch 23)/V ITALS_5_0_ 23_4/Sourc e/VITALSDA TAENTRY | |
30 | * | |
31 | * ******* ********** Version 6 ******* ********** | |
32 | * User: V haishandri a Date: 6/ 17/08 T ime: 4:04p | |
33 | * Updated in $/Vita ls/5.0 (Ve rsion 5.0) /VitalsGUI 2007/Vital s/VITALSDA TAENTRY | |
34 | * | |
35 | * ******* ********** Version 4 ******* ********** | |
36 | * User: V haishandri a Date: 2/ 01/08 T ime: 7:39a | |
37 | * Updated in $/Vita ls GUI 200 7/Vitals/V ITALSDATAE NTRY | |
38 | * Vitals GUI 5.0.22 .3 | |
39 | * | |
40 | * ******* ********** Version 3 ******* ********** | |
41 | * User: V haishandri a Date: 1/ 07/08 T ime: 6:52p | |
42 | * Updated in $/Vita ls GUI 200 7/Vitals/V ITALSDATAE NTRY | |
43 | * | |
44 | * ******* ********** Version 2 ******* ********** | |
45 | * User: V haishandri a Date: 7/ 17/07 T ime: 2:30p | |
46 | * Updated in $/Vita ls GUI 200 7/Vitals-5 -0-18/VITA LSDATAENTR Y | |
47 | * | |
48 | * ******* ********** Version 1 ******* ********** | |
49 | * User: V haishandri a Date: 5/ 14/07 T ime: 10:29 a | |
50 | * Created in $/Vita ls GUI 200 7/Vitals-5 -0-18/VITA LSDATAENTR Y | |
51 | * | |
52 | * ******* ********** Version 2 ******* ********** | |
53 | * User: V haishandri a Date: 6/ 13/06 T ime: 11:15 a | |
54 | * Updated in $/Vita ls/VITALS- 5-0-18/Vit alsDataEnt ry | |
55 | * | |
56 | * ******* ********** Version 1 ******* ********** | |
57 | * User: V haishandri a Date: 5/ 16/06 T ime: 5:43p | |
58 | * Created in $/Vita ls/VITALS- 5-0-18/Vit alsDataEnt ry | |
59 | * GUI v. 5.0.18 upd ates the d efault vit al type IE Ns with th e local | |
60 | * values. | |
61 | * | |
62 | * ******* ********** Version 1 ******* ********** | |
63 | * User: V haishandri a Date: 5/ 16/06 T ime: 5:33p | |
64 | * Created in $/Vita ls/Vitals- 5-0-18/VIT ALS-5-0-18 /VitalsDat aEntry | |
65 | * | |
66 | * ******* ********** Version 2 ******* ********** | |
67 | * User: V haishandri a Date: 7/ 22/05 T ime: 3:51p | |
68 | * Updated in $/Vita ls/Vitals GUI v 5.0 .2.1 -5.0. 3.1 - Patc h GMVR-5-7 (CASMed, CCOW) - De lphi 6/Vit alsDataEnt ry | |
69 | * | |
70 | * ******* ********** Version 1 ******* ********** | |
71 | * User: V haishandri a Date: 5/ 24/05 T ime: 3:35p | |
72 | * Created in $/Vita ls/Vitals GUI v 5.0 .2.1 -5.0. 3.1 - Patc h GMVR-5-7 (CASMed, No CCOW) - Delphi 6/ VitalsData Entry | |
73 | * | |
74 | * ******* ********** Version 1 ******* ********** | |
75 | * User: V haishandri a Date: 4/ 16/04 T ime: 4:20p | |
76 | * Created in $/Vita ls/Vitals GUI Versio n 5.0.3 (C COW, CPRS, Delphi 7) /VITALSDAT AENTRY | |
77 | * | |
78 | * ******* ********** Version 2 ******* ********** | |
79 | * User: V haishandri a Date: 1/ 30/04 T ime: 4:32p | |
80 | * Updated in $/Vita lsLite/Vit alsLiteDLL | |
81 | * | |
82 | * ******* ********** Version 1 ******* ********** | |
83 | * User: V haishandri a Date: 1/ 15/04 T ime: 3:06p | |
84 | * Created in $/Vita lsLite/Vit alsLiteDLL | |
85 | * Vitals Lite DLL | |
86 | * | |
87 | * | |
88 | ========== ========== ========== ========== ========== ========== ========== ========== | |
89 | } | |
90 | interface | |
91 | ||
92 | uses | |
93 | Windows, | |
94 | Messages , | |
95 | SysUtils , | |
96 | Classes, | |
97 | Graphics , | |
98 | Controls , | |
99 | Forms, | |
100 | Dialogs, | |
101 | StdCtrls , | |
102 | Buttons, | |
103 | ComCtrls , | |
104 | ExtCtrls | |
105 | , ActnLi st | |
106 | , uGMV_T emplate | |
107 | , uGMV_F ileEntry | |
108 | , uGMV_G lobalVars | |
109 | , uGMV_V italTypes | |
110 | ; | |
111 | ||
112 | type | |
113 | TfraGMV_ InputOne2 = class(TF rame) | |
114 | pnlMai n: TPanel; | |
115 | pnlVal ues: TPane l; | |
116 | cbxInp ut: TCombo Box; | |
117 | pnlRef usedUnavai lable: TPa nel; | |
118 | cbxRef used: TChe ckBox; | |
119 | cbxUna vailable: TCheckBox; | |
120 | pnlQua lifiers: T Panel; | |
121 | bbtnQu alifiers: TBitBtn; | |
122 | lblQua lifiers: T Label; | |
123 | ckbMet ric: TChec kBox; | |
124 | pnlNam e: TPanel; | |
125 | lblVit al: TLabel ; | |
126 | lblUni t: TLabel; | |
127 | lblNum : TLabel; | |
128 | bvU: T Bevel; | |
129 | bvR: T Bevel; | |
130 | bvMetr ic: TBevel ; | |
131 | bvQual : TBevel; | |
132 | cbxUni ts: TCombo Box; | |
133 | proced ure cbxInp utExit(Sen der: TObje ct); | |
134 | proced ure bbtnQu alifiersCl ick(Sender : TObject) ; | |
135 | proced ure ckbMet ricClick(S ender: TOb ject); | |
136 | proced ure cbxRef usedClick( Sender: TO bject); | |
137 | proced ure cbxUna vailableCl ick(Sender : TObject) ; | |
138 | proced ure Disabl ePanel; | |
139 | proced ure Enable Panel; | |
140 | proced ure cbxRef usedMouseU p(Sender: TObject; B utton: TMo useButton; | |
141 | Shif t: TShiftS tate; x, Y : integer) ; | |
142 | proced ure cbxUna vailableMo useUp(Send er: TObjec t; Button: TMouseBut ton; | |
143 | Shif t: TShiftS tate; x, Y : integer) ; | |
144 | proced ure cbxInp utKeyDown( Sender: TO bject; var Key: Word ; | |
145 | Shif t: TShiftS tate); | |
146 | proced ure cbxInp utChange(S ender: TOb ject); | |
147 | proced ure cbxInp utClick(Se nder: TObj ect); | |
148 | proced ure acMetr icChangedE xecute(Sen der: TObje ct); | |
149 | proced ure ckbMet ricEnter(S ender: TOb ject); | |
150 | proced ure ckbMet ricExit(Se nder: TObj ect); | |
151 | proced ure cbxRef usedEnter( Sender: TO bject); | |
152 | proced ure cbxRef usedExit(S ender: TOb ject); | |
153 | proced ure cbxUna vailableEx it(Sender: TObject); | |
154 | proced ure cbxUna vailableEn ter(Sender : TObject) ; | |
155 | proced ure bbtnQu alifiersEn ter(Sender : TObject) ; | |
156 | proced ure bbtnQu alifiersEx it(Sender: TObject); | |
157 | proced ure cbxInp utKeyPress (Sender: T Object; va r Key: Cha r); | |
158 | proced ure cbxInp utEnter(Se nder: TObj ect); | |
159 | proced ure cbxUni tsEnter(Se nder: TObj ect); | |
160 | proced ure cbxUni tsExit(Sen der: TObje ct); | |
161 | private | |
162 | fTempl ateVital: TGMV_Templ ateVital; | |
163 | fTempl ateVitalTy pe: TVital Type; | |
164 | fVital Qualifiers : string; | |
165 | fValue Dbl: Doubl e; {This s tores the value for the input in US Stan dard where applicabl e} | |
166 | fValue Int: integ er; {This stores the value for the input in US Sta ndard wher e applicab le} | |
167 | // FVal ueStr: str ing; {This stores th e value fo r the inpu t in US St andard whe re applica ble} | |
168 | fPO2Fl owRate: st ring; | |
169 | fPO2Pe rcentage: string; | |
170 | fCheck ErrorMessa ge: String ; | |
171 | bCPRSM etric: Boo lean; | |
172 | bMetri c: Boolean ; | |
173 | bIgnor e: Boolean ; | |
174 | functi on ValidBP : Boolean; | |
175 | functi on ValidTe mperature: Boolean; | |
176 | functi on ValidPu lse: Boole an; | |
177 | functi on ValidRe spiration: Boolean; | |
178 | functi on ValidWe ight(aDT: TDateTime) : Boolean; | |
179 | functi on ValidHe ight(aDT: TDateTime) : Boolean; | |
180 | functi on ValidPa in: Boolea n; | |
181 | functi on ValidGi rth: Boole an; | |
182 | functi on ValidPO 2: Boolean ; | |
183 | functi on ValidCV P: Boolean ; | |
184 | proced ure OutOfR ange(aVita lType:Stri ng=''); | |
185 | proced ure SetTem plateVital (const Val ue: TGMV_T emplateVit al); | |
186 | proced ure SetPan elStatus(b Status:Boo lean);//AA N 07/11/20 02 | |
187 | functi on HintStr ing(isMetr ic:Boolean ):String; | |
188 | { Priv ate declar ations } | |
189 | public | |
190 | DFN: S tring; | |
191 | Conver sionWarnin g: Boolean ; | |
192 | Valid: Boolean; | |
193 | Defaul tTemplateV ital: TGMV _TemplateV ital; | |
194 | functi on VitalIE N: string; | |
195 | functi on VitalsR ate: strin g; | |
196 | functi on VitalsQ ualifiers: string; | |
197 | proced ure ShowMe trics; | |
198 | proced ure SetMet ricStyle(b CPRSStyle: Boolean); | |
199 | functi on Check(a DT:TDateTi me):Boolea n; | |
200 | proced ure ClearP O2FlowRate AndPercent age; | |
201 | proced ure SetMet ricUnitLab els(aMetri c:Boolean) ; | |
202 | ||
203 | functi on getStat usString:S tring; | |
204 | proced ure setSta tusString( aString:St ring); | |
205 | functi on getLeng th(aString :String;aM etric:Bool ean):Doubl e; | |
206 | publishe d | |
207 | proper ty Templat eVital: TG MV_Templat eVital | |
208 | read FTemplate Vital writ e SetTempl ateVital; | |
209 | end; | |
210 | ||
211 | implementa tion | |
212 | ||
213 | uses | |
214 | fGMV_S upO2 | |
215 | , fGMV_Q ualifiers | |
216 | , uGMV_U tils | |
217 | , uGMV_C ommon | |
218 | , uGMV_C onst | |
219 | , fGMV_I nputLite, uGMV_Engin e | |
220 | ; | |
221 | ||
222 | {$R *.DFM} | |
223 | ||
224 | var | |
225 | tmpDoubl e: Double; | |
226 | tmpInt: integer; | |
227 | ||
228 | const | |
229 | cRefused = 'Refuse d'; | |
230 | cUnavail able = 'Un available' ; | |
231 | cWeightD elta = 20. 0; | |
232 | cHeightD elta = 10. 0; | |
233 | ||
234 | emDouble Check = 'D ouble chec k to ensur e that you have ente red the da ta for'#13 + | |
235 | 'the c orrect pat ient''s ch art and in the corre ct units o f measure. '; | |
236 | ||
237 | fmtDoubl eCheck = ' The value just enter ed differs from the most'#13+ | |
238 | 'recen t %s recor ded values by more t han %2.0n% %'#13#13+ | |
239 | ||
240 | 'Just entered: '+Char(VK_ TAB)+'%s % s ' + Char (VK_TAB) + '%s'#13+ | |
241 | 'Previ ous value: '+Char(VK_ TAB)+'%s % s ' + Char (VK_TAB) + '%s'#13#1 3+ | |
242 | ||
243 | 'Doubl e check to ensure th at you hav e entered data'#13+ | |
244 | 'for t he correct patient'' s chart an d in the c orrect'#13 + | |
245 | 'units of measur e.'#13#13+ | |
246 | ||
247 | 'Do yo u want to save the n ew value?' ; | |
248 | ||
249 | function g etDelta(aD bl:Double; aValue:Str ing): Doub le; | |
250 | var | |
251 | dValue: Double; | |
252 | begin | |
253 | dValue : = strToFlo atDef(aVal ue,0.0); | |
254 | Result : = dValue - aDbl; | |
255 | if Resul t < 0.0 th en | |
256 | Result := -Resul t; | |
257 | Result : = Result / dValue; | |
258 | Result : = 100.0 * Result; | |
259 | end; | |
260 | ||
261 | { TfraGM V_InputOne } | |
262 | procedure TfraGMV_In putOne2.Cl earPO2Flow RateAndPer centage; | |
263 | begin | |
264 | FPO2Flow Rate := '' ; | |
265 | FPO2Perc entage := ''; | |
266 | end; | |
267 | ||
268 | procedure TfraGMV_In putOne2.Sh owMetrics; | |
269 | begin | |
270 | if not b CPRSMetric then | |
271 | begin | |
272 | cbxU nits.Visib le := Fals e; | |
273 | lblU nit.Visibl e := bMetr ic; | |
274 | ckbM etric.Visi ble := bMe tric; | |
275 | end | |
276 | else | |
277 | begin | |
278 | lblU nit.Visibl e := False ; | |
279 | ckbM etric.Visi ble := Fal se; | |
280 | cbxU nits.Visib le := bMet ric; | |
281 | end; | |
282 | cbxInput .Hint := H intString( ckbMetric. Checked); | |
283 | SetMetri cUnitLabel s(ckbMetri c.Checked) ; | |
284 | end; | |
285 | ||
286 | procedure TfraGMV_In putOne2.Se tMetricSty le(bCPRSSt yle:Boolea n); | |
287 | begin | |
288 | bcPRSMet ric := bCP RSStyle; | |
289 | ShowMetr ics; | |
290 | end; | |
291 | ||
292 | procedure TfraGMV_In putOne2.Se tTemplateV ital(const Value: TG MV_Templat eVital); | |
293 | var | |
294 | i: integ er; | |
295 | aType: T VitalType; | |
296 | begin | |
297 | Valid := True; | |
298 | FTemplat eVital := Value; | |
299 | lblVital .Caption : = TitleCas e(FTemplat eVital.Vit alName) + ':'; | |
300 | ckbMetri c.Checked := FTempla teVital.Me tric; | |
301 | lblQuali fiers.Capt ion := ''; | |
302 | FVitalQu alifiers : = ''; | |
303 | i := 1; | |
304 | while Pi ece(FTempl ateVital.Q ualifiers, '~', i) < > '' do | |
305 | begin | |
306 | if F VitalQuali fiers <> ' ' then | |
307 | FV italQualif iers := FV italQualif iers + ':' ; | |
308 | FVit alQualifie rs := FVit alQualifie rs + Piece (Piece(FTe mplateVita l.Qualifie rs, '~', i ), ',', 2) ; | |
309 | inc( i); | |
310 | end; | |
311 | //Defaul ts --- //A AN 07/10/2 002 | |
312 | cbxInput .Style := csSimple; | |
313 | cbxInput .Text := ' '; | |
314 | ckbMetri c.Visible := False; | |
315 | cbxUnits .Visible : = False; | |
316 | lblQuali fiers.Capt ion := Tit leCase(FTe mplateVita l.DisplayQ ualifiers) ; | |
317 | lblUnit. Caption := ''; | |
318 | lblUnit. Visible := False; | |
319 | ckbMetri c.Visible := False; | |
320 | ||
321 | bvQual.V isible := False; | |
322 | bvU.Visi ble := Fal se; | |
323 | bvR.Visi ble := Fal se; | |
324 | bvMetric .Visible : = False; | |
325 | ||
326 | bMetric := False; | |
327 | bCPRSMet ric := Fal se; | |
328 | // Changes to avoid using fixe d number f or the typ es ------- ------- AA N 12/04/02 | |
329 | // case S trToIntDef (FTemplate Vital.IEN, -1) of | |
330 | aType := VitalType ByString(F TemplateVi tal.IEN); | |
331 | cbxInput .Hint := H intString( ckbMetric. Checked);/ /HintText; //AAN 07/0 8/2002 | |
332 | case aTy pe of | |
333 | vtBP: FTemplate VitalType := vtBP; | |
334 | vtTemp : | |
335 | begi n | |
336 | FT emplateVit alType := vtTemp; | |
337 | ck bMetric.Vi sible := T rue; | |
338 | ||
339 | lb lUnit.Capt ion := 'F' ; | |
340 | cb xUnits.Ite ms.Clear; | |
341 | cb xUnits.Ite ms.Add('F' ); | |
342 | cb xUnits.Ite ms.Add('C' ); | |
343 | if ckbMetric .Checked t hen | |
344 | cbxUnits.I temIndex : = 1 | |
345 | el se | |
346 | cbxUnits.I temIndex : = 0; | |
347 | ||
348 | bM etric := T rue; | |
349 | end; | |
350 | vtResp : FTempla teVitalTyp e := vtRes p; | |
351 | vtPuls e: FTempla teVitalTyp e := vtPul se; | |
352 | vtHeig ht: | |
353 | begi n | |
354 | FT emplateVit alType := vtHeight; | |
355 | ck bMetric.Vi sible := T rue; | |
356 | lb lUnit.Capt ion := '(i n)'; | |
357 | cb xUnits.Ite ms.Clear; | |
358 | cb xUnits.Ite ms.Add('in '); | |
359 | cb xUnits.Ite ms.Add('cm '); | |
360 | if ckbMetric .Checked t hen | |
361 | cbxUnits.I temIndex : = 1 | |
362 | el se | |
363 | cbxUnits.I temIndex : = 0; | |
364 | bM etric := T rue; | |
365 | end; | |
366 | vtWeig ht: | |
367 | begi n | |
368 | FT emplateVit alType := vtWeight; | |
369 | ck bMetric.Vi sible := T rue; | |
370 | lb lUnit.Capt ion := '(l b)'; | |
371 | cb xUnits.Ite ms.Clear; | |
372 | cb xUnits.Ite ms.Add('lb '); | |
373 | cb xUnits.Ite ms.Add('kg '); | |
374 | if ckbMetric .Checked t hen | |
375 | cbxUnits.I temIndex : = 1 | |
376 | el se | |
377 | cbxUnits.I temIndex : = 0; | |
378 | ||
379 | bM etric := T rue; | |
380 | end; | |
381 | vtCirc um: | |
382 | begi n | |
383 | FT emplateVit alType := vtCircum; | |
384 | ck bMetric.Vi sible := T rue; | |
385 | lb lUnit.Capt ion := '(i n)'; | |
386 | cb xUnits.Ite ms.Clear; | |
387 | cb xUnits.Ite ms.Add('in '); | |
388 | cb xUnits.Ite ms.Add('cm '); | |
389 | cb xUnits.Ite mIndex := cbxUnits.I tems.Index Of('in'); // vhaispb ellc 2010/ 05/06 Reme dy: 370106 | |
390 | // cbxUnits.T ext := 'in '; | |
391 | if ckbMetric .Checked t hen | |
392 | cbxUnits.I temIndex : = 1 | |
393 | el se | |
394 | cbxUnits.I temIndex : = 0; | |
395 | ||
396 | bM etric := T rue; | |
397 | end; | |
398 | vtCVP: | |
399 | begi n | |
400 | FT emplateVit alType := vtCVP; | |
401 | ck bMetric.Ca ption := ' mmHg'; | |
402 | ck bMetric.Vi sible := T rue; | |
403 | ||
404 | lb lVital.Cap tion := 'C VP';//AAN 07/03/2002 | |
405 | bb tnQualifie rs.Visible := False; | |
406 | lb lQualifier s.Caption := ''; | |
407 | lb lUnit.Capt ion := '(c mH2O)'; | |
408 | cb xUnits.Ite ms.Clear; | |
409 | cb xUnits.Ite ms.Add('cm H20'); | |
410 | cb xUnits.Ite ms.Add('mm Hg'); | |
411 | cb xUnits.Ite mIndex := cbxUnits.I tems.Index Of('cmH20' ); // vhai spbellc 20 10/05/06 R emedy: 370 106 | |
412 | // cbxUnits.T ext := 'cm H20'; | |
413 | if ckbMetric .Checked t hen | |
414 | cbxUnits.I temIndex : = 1 | |
415 | el se | |
416 | cbxUnits.I temIndex : = 0; | |
417 | ||
418 | bM etric := T rue; | |
419 | end; | |
420 | vtPO2: | |
421 | // vha ishandria 060613 - R oom Air qu estion | |
422 | begi n | |
423 | FT emplateVit alType := vtPO2; | |
424 | // vhaisha ndria 0609 20 Remedy 146205 - R oom Air ca n not be s elected as the defau lt | |
425 | // lblQualifi ers.Captio n := '[]'; //vhaisha ndria 0607 25 Remedy 150714, 15 1694, 1462 05 | |
426 | bb tnQualifie rs.Hint := 'Press to select Su pplemental Oxygen Ra te, Concen tration an d Method'; | |
427 | end; | |
428 | vtPain : | |
429 | begi n | |
430 | FT emplateVit alType := vtPain; | |
431 | cb xInput.Sty le := csDr opDownList ; // vhais handria 05 0209 end | |
432 | // vhaisha ndria 0507 06 added b lank line to the pai n list | |
433 | cb xInput.Ite ms.CommaTe xt := '"", "0 - no pa in","1 - s lightly un comfortabl e",2,3,4,5 ,6,7,8,9," 10 - worst imaginabl e","99 - u nable to r espond"'; | |
434 | cb xInput.Ite mIndex := -1; | |
435 | cb xInput.Hin t := 'Ente r a value from '+Flo atToStr(GM VVitalLoRa nge[FTempl ateVitalTy pe])+ | |
436 | ' to '+ Fl oatToStr(G MVVitalHiR ange[FTemp lateVitalT ype])+' or 99';//AAN 04/15/200 3 | |
437 | bb tnQualifie rs.Visible := False; | |
438 | lb lQualifier s.Caption := ''; | |
439 | end; | |
440 | else | |
441 | FTempl ateVitalTy pe := vtUn known; | |
442 | end; | |
443 | ShowMetr ics; | |
444 | end; | |
445 | ||
446 | function T fraGMV_Inp utOne2.Hin tString(is Metric:Boo lean):Stri ng; | |
447 | var | |
448 | fLow,fHi gh:Double; | |
449 | begin | |
450 | fLow := GMVVitalLo Range[FTem plateVital Type]; | |
451 | fHigh := GMVVitalH iRange[FTe mplateVita lType]; | |
452 | if isMet ric then | |
453 | begin | |
454 | case FTemplate VitalType of | |
455 | vt Temp: begi n | |
456 | fLow := ConvertFTo C(fLow); | |
457 | fHigh := ConvertFT oC(fHigh); | |
458 | end; | |
459 | vt Height,vtC ircum: beg in | |
460 | // fLow : =ConvertIn ToCm(fLow) ; | |
461 | // fHigh :=ConvertI nToCm(fHig h); | |
462 | fLow := fLow*2.54; | |
463 | fHigh := fHigh*2.5 4; | |
464 | end; | |
465 | vt Weight: be gin | |
466 | fLow :=C onvertLbsT oKgs(fLow) ; | |
467 | fHigh := ConvertLbs ToKgs(fHig h); | |
468 | end; | |
469 | vt CVP: begin | |
470 | fLow := ConvertcmH 20TommHg(f Low); | |
471 | fHigh := Convertcm H20TommHg( fHigh); | |
472 | end; | |
473 | end; | |
474 | end; | |
475 | Result : = 'Please enter a va lue from '+ | |
476 | FloatT oStr(fLow) + ' to ' + FloatTo Str(fHigh) ; | |
477 | end; | |
478 | ||
479 | procedure TfraGMV_In putOne2.Ou tOfRange(a VitalType: String='') ; | |
480 | var | |
481 | s: Strin g; | |
482 | begin | |
483 | s := 'Th e value yo u entered is out of range for this vital .' + #13#1 3+ | |
484 | Hint String(ckb Metric.Che cked); | |
485 | if aVita lType <> ' ' then s := 'Vital Type: '+aV italType+ #13+#13+s; | |
486 | MessageD lg(s, mtEr ror, [mbOk ], 0); | |
487 | end; | |
488 | ||
489 | procedure TfraGMV_In putOne2.cb xInputExit (Sender: T Object); | |
490 | begin | |
491 | cbxInput .Text := t rim(cbxInp ut.Text);/ / Remedy 1 70801 vha ishandria 061214 | |
492 | ||
493 | if not C heck(0) th en | |
494 | cbxInp ut.SetFocu s; | |
495 | setStatu sString('' ); | |
496 | end; | |
497 | ||
498 | procedure TfraGMV_In putOne2.bb tnQualifie rsClick(Se nder: TObj ect); | |
499 | var | |
500 | s: Strin g; | |
501 | Quals: s tring; | |
502 | QualsTex t: string; | |
503 | PO2FlowR ate: strin g; | |
504 | PO2Perce ntage: str ing; | |
505 | //const // vhaishand ria 050714 | |
506 | // cRoomA ir = 'ROOM AIR'; // vhaishandr ia 050714 | |
507 | ||
508 | begin | |
509 | if FTemp lateVitalT ype = vtPO 2 then | |
510 | begin | |
511 | PO2F lowRate := FPO2FlowR ate; | |
512 | PO2P ercentage := FPO2Per centage; | |
513 | if G etSuppleme ntO2Data(P O2FlowRate , PO2Perce ntage, TCo ntrol(Send er),lblQua lifiers.Ca ption) the n | |
514 | be gin | |
515 | FPO2FlowRa te := PO2F lowRate; | |
516 | FPO2Percen tage := pi ece(PO2Per centage,'^ ',1); | |
517 | FVitalQual ifiers := piece(PO2P ercentage, '^',2); | |
518 | QualsText := piece(P O2Percenta ge,'^',3); | |
519 | s := ' ';/ /AAN 11/07 /2002 -- t wo spaces between Qu alifier an d data | |
520 | if FPO2Flo wRate <> ' ' then | |
521 | s := s + ' ' + F PO2FlowRat e + ' l/mi n'; | |
522 | if FPO2Per centage <> '' then | |
523 | s := s + ' ' + FPO 2Percentag e + ' %'; | |
524 | if s = ' ' then s := ''; | |
525 | // 2007122 0 vhaishan dria --- a ll flow ra tes and %% values ar e included --- ///// | |
526 | lblQualifi ers.Captio n := '[' + QualsText + s + ']' | |
527 | (* ======= ========== ========== ========== ========== ========== ========== = 20071220 | |
528 | if (FPO2Fl owRate <> '') or (FP O2Percenta ge <> '') then | |
529 | lblQual ifiers.Cap tion := '[ ' + QualsT ext + s + ']' | |
530 | else if po s(cRoomAir ,uppercase (QualsText )) > 0 the n // vhais handria 05 0714 | |
531 | lblQual ifiers.Cap tion := '[ ' + QualsT ext + ']' // vhaisha ndria 0507 14 | |
532 | else | |
533 | lblQual ifiers.Cap tion := '[ ]'; | |
534 | ========== ========== ========== ========== ========== ========== ========== ========*) | |
535 | en d; | |
536 | Exit ; | |
537 | end; | |
538 | ||
539 | Quals := FVitalQua lifiers; | |
540 | if Selec tQualifier s(FTemplat eVitalType , Quals, Q ualsText, TControl(S ender),cbx Input.Text ) then | |
541 | begin | |
542 | FVit alQualifie rs := Qual s; | |
543 | lblQ ualifiers. Caption := '[' + Qua lsText + ' ]'; | |
544 | end; | |
545 | end; | |
546 | ||
547 | procedure TfraGMV_In putOne2.Se tMetricUni tLabels(aM etric:Bool ean); | |
548 | begin | |
549 | //UPDATE D CODE vha ispbellc 2 010/05/06 Remedy: 37 0106 | |
550 | if aMetr ic then | |
551 | case FTemplate VitalType of | |
552 | vt Temp: begi n | |
553 | i f (cbxUnit s.Items.In dexOf('C') = -1) the n | |
554 | cbxUnits.I tems.Add(' C'); | |
555 | c bxUnits.It emIndex := cbxUnits. Items.Inde xOf('C'); | |
556 | // cbxUnits. Text := 'C '; | |
557 | en d; | |
558 | vt Weight: be gin | |
559 | i f (cbxUnit s.Items.In dexOf('kg' ) = -1) th en | |
560 | cbxUnits.I tems.Add(' kg'); | |
561 | c bxUnits.It emIndex := cbxUnits. Items.Inde xOf('kg'); | |
562 | / /cbxUnits. Text := 'k g'; | |
563 | en d; | |
564 | vt Height: be gin | |
565 | i f (cbxUnit s.Items.In dexOf('cm' ) = -1) th en | |
566 | cbxUnits.I tems.Add(' cm'); | |
567 | c bxUnits.It emIndex := cbxUnits. Items.Inde xOf('cm'); | |
568 | / /cbxUnits. Text := 'c m'; | |
569 | en d; | |
570 | vt Circum: be gin | |
571 | i f (cbxUnit s.Items.In dexOf('cm' ) = -1) th en | |
572 | cbxUnits.I tems.Add(' cm'); | |
573 | c bxUnits.It emIndex := cbxUnits. Items.Inde xOf('cm'); | |
574 | / /cbxUnits. Text := 'c m'; | |
575 | en d; | |
576 | vt CVP: begin | |
577 | i f (cbxUnit s.Items.In dexOf('mmH g') = -1) then | |
578 | cbxUnits.I tems.Add(' mmHg'); | |
579 | c bxUnits.It emIndex := cbxUnits. Items.Inde xOf('mmHg' ); | |
580 | / /cbxUnits. Text := 'm mHg'; | |
581 | en d; | |
582 | end | |
583 | else | |
584 | case FTemplate VitalType of | |
585 | vt Temp: begi n | |
586 | i f (cbxUnit s.Items.In dexOf('F') = -1) the n | |
587 | cbxUnits.I tems.Add(' F'); | |
588 | c bxUnits.It emIndex := cbxUnits. Items.Inde xOf('F'); | |
589 | / /cbxUnits. Text := 'F '; | |
590 | en d; | |
591 | vt Weight: be gin | |
592 | i f (cbxUnit s.Items.In dexOf('lb' ) = -1) th en | |
593 | cbxUnits.I tems.Add(' lb'); | |
594 | c bxUnits.It emIndex := cbxUnits. Items.Inde xOf('lb'); | |
595 | / /cbxUnits. Text := 'l b'; | |
596 | en d; | |
597 | vt Height: be gin | |
598 | i f (cbxUnit s.Items.In dexOf('in' ) = -1) th en | |
599 | cbxUnits.I tems.Add(' in'); | |
600 | c bxUnits.It emIndex := cbxUnits. Items.Inde xOf('in'); | |
601 | // cbxUnits. Text := 'i n'; | |
602 | en d; | |
603 | vt Circum: be gin | |
604 | i f (cbxUnit s.Items.In dexOf('in' ) = -1) th en | |
605 | cbxUnits.I tems.Add(' in'); | |
606 | c bxUnits.It emIndex := cbxUnits. Items.Inde xOf('in'); | |
607 | / /cbxUnits. Text := 'i n'; | |
608 | en d; | |
609 | vt CVP: begin | |
610 | i f (cbxUnit s.Items.In dexOf('cmH 20') = -1) then | |
611 | cbxUnits.I tems.Add(' cmH20'); | |
612 | c bxUnits.It emIndex := cbxUnits. Items.Inde xOf('cmH20 '); | |
613 | // cbxUnits. Text := 'c mH20'; | |
614 | en d; | |
615 | end; | |
616 | end; | |
617 | ||
618 | procedure TfraGMV_In putOne2.ck bMetricCli ck(Sender: TObject); | |
619 | var | |
620 | IsMetric : Boolean; | |
621 | begin | |
622 | IsMetric := ckbMet ric.Checke d; | |
623 | if IsMet ric then | |
624 | case FTemplate VitalType of | |
625 | vt Temp: lblU nit.Captio n := '(C)' ; | |
626 | vt Weight: lb lUnit.Capt ion := '(k g)'; | |
627 | vt Height: lb lUnit.Capt ion := '(c m)'; | |
628 | vt Circum: lb lUnit.Capt ion := '(c m)'; | |
629 | vt CVP: lblUn it.Caption := '(mmHg )'; | |
630 | end | |
631 | else | |
632 | case FTemplate VitalType of | |
633 | vt Temp: lblU nit.Captio n := '(F)' ; | |
634 | vt Weight: lb lUnit.Capt ion := '(l b)'; | |
635 | vt Height: lb lUnit.Capt ion := '(i n)'; | |
636 | vt Circum: lb lUnit.Capt ion := '(i n)'; | |
637 | vt CVP: lblUn it.Caption := '(cmH2 0)'; | |
638 | end; | |
639 | cbxInput .Hint := H intString( ckbMetric. Checked);/ / vhaishan dria 2003/ 06/06 | |
640 | SetMetri cUnitLabel s(IsMetric ); // vhai spbellc 20 10/05/06 R emedy: 370 106 | |
641 | {$IFDEF ME TRICCONVER SION} | |
642 | if (cbxI nput.Text <> '') the n | |
643 | begin | |
644 | IsMe tric := ck bMetric.Ch ecked; | |
645 | case FTemplate VitalType of | |
646 | vt Temp: | |
647 | begin | |
648 | if (cbxIn put.Text < > '') then | |
649 | if IsM etric then | |
650 | cb xInput.Tex t := Float ToStr(conv ertFToC(FV alueDbl)) | |
651 | else | |
652 | cb xInput.Tex t := Float ToStr(FVal ueDbl); | |
653 | end; | |
654 | vt Weight: | |
655 | begin | |
656 | if IsMet ric then | |
657 | cbxI nput.Text := FloatTo Str(Conver tLbsToKgs( FValueDbl) ) | |
658 | else | |
659 | cbxI nput.Text := FloatTo Str(FValue Dbl); | |
660 | end; | |
661 | vt Height: | |
662 | begin | |
663 | if IsMet ric then | |
664 | cbxI nput.Text := FloatTo Str(Conver tInToCm(FV alueDbl)) | |
665 | else | |
666 | cbxI nput.Text := FloatTo Str(FValue Dbl); | |
667 | end; | |
668 | vt Circum: | |
669 | begin | |
670 | if IsMet ric then | |
671 | cbxI nput.Text := FloatTo Str(Conver tInToCm(FV alueDbl)) | |
672 | else | |
673 | cbxI nput.Text := FloatTo Str(FValue Dbl); | |
674 | end; | |
675 | // vhaisha ndria 07/0 3/2002 --- ---------- ---------- ---------- ---------- ---- Begin | |
676 | vt CVP: | |
677 | begin | |
678 | try | |
679 | if IsM etric then | |
680 | cb xInput.Tex t := Forma t('%1.1f', [ConvertCM H20TommHg( FValueDbl) ]) | |
681 | else | |
682 | cb xInput.Tex t := Forma t('%1.2f', [FValueDbl ]); | |
683 | except | |
684 | end; | |
685 | end; | |
686 | // vhaisha ndria 07/0 3/2002 --- ---------- ---------- ---------- ---------- ------ end | |
687 | end; | |
688 | end; | |
689 | {$ELSE} | |
690 | if (cbxI nput.Text <> '') and Conversio nWarning t hen | |
691 | ShowMe ssage('Uni ts have be en changed ...'); | |
692 | {$ENDIF} | |
693 | end; | |
694 | ||
695 | function T fraGMV_Inp utOne2.Vit alsRate: s tring; | |
696 | var | |
697 | sValue, | |
698 | sPercent ,sFlow:Str ing; | |
699 | S: Strin g; | |
700 | begin | |
701 | if cbxRe fused.Chec ked then | |
702 | Result := GMVVit alTypeIEN[ FTemplateV italType] + ';Refuse d;' | |
703 | else if cbxUnavail able.Check ed then | |
704 | Result := GMVVit alTypeIEN[ FTemplateV italType] + ';Unavai lable;' | |
705 | else if FTemplateV italType = vtPO2 the n | |
706 | begin | |
707 | (* | |
708 | Resu lt := GMVV italTypeIE N[FTemplat eVitalType ] + ';' + cbxInput.T ext + ';'; | |
709 | if F PO2FlowRat e <> '' th en | |
710 | s: = FPO2Flow Rate + ' l /min ' | |
711 | else | |
712 | s: = ''; | |
713 | if F PO2Percent age <> '' then | |
714 | Re sult := Re sult + S + FPO2Perce ntage + '% ' | |
715 | else if FPO2Fl owRate <> '' then | |
716 | Re sult := Re sult + S; | |
717 | *) | |
718 | sVal ue := cbxI nput.Text; | |
719 | sFlo w := ''; | |
720 | sPer cent := '' ; | |
721 | ||
722 | if F PO2FlowRat e <> '' th en | |
723 | sF low := FPO 2FlowRate + ' l/min '; | |
724 | if F PO2Percent age <> '' then | |
725 | sP ercent := FPO2Percen tage + '%' ; | |
726 | ||
727 | // if sValue + sPercent + sFlow = ' ' then // vhaishand ria 2008-0 1-24 | |
728 | if s Value = '' then | |
729 | Re sult := '' | |
730 | else | |
731 | Re sult := GM VVitalType IEN[FTempl ateVitalTy pe] + ';' + cbxInput .Text + | |
732 | ';' + sFlo w + sPerce nt; | |
733 | ||
734 | end | |
735 | else if cbxInput.T ext = '' t hen | |
736 | Result := '' | |
737 | else if FTemplateV italType = vtCVP the n | |
738 | begin | |
739 | // Re sult := GM VVitalType IEN[FTempl ateVitalTy pe] + Form at(';%1.1f ;',[FValue Dbl]); | |
740 | s := Format('; %1.1f',[FV alueDbl]); | |
741 | if p os('.0',s) = length( s)-1 then | |
742 | s := copy(s, 1,Length(s )-2); | |
743 | Resu lt := GMVV italTypeIE N[FTemplat eVitalType ] + s + '; '; | |
744 | end | |
745 | else if FTemplateV italType = vtTemp th en | |
746 | Result := GMVVit alTypeIEN[ FTemplateV italType] + ';' + Fl oatToStr(F ValueDbl) | |
747 | else if FTemplateV italType = vtWeight then | |
748 | Result := GMVVit alTypeIEN[ FTemplateV italType] + ';' + Fl oatToStr(F ValueDbl) | |
749 | else if FTemplateV italType = vtHeight then | |
750 | Result := GMVVit alTypeIEN[ FTemplateV italType] + ';' + Fl oatToStr(F ValueDbl) | |
751 | else if FTemplateV italType = vtPain th en | |
752 | begin | |
753 | if p os('-',cbx Input.Text ) <> 0 the n | |
754 | Re sult := GM VVitalType IEN[FTempl ateVitalTy pe] + ';' + | |
755 | copy(cbxIn put.Text,1 ,pos('-',c bxInput.Te xt)-2) | |
756 | else | |
757 | Re sult := GM VVitalType IEN[FTempl ateVitalTy pe] + ';' + cbxInput .Text; | |
758 | end | |
759 | else if FTemplateV italType = vtResp th en | |
760 | Result := GMVVit alTypeIEN[ FTemplateV italType] + ';' + In tToStr(FVa lueInt) | |
761 | else if FTemplateV italType = vtPulse t hen | |
762 | Result := GMVVit alTypeIEN[ FTemplateV italType] + ';' + In tToStr(FVa lueInt) | |
763 | else if FTemplateV italType = vtBP then | |
764 | Result := GMVVit alTypeIEN[ FTemplateV italType] + ';' + cb xInput.Tex t | |
765 | else | |
766 | Result := GMVVit alTypeIEN[ FTemplateV italType] + ';' + Fl oatToStr(F ValueDbl); | |
767 | end; | |
768 | ||
769 | function T fraGMV_Inp utOne2.Vit alsQualifi ers: strin g; | |
770 | begin | |
771 | if cbxRe fused.Chec ked or cbx Unavailabl e.Checked then | |
772 | Result := '' | |
773 | else | |
774 | Result := FVital Qualifiers ; | |
775 | end; | |
776 | ||
777 | function T fraGMV_Inp utOne2.Vit alIEN: str ing; | |
778 | begin | |
779 | Result : = GMVVital TypeIEN[FT emplateVit alType] | |
780 | end; | |
781 | ||
782 | procedure TfraGMV_In putOne2.cb xRefusedCl ick(Sender : TObject) ; | |
783 | begin | |
784 | if cbxRe fused.Chec ked or cbx Unavailabl e.Checked then | |
785 | begin | |
786 | Disa blePanel; | |
787 | GetP arentForm( self).Perf orm(CM_VIT ALCHANGED, 0,0);//200 3/08/29 AA N | |
788 | end | |
789 | else | |
790 | Enable Panel; | |
791 | if cbxRe fused.Chec ked then | |
792 | begin | |
793 | cbxU navailable .Checked : = False; | |
794 | cbxI nput.Text := ''; | |
795 | end; | |
796 | end; | |
797 | ||
798 | procedure TfraGMV_In putOne2.cb xUnavailab leClick(Se nder: TObj ect); | |
799 | begin | |
800 | if cbxUn available. Checked or cbxRefuse d.Checked then | |
801 | begin | |
802 | Disa blePanel; | |
803 | GetP arentForm( self).Perf orm(CM_VIT ALCHANGED, 0,0);//200 3/08/29 AA N | |
804 | end | |
805 | else | |
806 | Enable Panel; | |
807 | if cbxUn available. Checked th en | |
808 | begin | |
809 | cbxR efused.Che cked := Fa lse; | |
810 | cbxI nput.Text := ''; | |
811 | end; | |
812 | end; | |
813 | ||
814 | procedure TfraGMV_In putOne2.Di sablePanel ; | |
815 | begin | |
816 | SetPanel Status(Fal se); | |
817 | end; | |
818 | ||
819 | procedure TfraGMV_In putOne2.En ablePanel; | |
820 | begin | |
821 | SetPanel Status(Tru e); | |
822 | end; | |
823 | ||
824 | procedure TfraGMV_In putOne2.Se tPanelStat us(bStatus :Boolean); | |
825 | begin | |
826 | cbxInput .Enabled : = bStatus; | |
827 | cbxUnits .Enabled : = bStatus; | |
828 | lblUnit. Enabled := bStatus; | |
829 | lblNum.E nabled := bStatus; | |
830 | lblVital .Enabled : = bStatus; | |
831 | ckbMetri c.Enabled := bStatus ; | |
832 | bbtnQual ifiers.Ena bled := b Status; | |
833 | lblQuali fiers.Enab led := bSt atus; | |
834 | if bStat us then | |
835 | begin | |
836 | cbxI nput.Color := clWind ow; | |
837 | cbxU nits.Color := clWind ow; | |
838 | end | |
839 | else | |
840 | begin | |
841 | cbxI nput.Color := pnlVal ues.Color; | |
842 | cbxU nits.Color := pnlVal ues.Color; | |
843 | end; | |
844 | end; | |
845 | ||
846 | procedure TfraGMV_In putOne2.cb xRefusedMo useUp(Send er: TObjec t; | |
847 | Button: TMouseButt on; Shift: TShiftSta te; x, Y: integer); | |
848 | var | |
849 | ScrollBo x: TScroll Box; | |
850 | i: integ er; | |
851 | begin | |
852 | if (ssSh ift in Shi ft) and (c bxRefused. Checked) t hen | |
853 | if Sel f.Parent i s TScrollB ox then | |
854 | if M essageDlg( 'Mark all vitals as Refused?', mtConfirm ation, [mb Yes, mbNo, mbCancel] , 0) = mrY es then | |
855 | be gin | |
856 | ScrollBox := TScroll Box(Self.P arent); | |
857 | for i := 0 to Scroll Box.Compon entCount - 1 do | |
858 | if Scrol lBox.Compo nents[i] i s TfraGMV_ InputOne2 then | |
859 | begin | |
860 | Tfra GMV_InputO ne2(Scroll Box.Compon ents[i]).c bxRefused. Checked := True; | |
861 | Tfra GMV_InputO ne2(Scroll Box.Compon ents[i]).c bxRefusedC lick(Sende r); | |
862 | end; | |
863 | en d; | |
864 | end; | |
865 | ||
866 | procedure TfraGMV_In putOne2.cb xUnavailab leMouseUp( Sender: TO bject; | |
867 | Button: TMouseButt on; Shift: TShiftSta te; x, Y: integer); | |
868 | var | |
869 | ScrollBo x: TScroll Box; | |
870 | i: integ er; | |
871 | begin | |
872 | if (ssSh ift in Shi ft) and (c bxUnavaila ble.Checke d) then | |
873 | if Sel f.Parent i s TScrollB ox then | |
874 | if M essageDlg( 'Mark all vitals as Unavailabl e?', mtCon firmation, [mbYes, m bNo, mbCan cel], 0) = mrYes the n | |
875 | be gin | |
876 | ScrollBox := TScroll Box(Self.P arent); | |
877 | for i := 0 to Scroll Box.Compon entCount - 1 do | |
878 | if Scrol lBox.Compo nents[i] i s TfraGMV_ InputOne2 then | |
879 | begin | |
880 | Tfra GMV_InputO ne2(Scroll Box.Compon ents[i]).c bxUnavaila ble.Checke d := True; | |
881 | Tfra GMV_InputO ne2(Scroll Box.Compon ents[i]).c bxUnavaila bleClick(S ender); | |
882 | end; | |
883 | en d; | |
884 | end; | |
885 | ||
886 | procedure TfraGMV_In putOne2.cb xInputKeyD own(Sender : TObject; var Key: Word; | |
887 | Shift: T ShiftState ); | |
888 | var | |
889 | j, // NO IS RIC-010 3-22002 Ja n 27 2003 | |
890 | i: integ er; | |
891 | begin | |
892 | i := Sel f.Componen tIndex; | |
893 | if Key = VK_RETURN then | |
894 | begin | |
895 | if s sShift in Shift then | |
896 | be gin | |
897 | while i > 0 do | |
898 | try | |
899 | TfraGM V_InputOne 2(Parent.C omponents[ i - 1]).cb xInput.Set Focus; | |
900 | break; | |
901 | except | |
902 | i := i - 1; | |
903 | end; | |
904 | if i = 0 t hen | |
905 | begin | |
906 | j := S elf.Compon entIndex; | |
907 | i := P arent.Comp onentCount ; | |
908 | while j < i do | |
909 | try | |
910 | Tf raGMV_Inpu tOne2(Pare nt.Compone nts[i - 1] ).cbxInput .SetFocus; | |
911 | br eak; | |
912 | exce pt | |
913 | i := i - 1; | |
914 | end; | |
915 | if i=j then //AA N 2003/06/ 04 -- | |
916 | begi n | |
917 | // Try to sa ve | |
918 | tr y | |
919 | GetParent Form(Self) .Perform(C M_SAVEINPU T, 0, 0); | |
920 | ex cept | |
921 | en d; | |
922 | end; | |
923 | end; | |
924 | en d | |
925 | else | |
926 | be gin | |
927 | while i < Parent.Com ponentCoun t - 1 do | |
928 | try | |
929 | TfraGM V_InputOne 2(Parent.C omponents[ i + 1]).cb xInput.Set Focus; | |
930 | break; | |
931 | except | |
932 | i := i + 1; | |
933 | end; | |
934 | if i = Par ent.Compon entCount - 1 then | |
935 | begin | |
936 | j := S elf.Compon entIndex; | |
937 | i := 0 ; | |
938 | while i < j do | |
939 | try | |
940 | Tf raGMV_Inpu tOne2(Pare nt.Compone nts[i]).cb xInput.Set Focus; | |
941 | br eak; | |
942 | exce pt | |
943 | i := i + 1; | |
944 | end; | |
945 | if i=j then //AA N 2003/06/ 04 -- | |
946 | begi n // T ry to save | |
947 | tr y | |
948 | GetParent Form(Self) .Perform(C M_SAVEINPU T, 0, 0); | |
949 | ex cept | |
950 | en d; | |
951 | end; | |
952 | end; | |
953 | en d; | |
954 | end; | |
955 | end; | |
956 | ||
957 | procedure TfraGMV_In putOne2.cb xInputChan ge(Sender: TObject); | |
958 | begin | |
959 | if (cbxI nput.Text = cRefused ) or (cbxI nput.Text = cUnavail able) then | |
960 | SetPan elStatus(F alse) | |
961 | else | |
962 | SetPan elStatus(T rue); | |
963 | GetParen tForm(self ).Perform( CM_VITALCH ANGED,0,0) ;//09/11/0 2 | |
964 | end; | |
965 | ||
966 | procedure TfraGMV_In putOne2.cb xInputClic k(Sender: TObject); | |
967 | begin | |
968 | cbxInput .SelStart := 0; | |
969 | end; | |
970 | ||
971 | procedure TfraGMV_In putOne2.ac MetricChan gedExecute (Sender: T Object); | |
972 | begin | |
973 | case FTe mplateVita lType of | |
974 | vtTemp : ckbM etric.Chec ked := cbx Units.Text = 'C'; | |
975 | vtWeig ht: ckbM etric.Chec ked := cbx Units.Text = 'kg'; | |
976 | vtHeig ht: ckbM etric.Chec ked := cbx Units.Text = 'cm'; | |
977 | vtCirc um: ckbM etric.Chec ked := cbx Units.Text = 'cm'; | |
978 | vtCVP: ckbM etric.Chec ked := cbx Units.Text = 'mmHg'; | |
979 | end; | |
980 | cbxInput .Hint := H intString( ckbMetric. Checked); | |
981 | end; | |
982 | ||
983 | procedure TfraGMV_In putOne2.ck bMetricEnt er(Sender: TObject); | |
984 | begin | |
985 | bvMetric .Visible : = True; | |
986 | end; | |
987 | ||
988 | procedure TfraGMV_In putOne2.ck bMetricExi t(Sender: TObject); | |
989 | begin | |
990 | bvMetric .Visible : = False; | |
991 | end; | |
992 | ||
993 | procedure TfraGMV_In putOne2.cb xRefusedEn ter(Sender : TObject) ; | |
994 | begin | |
995 | bvR.Visi ble := Tru e; | |
996 | end; | |
997 | ||
998 | procedure TfraGMV_In putOne2.cb xRefusedEx it(Sender: TObject); | |
999 | begin | |
1000 | bvR.Visi ble := Fal se; | |
1001 | end; | |
1002 | ||
1003 | procedure TfraGMV_In putOne2.cb xUnavailab leExit(Sen der: TObje ct); | |
1004 | begin | |
1005 | bvU.Visi ble := Fal se; | |
1006 | end; | |
1007 | ||
1008 | procedure TfraGMV_In putOne2.cb xUnavailab leEnter(Se nder: TObj ect); | |
1009 | begin | |
1010 | bvU.Visi ble := Tru e; | |
1011 | end; | |
1012 | ||
1013 | procedure TfraGMV_In putOne2.bb tnQualifie rsEnter(Se nder: TObj ect); | |
1014 | begin | |
1015 | bvQual.V isible := True; | |
1016 | setStatu sString(lb lQualifier s.Caption) ; | |
1017 | end; | |
1018 | ||
1019 | procedure TfraGMV_In putOne2.bb tnQualifie rsExit(Sen der: TObje ct); | |
1020 | begin | |
1021 | bvQual.V isible := False; | |
1022 | setStatu sString('' ); | |
1023 | end; | |
1024 | ||
1025 | //======== ========== ========== ========== ========== ========== ========= Validation | |
1026 | //======== ========== ========== ========== ========== ========== ========== ========== | |
1027 | function M essageDlgE nteredInva lidValue(S ,ErrorS:St ring;sType :String='' ): Word;// AAN 07/03/ 2002 | |
1028 | var | |
1029 | ss: Stri ng; | |
1030 | begin | |
1031 | if Error S = '' the n | |
1032 | // ss : = 'The val ue you ent ered ''' + S + ''' i s not vali d' + #13 + #13 + Err orS; | |
1033 | ss := 'The value you enter ed ''' + S + ''' is not valid' | |
1034 | else | |
1035 | ss := ErrorS; | |
1036 | ||
1037 | if sType <> '' the n | |
1038 | ss := 'Vital Typ e: '+sType +#13#13+ss ; | |
1039 | ||
1040 | result : = Message Dlg(ss, mt Error, [mb ok], 0); | |
1041 | end; | |
1042 | ||
1043 | function T fraGMV_Inp utOne2.Che ck(aDT: TD ateTime):B oolean; | |
1044 | var | |
1045 | OKToProc eed: Boole an; | |
1046 | begin | |
1047 | OKToProc eed := Tru e; | |
1048 | fCheckEr rorMessage := ''; | |
1049 | if cbxIn put.Text < > '' then | |
1050 | begin | |
1051 | case FTemplate VitalType of | |
1052 | ||
1053 | vt Unknown: | |
1054 | begin | |
1055 | MessageD lg('Unknow n Vital Ty pe!', mtEr ror, [mbok ], 0); | |
1056 | OKToProc eed := Tru e; | |
1057 | end; | |
1058 | ||
1059 | vt BP: OKToPr oceed := V alidBP; | |
1060 | vt Temp: OKTo Proceed := ValidTemp erature; | |
1061 | vt Pulse: OKT oProceed : = ValidPul se; | |
1062 | vt Resp: OKTo Proceed := ValidResp iration; | |
1063 | vt Height: OK ToProceed := ValidHe ight(aDT); | |
1064 | vt Weight: OK ToProceed := ValidWe ight(aDT); | |
1065 | vt Pain: OKTo Proceed := ValidPain ; | |
1066 | vt Circum: OK ToProceed := ValidGi rth; | |
1067 | vt PO2: OKToP roceed := ValidPO2; | |
1068 | vt CVP: OKToP roceed := ValidCVP; | |
1069 | ||
1070 | else | |
1071 | be gin | |
1072 | MessageDlg ('Cannot v alidate th is vital t ype.', mtE rror, [mbo k], 0); | |
1073 | OKToProcee d := False ; | |
1074 | en d; | |
1075 | end; | |
1076 | end; | |
1077 | ||
1078 | Valid := OKToProce ed; | |
1079 | Result : = OKToProc eed; | |
1080 | end; | |
1081 | ||
1082 | ||
1083 | ||
1084 | function T fraGMV_Inp utOne2.Val idPain: Bo olean; | |
1085 | var | |
1086 | PainValu e: integer ; | |
1087 | begin | |
1088 | // vhaisha ndria 0507 06 blank v alue for p ain added | |
1089 | if cbxIn put.Text = '' then | |
1090 | begin | |
1091 | Resu lt := True ; | |
1092 | Exit ; | |
1093 | end; | |
1094 | ||
1095 | if pos(' -',cbxInpu t.Text) <> 0 then | |
1096 | begin | |
1097 | Pain Value := S trToInt(Co py(cbxInpu t.Text,1,p os('-',cbx Input.Text )-2)); | |
1098 | end | |
1099 | else | |
1100 | PainVa lue := Str ToIntDef(c bxInput.Te xt, -1); | |
1101 | ||
1102 | if ((Pai nValue >= 0) and (Pa inValue <= 10)) or ( PainValue = 99) then | |
1103 | begin | |
1104 | FVal ueInt := P ainValue; | |
1105 | Resu lt := True ; | |
1106 | end | |
1107 | else | |
1108 | begin | |
1109 | Mess ageDlg('Pa in must be a numeric value fro m 0 to 10 ' + #13 + | |
1110 | 'o r 99 if pa tient is u nable to r espond.',m tError,[], 0); | |
1111 | Resu lt := Fals e; | |
1112 | end; | |
1113 | end; | |
1114 | ||
1115 | function T fraGMV_Inp utOne2.Val idPO2: Boo lean; | |
1116 | begin | |
1117 | Result : = False; | |
1118 | try | |
1119 | tmpInt := StrToI nt(cbxInpu t.Text); | |
1120 | if (tm pInt >= GM VVitalLoRa nge[vtPO2] ) and | |
1121 | (tmp Int <= GMV VitalHiRan ge[vtPO2]) then | |
1122 | begi n | |
1123 | {P rocess val id PO2 Her e} | |
1124 | FV alueInt := tmpInt; | |
1125 | Re sult := Tr ue; | |
1126 | end | |
1127 | else | |
1128 | OutO fRange('Pu lse Ox.'); | |
1129 | except | |
1130 | on E: EConvertEr ror do | |
1131 | // Me ssageDlg(' The value you entere d ''' + cb xInput.Tex t + ''' is not valid ', | |
1132 | // mtError, [ mbok], 0); | |
1133 | Mess ageDlgEnte redInvalid Value(cbxI nput.Text, '','Pulse Ox.'); | |
1134 | else | |
1135 | raise; | |
1136 | end; | |
1137 | end; | |
1138 | ||
1139 | function T fraGMV_Inp utOne2.Val idCVP: Boo lean; | |
1140 | begin | |
1141 | Result : = False; | |
1142 | if cbxIn put.Text = '.' then | |
1143 | begin | |
1144 | Mess ageDlgEnte redInvalid Value(cbxI nput.Text, '','CVP'); //vhaishan dria 05042 9 | |
1145 | Exit ; | |
1146 | end; | |
1147 | try | |
1148 | //AAN 07/0 3/2002---- ---------- ---------- ---------- ---------- ---------- ---- Begin | |
1149 | tmpDou ble := Str ToFloat(cb xInput.Tex t); | |
1150 | if ckb Metric.Che cked then | |
1151 | tmpD ouble := C onvertmmHG toCMH20(tm pDouble); | |
1152 | if (tm pDouble >= GMVVitalL oRange[vtC VP]) and | |
1153 | (tmp Double <= GMVVitalHi Range[vtCV P]) then | |
1154 | begi n | |
1155 | {P rocess val id CVP Her e} | |
1156 | FV alueDbl := tmpDouble ; | |
1157 | Re sult := Tr ue; | |
1158 | end | |
1159 | //AAN 07/0 3/2002---- ---------- ---------- ---------- ---------- ---------- ------ End | |
1160 | else | |
1161 | OutO fRange('CV P'); | |
1162 | except | |
1163 | on E: EConvertEr ror do | |
1164 | Mess ageDlgEnte redInvalid Value(cbxI nput.Text, E.Message, 'CVP');//A AN 07/03/2 002 | |
1165 | else | |
1166 | raise; | |
1167 | end; | |
1168 | end; | |
1169 | ||
1170 | function T fraGMV_Inp utOne2.Val idBP: Bool ean; | |
1171 | var | |
1172 | i,iCount : Integer; | |
1173 | s, sS, s D, sM: Str ing; | |
1174 | bS,bD,bM : Boolean; | |
1175 | Systolic , Diastoli c, Middle: integer; | |
1176 | begin | |
1177 | Result : = False; | |
1178 | try | |
1179 | {AAN 2003/ 06/05----- ---------- ---------- ---------- ---------- ---------- ----Start} | |
1180 | s := c bxInput.Te xt; | |
1181 | sS := trim(Piece (s, '/', 1 )); | |
1182 | sD := trim(Piece (s, '/', 2 )); | |
1183 | sM := trim(Piece (s, '/', 3 )); | |
1184 | ||
1185 | iCount := 0; | |
1186 | for i := 1 to le ngth(s) do | |
1187 | if c opy(s,i,1) = '/' the n inc(iCou nt); | |
1188 | ||
1189 | s := P iece(cbxIn put.Text, '/', 4); | |
1190 | if (s <>'') | |
1191 | or ( iCount > 2 ) | |
1192 | or ( iCount < 1 ) | |
1193 | or ( (iCount=2) and (sD=' ') and (sM ='')) | |
1194 | or ( (iCount=2) and (sM=' ')) | |
1195 | // or ((iCount= 1) and (sD =''))//unc omment thi s line to reject val ues like ' 120/' | |
1196 | then | |
1197 | begi n | |
1198 | Me ssageDlgEn teredInval idValue(cb xInput.Tex t,sMsgInva lidBP,'BP' );//AAN 07 /03/2002 | |
1199 | Ex it; | |
1200 | end; | |
1201 | ||
1202 | Systol ic := StrT oInt(sS); | |
1203 | bS := | |
1204 | (Sys tolic >= G MVVitalLoR ange[vtBP] ) and | |
1205 | (Sys tolic <= G MVVitalHiR ange[vtBP] ); | |
1206 | ||
1207 | ||
1208 | if sD <> '' then | |
1209 | begi n | |
1210 | Di astolic := StrToInt(s D); | |
1211 | s := ss + '/ '+SD;// Re medy 17080 1 | |
1212 | end | |
1213 | else | |
1214 | begi n | |
1215 | s := ss+'/'; // Remedy 170801 | |
1216 | Di astolic := -1; | |
1217 | end; | |
1218 | ||
1219 | bD := (sD = '') or | |
1220 | ((Di astolic >= GMVVitalL oRange[vtB P]) and | |
1221 | (Di astolic <= GMVVitalH iRange[vtB P])); | |
1222 | ||
1223 | if sM <> '' then | |
1224 | begi n | |
1225 | s := s + '/' + sM; // R emedy 1708 01 | |
1226 | Mi ddle :=Str ToInt(sM); | |
1227 | end | |
1228 | else | |
1229 | Midd le := -1; | |
1230 | ||
1231 | bM := (sM = '') or | |
1232 | ((Middle > = GMVVital LoRange[vt BP]) and | |
1233 | (Middle <= GMVVitalH iRange[vtB P])); | |
1234 | ||
1235 | Result :=(bS and bD and bM ); | |
1236 | ||
1237 | if sM = '' then | |
1238 | Resu lt := Resu lt and (Di astolic < Systolic) | |
1239 | else | |
1240 | Resu lt := Resu lt and (Mi ddle < Sys tolic); | |
1241 | ||
1242 | if not Result th en | |
1243 | Mess ageDlgEnte redInvalid Value(cbxI nput.Text, sMsgInvali dBP,'BP')/ /AAN 07/03 /2002 | |
1244 | else | |
1245 | cbxI nput.Text := s; // R emedy 1708 01 | |
1246 | ||
1247 | Exit; | |
1248 | ||
1249 | {AAN 2003/ 06/05----- ---------- ---------- ---------- ---------- ---------- ------End} | |
1250 | Systol ic := StrT oInt(Piece (cbxInput. Text, '/', 1)); | |
1251 | Diasto lic := Str ToInt(Piec e(cbxInput .Text, '/' , 2)); | |
1252 | Middle := StrToI ntDef(Piec e(cbxInput .Text, '/' , 3), 0); | |
1253 | if Dia stolic = 0 then | |
1254 | begi n | |
1255 | if | |
1256 | (Systolic >= GMVVita lLoRange[v tBP]) and | |
1257 | (Systolic <= GMVVita lHiRange[v tBP]) and | |
1258 | (Middle >= GMVVitalL oRange[vtB P]) and | |
1259 | (Middle <= GMVVitalH iRange[vtB P]) then | |
1260 | begin | |
1261 | Result : = True; | |
1262 | end | |
1263 | el se | |
1264 | Exit; | |
1265 | end; | |
1266 | ||
1267 | if ( | |
1268 | (Mid dle = 0) a nd | |
1269 | (Sys tolic >= G MVVitalLoR ange[vtBP] ) and | |
1270 | (Sys tolic <= G MVVitalHiR ange[vtBP] ) and | |
1271 | (Dia stolic >= GMVVitalLo Range[vtBP ]) and | |
1272 | (Dia stolic <= GMVVitalHi Range[vtBP ]) | |
1273 | ) | |
1274 | or | |
1275 | ( | |
1276 | (Sys tolic >= G MVVitalLoR ange[vtBP] ) and | |
1277 | (Sys tolic <= G MVVitalHiR ange[vtBP] ) and | |
1278 | (Dia stolic >= GMVVitalLo Range[vtBP ]) and | |
1279 | (Dia stolic <= GMVVitalHi Range[vtBP ]) and | |
1280 | (Mid dle >= GMV VitalLoRan ge[vtBP]) and | |
1281 | (Mid dle <= GMV VitalHiRan ge[vtBP]) | |
1282 | ) th en | |
1283 | begi n | |
1284 | Re sult := Tr ue; | |
1285 | end | |
1286 | else | |
1287 | Mess ageDlgEnte redInvalid Value(cbxI nput.Text, sMsgInvali dBP,'BP'); //AAN 07/0 3/2002 | |
1288 | except | |
1289 | on E: EConvertEr ror do | |
1290 | Me ssageDlgEn teredInval idValue(cb xInput.Tex t,sMsgInva lidBP+#13+ E.Message, 'BP');//AA N 07/03/20 02 | |
1291 | else | |
1292 | raise; | |
1293 | end; | |
1294 | end; | |
1295 | ||
1296 | function T fraGMV_Inp utOne2.Val idTemperat ure: Boole an; | |
1297 | begin | |
1298 | Result : = False; | |
1299 | try | |
1300 | tmpDou ble := Str ToFloat(cb xInput.Tex t); | |
1301 | if ckb Metric.Che cked then | |
1302 | tmpD ouble := C onvertCToF (tmpDouble ); | |
1303 | if (tm pDouble >= GMVVitalL oRange[vtT emp]) and | |
1304 | (tmp Double <= GMVVitalHi Range[vtTe mp]) then | |
1305 | begi n {Process valid Tem perature h ere} | |
1306 | FV alueDbl := tmpDouble ; | |
1307 | Re sult := Tr ue; | |
1308 | end | |
1309 | else | |
1310 | OutO fRange('Te mperature' ); | |
1311 | except | |
1312 | on E: EConvertEr ror do | |
1313 | Mess ageDlgEnte redInvalid Value(cbxI nput.Text, E.Message, 'Temperatu re');//AAN 07/03/200 2 | |
1314 | else | |
1315 | raise; | |
1316 | end; | |
1317 | end; | |
1318 | ||
1319 | function T fraGMV_Inp utOne2.Val idPulse: B oolean; | |
1320 | begin | |
1321 | Result : = False; | |
1322 | try | |
1323 | tmpInt := StrToI nt(cbxInpu t.Text); | |
1324 | if (tm pInt >= GM VVitalLoRa nge[vtPuls e]) and | |
1325 | (tmp Int <= GMV VitalHiRan ge[vtPulse ]) then | |
1326 | begi n {Process valid Pul se Here} | |
1327 | FV alueInt := tmpInt; | |
1328 | Re sult := Tr ue; | |
1329 | end | |
1330 | else | |
1331 | OutO fRange('Pu lse'); | |
1332 | except | |
1333 | on E: EConvertEr ror do | |
1334 | Mess ageDlgEnte redInvalid Value(cbxI nput.Text, E.Message, 'Pulse');/ /AAN 07/03 /2002 | |
1335 | else | |
1336 | raise; | |
1337 | end; | |
1338 | end; | |
1339 | ||
1340 | function T fraGMV_Inp utOne2.Val idRespirat ion: Boole an; | |
1341 | begin | |
1342 | Result : = False; | |
1343 | try | |
1344 | tmpInt := StrToI nt(cbxInpu t.Text); | |
1345 | if (tm pInt >= GM VVitalLoRa nge[vtResp ]) and | |
1346 | (tmp Int <= GMV VitalHiRan ge[vtResp] ) then | |
1347 | begi n {Process valid res piration h ere} | |
1348 | FV alueInt := tmpInt; | |
1349 | Re sult := Tr ue; | |
1350 | end | |
1351 | else | |
1352 | OutO fRange('Re spiration' ); | |
1353 | except | |
1354 | on E: EConvertEr ror do | |
1355 | Mess ageDlgEnte redInvalid Value(cbxI nput.Text, E.Message, 'Respirati on');//AAN 07/03/200 2 | |
1356 | else | |
1357 | raise; | |
1358 | end; | |
1359 | end; | |
1360 | ||
1361 | function T fraGMV_Inp utOne2.Val idWeight(a DT: TDateT ime): Bool ean; | |
1362 | var | |
1363 | dd: Doub le; | |
1364 | sCode, s Units, sDa teTime, | |
1365 | sValue, sMsg, | |
1366 | s: Strin g; | |
1367 | ||
1368 | function FormatVal ue(aValue: String):St ring; | |
1369 | var | |
1370 | ddd: D ouble; | |
1371 | begin | |
1372 | if not ckbMetric .Checked t hen | |
1373 | Resu lt := aVal ue | |
1374 | else | |
1375 | begi n | |
1376 | dd d := StrTo Float(aVal ue); | |
1377 | dd d := Conve rtLbsToKgs (ddd); | |
1378 | Re sult := Fl oatToStr(d dd);//+ 'k g'; | |
1379 | end; | |
1380 | end; | |
1381 | ||
1382 | begin | |
1383 | Result : = False; | |
1384 | try | |
1385 | tmpDou ble := Str ToFloat(cb xInput.Tex t); | |
1386 | if ckb Metric.Che cked then | |
1387 | tmpD ouble := C onvertKgsT oLbs(tmpDo uble); | |
1388 | if (tm pDouble >= GMVVitalL oRange[vtW eight]) an d | |
1389 | (tmp Double <= GMVVitalHi Range[vtWe ight]) the n | |
1390 | begi n {Process valid wei ght Here} | |
1391 | fV alueDbl := tmpDouble ; | |
1392 | if aDT = 0 t hen | |
1393 | Result := True | |
1394 | el se | |
1395 | begin | |
1396 | s := get ClosestRea ding(DFN, | |
1397 | FloatT oStr(Windo wsDateTime ToFMDateTi me(aDT)), | |
1398 | GMVVit alTypeAbbv [fTemplate VitalType] ,'0'); | |
1399 | ||
1400 | sCode := Piece(s,' ^',1); | |
1401 | sValue : = Piece(Pi ece(s,'^', 2),#13,1); | |
1402 | ||
1403 | if sCode = '-1' th en | |
1404 | raise Exception. Create(Pie ce(s,'^',2 )) | |
1405 | else if sCode = '- 2' then | |
1406 | begin | |
1407 | sMsg := Format (fmtDouble Check,['we ight',cWei ghtDelta, | |
1408 | c bxInput.Te xt,cbxUnit s.Text, FM DateTimeSt r(FloatToS tr(aDT)), | |
1409 | sValue,sUn its,sDateT ime]); | |
1410 | Resu lt := Mes sageDialog ('Warning' ,sMsg,mtWa rning,[mbN o,mbYes],m rNo,0)=mrY es; | |
1411 | end | |
1412 | else | |
1413 | begin | |
1414 | dd : = getDelta (fValueDbl ,sValue); | |
1415 | if d d >= cWeig htDelta th en | |
1416 | be gin | |
1417 | sValue := FormatValu e(sValue); | |
1418 | sDateTime := FMDateT imeStr(sCo de); | |
1419 | sMsg := Fo rmat(fmtDo ubleCheck, ['weight', cWeightDel ta, | |
1420 | cbxInpu t.Text,cbx Units.Text , FMDateTi meStr(Floa tToStr(aDT )), | |
1421 | sValue ,cbxUnits. Text,sDate Time]); | |
1422 | Result := MessageDi alog('Warn ing',sMsg, mtWarning, [mbNo,mbYe s],mrNo,0) =mrYes; | |
1423 | en d | |
1424 | else | |
1425 | Re sult := Tr ue; | |
1426 | end; | |
1427 | end; | |
1428 | end | |
1429 | else | |
1430 | OutO fRange('We ight'); | |
1431 | except | |
1432 | on E: EConvertEr ror do | |
1433 | Mess ageDlgEnte redInvalid Value(cbxI nput.Text, E.Message, 'Weight'); //AAN 07/0 3/2002 | |
1434 | else | |
1435 | raise; | |
1436 | end; | |
1437 | end; | |
1438 | ||
1439 | function T fraGMV_Inp utOne2.get Length(aSt ring:Strin g;aMetric: Boolean):D ouble; | |
1440 | var | |
1441 | sFeet,sI nches,sVal ue:String; | |
1442 | fFeet,fI nches,_Dou ble: Doubl e; | |
1443 | begin | |
1444 | // Ent er Height in Feet an d Inches - ---------- ---------- - Start | |
1445 | sValue := aStrin g; | |
1446 | _Doubl e := 0; // vhaishand ria 2007-0 7-12 | |
1447 | if not aMetric a nd | |
1448 | ((po s('''',sVa lue) > 0 ) or (pos(' "',sValue) > 0 )) th en | |
1449 | begi n | |
1450 | if pos('''', sValue) > 0 then sFe et := piec e(sValue,' ''',1) | |
1451 | el se sFe et := ''; | |
1452 | ||
1453 | if pos('''', sValue) > 0 then sIn ches := pi ece(sValue ,'''',2) | |
1454 | el se sIn ches := sV alue; | |
1455 | ||
1456 | if pos('"',s Inches) > 0 then sIn ches := pi ece(sInche s,'"',1); | |
1457 | ||
1458 | tr y | |
1459 | fFeet := 0 ; | |
1460 | fInches := 0; | |
1461 | if sFeet < > '' then fFeet := S trToFloat( sFeet); | |
1462 | if sInches <> '' the n fInches := StrToFl oat(sInche s); | |
1463 | ||
1464 | if (sFeet <> '') and (fInches > 12) then | |
1465 | begin | |
1466 | raise Exception. CreateFmt( | |
1467 | '"%s " invalid input form at',[aStri ng]); | |
1468 | end; | |
1469 | _Double := 12 * fFee t + fInche s; | |
1470 | ||
1471 | bIgnore := True; | |
1472 | sValue := Format('%f ',[_Double ]); | |
1473 | cbxInput.T ext := sVa lue; | |
1474 | bIgnore := False; | |
1475 | ex cept | |
1476 | en d; | |
1477 | end | |
1478 | else | |
1479 | _Dou ble := Str ToFloat(aS tring); | |
1480 | Result : = _Double; | |
1481 | end; | |
1482 | ||
1483 | function T fraGMV_Inp utOne2.Val idHeight(a DT: TDateT ime): Bool ean; | |
1484 | var | |
1485 | dd: Doub le; | |
1486 | sCode,sU nits,sDate Time, | |
1487 | sValue,s Msg, | |
1488 | s: Strin g; | |
1489 | ||
1490 | function FormatVal ue(aValue: String):St ring; | |
1491 | var | |
1492 | ddd: D ouble; | |
1493 | begin | |
1494 | if not ckbMetric .Checked t hen | |
1495 | Resu lt := aVal ue | |
1496 | else | |
1497 | begi n | |
1498 | dd d := StrTo Float(aVal ue); | |
1499 | dd d := Conve rtInToCm(d dd); | |
1500 | Re sult := Fl oatToStr(d dd);//+ 'c m'; | |
1501 | end; | |
1502 | end; | |
1503 | ||
1504 | begin | |
1505 | Result : = False; | |
1506 | try | |
1507 | tmpDou ble := get Length(cbx Input.Text ,ckbMetric .Checked); | |
1508 | if ckb Metric.Che cked then | |
1509 | tmpD ouble := C onvertCmTo In(tmpDoub le); | |
1510 | if (tm pDouble >= GMVVitalL oRange[vtH eight]) an d | |
1511 | (tmp Double <= GMVVitalHi Range[vtHe ight]) the n | |
1512 | begi n {Proces s valid he ight here} | |
1513 | FV alueDbl := tmpDouble ; | |
1514 | ||
1515 | if aDT = 0 t hen | |
1516 | Result := True | |
1517 | el se | |
1518 | begin | |
1519 | s := get ClosestRea ding(DFN,F loatToStr( WindowsDat eTimeToFMD ateTime(aD T)), | |
1520 | GMVVit alTypeAbbv [fTemplate VitalType] ,'0'); | |
1521 | ||
1522 | sCode := Piece(s,' ^',1); | |
1523 | sValue : = Piece(Pi ece(s,'^', 2),#13,1); | |
1524 | ||
1525 | if sCode = '-1' th en | |
1526 | raise Exception. Create(Pie ce(s,'^',2 )) | |
1527 | else if sCode = '- 2' then | |
1528 | begin | |
1529 | sMsg := Format (fmtDouble Check,['he ight',cHei ghtDelta, | |
1530 | c bxInput.Te xt,cbxUnit s.Text, FM DateTimeSt r(FloatToS tr(aDT)), | |
1531 | sValue,sUn its,sDateT ime]); | |
1532 | Resu lt := Mes sageDialog ('Warning' ,sMsg,mtWa rning,[mbN o,mbYes],m rNo,0)=mrY es; | |
1533 | end | |
1534 | else | |
1535 | begin | |
1536 | dd : = getDelta (fValueDbl ,sValue); | |
1537 | if d d >= cHeig htDelta th en | |
1538 | be gin | |
1539 | sValue := FormatValu e(sValue); | |
1540 | sDateTime := FMDateT imeStr(sCo de); | |
1541 | sMsg := Fo rmat(fmtDo ubleCheck, ['height', cHeightDel ta, | |
1542 | cbxInpu t.Text,cbx Units.Text , FMDateTi meStr(Floa tToStr(aDT )), | |
1543 | sValue ,cbxUnits. Text,sDate Time]); | |
1544 | Result := MessageDi alog('Warn ing',sMsg, mtWarning, [mbNo,mbYe s],mrNo,0) =mrYes; | |
1545 | en d | |
1546 | else | |
1547 | Re sult := Tr ue; | |
1548 | end; | |
1549 | ||
1550 | end; | |
1551 | end | |
1552 | else | |
1553 | OutO fRange('He ight'); | |
1554 | except | |
1555 | on E: EConvertEr ror do | |
1556 | Mess ageDlgEnte redInvalid Value(cbxI nput.Text, E.Message, 'Height'); //AAN 07/0 3/2002 | |
1557 | else | |
1558 | raise; | |
1559 | end; | |
1560 | end; | |
1561 | ||
1562 | function T fraGMV_Inp utOne2.Val idGirth: B oolean; | |
1563 | begin | |
1564 | Result : = False; | |
1565 | try | |
1566 | //{$IFDEF R144925} | |
1567 | tmpDou ble := get Length(cbx Input.Text ,ckbMetric .Checked); | |
1568 | //{$ELSE} | |
1569 | // tmpD ouble := S trToFloat( cbxInput.T ext); | |
1570 | //{$ENDIF} | |
1571 | // tmpD ouble := S trToFloat( cbxInput.T ext); | |
1572 | if ckb Metric.Che cked then | |
1573 | tmpD ouble := C onvertCmTo In(tmpDoub le); | |
1574 | if (tm pDouble >= GMVVitalL oRange[vtC ircum]) an d | |
1575 | (tmp Double <= GMVVitalHi Range[vtCi rcum]) the n | |
1576 | begi n | |
1577 | {P rocess val id girth h ere} | |
1578 | FV alueDbl := tmpDouble ; | |
1579 | Re sult := Tr ue; | |
1580 | end | |
1581 | else | |
1582 | OutO fRange('Ci rcumferenc e/Girth'); | |
1583 | except | |
1584 | on E: EConvertEr ror do | |
1585 | Mess ageDlgEnte redInvalid Value(cbxI nput.Text, E.Message, 'Girth');/ /AAN 07/03 /2002 | |
1586 | else | |
1587 | raise; | |
1588 | end; | |
1589 | end; | |
1590 | ||
1591 | procedure TfraGMV_In putOne2.cb xInputKeyP ress(Sende r: TObject ; | |
1592 | var Key: Char); | |
1593 | var | |
1594 | s:String ; | |
1595 | iLen: In teger;// = 2; | |
1596 | begin | |
1597 | //{$IFDEF R144925} / / Enter He ight in Fe et and Inc hes | |
1598 | if (fTem plateVital Type = vtH eight) the n | |
1599 | begin | |
1600 | if (pos(char( key),'0123 456789."'' ') = 0) an d | |
1601 | (K ey<>char(V K_Back)) t hen | |
1602 | be gin | |
1603 | Key := #0; | |
1604 | en d; | |
1605 | Exit ; | |
1606 | end; | |
1607 | //{$ENDIF} | |
1608 | ||
1609 | iLen := 2; | |
1610 | if (fTem plateVital Type = vtT emp) or | |
1611 | (fTem plateVital Type = vtC VP) then i Len := 1; | |
1612 | if (fTem plateVital Type = vtH eight) or | |
1613 | (fTemp lateVitalT ype = vtCi rcum) or | |
1614 | (fTemp lateVitalT ype = vtWe ight) then iLen := 2 ; | |
1615 | ||
1616 | if (fTem plateVital Type = vtC ircum) or | |
1617 | (fTemp lateVitalT ype = vtHe ight) or | |
1618 | (fTemp lateVitalT ype = vtCV P) or | |
1619 | (fTemp lateVitalT ype = vtTe mp) or | |
1620 | (fTemp lateVitalT ype = vtWe ight) then | |
1621 | begin | |
1622 | if ( pos(char(K ey),'01234 56789.') < > 0) and ( cbxInput.S elStart>=p os('.',cbx Input.Text )) then | |
1623 | be gin | |
1624 | s := Piece (cbxInput. Text,'.',2 ); | |
1625 | if Length( s)> iLen-1 then | |
1626 | begin | |
1627 | s := c opy(s,1,iL en-1); | |
1628 | cbxInp ut.Text := Piece(cbx Input.Text ,'.',1)+'. '+s+Key; | |
1629 | cbxInp ut.SelStar t := pos(' .',cbxInpu t.Text)+iL en-1; | |
1630 | cbxInp ut.SelLeng th := 1; | |
1631 | Key := #0; | |
1632 | end; | |
1633 | en d; | |
1634 | ||
1635 | end; | |
1636 | end; | |
1637 | ||
1638 | function T fraGMV_Inp utOne2.get StatusStri ng; | |
1639 | begin | |
1640 | result : = lblVital .Caption; | |
1641 | end; | |
1642 | ||
1643 | procedure TfraGMV_In putOne2.cb xInputEnte r(Sender: TObject); | |
1644 | begin | |
1645 | setStatu sString(ge tStatusStr ing); | |
1646 | end; | |
1647 | ||
1648 | procedure TfraGMV_In putOne2.se tStatusStr ing(aStrin g:String); | |
1649 | begin | |
1650 | if not a ssigned(fr mGMV_Input Lite) then exit; | |
1651 | try | |
1652 | frmGMV _InputLite .StatusBar .SimpleTex t := ' '+ aString; | |
1653 | except | |
1654 | end; | |
1655 | end; | |
1656 | ||
1657 | procedure TfraGMV_In putOne2.cb xUnitsEnte r(Sender: TObject); | |
1658 | begin | |
1659 | setStatu sString(cb xUnits.Tex t); | |
1660 | end; | |
1661 | ||
1662 | procedure TfraGMV_In putOne2.cb xUnitsExit (Sender: T Object); | |
1663 | begin | |
1664 | setStatu sString('' ); | |
1665 | end; | |
1666 | ||
1667 | end. | |
1668 |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.