Class

TfrmVisit

Module

fVisit

Last Modified

7/15/2014 3:26:40 PM

Scope

Interfaced

Inherits from

TfrmBase508Form

Declaration


TfrmVisit = class(TfrmBase508Form)
  pnlBase: TORAutoPanel;
  lblInstruct: TStaticText;
  radAppt: TRadioButton;
  radAdmit: TRadioButton;
  radNewVisit: TRadioButton;
  lstVisit: TORListBox;
  lblSelect: TLabel;
  pnlVisit: TORAutoPanel;
  cboLocation: TORComboBox;
  timVisitDate: TORDateBox;
  lblVisitDate: TLabel;
  cmdOK: TButton;
  cmdCancel: TButton;
  grpCategory: TGroupBox;
  ckbHistorical: TCheckBox;
  procedure radSelectorClick(Sender: TObject);
  procedure cboLocationNeedData(Sender: TObject; const StartFrom: string;
    Direction, InsertAt: Integer);
  procedure cmdCancelClick(Sender: TObject);
  procedure cmdOKClick(Sender: TObject);
  procedure FormCreate(Sender: TObject);
private
  { Private declarations }
  FChanged: Boolean;
  FDateTime: TFMDateTime;
  FLocation: Integer;
  FLocationName: string;
  FVisitCategory: Char;
  FStandAlone: Boolean;
public
  { Public declarations }
end;

DFM Objects


frmVisit : TfrmVisit
 ├pnlBase : TORAutoPanel
 │ ├lblSelect : TLabel
 │ ├lblVisitDate : TLabel
 │ ├lblInstruct : TStaticText
 │ ├pnlVisit : TORAutoPanel
 │ │ ├timVisitDate : TORDateBox
 │ │ ├cboLocation : TORComboBox
 │ │ └grpCategory : TGroupBox
 │ │   └ckbHistorical : TCheckBox
 │ ├lstVisit : TORListBox
 │ ├radAppt : TRadioButton
 │ ├radAdmit : TRadioButton
 │ ├radNewVisit : TRadioButton
 │ ├cmdOK : TButton
 │ └cmdCancel : TButton
 └amgrMain : TVA508AccessibilityManager

Class Hierarchy


Class Fields

Name Type Scope Comments
cboLocation TORComboBox Public/Published -
ckbHistorical TCheckBox Public/Published -
cmdCancel TButton Public/Published -
cmdOK TButton Public/Published -
FChanged Boolean Private Private declarations
FDateTime TFMDateTime Private -
FLocation Integer Private -
FLocationName UnicodeString Private -
FStandAlone Boolean Private -
FVisitCategory Char Private -
grpCategory Simple (unknown) Public/Published -
lblInstruct TStaticText Public/Published -
lblSelect TLabel Public/Published -
lblVisitDate TLabel Public/Published -
lstVisit TORListBox Public/Published -
pnlBase Simple (unknown) Public/Published -
pnlVisit Simple (unknown) Public/Published -
radAdmit Simple (unknown) Public/Published -
radAppt Simple (unknown) Public/Published -
radNewVisit Simple (unknown) Public/Published -
timVisitDate TORDateBox Public/Published -

Methods

Name Declaration Scope Comments
cboLocationNeedData procedure cboLocationNeedData(Sender: TObject; const StartFrom: string; Direction, InsertAt: Integer); Public/Published Callback for location combobox to list active locations
cmdCancelClick procedure cmdCancelClick(Sender: TObject); Public/Published Cancel form - no change to visit information
cmdOKClick procedure cmdOKClick(Sender: TObject); Public/Published Gather and validate visit information
FormCreate procedure FormCreate(Sender: TObject); Public/Published
Procedure UpdateVisit(FontSize: Integer);
{displays visit selection form and directly updates the visit in Encounter }
var
  VisitUpdate: TVisitUpdate;
begin
  SelectVisit(FontSize, VisitUpdate);
  if VisitUpdate.Changed then
  begin
    Encounter.Location  := VisitUpdate.Location;
    Encounter.DateTime  := VisitUpdate.DateTime;
    Encounter.VisitCategory := VisitUpdate.VisitCategory;
    Encounter.StandAlone := VisitUpdate.StandAlone;
  end;
end;

procedure SelectVisit(FontSize: Integer; var VisitUpdate: TVisitUpdate);
{displays visit selection form and returns a record of the updated information }
var
  frmVisit: TfrmVisit;
  W, H: Integer;
begin
  frmVisit := TfrmVisit.Create(Application);
  try
    with frmVisit do
    begin
      Font.Size := FontSize;
      lblInstruct.Font.Size := FontSize;
      W := ClientWidth;
      H := ClientHeight;
      ResizeToFont(FontSize, W, H);
      ClientWidth  := W; pnlBase.Width  := W;
      ClientHeight := H; pnlBase.Height := W;
      frmVisit.ShowModal;
      with VisitUpdate do
      begin
        Changed := FChanged;
        DateTime := FDateTime;
        Location := FLocation;
        LocationName := FLocationName;
        VisitCategory := FVisitCategory;
        StandAlone := FStandAlone;
      end; {with VisitRec}
    end; {with frmVisit}
  finally
    frmVisit.Release;
  end;
end;


 initialize private fields and display appropriate visit selection controls
radSelectorClick procedure radSelectorClick(Sender: TObject); Public/Published Change visit data entry according to the radiobutton selected (appts, admissions, new visit