Produced by Araxis Merge on 4/16/2019 12:20:47 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 | C:\AraxisMergeCompare\Pri_un\CPRS_32_P2_PCE\OR_30_405V60_SRC\Encounter | fEncounterFrame.pas | Wed Dec 12 14:04:38 2018 UTC |
2 | C:\AraxisMergeCompare\Pri_re\CPRS v32 P2 PCE Standardization-redacted\CPRS_32_P2_PCE\OR_30_405V60_SRC\Encounter | fEncounterFrame.pas | Fri Apr 12 13:42:36 2019 UTC |
Description | Between Files 1 and 2 |
|
---|---|---|
Text Blocks | Lines | |
Unchanged | 2 | 1754 |
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 fEnco unterFrame ; | |
2 | ||
3 | interface | |
4 | ||
5 | uses | |
6 | Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dia logs, | |
7 | Tabs, Co mCtrls, Ex tCtrls, Me nus, StdCt rls, Butto ns, fPCEBa se, fStand ardCodes, | |
8 | fVisitTy pe, fDiagn oses, fPro cedure, fI mmunizatio n, fSkinTe st, fPatie ntEd, | |
9 | fHealthF actor, fEx am, uPCE, rPCE, rTIU , ORCtrls, ORFn, fEn cVitals, r vitals, fB ase508Form , | |
10 | VA508Acc essibility Manager; | |
11 | ||
12 | const | |
13 | //tab na mes | |
14 | CT_Visit Nm = 'Visi t Type'; | |
15 | CT_DiagN m = 'Diag noses'; | |
16 | CT_ProcN m = 'Proc edures'; | |
17 | CT_ImmNm = 'Immu nizations' ; | |
18 | CT_SkinN m = 'Skin Tests'; | |
19 | CT_PedNm = 'Pati ent Ed'; | |
20 | CT_HlthN m = 'Heal th Factors '; | |
21 | CT_XamNm = 'Exam s'; | |
22 | CT_VitNm = 'Vita ls'; | |
23 | CT_GAFNm = 'GAF' ; | |
24 | CT_STDNm = 'Stan dard Codes '; | |
25 | ||
26 | //number s assigned to tabs t o make cha nges easie r | |
27 | //they m ust be seq uential | |
28 | CT_NOPAG E = -1; | |
29 | CT_UNKNO WN = 0; | |
30 | CT_VISIT TYPE = 1; CT_FIR ST = 1; | |
31 | CT_DIAGN OSES = 2; | |
32 | CT_PROCE DURES = 3; | |
33 | CT_IMMUN IZATIONS = 4; | |
34 | CT_SKINT ESTS = 5; | |
35 | CT_PATIE NTED = 6; | |
36 | CT_HEALT HFACTORS = 7; | |
37 | CT_EXAMS = 8; | |
38 | CT_VITAL S = 9; | |
39 | CT_GAF = 10; | |
40 | CT_STAND ARDCODES = 11; CT_LA ST = 11; | |
41 | ||
42 | NUM_TABS = 3 ; | |
43 | TAG_VTYP E = 1 0; | |
44 | TAG_DIAG = 2 0; | |
45 | TAG_PROC = 3 0; | |
46 | TAG_IMMU NIZ = 4 0; | |
47 | TAG_SKIN = 5 0; | |
48 | TAG_PED = 6 0; | |
49 | TAG_HF = 7 0; | |
50 | TAG_XAM = 8 0; | |
51 | TAG_TRT = 9 0; | |
52 | ||
53 | TX_NOSEC TION = '-1 ^No sectio ns found'; | |
54 | TX_PROV_ REQ = 'A p rimary enc ounter pro vider must be select ed before encounter data can' + CRLF + | |
55 | 'be saved. Se lect the P rimary Enc ounter Pro vider on t he VISIT T YPE tab.' + CRLF + | |
56 | 'Oth erwise, pr ess <Cance l> to quit without s aving data .'; | |
57 | ||
58 | TC_PROV_ REQ = 'Mis sing Prima ry Provide r for Enco unter'; | |
59 | ||
60 | type | |
61 | TfrmEnco unterFrame = class(T frmBase508 Form) | |
62 | Status Bar1: TSta tusBar; | |
63 | pnlPag e: TPanel; | |
64 | Bevel1 : TBevel; | |
65 | TabCon trol: TTab Control; | |
66 | ||
67 | proced ure tabPag eChange(Se nder: TObj ect; NewTa b: Integer ; | |
68 | var AllowChang e: Boolean ); | |
69 | proced ure FormRe size(Sende r: TObject ); | |
70 | proced ure Sectio nClick(Sen der: TObje ct); | |
71 | proced ure FormDe stroy(Send er: TObjec t); | |
72 | proced ure FormCr eate(Sende r: TObject ); | |
73 | proced ure FormCl oseQuery(S ender: TOb ject; var CanClose: Boolean); | |
74 | proced ure TabCon trolChange (Sender: T Object); | |
75 | proced ure TabCon trolChangi ng(Sender: TObject; | |
76 | var AllowChang e: Boolean ); | |
77 | proced ure FormKe yDown(Send er: TObjec t; var Key : Word; | |
78 | Shif t: TShiftS tate); | |
79 | proced ure FormCl ose(Sender : TObject; var Actio n: TCloseA ction); | |
80 | proced ure FormCa nResize(Se nder: TObj ect; var N ewWidth, | |
81 | NewH eight: Int eger; var Resize: Bo olean); | |
82 | proced ure FormSh ow(Sender: TObject); | |
83 | proced ure TabCon trolEnter( Sender: TO bject); | |
84 | ||
85 | private | |
86 | FAutoS ave: boole an; | |
87 | FSaveN eeded: boo lean; | |
88 | FChang eSource: I nteger; | |
89 | FCance l: Boolea n; //Indic ates the c ancel butt on has bee n pressed; | |
90 | FAbort : boolean; // indica tes that n either OK or Cancel has been p ressed | |
91 | FormLi st: TStrin gList; // Holds the types of a ny forms t hat will b e used | |
92 | // in the fra me. They must be av ailable at compile t ime | |
93 | FLastP age: TfrmP CEBase; | |
94 | FGiveM ultiTabMes sage: bool ean; | |
95 | proced ure Create ChildForms (Sender: T Object; Lo cation: in teger); | |
96 | proced ure SynchP CEData; | |
97 | proced ure Switch ToPage(New Form: Tfrm PCEBase); //was tf rmPage | |
98 | functi on PageIDT oForm(Page ID: Intege r): TfrmPC EBase; | |
99 | functi on PageIDT oTab(PageI D: Integer ): string; | |
100 | proced ure LoadFo rmList(Loc ation: int eger); | |
101 | proced ure Create Forms; | |
102 | proced ure AddTab s; | |
103 | functi on FormLis tContains( item: stri ng): Boole an; | |
104 | functi on SendDat a: boolean ; | |
105 | proced ure Update Encounter( PCE: TPCED ata); | |
106 | proced ure SetFor mFonts; | |
107 | ||
108 | public | |
109 | proced ure SynchP CEVimmSubD ata; | |
110 | proced ure Select Tab(NewTab Name: stri ng); | |
111 | proper ty ChangeS ource: Integer re ad FChange Source; | |
112 | proper ty Forms: tstringlis t read For mList; | |
113 | proper ty Cancel: Boolean re ad FCancel write FCa ncel; | |
114 | proper ty Abort: B oolean rea d FAbort w rite FAbor t; | |
115 | end; | |
116 | ||
117 | var | |
118 | frmEncou nterFrame: TfrmEncou nterFrame; | |
119 | uSCCond: TSCCon ditions; | |
120 | uVisitTy pe: TPCEPr oc; // contain s info for visit typ e page | |
121 | uEncPCED ata: TPCED ata; | |
122 | uProvide rs: TPCEPr oviderList ; | |
123 | ||
124 | // Returns true if P CE data st ill needs to be save d - vitals /gaf are a lways save d | |
125 | function U pdatePCE(P CEData: TP CEData; Sa veOnExit: boolean = TRUE): boo lean; | |
126 | ||
127 | implementa tion | |
128 | ||
129 | uses | |
130 | uCore, | |
131 | fGAF, uC onst, | |
132 | rCore, f PCEProvide r, rMisc, VA508Acces sibilityRo uter, VAUt ils; | |
133 | ||
134 | {$R *.DFM} | |
135 | ||
136 | {///////// ////////// ////////// ////////// ////////// ////////// ////////// ////////// | |
137 | //Name: fu nction Tfr mEncounter Frame.Page IDToTab(Pa geID: Inte ger): Stri ng; | |
138 | //Created: Jan 1999 | |
139 | //By: Robe rt Bott | |
140 | //Location : ISL | |
141 | //Descript ion: retur ns the tab index tha t correspo nds to a g iven PageI D . | |
142 | ////////// ////////// ////////// ////////// ////////// ////////// ////////// /////////} | |
143 | function T frmEncount erFrame.Pa geIDToTab( PageID: In teger): St ring; | |
144 | begin | |
145 | result : = ''; | |
146 | case Pag eID of | |
147 | CT_NOP AGE: Result : = ''; | |
148 | CT_UNK NOWN: Result : = ''; | |
149 | CT_VIS ITTYPE: Result : = CT_Visit Nm; | |
150 | CT_DIA GNOSES: Result : = CT_DiagN m; | |
151 | CT_PRO CEDURES: Result : = CT_ProcN m; | |
152 | CT_IMM UNIZATIONS : Result : = CT_ImmNm ; | |
153 | CT_SKI NTESTS: Result : = CT_SkinN m; | |
154 | CT_PAT IENTED: Result : = CT_PedNm ; | |
155 | CT_HEA LTHFACTORS : Result : = CT_HlthN m; | |
156 | CT_EXA MS: Result : = CT_XamNm ; | |
157 | CT_VIT ALS: Result : = CT_VitNm ; | |
158 | CT_GAF : Result : = CT_GAFNm ; | |
159 | CT_STA NDARDCODES : Result : = CT_STDNm ; | |
160 | end; | |
161 | end; | |
162 | ||
163 | ||
164 | {///////// ////////// ////////// ////////// ////////// ////////// ////////// ////////// | |
165 | //Name: fu nction Tfr mEncounter Frame.Page IDToForm(P ageID: Int eger): Tfr mPCEBase; | |
166 | //Created: Jan 1999 | |
167 | //By: Robe rt Bott | |
168 | //Location : ISL | |
169 | //Descript ion: retur n the form name base d on the P ageID} | |
170 | ////////// ////////// ////////// ////////// ////////// ////////// ////////// /////////} | |
171 | function T frmEncount erFrame.Pa geIDToForm (PageID: I nteger): T frmPCEBase ; | |
172 | begin | |
173 | case Pag eID of | |
174 | CT_VIS ITTYPE: Result : = frmVisit Type; | |
175 | CT_DIA GNOSES: Result : = frmDiagn oses; | |
176 | CT_PRO CEDURES: Result : = frmProce dures; | |
177 | CT_IMM UNIZATIONS : Result : = frmImmun izations; | |
178 | CT_SKI NTESTS: Result : = frmSkinT ests; | |
179 | CT_PAT IENTED: Result : = frmPatie ntEd; | |
180 | CT_HEA LTHFACTORS : Result : = frmHealt hFactors; | |
181 | CT_EXA MS: Result : = frmExams ; | |
182 | CT_VIT ALS: Result : = frmEncVi tals; | |
183 | CT_GAF : Result : = frmGAF; | |
184 | CT_STA NDARDCODES : Result : = frmStand ardCodes; | |
185 | else // not a vali d form | |
186 | result := frmPCE Base; | |
187 | end; | |
188 | end; | |
189 | ||
190 | ||
191 | {///////// ////////// ////////// ////////// ////////// ////////// ////////// ////////// | |
192 | //Name: pr ocedure Tf rmEncounte rFrame.Cre atChildFor ms(Sender: TObject); | |
193 | //Created: Jan 1999 | |
194 | //By: Robe rt Bott | |
195 | //Location : ISL | |
196 | //Descript ion: Finds out what pages to d isplay, ha s the page s and tabs created. | |
197 | ////////// ////////// ////////// ////////// ////////// ////////// ////////// /////////} | |
198 | procedure TfrmEncoun terFrame.C reateChild Forms(Send er: TObjec t; Locatio n: integer ); | |
199 | begin | |
200 | //load F ormList wi th a list of all for ms to disp lay. | |
201 | inherite d; | |
202 | LoadForm List(Locat ion); | |
203 | AddTabs; | |
204 | CreateFo rms; | |
205 | end; | |
206 | ||
207 | ||
208 | ||
209 | {///////// ////////// ////////// ////////// ////////// ////////// ////////// ////////// | |
210 | //Name: Tf rmEncounte rFrame.Loa dFormList; | |
211 | //Created: Jan 1999 | |
212 | //By: Robe rt Bott | |
213 | //Location : ISL | |
214 | //Descript ion: Loads Formlist with the f orms to cr eate, will be replac ed by RPC call. | |
215 | ////////// ////////// ////////// ////////// ////////// ////////// ////////// /////////} | |
216 | procedure TfrmEncoun terFrame.L oadFormLis t(Location : integer) ; | |
217 | begin | |
218 | //change this to a n RPC in R PCE.pas | |
219 | FormList .clear; | |
220 | FormList .add(CT_Vi sitNm); | |
221 | FormList .add(CT_Di agNm); | |
222 | FormList .add(CT_Pr ocNm); | |
223 | formList .add(CT_Vi tNm); | |
224 | formList .add(CT_Im mNm); | |
225 | formList .add(CT_Sk inNm); | |
226 | formList .add(CT_Pe dNm); | |
227 | formList .add(CT_Hl thNm); | |
228 | formList .add(CT_Xa mNm); | |
229 | if MHCli nic(Locati on) then | |
230 | formLi st.add(CT_ GAFNm); | |
231 | if Stand ardCodesAc tive then | |
232 | formLi st.add(CT_ STDNm); | |
233 | end; | |
234 | ||
235 | ||
236 | {///////// ////////// ////////// ////////// ////////// ////////// ////////// ////////// | |
237 | //Name: fu nction Tfr mEncounter Frame.Form ListContai ns(item: s tring): Bo olean; | |
238 | //Created: 12/06/98 | |
239 | //By: Robe rt Bott | |
240 | //Location : ISL | |
241 | //Descript ion: Retur ns a boole an value i ndicating if a given string ex ists in | |
242 | // the for mlist. | |
243 | ////////// ////////// ////////// ////////// ////////// ////////// ////////// /////////} | |
244 | function T frmEncount erFrame.Fo rmListCont ains(item: string): Boolean; | |
245 | begin | |
246 | result : = false; | |
247 | if (Form List.Index Of(item) < > -1 ) the n | |
248 | result := true; | |
249 | end; | |
250 | ||
251 | {///////// ////////// ////////// ////////// ////////// ////////// ////////// ////////// | |
252 | //Name: pr ocedure Tf rmEncounte rFrame.Cre ateForms; | |
253 | //Created: Jan 1999 | |
254 | //By: Robe rt Bott | |
255 | //Location : ISL | |
256 | //Descript ion: Crea tes all of the forms in the li st. | |
257 | ////////// ////////// ////////// ////////// ////////// ////////// ////////// /////////} | |
258 | procedure TfrmEncoun terFrame.C reateForms ; | |
259 | var | |
260 | i: integ er; | |
261 | begin | |
262 | //could this be pl aced in a loop using PagedIdTo Tab & Page IDToFOrm & ? | |
263 | ||
264 | if FormL istContain s(CT_Visit Nm) then | |
265 | frmVis itType := TfrmVisit Type.Creat eLinked(pn lPage); | |
266 | if FormL istContain s(CT_DiagN m) then | |
267 | frmDia gnoses := TfrmDiagn oses.Creat eLinked(pn lPage); | |
268 | if FormL istContain s(CT_ProcN m) then | |
269 | frmPro cedures := TfrmProce dures.Crea teLinked(p nlPage); | |
270 | if FormL istContain s(CT_VitNm ) then | |
271 | frmEnc Vitals := TfrmEncVit als.Create Linked(pnl Page); | |
272 | if FormL istContain s(CT_ImmNm ) then | |
273 | frmImm unizations := TfrmIm munization s.CreateLi nked(pnlPa ge); | |
274 | if FormL istContain s(CT_SkinN m) then | |
275 | frmSki nTests := TfrmSkinTe sts.Create Linked(pnl Page); | |
276 | if FormL istContain s(CT_PedNm ) then | |
277 | frmPat ientEd := TfrmPatien tEd.Create Linked(pnl Page); | |
278 | if FormL istContain s(CT_HlthN m) then | |
279 | frmHea lthFactors := TfrmHE althFactor s.CreateLi nked(pnlPa ge); | |
280 | if FormL istContain s(CT_XamNm ) then | |
281 | frmExa ms := Tfrm Exams.Crea teLinked(p nlPage); | |
282 | if FormL istContain s(CT_GAFNm ) then | |
283 | frmGAF := TfrmGA F.CreateLi nked(pnlPa ge); | |
284 | if FormL istContain s(CT_STDNm ) then | |
285 | frmSta ndardCodes := TfrmSt andardCode s.CreateLi nked(pnlPa ge); | |
286 | //must s witch base d on capti on, as all tabs may not be pre sent. | |
287 | for i := CT_FIRST to CT_LAST do | |
288 | begin | |
289 | if For mlist.Inde xOf(PageId ToTab(i)) <> -1 then | |
290 | Page IDToForm(i ).Visible := (Formli st.IndexOf (PageIdToT ab(i)) = 0 ); | |
291 | end; | |
292 | end; | |
293 | ||
294 | ||
295 | {///////// ////////// ////////// ////////// ////////// ////////// ////////// ////////// | |
296 | //Name: Tf rmEncounte rFrame.Swi tchToPage( NewForm: t frmPCEBase ); | |
297 | //Created: Jan 1999 | |
298 | //By: Robe rt Bott | |
299 | //Location : ISL | |
300 | //Descript ion: Bring s the sele cted page to the fro nt for dis play. | |
301 | ////////// ////////// ////////// ////////// ////////// ////////// ////////// /////////} | |
302 | procedure TfrmEncoun terFrame.S witchToPag e(NewForm: tfrmPCEBa se);// was TfrmPage) ; | |
303 | { unmerge/ merge menu s, bring p age to top of z-orde r, call fo rm-specifi c OnDispla y code } | |
304 | begin | |
305 | if (NewF orm = nil) or (FLast Page = New Form) then Exit; | |
306 | if Assig ned(FLastP age) then | |
307 | FLastP age.Hide; | |
308 | FLastPag e := NewFo rm; | |
309 | // KeyPre view := (N ewForm = f rmEncVital s); | |
310 | NewForm. DisplayPag e; // thi s calls Br ingToFront for the f orm | |
311 | end; | |
312 | ||
313 | ||
314 | ||
315 | {///////// ////////// ////////// ////////// ////////// ////////// ////////// ////////// | |
316 | //Name: pr ocedure Tf rmEncounte rFrame.tab PageChange (Sender: T Object; Ne wTab: Inte ger; var A llowChange : Boolean) ; | |
317 | //Created: Jan 1999 | |
318 | //By: Robe rt Bott | |
319 | //Location : ISL | |
320 | //Descript ion: Finds the page, and calls SwithToPa ge to disp lay it. | |
321 | ////////// ////////// ////////// ////////// ////////// ////////// ////////// /////////} | |
322 | procedure TfrmEncoun terFrame.t abPageChan ge(Sender: TObject; NewTab: In teger; var AllowChan ge: Boolea n); | |
323 | { switches to form l inked to N ewTab } | |
324 | var | |
325 | i: integ er; | |
326 | begin | |
327 | //must swi tch based on caption , as all t abs may no t be prese nt. | |
328 | for i := C T_FIRST to CT_LAST d o | |
329 | begin | |
330 | With For mlist do | |
331 | if New Tab = Inde xOf(PageId ToTab(i)) then | |
332 | begin | |
333 | Page IDToForm(i ).show; | |
334 | Swit chToPage(P ageIDToFor m(i)); | |
335 | end; | |
336 | end; | |
337 | end; | |
338 | ||
339 | { Resize a nd Font-Ch ange proce dures ---- ---------- ---------- ---------- ---------- ---------- --- } | |
340 | ||
341 | {///////// ////////// ////////// ////////// ////////// ////////// ////////// ////////// | |
342 | //Name: pr ocedure Tf rmEncounte rFrame.For mResize(Se nder: TObj ect); | |
343 | //Created: Jan 1999 | |
344 | //By: Robe rt Bott | |
345 | //Location : ISL | |
346 | //Descript ion: Resiz es all win dows when parent cha nges. | |
347 | ////////// ////////// ////////// ////////// ////////// ////////// ////////// /////////} | |
348 | procedure TfrmEncoun terFrame.F ormResize( Sender: TO bject); | |
349 | var | |
350 | i: integ er; | |
351 | begin | |
352 | for i := CT_FIRST t o CT_LAST do | |
353 | if (For mList.Inde xOf(PageId ToTab(i)) <> -1) the n | |
354 | MoveW indow(Page IdToForm(i ).Handle, 0, 0, pnlP age.Client Width, pnl page.Clien tHeight, t rue); | |
355 | self.rep aint; | |
356 | end; | |
357 | ||
358 | {///////// ////////// ////////// ////////// ////////// ////////// ////////// ////////// | |
359 | //Name: pr ocedure Tf rmEncounte rFrame.Add Tabs; | |
360 | //Created: Jan 1999 | |
361 | //By: Robe rt Bott | |
362 | //Location : ISL | |
363 | //Descript ion: adds a tab for each page that will be display ed | |
364 | ////////// ////////// ////////// ////////// ////////// ////////// ////////// /////////} | |
365 | procedure TfrmEncoun terFrame.A ddTabs; | |
366 | ||
367 | var | |
368 | i: integ er; | |
369 | begin | |
370 | TabContr ol.Tabs.Cl ear; | |
371 | for I := 0 to (For mlist.coun t - 1) do | |
372 | TabCon trol.Tabs. Add(Formli st.Strings [i]); | |
373 | end; | |
374 | ||
375 | ||
376 | {///////// ////////// ////////// ////////// ////////// ////////// ////////// ////////// | |
377 | //Name: pr ocedure Up datePCE(PC EData: TPC EData); | |
378 | //Created: Jan 1999 | |
379 | //By: Robe rt Bott | |
380 | //Location : ISL | |
381 | //Descript ion: The m ain call t o open the encounter frame and capture e ncounter | |
382 | // informa tion. | |
383 | ////////// ////////// ////////// ////////// ////////// ////////// ////////// /////////} | |
384 | function U pdatePCE(P CEData: TP CEData; Sa veOnExit: boolean = TRUE): boo lean; | |
385 | var | |
386 | // FontHe ight, | |
387 | // FontWi dth: Integ er; | |
388 | AUser: s tring; | |
389 | ||
390 | begin | |
391 | frmEncou nterFrame := TfrmEnc ounterFram e.Create(A pplication ); | |
392 | try | |
393 | frmEnc ounterFram e.FAutoSav e := SaveO nExit; | |
394 | ||
395 | uEncPC EData := P CEData; | |
396 | if(uEn cPCEData.E mpty and ( (uEncPCEDa ta.Locatio n = 0) or (uEncPCEDa ta.VisitDa teTime = 0 )) and | |
397 | (not Encounter .NeedVisit )) then | |
398 | uEnc PCEData.Us eEncounter := TRUE; | |
399 | frmEnc ounterFram e.Caption := 'Encoun ter Form f or ' + Ext ernalName( uEncPCEDat a.Location , 44) + | |
400 | ' (' + FormatFM DateTime(' mmm dd,yyy y@hh:nn', uEncPCEDat a.VisitDat eTime) + ' )'; | |
401 | uProvi ders.Assig n(uEncPCED ata.Provid ers); | |
402 | SetDef aultProvid er(uProvid ers, uEncP CEData); | |
403 | AUser := IntToSt r(uProvide rs.Pending IEN(FALSE) ); | |
404 | if(AUs er <> '0') and (uPro viders.Ind exOfProvid er(AUser) < 0) and | |
405 | Aut oCheckout( uEncPCEDat a.Location ) then | |
406 | uPro viders.Add Provider(A User, uPro viders.Pen dingName(F ALSE), FAL SE); | |
407 | ||
408 | frmEnc ounterFram e.CreateCh ildForms(f rmEncounte rFrame, PC EData.Loca tion); | |
409 | SetFor mPosition( frmEncount erFrame); | |
410 | Resize AnchoredFo rmToFont(f rmEncounte rFrame); | |
411 | //SetF ormPositio n(frmEncou nterFrame) ; | |
412 | ||
413 | with f rmEncounte rFrame do | |
414 | begin | |
415 | SetR PCEncLocat ion(PCEDat a.Location ); | |
416 | Sync hPCEData; | |
417 | TabC ontrol.Tab index := 0 ; | |
418 | TabC ontrolChan ge(TabCont rol); | |
419 | ||
420 | Show Modal; | |
421 | Resu lt := FSav eNeeded; | |
422 | end; | |
423 | finally | |
424 | // frm EncounterF rame.Free; v22.11 (JD and SM ) | |
425 | frmEnc ounterFram e.Release; | |
426 | //frmE ncounterFr ame := nil ; access violation source? r emoved 7/2 8/03 RV | |
427 | end; | |
428 | end; | |
429 | ||
430 | {///////// ////////// ////////// ////////// ////////// ////////// ////////// ////////// | |
431 | //Name: Tf rmEncounte rFrame.Sec tionClick( Sender: TO bject); | |
432 | //Created: Jan 1999 | |
433 | //By: Robe rt Bott | |
434 | //Location : ISL | |
435 | //Descript ion: Call the proced ure apropr iate for t he selecte d tab | |
436 | ////////// ////////// ////////// ////////// ////////// ////////// ////////// /////////} | |
437 | procedure TfrmEncoun terFrame.S ectionClic k(Sender: TObject); | |
438 | begin | |
439 | with Sen der as TLi stBox do c ase Tag of | |
440 | TAG_VTYP E: if Fo rmListCont ains(CT_Vi sitNm) the n | |
441 | begin | |
442 | wit h frmVisit Type do | |
443 | l stVTypeSec tionClick( Sender); | |
444 | end; | |
445 | end; | |
446 | end; | |
447 | ||
448 | procedure EmptyProc( Dest: TStr ings); | |
449 | begin | |
450 | // used bu Sync St andard Cod es | |
451 | end; | |
452 | {///////// ////////// ////////// ////////// ////////// ////////// ////////// ////////// | |
453 | //Name: pr ocedure Tf rmEncounte rFrame.Syn chPCEData; | |
454 | //Created: Jan 1999 | |
455 | //By: Robe rt Bott | |
456 | //Location : ISL | |
457 | //Descript ion: Synch ronize any existing PCE data w ith what i s displaye d in the f orm. | |
458 | ////////// ////////// ////////// ////////// ////////// ////////// ////////// /////////} | |
459 | procedure TfrmEncoun terFrame.S ynchPCEDat a; | |
460 | ||
461 | procedur e InitList (AListBox: TORListBo x); | |
462 | var | |
463 | DoClic k: boolean ; | |
464 | ||
465 | begin | |
466 | with A ListBox do | |
467 | begin | |
468 | DoCl ick := TRU E; | |
469 | case Tag of | |
470 | TA G_VTYPE: begin | |
471 | if Form ListContai ns(CT_Visi tNm) then | |
472 | List VisitTypeS ections(It ems); | |
473 | DoClick := AutoSe lectVisit( PCERPCEncL ocation); | |
474 | end; | |
475 | end; | |
476 | if I tems.Count > 0 then | |
477 | begi n | |
478 | if DoClick t hen | |
479 | be gin | |
480 | ItemIndex := 0; | |
481 | SectionCli ck(AListBo x); | |
482 | en d; | |
483 | end | |
484 | else Items.Add (TX_NOSECT ION); | |
485 | end; | |
486 | end; | |
487 | ||
488 | begin | |
489 | if FormL istContain s(CT_Visit Nm) then | |
490 | with frm VisitType do | |
491 | begin | |
492 | Init List(frmVi sitType.ls tVTypeSect ion); // s et up Visi t Type pag e | |
493 | List SCDisabili ties(memSC Display.Li nes); | |
494 | uSCC ond := Eli gbleCondit ions; | |
495 | frmV isitType.f raVisitRel ated.InitA llow(uSCCo nd); | |
496 | end; | |
497 | with uEn cPCEData d o // load any existi ng data fr om PCEData | |
498 | begin | |
499 | if For mListConta ins(CT_Vis itNm) then | |
500 | frmV isitType.f raVisitRel ated.InitR elated(uEn cPCEData); | |
501 | if For mListConta ins(CT_Dia gNm) then | |
502 | frmD iagnoses.I nitTab(Cop yDiagnoses , ListDiag nosisSecti ons); | |
503 | if For mListConta ins(CT_Pro cNm) then | |
504 | frmP rocedures. InitTab(Co pyProcedur es, ListPr ocedureSec tions); | |
505 | if For mListConta ins(CT_Imm Nm) then | |
506 | frmI mmunizatio ns.InitTab (CopyImmun izations,L istImmuniz Sections); | |
507 | if For mListConta ins(CT_Ski nNm) then | |
508 | frmS kinTests.I nitTab(Cop ySkinTests , ListSkin Sections); | |
509 | if For mListConta ins(CT_Ped Nm) then | |
510 | frmP atientEd.I nitTab(Cop yPatientEd s, ListPat ientSectio ns); | |
511 | if For mListConta ins(CT_Hlt hNm) then | |
512 | frmH ealthFacto rs.InitTab (CopyHealt hFactors, ListHealth Sections); | |
513 | if For mListConta ins(CT_Xam Nm) then | |
514 | frmE xams.InitT ab(CopyExa ms, ListEx amsSection s); | |
515 | if For mListConta ins(CT_STD Nm) then | |
516 | frmS tandardCod es.InitTab (CopyStand ardCodes, EmptyProc) ; | |
517 | uVisit Type.Assig n(VisitTyp e); | |
518 | if For mListConta ins(CT_Vis itNm) then | |
519 | with f rmVisitTyp e do | |
520 | begin | |
521 | Matc hVType; | |
522 | end; | |
523 | end; | |
524 | end; | |
525 | ||
526 | ||
527 | procedure TfrmEncoun terFrame.S ynchPCEVim mSubData; | |
528 | begin | |
529 | with uEn cPCEData d o // load any existi ng data fr om PCEData | |
530 | begin | |
531 | if F ormListCon tains(CT_D iagNm) the n | |
532 | be gin | |
533 | frmDiagnos es.removeA ll; | |
534 | frmDiagnos es.InitTab (CopyDiagn oses, List DiagnosisS ections); | |
535 | en d; | |
536 | if F ormListCon tains(CT_P rocNm) the n | |
537 | be gin | |
538 | frmProcedu res.remove All; | |
539 | frmProcedu res.InitTa b(CopyProc edures, Li stProcedur eSections) ; | |
540 | en d; | |
541 | end; | |
542 | end; | |
543 | ||
544 | {///////// ////////// ////////// ////////// ////////// ////////// ////////// ////////// | |
545 | //Name: pr ocedure Tf rmEncounte rFrame.For mDestroy(S ender: TOb ject); | |
546 | //Created: Jan 1999 | |
547 | //By: Robe rt Bott | |
548 | //Location : ISL | |
549 | //Descript ion: Free up objects in memory when dest roying for m. | |
550 | ////////// ////////// ////////// ////////// ////////// ////////// ////////// /////////} | |
551 | procedure TfrmEncoun terFrame.F ormDestroy (Sender: T Object); | |
552 | var | |
553 | i: integ er; | |
554 | ||
555 | begin | |
556 | inherite d; | |
557 | for i := Component Count-1 do wnto 0 do | |
558 | if(Com ponents[i] is TForm) then | |
559 | TFor m(Componen ts[i]).Fre e; | |
560 | formlist .clear; | |
561 | KillObj( @uProvider s); | |
562 | uVisitTy pe.Free; | |
563 | Formlist .free; | |
564 | Applicat ion.Proces sMessages; | |
565 | end; | |
566 | ||
567 | ||
568 | {///////// ////////// ////////// ////////// ////////// ////////// ////////// ////////// | |
569 | //Name: pr ocedure Tf rmEncounte rFrame.For mCreate(Se nder: TObj ect); | |
570 | //Created: Jan 1999 | |
571 | //By: Robe rt Bott | |
572 | //Location : ISL | |
573 | //Descript ion: Creat e instance s of the o bjects nee ded. | |
574 | ////////// ////////// ////////// ////////// ////////// ////////// ////////// /////////} | |
575 | procedure TfrmEncoun terFrame.F ormCreate( Sender: TO bject); | |
576 | begin | |
577 | uProvide rs := TPCE ProviderLi st.Create; | |
578 | uVisitTy pe := TPCE Proc.creat e; | |
579 | //uVital Old := TS tringList. create; | |
580 | //uVital New := TS tringList. create; | |
581 | FormList := TStrin gList.crea te; | |
582 | fCancel := False; | |
583 | FAbort : = TRUE; | |
584 | SetFormF onts; | |
585 | FGiveMul tiTabMessa ge := Scre enReaderSy stemActive ; | |
586 | end; | |
587 | ||
588 | ||
589 | {///////// ////////// ////////// ////////// ////////// ////////// ////////// ////////// | |
590 | //Name: pr ocedure Tf rmEncounte rFrame.Sen dData; | |
591 | //Created: Jan 1999 | |
592 | //By: Robe rt Bott | |
593 | //Location : ISL | |
594 | //Descript ion: Send Data back to the M s ide sor st oring. | |
595 | ////////// ////////// ////////// ////////// ////////// ////////// ////////// /////////} | |
596 | function T frmEncount erFrame.Se ndData: bo olean; | |
597 | //send PCE data to t he RPC | |
598 | var | |
599 | StoreMes sage: stri ng; | |
600 | GAFScore : integer; | |
601 | GAFDate: TFMDateTi me; | |
602 | GAFStaff : Int64; | |
603 | ||
604 | begin | |
605 | inherite d; | |
606 | // do va lidation f or vitals & anything else here | |
607 | Result := true; | |
608 | //proces s vitals | |
609 | if FormL istContain s(CT_VitNm ) then | |
610 | begin | |
611 | with f rmEncVital s do | |
612 | if Has Data then | |
613 | begin | |
614 | if A ssignVital s then | |
615 | begi n | |
616 | St oreMessage := ValAnd StoreVital s(frmEncVi tals.Vital New); | |
617 | if (Storemes sage <> 'T rue') then | |
618 | be gin | |
619 | ShowMsg(st oremessage ); | |
620 | // exit; | |
621 | en d; | |
622 | end; | |
623 | end; | |
624 | end; | |
625 | ||
626 | if(FormL istContain s(CT_GAFNm )) then | |
627 | begin | |
628 | frmGAF .GetGAFSco re(GAFScor e, GAFDate , GAFStaff ); | |
629 | if(GAF Score > 0) then | |
630 | Save GAFScore(G AFScore, G AFDate, GA FStaff); | |
631 | end; | |
632 | ||
633 | //PCE | |
634 | ||
635 | UpdateEn counter(uE ncPCEData) ; | |
636 | with uEn cPCEData d o | |
637 | begin | |
638 | if FAu toSave the n | |
639 | Resu lt := Save | |
640 | else | |
641 | FSav eNeeded := TRUE; | |
642 | end; | |
643 | if Resul t then Clo se; | |
644 | end; | |
645 | ||
646 | {///////// ////////// ////////// ////////// ////////// ////////// ////////// ////////// | |
647 | //Name: pr ocedure Tf rmEncounte rFrame.For mCloseQuer y(Sender: TObject; | |
648 | //Created: Jan 1999 | |
649 | //By: Robe rt Bott | |
650 | //Location : ISL | |
651 | //Descript ion: Check to see if the Cance l button w as pressed , if not, call | |
652 | // procedu re to send the data to the ser ver. | |
653 | ////////// ////////// ////////// ////////// ////////// ////////// ////////// /////////} | |
654 | procedure TfrmEncoun terFrame.F ormCloseQu ery(Sender : TObject; | |
655 | var CanC lose: Bool ean); | |
656 | ||
657 | const | |
658 | TXT_SAVE CHANGES = 'Save Chan ges?'; | |
659 | ||
660 | var | |
661 | TmpPCEDa ta: TPCEDa ta; | |
662 | ask, Cha ngeOK: boo lean; | |
663 | ||
664 | begin | |
665 | CanClose := True; | |
666 | if(FAbor t) then | |
667 | FCance l := (Info Box(TXT_SA VECHANGES, TXT_SAVEC HANGES, MB _YESNO) = ID_NO); | |
668 | if FCanc el then Ex it; //*KC M* | |
669 | ||
670 | if(uProv iders.Prim aryIdx >= 0) then | |
671 | ask := TRUE | |
672 | else | |
673 | begin | |
674 | TmpPCE Data := TP CEData.Cre ate; | |
675 | try | |
676 | uEnc PCEData.Co pyPCEData( TmpPCEData ); | |
677 | Upda teEncounte r(TmpPCEDa ta); | |
678 | ask := TmpPCED ata.NeedPr oviderInfo ; | |
679 | finall y | |
680 | TmpP CEData.Fre e; | |
681 | end; | |
682 | end; | |
683 | if ask a nd (NoPrim aryPCEProv ider(uProv iders, uEn cPCEData)) then | |
684 | begin | |
685 | InfoBo x(TX_PROV_ REQ, TC_PR OV_REQ, MB _OK or MB_ ICONWARNIN G); | |
686 | CanClo se := Fals e; | |
687 | Exit; | |
688 | end; | |
689 | ||
690 | uVisitTy pe.Provide r := uProv iders.Prim aryIEN; { RV - v20.1 } | |
691 | ||
692 | if FormL istContain s(CT_VitNm ) then | |
693 | CanClo se := frmE ncVitals.O K2SaveVita ls; | |
694 | ||
695 | if CanCl ose and Fo rmListCont ains(CT_Pr ocNm) then | |
696 | begin | |
697 | CanC lose := fr mProcedure s.OK2SaveP rocedures; | |
698 | if n ot CanClos e then | |
699 | be gin | |
700 | tabPageCha nge(Self, FormList.I ndexOf(CT_ ProcNm), C hangeOK); | |
701 | SwitchToPa ge(PageIDT oForm(CT_P ROCEDURES) ); | |
702 | TabControl .TabIndex := FormLis t.IndexOf( CT_ProcNm) ; | |
703 | en d; | |
704 | end; | |
705 | ||
706 | if CanCl ose then C anClose := SendData; //*KCM* | |
707 | ||
708 | end; | |
709 | ||
710 | procedure TfrmEncoun terFrame.T abControlC hange(Send er: TObjec t); | |
711 | var | |
712 | i: integ er; | |
713 | begin | |
714 | //must swi tch based on caption , as all t abs may no t be prese nt. | |
715 | if (send er as tTab Control).t abindex = -1 then ex it; | |
716 | ||
717 | if TabCo ntrol.CanF ocus and A ssigned(FL astPage) a nd not Tab Control.Fo cused then | |
718 | TabCon trol.SetFo cus; //CQ : 14845 | |
719 | ||
720 | for i := CT_FIRST to CT_LAST do | |
721 | begin | |
722 | with F ormlist do | |
723 | with sender as tTabContr ol do | |
724 | if Tabindex = IndexOf( PageIdToTa b(i)) then | |
725 | begi n | |
726 | Pa geIDToForm (i).show; | |
727 | Sw itchToPage (PageIDToF orm(i)); | |
728 | Ex it; | |
729 | end; | |
730 | end; | |
731 | end; | |
732 | ||
733 | procedure TfrmEncoun terFrame.T abControlC hanging(Se nder: TObj ect; | |
734 | var Allo wChange: B oolean); | |
735 | begin | |
736 | if(assig ned(FLastP age)) then | |
737 | FLastP age.AllowT abChange(A llowChange ); | |
738 | end; | |
739 | ||
740 | procedure TfrmEncoun terFrame.U pdateEncou nter(PCE: TPCEData); | |
741 | begin | |
742 | with PCE do | |
743 | begin | |
744 | if For mListConta ins(CT_Vis itNm) then | |
745 | begin | |
746 | Visi tType := u VisitType; | |
747 | frmV isitType.f raVisitRel ated.GetRe lated(uEnc PCEData); | |
748 | Prov iders.Merg e(uProvide rs); | |
749 | end; | |
750 | // DN S BELLC | |
751 | if For mListConta ins(CT_Dia gNm) then | |
752 | SetD iagnoses(f rmDiagnose s.lstCapti onList.Ite msStrings) ; | |
753 | if For mListConta ins(CT_Pro cNm) then | |
754 | SetPr ocedures(f rmProcedur es.lstCapt ionList.It emsStrings ); | |
755 | if For mListConta ins(CT_Imm Nm) then | |
756 | Set Immunizati ons(frmImm unizations .lstCaptio nList.Item sStrings); | |
757 | if For mListConta ins(CT_Ski nNm) then | |
758 | Set SkinTests( frmSkinTes ts.lstCapt ionList.It emsStrings ); | |
759 | if For mListConta ins(CT_Ped Nm) then | |
760 | SetP atientEds( frmPatient Ed.lstCapt ionList.It emsStrings ); | |
761 | if For mListConta ins(CT_Hlt hNm) then | |
762 | SetH ealthFacto rs(frmHeal thFactors. lstCaption List.Items Strings); | |
763 | if For mListConta ins(CT_Xam Nm) then | |
764 | SetE xams(frmEx ams.lstCap tionList.I temsString s); | |
765 | if For mListConta ins(CT_STD Nm) then | |
766 | SetS tandardCod es(frmStan dardCodes. lstCaption List.Items Strings); | |
767 | end; | |
768 | end; | |
769 | ||
770 | procedure TfrmEncoun terFrame.S electTab(N ewTabName: string); | |
771 | var | |
772 | AllowCha nge: boole an; | |
773 | begin | |
774 | AllowCha nge := Tru e; | |
775 | tabContr ol.TabInde x := FormL ist.IndexO f(NewTabNa me); | |
776 | tabPageC hange(Self , tabContr ol.TabInde x, AllowCh ange); | |
777 | end; | |
778 | ||
779 | procedure TfrmEncoun terFrame.T abControlE nter(Sende r: TObject ); | |
780 | begin | |
781 | if FGive MultiTabMe ssage then // CQ#154 83 | |
782 | begin | |
783 | FGiveM ultiTabMes sage := FA LSE; | |
784 | GetScr eenReader. Speak('Mul ti tab for m'); | |
785 | end; | |
786 | end; | |
787 | ||
788 | procedure TfrmEncoun terFrame.F ormKeyDown (Sender: T Object; va r Key: Wor d; | |
789 | Shift: T ShiftState ); | |
790 | var | |
791 | CanChang e: boolean ; | |
792 | begin | |
793 | inherite d; | |
794 | if (Key = VK_ESCAP E) then | |
795 | begin | |
796 | Key := 0; | |
797 | FLastP age.btnCan cel.Click; | |
798 | end | |
799 | else if Key = VK_T AB then | |
800 | begin | |
801 | if ssC trl in Shi ft then | |
802 | begin | |
803 | CanC hange := T rue; | |
804 | if A ssigned(Ta bControl.O nChanging) then | |
805 | Ta bControl.O nChanging( TabControl , CanChang e); | |
806 | if C anChange t hen | |
807 | begi n | |
808 | if ssShift i n Shift th en | |
809 | be gin | |
810 | if TabCont rol.TabInd ex < 1 the n | |
811 | TabContr ol.TabInde x := TabCo ntrol.Tabs .Count -1 | |
812 | else | |
813 | TabContr ol.TabInde x := TabCo ntrol.TabI ndex - 1; | |
814 | en d | |
815 | el se | |
816 | TabControl .TabIndex := (TabCon trol.TabIn dex + 1) m od TabCont rol.Tabs.C ount; | |
817 | if Assigned( TabControl .OnChange) then | |
818 | TabControl .OnChange( TabControl ); | |
819 | end; | |
820 | Key := 0; | |
821 | end; | |
822 | end; | |
823 | end; | |
824 | ||
825 | procedure TfrmEncoun terFrame.S etFormFont s; | |
826 | var | |
827 | NewFontS ize: integ er; | |
828 | begin | |
829 | NewFontS ize := Mai nFontsize; | |
830 | if FormL istContain s(CT_Visit Nm) then | |
831 | frmVis itType.Fon t.Size := NewFontSiz e; | |
832 | if FormL istContain s(CT_DiagN m) then | |
833 | frmDia gnoses.Fon t.Size := NewFontSiz e; | |
834 | if FormL istContain s(CT_ProcN m) then | |
835 | frmPro cedures.Fo nt.Size := NewFontSi ze; | |
836 | if FormL istContain s(CT_ImmNm ) then | |
837 | frmImm unizations .Font.Size := NewFon tSize; | |
838 | if FormL istContain s(CT_SkinN m) then | |
839 | frmSki nTests.Fon t.Size := NewFontSiz e; | |
840 | if FormL istContain s(CT_PedNm ) then | |
841 | frmPat ientEd.Fon t.Size := NewFontSiz e; | |
842 | if FormL istContain s(CT_HlthN m) then | |
843 | frmHea lthFactors .Font.Size := NewFon tSize; | |
844 | if FormL istContain s(CT_XamNm ) then | |
845 | frmExa ms.Font.Si ze := NewF ontSize; | |
846 | if FormL istContain s(CT_VitNm ) then | |
847 | frmEnc Vitals.Fon t.Size := NewFontSiz e; | |
848 | if FormL istContain s(CT_GAFNm ) then | |
849 | frmGAF .SetFontSi ze(NewFont Size); | |
850 | if FormL istContain s(CT_STDNm ) then | |
851 | frmSta ndardCodes .SetFontSi ze(NewFont Size); | |
852 | end; | |
853 | ||
854 | procedure TfrmEncoun terFrame.F ormClose(S ender: TOb ject; | |
855 | var Acti on: TClose Action); | |
856 | begin | |
857 | SaveUser Bounds(Sel f); | |
858 | end; | |
859 | ||
860 | procedure TfrmEncoun terFrame.F ormCanResi ze(Sender: TObject; var NewWid th, | |
861 | NewHeigh t: Integer ; var Resi ze: Boolea n); | |
862 | begin | |
863 | //CQ4740 | |
864 | if NewWi dth < 200 then | |
865 | begin | |
866 | NewWi dth := 200 ; | |
867 | Resiz e := false ; | |
868 | end; | |
869 | end; | |
870 | ||
871 | procedure TfrmEncoun terFrame.F ormShow(Se nder: TObj ect); | |
872 | begin | |
873 | inherite d; | |
874 | if TabCo ntrol.CanF ocus then | |
875 | TabCon trol.SetFo cus; | |
876 | end; | |
877 | ||
878 | end. |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.