Module

fEncnt

Path

C:\CPRS\CPRS30\fEncnt.pas

Last Modified

7/15/2014 3:26:36 PM

Comments

Modifed: 7/26/99
By: Robert Bott
Location: ISL
Description of Mod:
  Moved asignment of historical visit category from the cboNewVisitChange event
   to the ckbHistoricalClick event.

Units Used in Interface

Name Comments
fAutoSz -
fBase508Form -
fFrame -
rOptions -

Units Used in Implementation

Name Comments
fReview -
rCore -
rPCE -
uConst -
uCore -
uPCE -

Classes

Name Comments
TfrmEncounter -

Procedures

Name Owner Declaration Scope Comments
AppShowHint TfrmEncounter procedure AppShowHint(var HintStr: string; var CanShow: Boolean; var HintInfo: THintInfo); Private
Procedure TfrmEncounter.cboPtProviderChange(Sender: TObject);
var
  txt: string;
  AIEN: Int64;

begin
  if(FFilter <> NPF_ENCOUNTER) then exit;
  AIEN := cboPtProvider.ItemIEN;
  if(AIEN <> 0) then
  begin
    txt := InvalidPCEProviderTxt(AIEN, FPCDate);
    if(txt <> '') then
    begin
      InfoBox(cboPtProvider.text + txt, TX_BAD_PROV, MB_OK);
      cboPtProvider.ItemIndex := -1;
    end;
  end;
end;
calVisitDateChange TfrmEncounter procedure calVisitDateChange(Sender: TObject); Public/Published -
calVisitDateExit TfrmEncounter procedure calVisitDateExit(Sender: TObject); Public/Published -
cboNewVisitChange TfrmEncounter procedure cboNewVisitChange(Sender: TObject); Public/Published -
cboNewVisitNeedData TfrmEncounter procedure cboNewVisitNeedData(Sender: TObject; const StartFrom: String; Direction, InsertAt: Integer); Public/Published -
cboPtProviderNeedData TfrmEncounter procedure cboPtProviderNeedData(Sender: TObject; const StartFrom: String; Direction, InsertAt: Integer); Public/Published -
ckbHistoricalClick TfrmEncounter procedure ckbHistoricalClick(Sender: TObject); Public/Published -
cmdCancelClick TfrmEncounter procedure cmdCancelClick(Sender: TObject); Public/Published -
cmdDateRangeClick TfrmEncounter procedure cmdDateRangeClick(Sender: TObject); Public/Published -
cmdOKClick TfrmEncounter procedure cmdOKClick(Sender: TObject); Public/Published -
FormClose TfrmEncounter procedure FormClose(Sender: TObject; var Action: TCloseAction); Public/Published -
FormCreate TfrmEncounter procedure FormCreate(Sender: TObject); Public/Published -
FormDestroy TfrmEncounter procedure FormDestroy(Sender: TObject); Public/Published -
FormResize TfrmEncounter procedure FormResize(Sender: TObject); Public/Published -
FormShow TfrmEncounter procedure FormShow(Sender: TObject); Public/Published -
lstAdmitChange TfrmEncounter procedure lstAdmitChange(Sender: TObject); Public/Published -
lstClinicChange TfrmEncounter procedure lstClinicChange(Sender: TObject); Public/Published V|A;DateTime;LocIEN^DateTime^LocName^Status
pgeVisitChange TfrmEncounter procedure pgeVisitChange(Sender: TObject); Public/Published -
pgeVisitMouseDown TfrmEncounter procedure pgeVisitMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); Public/Published -
SetVisitCat TfrmEncounter procedure SetVisitCat; Private -
UpdateEncounter - procedure UpdateEncounter(PersonFilter: Int64; ADate: TFMDateTime = 0; TIULocation: integer = 0; DelayedOrder: Boolean = False); Interfaced -
UpdateVisit - procedure UpdateVisit(FontSize: Integer; TIULocation: integer); overload; Interfaced -
UpdateVisit - procedure UpdateVisit(FontSize: Integer); overload; Interfaced -

Functions

Name Owner Declaration Scope Comments
AllowAutoFocusChange TfrmEncounter function AllowAutoFocusChange: Boolean; Private -

Global Variables

Name Type Declaration Comments
uTIULocation Integer uTIULocation: integer; -
uTIULocationName UnicodeString uTIULocationName: string; -

Constants

Name Declaration Scope Comments
TC_FUTURE_WARNING 'Visit Is In Future' Global -
TC_LOCONLY 'Location for Current Activities' Global -
TC_MISSING 'Incomplete Encounter Information' Global -
TX_FUTURE_WARNING 'You have selected a visit with a date in the future. Are you sure?' Global -
TX_NO_DATE 'A valid date/time has not been entered.' Global -
TX_NO_LOC 'A visit location has not been selected.' Global -
TX_NO_TIME 'A valid time has not been entered.' Global -


Module Source

1     unit fEncnt;
2     
3     //Modifed: 7/26/99
4     //By: Robert Bott
5     //Location: ISL
6     //Description of Mod:
7     //  Moved asignment of historical visit category from the cboNewVisitChange event
8     //   to the ckbHistoricalClick event.
9     
10    
11    interface
12    
13    uses
14      Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
15      StdCtrls, ORCtrls, ORDtTm, ORFn, ExtCtrls, ComCtrls, ORDtTmRng, fAutoSz, rOptions, fBase508Form,
16      VA508AccessibilityManager, fFrame;
17    
18    type
19      TfrmEncounter = class(TfrmBase508Form)
20        cboPtProvider: TORComboBox;
21        lblProvider: TLabel;
22        cmdOK: TButton;
23        cmdCancel: TButton;
24        lblLocation: TLabel;
25        txtLocation: TCaptionEdit;
26        dlgDateRange: TORDateRangeDlg;
27        cmdDateRange: TButton;
28        lblInstruct: TLabel;
29        Panel1: TPanel;
30        pgeVisit: TPageControl;
31        tabClinic: TTabSheet;
32        lstClinic: TORListBox;
33        tabAdmit: TTabSheet;
34        lstAdmit: TORListBox;
35        tabNewVisit: TTabSheet;
36        lblVisitDate: TLabel;
37        lblNewVisit: TLabel;
38        calVisitDate: TORDateBox;
39        ckbHistorical: TORCheckBox;
40        cboNewVisit: TORComboBox;
41        Panel2: TPanel;
42        lblDateRange: TLabel;
43        lblClinic: TLabel;
44        Panel3: TPanel;
45        lblAdmit: TLabel;
46        procedure FormCreate(Sender: TObject);
47        procedure pgeVisitChange(Sender: TObject);
48        procedure cmdOKClick(Sender: TObject);
49        procedure cmdCancelClick(Sender: TObject);
50        procedure cboNewVisitNeedData(Sender: TObject; const StartFrom: String;
51          Direction, InsertAt: Integer);
52        procedure calVisitDateChange(Sender: TObject);
53        procedure cboNewVisitChange(Sender: TObject);
54        procedure calVisitDateExit(Sender: TObject);
55        procedure cboPtProviderNeedData(Sender: TObject;
56          const StartFrom: String; Direction, InsertAt: Integer);
57        procedure ckbHistoricalClick(Sender: TObject);
58        procedure cmdDateRangeClick(Sender: TObject);
59        procedure FormDestroy(Sender: TObject);
60        procedure FormClose(Sender: TObject; var Action: TCloseAction);
61        procedure lstAdmitChange(Sender: TObject);
62        procedure lstClinicChange(Sender: TObject);
63        procedure FormResize(Sender: TObject);
64        procedure FormShow(Sender: TObject);
65        procedure pgeVisitMouseDown(Sender: TObject; Button: TMouseButton;
66          Shift: TShiftState; X, Y: Integer);
67      private
68        CLINIC_TXT : String;
69        FFilter: Int64;
70        FPCDate: TFMDateTime;
71        FProvider: Int64;
72        FLocation: Integer;
73        FLocationName: string;
74        FDateTime: TFMDateTime;
75        FVisitCategory: Char;
76        FStandAlone: Boolean;
77        FFromSelf: Boolean;
78        FFromDate: TFMDateTime;
79        FThruDate: TFMDateTIme;
80        FEncFutureLimit: string;
81        FFromCreate: Boolean;
82        FOldHintEvent: TShowHintEvent;
83        OKPressed: Boolean;
84        DoNotNeedLocation: Boolean;     //AGP This is used to not force a location when writing a delayed order
85        procedure AppShowHint(var HintStr: string; var CanShow: Boolean;
86                              var HintInfo: THintInfo);
87        procedure SetVisitCat;
88        function AllowAutoFocusChange: Boolean;
89      public
90        { Public declarations }
91      end;
92    
93    procedure UpdateEncounter(PersonFilter: Int64; ADate: TFMDateTime = 0; TIULocation: integer = 0; DelayedOrder: Boolean = False);
94    procedure UpdateVisit(FontSize: Integer); overload;
95    procedure UpdateVisit(FontSize: Integer; TIULocation: integer); overload;
96    
97    implementation
98    
99    {$R *.DFM}
100   
101   uses rCore, uCore, uConst, fReview, uPCE, rPCE, VA508AccessibilityRouter,
102     VAUtils;
103   
104   const
105     TC_MISSING = 'Incomplete Encounter Information';
106     TX_NO_DATE = 'A valid date/time has not been entered.';
107     TX_NO_TIME = 'A valid time has not been entered.';
108     TX_NO_LOC  = 'A visit location has not been selected.';
109     TC_LOCONLY = 'Location for Current Activities';
110     TX_FUTURE_WARNING = 'You have selected a visit with a date in the future.  Are you sure?';
111     TC_FUTURE_WARNING = 'Visit Is In Future';
112   
113   var
114     uTIULocation: integer;
115     uTIULocationName: string;
116   
117   procedure UpdateVisit(FontSize: Integer);
118   begin
119     UpdateEncounter(NPF_SUPPRESS);
120   end;
121   
122   procedure UpdateVisit(FontSize: Integer; TIULocation: integer);
123   begin
124     UpdateEncounter(NPF_SUPPRESS, 0, TIULocation);
125   end;
126   
127   procedure UpdateEncounter(PersonFilter: Int64; ADate: TFMDateTime = 0;  TIULocation: integer = 0; DelayedOrder: Boolean = False);
128   const
129     UP_SHIFT = 85;
130   var
131     frmEncounter: TfrmEncounter;
132     CanChange: Boolean;
133     TimedOut: Boolean;
134   begin
135     uTIULocation := TIULocation;
136     if uTIULocation <> 0 then uTIULocationName := ExternalName(uTIULocation, FN_HOSPITAL_LOCATION);
137     frmEncounter := TfrmEncounter.Create(Application);
138     try
139       if DelayedOrder = True then frmEncounter.DoNotNeedLocation := True
140       else frmEncounter.DoNotNeedLocation := False;
141       TimedOut := False;
142       ResizeAnchoredFormToFont(frmEncounter);
143       with frmEncounter do
144       begin
145         FFilter := PersonFilter;
146         FPCDate := ADate;
147         if PersonFilter = NPF_SUPPRESS then           // not prompting for provider
148         begin
149           lblProvider.Visible := False;
150           cboPtProvider.Visible := False;
151           lblInstruct.Visible := True;
152           Caption := TC_LOCONLY;
153           Height := frmEncounter.Height - UP_SHIFT;
154         end
155         else                                          // also prompt for provider
156         begin
157           // InitLongList must be done AFTER FFilter is set
158           cboPtProvider.InitLongList(Encounter.ProviderName);
159           cboPtProvider.SelectByIEN(FProvider);
160         end;
161         ShowModal;
162         if DEAContext and ((Assigned(Changes.Orders)) and (Changes.Count > 0)) and (Encounter.Provider <> FProvider) then DelayReviewChanges := True;
163         if OKPressed then
164         begin
165           CanChange := True;
166          // if (fframe.frmFrame.DoNotChangeEncWindow = true) and (encounter.Location <> frmEncounter.FLocation) then
167          //    fframe.frmFrame.DoNotChangeEncWindow := false;
168           if (PersonFilter <> NPF_SUPPRESS) and (not DelayReviewChanges) and
169              (((Encounter.Provider =  User.DUZ) and (FProvider <> User.DUZ)) or
170               ((Encounter.Provider <> User.DUZ) and (FProvider =  User.DUZ)))
171              then CanChange := ReviewChanges(TimedOut);
172           if CanChange then
173           begin
174             if PersonFilter <> NPF_SUPPRESS then Encounter.Provider := FProvider;
175             Encounter.Location      := FLocation;
176             Encounter.DateTime      := FDateTime;
177             Encounter.VisitCategory := FVisitCategory;
178             Encounter.StandAlone    := FStandAlone;
179           end;
180         end;
181         if DelayReviewChanges then DelayReviewChanges := False;
182         if DEAContext then DEAContext := False;
183       end;
184     finally
185       frmEncounter.Release;
186     end;
187   end;
188   
189   procedure TfrmEncounter.FormCreate(Sender: TObject);
190   var
191     ADateFrom, ADateThru: TDateTime;
192     BDateFrom, BDateThru: Integer;
193     BDisplayFrom, BDisplayThru: String;
194   begin
195     inherited;
196     FProvider      := Encounter.Provider;
197     FLocation      := Encounter.Location;
198     FLocationName  := Encounter.LocationName;
199     FDateTime      := Encounter.DateTime;
200     FVisitCategory := Encounter.VisitCategory;
201     FStandAlone    := Encounter.StandAlone;
202     rpcGetEncFutureDays(FEncFutureLimit); 
203     rpcGetRangeForEncs(BDateFrom, BDateThru, False); // Get user's current date range settings.
204     if BDateFrom > 0 then
205       BDisplayFrom := 'T-' + IntToStr(BDateFrom)
206     else
207       BDisplayFrom := 'T';
208     if BDateThru > 0 then
209       BDisplayThru := 'T+' + IntToStr(BDateThru)
210     else
211       BDisplayThru := 'T';
212     lblDateRange.Caption := '(' + BDisplayFrom + ' thru ' + BDisplayThru + ')';
213     ADateFrom := (FMDateTimeToDateTime(FMToday) - BDateFrom);
214     ADateThru := (FMDateTimeToDateTime(FMToday) + BDateThru);
215     FFromDate      := DateTimeToFMDateTime(ADateFrom);
216     FThruDate      := DateTimeToFMDateTime(ADateThru) + 0.2359;
217     FFromCreate    := True;
218     with txtLocation do if Length(FLocationName) > 0 then
219     begin
220       Text := FLocationName + '  ';
221       if (FVisitCategory <> 'H') and (FDateTime <> 0) then
222         Text := Text + FormatFMDateTime('mmm dd,yy hh:nn', FDateTime);
223     end
224     else Text := '< Select a location from the tabs below.... >';
225     OKPressed := False;
226     pgeVisit.ActivePage := tabClinic;
227     pgeVisitChange(Self);
228     if lstClinic.Items.Count = 0 then
229     begin
230       pgeVisit.ActivePage := tabNewVisit;
231       pgeVisitChange(Self);
232     end;
233     ckbHistorical.Hint := 'A historical visit or encounter is a visit that occurred at some time' + CRLF +
234                           'in the past or at some other location (possibly non-VA).  Although these' + CRLF +
235                           'are not used for workload credit, they can be used for setting up the' + CRLF +
236                           'PCE reminder maintenance system, or other non-workload-related reasons.';
237     FOldHintEvent := Application.OnShowHint;
238     Application.OnShowHint := AppShowHint;
239     FFromCreate := False;
240     //JAWS will read the second caption if 2 are displayed, so Combining Labels
241     CLINIC_TXT := lblClinic.Caption+'  ';
242     lblClinic.Caption := CLINIC_TXT + lblDateRange.Caption;
243     lblDateRange.Hide;
244   end;
245   
246   procedure TfrmEncounter.cboPtProviderNeedData(Sender: TObject; const StartFrom: string;
247     Direction, InsertAt: Integer);
248   begin
249     inherited;
250     case FFilter of
251       NPF_PROVIDER:  cboPtProvider.ForDataUse(SubSetOfProviders(StartFrom, Direction));
252   //    NPF_ENCOUNTER: cboPtProvider.ForDataUse(SubSetOfUsersWithClass(StartFrom, Direction, FloatToStr(FPCDate)));
253       else cboPtProvider.ForDataUse(SubSetOfPersons(StartFrom, Direction));
254     end;
255   end;
256   
257   procedure TfrmEncounter.pgeVisitChange(Sender: TObject);
258   begin
259     inherited;
260     cmdDateRange.Visible := pgeVisit.ActivePage = tabClinic;
261     if (pgeVisit.ActivePage = tabClinic) and (lstClinic.Items.Count = 0) then
262     begin
263       ListApptAll(lstClinic.Items, Patient.DFN, FFromDate, FThruDate);
264       if AllowAutoFocusChange then
265         ActiveControl := lstClinic;
266     end;
267     if (pgeVisit.ActivePage = tabAdmit)    and (lstAdmit.Items.Count = 0) then
268     begin
269       ListAdmitAll(lstAdmit.Items, Patient.DFN);
270       if AllowAutoFocusChange then
271         ActiveControl := lstAdmit;
272     end;
273     if pgeVisit.ActivePage = tabNewVisit then
274     begin
275       if cboNewVisit.Items.Count = 0 then
276       begin
277         if FVisitCategory <> 'H' then
278         begin
279           if uTIULocation <> 0 then
280           begin
281             cboNewVisit.InitLongList(uTIULocationName);
282             cboNewVisit.SelectByIEN(uTIULocation);
283             cboNewVisitChange(Self);
284           end
285           else
286           begin
287             cboNewVisit.InitLongList(FLocationName);
288             if Encounter.Location <> 0 then cboNewVisit.SelectByIEN(FLocation);
289           end;
290           FFromSelf := True;
291           with calVisitDate do if FDateTime <> 0 then FMDateTime := FDateTime else Text := 'NOW';
292           FFromSelf := False;
293           if AllowAutoFocusChange then
294             ActiveControl := cboNewVisit;
295         end
296         else if FVisitCategory = 'E' then
297         begin
298           ckbHistorical.Checked := True;
299           if AllowAutoFocusChange then
300             ActiveControl := cboNewVisit;
301         end
302         else
303         begin
304           cboNewVisit.InitLongList('');
305         end;
306       end; {if cboNewVisit}
307     end; {if pgeVisit.ActivePage}
308     if ScreenReaderSystemActive then
309       ActiveControl := pgeVisit;
310   end;
311   
312   procedure TfrmEncounter.pgeVisitMouseDown(Sender: TObject;
313     Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
314   begin
315     inherited;
316     if pgeVisit.ActivePage = tabNewVisit then
317       if cboNewVisit.CanFocus then
318         cboNewVisit.SetFocus;
319   end;
320   
321   procedure TfrmEncounter.cboNewVisitNeedData(Sender: TObject; const StartFrom: string;
322     Direction, InsertAt: Integer);
323   begin
324     inherited;
325     cboNewVisit.ForDataUse(SubSetOfNewLocs(StartFrom, Direction));
326   end;
327   
328   procedure TfrmEncounter.cmdDateRangeClick(Sender: TObject);
329   begin
330     dlgDateRange.FMDateStart := FFromDate;
331     dlgDateRange.FMDateStop  := FThruDate;
332     if dlgDateRange.Execute then
333     begin
334       FFromDate := dlgDateRange.FMDateStart;
335       FThruDate := dlgDateRange.FMDateStop + 0.2359;
336       lblDateRange.Caption := '(' + dlgDateRange.RelativeStart + ' thru '
337                                   + dlgDateRange.RelativeStop + ')';
338       //label
339       lblClinic.Caption := CLINIC_TXT + lblDateRange.Caption;
340       //list
341       lstClinic.Caption := lblClinic.Caption + ' ' + lblDateRange.Caption;
342       lstClinic.Items.Clear;
343       ListApptAll(lstClinic.Items, Patient.DFN, FFromDate, FThruDate);
344     end;
345   end;
346   
347   procedure TfrmEncounter.cboNewVisitChange(Sender: TObject);
348   begin
349     inherited;
350     with cboNewVisit do
351     begin
352       FLocation := ItemIEN;
353       FLocationName := DisplayText[ItemIndex];
354       FDateTime := calVisitDate.FMDateTime;
355       SetVisitCat;
356       with txtLocation do
357       begin
358         Text := FLocationName + '  ';
359         if FDateTime <> 0 then Text := Text + FormatFMDateTime('mmm dd,yy hh:nn', FDateTime);
360       end;
361     end;
362   end;
363   
364   procedure TfrmEncounter.calVisitDateChange(Sender: TObject);
365   begin
366     inherited;
367     // The FFromSelf was added because without it, a new visit (minus the seconds gets created.
368     // Setting the text of calVisit caused the text to be re-evaluated & changed the FMDateTime property.
369     if FFromSelf then Exit;
370     with cboNewVisit do
371     begin
372       FLocation := ItemIEN;
373       FLocationName := DisplayText[ItemIndex];
374       FDateTime := calVisitDate.FMDateTime;
375       SetVisitCat;
376       txtLocation.Text := FLocationName + '  ' + calVisitDate.Text;
377     end;
378   end;
379   
380   procedure TfrmEncounter.calVisitDateExit(Sender: TObject);
381   begin
382     inherited;
383     with cboNewVisit do if ItemIEN > 0 then
384     begin
385       FLocation := ItemIEN;
386       FLocationName := DisplayText[ItemIndex];
387       FDateTime := calVisitDate.FMDateTime;
388       SetVisitCat;
389       with txtLocation do
390       begin
391         Text := FLocationName + '  ';
392         if FDateTime <> 0 then Text := Text + FormatFMDateTime('mmm dd,yy hh:nn', FDateTime);
393       end;
394     end;
395   end;
396   
397   procedure TfrmEncounter.cmdOKClick(Sender: TObject);
398   var
399     msg: string;
400     ADate, AMaxDate: TDateTime;
401   
402   begin
403     inherited;
404     msg := '';
405     if DoNotNeedLocation = False then
406       begin
407         if FLocation = 0 then msg := TX_NO_LOC;
408         if FDateTime <= 0 then msg := msg + CRLF + TX_NO_DATE
409         else if(pos('.',FloatToStr(FDateTime)) = 0) then msg := msg + CRLF + TX_NO_TIME;
410         if(msg <> '') then
411           begin
412             InfoBox(msg, TC_MISSING, MB_OK);
413             Exit;
414           end
415         else
416           begin
417             ADate := FMDateTimeToDateTime(Trunc(FDateTime));
418             AMaxDate := FMDateTimeToDateTime(FMToday) + StrToIntDef(FEncFutureLimit, 0);
419             if ADate > AMaxDate then
420                 if InfoBox(TX_FUTURE_WARNING, TC_FUTURE_WARNING, MB_YESNO or MB_ICONQUESTION) = MRNO then exit;
421           end;
422       end;
423     if FFilter <> NPF_SUPPRESS then FProvider := cboPtProvider.ItemIEN;
424     OKPressed := True;
425     Close;
426   end;
427   
428   procedure TfrmEncounter.cmdCancelClick(Sender: TObject);
429   begin
430     inherited;
431     Close;
432   end;
433   
434   procedure TfrmEncounter.ckbHistoricalClick(Sender: TObject);
435   begin
436     SetVisitCat;
437   end;
438   
439   {
440   procedure TfrmEncounter.cboPtProviderChange(Sender: TObject);
441   var
442     txt: string;
443     AIEN: Int64;
444   
445   begin
446     if(FFilter <> NPF_ENCOUNTER) then exit;
447     AIEN := cboPtProvider.ItemIEN;
448     if(AIEN <> 0) then
449     begin
450       txt := InvalidPCEProviderTxt(AIEN, FPCDate);
451       if(txt <> '') then
452       begin
453         InfoBox(cboPtProvider.text + txt, TX_BAD_PROV, MB_OK);
454         cboPtProvider.ItemIndex := -1;
455       end;
456     end;
457   end;
458    }
459   
460   procedure TfrmEncounter.AppShowHint(var HintStr: string;
461     var CanShow: Boolean; var HintInfo: THintInfo);
462   const
463     HistHintDelay = 30000; // 30 seconds
464   
465   begin
466     if (not Assigned(HintInfo.HintControl)) then exit;
467     if(HintInfo.HintControl = ckbHistorical) then
468       HintInfo.HideTimeout := HistHintDelay;
469     if(assigned(FOldHintEvent)) then
470       FOldHintEvent(HintStr, CanShow, HintInfo);
471   end;
472   
473   procedure TfrmEncounter.FormDestroy(Sender: TObject);
474   begin
475     //Application.OnShowHint := FOldHintEvent;     v22.11f - RV
476   end;
477   
478   procedure TfrmEncounter.SetVisitCat;
479   begin
480     if ckbHistorical.Checked then
481       FVisitCategory := 'E'
482     else
483       FVisitCategory := GetVisitCat('A', FLocation, Patient.Inpatient);
484     FStandAlone := (FVisitCategory = 'A');
485   end;
486   
487   function TfrmEncounter.AllowAutoFocusChange: Boolean;
488   begin
489     if ScreenReaderSystemActive or
490        Boolean(Hi(GetKeyState(VK_TAB))) or
491        Boolean(Hi(GetKeyState(VK_LEFT))) or
492        Boolean(Hi(GetKeyState(VK_RIGHT))) then
493       Result := FALSE
494     else
495       Result := TRUE;
496   end;
497   
498   procedure TfrmEncounter.FormClose(Sender: TObject;
499     var Action: TCloseAction);
500   begin
501     Application.OnShowHint := FOldHintEvent;
502   end;
503   
504   procedure TfrmEncounter.lstAdmitChange(Sender: TObject);
505   begin
506     inherited;
507     with lstAdmit do
508     begin
509       FLocation := StrToIntDef(Piece(Items[ItemIndex], U, 2), 0);
510       FLocationName := Piece(Items[ItemIndex], U, 3);
511       FDateTime := MakeFMDateTime(ItemID);
512       FVisitCategory := 'H';
513       FStandAlone := False;
514       txtLocation.Text := FLocationName;  // don't show admit date (could confuse user)
515     end;
516   end;
517   
518   procedure TfrmEncounter.lstClinicChange(Sender: TObject);
519   // V|A;DateTime;LocIEN^DateTime^LocName^Status
520   begin
521     inherited;
522     with lstClinic do
523     begin
524       FLocation := StrToIntDef(Piece(ItemID, ';', 3), 0);
525       FLocationName := Piece(Items[ItemIndex], U, 3);
526       FDateTime := MakeFMDateTime(Piece(ItemID,';', 2));
527       FVisitCategory := 'A';
528       FStandAlone := CharAt(ItemID, 1) = 'V';
529       with txtLocation do
530       begin
531         Text := FLocationName + '  ';
532         if FDateTime <> 0 then Text := Text + FormatFMDateTime('mmm dd,yy hh:nn', FDateTime);
533       end;
534     end;
535   end;
536   
537   procedure TfrmEncounter.FormResize(Sender: TObject);
538   begin
539     //CQ7118
540     if cboPtProvider.Visible then
541        begin
542        cmdOK.Left := cboPtProvider.Left + cboPtProvider.Width + 1;
543        cmdCancel.Left := cboPtProvider.Left + cboPtProvider.Width + 1;
544        end
545     else
546        begin
547        cmdOK.Left := cmdDateRange.Left;
548        cmdCancel.Left := cmdDateRange.Left;
549        end;
550   
551     cmdCancel.Top := cmdDateRange.Top - cmdCancel.Height - 10;
552     cmdOK.Top := cmdCancel.Top - cmdOK.Height - 1;
553   
554     cmdCancel.Top := cmdOK.Top + cmdOK.Height + 1;
555     cmdCancel.Width := cmdOK.Width;
556     //end CQ7118
557   end;
558   
559   procedure TfrmEncounter.FormShow(Sender: TObject);
560   begin
561     //CQ7118
562     if cboPtProvider.Visible then
563        begin
564        cmdOK.Left := cboPtProvider.Left + cboPtProvider.Width + 1;
565        cmdCancel.Left := cboPtProvider.Left + cboPtProvider.Width + 1;
566        end
567     else
568        begin
569        cmdOK.Left := cmdDateRange.Left;
570        cmdCancel.Left := cmdDateRange.Left;
571        end;
572   
573     cmdCancel.Top := cmdDateRange.Top - cmdCancel.Height - 10;
574     cmdOK.Top := cmdCancel.Top - cmdOK.Height - 1;
575     cmdCancel.Top := cmdOK.Top + cmdOK.Height + 1;
576     //end CQ7118
577     if Not User.IsProvider then
578       if cboPtProvider.CanFocus then
579         cboPtProvider.SetFocus;
580   end;
581   
582   end.

Module Calls (2 levels)


fEncnt
 ├rOptions
 │ └rCore
 ├fBase508Form
 │ ├uConst
 │ └uHelpManager
 ├fFrame
 │ ├fPage
 │ ├uConst
 │ ├VERGENCECONTEXTORLib_TLB
 │ ├fBase508Form...
 │ ├XuDsigS
 │ ├rCore...
 │ ├fPtSelMsg
 │ ├fPtSel
 │ ├fCover
 │ ├fProbs
 │ ├fMeds
 │ ├fOrders
 │ ├rOrders
 │ ├fNotes
 │ ├fConsults
 │ ├fDCSumm
 │ ├rMisc
 │ ├fLabs
 │ ├fReports
 │ ├rReports
 │ ├fPtDemo
 │ ├fEncnt...
 │ ├fPtCWAD
 │ ├uCore
 │ ├fAbout
 │ ├fReview
 │ ├fxBroker
 │ ├fxLists
 │ ├fxServer
 │ ├fRptBox
 │ ├rODAllergy
 │ ├uInit
 │ ├fLabInfo
 │ ├uReminders
 │ ├fReminderTree
 │ ├fDeviceSelect
 │ ├fDrawers
 │ ├fReminderDialog
 │ ├fOptions
 │ ├fGraphs
 │ ├fGraphData
 │ ├rTemplates
 │ ├fSurgery
 │ ├rSurgery
 │ ├uEventHooks
 │ ├uSignItems
 │ ├rECS
 │ ├fIconLegend
 │ ├uOrders
 │ ├uSpell
 │ ├uOrPtf
 │ ├fPatientFlagMulti
 │ ├fAlertForward
 │ ├UBAGlobals
 │ ├UBACore
 │ ├fOrdersSign
 │ ├uVitals
 │ ├fMHTest
 │ ├uFormMonitor
 │ ├fOtherSchedule
 │ ├uVA508CPRSCompatibility
 │ ├fIVRoutes
 │ ├fPrintLocation
 │ ├fTemplateEditor
 │ └fCombatVet
 ├rCore...
 ├uCore...
 ├uConst
 ├fReview...
 └rPCE
   ├uPCE
   ├UBACore...
   ├rCore...
   ├uCore...
   ├uConst
   ├fEncounterFrame
   ├UBAGlobals...
   └UBAConst

Module Called-By (2 levels)


                      fEncnt
                   uOrders┤ 
                   uCore┤ │ 
                 fODBase┤ │ 
                 rODBase┤ │ 
                  fFrame┤ │ 
                 fOrders┤ │ 
             fOrdersSign┤ │ 
                   fMeds┤ │ 
               fARTAllgy┤ │ 
                  fNotes┤ │ 
               fConsults┤ │ 
         fReminderDialog┤ │ 
                 fReview┤ │ 
            fOrdersRenew┤ │ 
               fOrdersCV┤ │ 
                 fODMeds┤ │ 
                 fOMNavA┤ │ 
         fOrderSaveQuick┤ │ 
                  fOMSet┤ │ 
          fOrdersRelease┤ │ 
                 fOMHTML┤ │ 
               fODMedNVA┤ │ 
fODChangeUnreleasedRenew┤ │ 
          fOrdersOnChart┤ │ 
         fODReleaseEvent┤ │ 
               fODActive┘ │ 
                 fFrame...┤ 
                   fVitals┤ 
              fEncVitals┤ │ 
                  fCover┤ │ 
                    fvit┘ │ 
                 fNotes...┤ 
                    fProbs┤ 
               fFrame...┤ │ 
                fProbEdt┤ │ 
                fProbflt┤ │ 
                fProbLex┘ │ 
              fConsults...┤ 
                   fDCSumm┤ 
               fFrame...┤ │ 
              fPrintList┤ │ 
              fReview...┤ │ 
            fAddlSigners┘ │ 
                  fSurgery┤ 
               fFrame...┤ │ 
              fReview...┘ │ 
                  fPCEEdit┘ 
               fNotes...┤   
             fSurgery...┘