2008-07-06 17:36:37 -04:00
|
|
|
unit fPtSelDemog;
|
|
|
|
|
|
|
|
interface
|
|
|
|
|
|
|
|
uses
|
|
|
|
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
|
2010-07-07 16:51:54 -04:00
|
|
|
StdCtrls, ExtCtrls, ORCtrls, fBase508Form, VA508AccessibilityManager;
|
2008-07-06 17:36:37 -04:00
|
|
|
|
|
|
|
type
|
2010-07-07 16:51:54 -04:00
|
|
|
TfrmPtSelDemog = class(TfrmBase508Form)
|
2008-07-06 17:36:37 -04:00
|
|
|
orapnlMain: TORAutoPanel;
|
|
|
|
lblSSN: TStaticText;
|
|
|
|
lblPtSSN: TStaticText;
|
|
|
|
lblDOB: TStaticText;
|
|
|
|
lblPtDOB: TStaticText;
|
|
|
|
lblPtSex: TStaticText;
|
|
|
|
lblPtVet: TStaticText;
|
|
|
|
lblPtSC: TStaticText;
|
|
|
|
lblLocation: TStaticText;
|
|
|
|
lblPtRoomBed: TStaticText;
|
|
|
|
lblPtLocation: TStaticText;
|
|
|
|
lblRoomBed: TStaticText;
|
|
|
|
lblPtName: TStaticText;
|
|
|
|
Memo: TCaptionMemo;
|
2015-05-07 12:34:29 -04:00
|
|
|
lblCombatVet: TStaticText;
|
2008-07-06 17:36:37 -04:00
|
|
|
procedure FormCreate(Sender: TObject);
|
|
|
|
procedure FormDestroy(Sender: TObject);
|
2015-05-07 12:34:29 -04:00
|
|
|
procedure FormShow(Sender: TObject);
|
2008-07-06 17:36:37 -04:00
|
|
|
private
|
|
|
|
FLastDFN: string;
|
|
|
|
FOldWinProc :TWndMethod;
|
|
|
|
procedure NewWinProc(var Message: TMessage);
|
|
|
|
public
|
|
|
|
procedure ClearIDInfo;
|
|
|
|
procedure ShowDemog(ItemID: string);
|
|
|
|
procedure ToggleMemo;
|
|
|
|
end;
|
|
|
|
|
|
|
|
var
|
|
|
|
frmPtSelDemog: TfrmPtSelDemog;
|
|
|
|
|
|
|
|
implementation
|
|
|
|
|
2015-05-07 12:34:29 -04:00
|
|
|
uses rCore, VA508AccessibilityRouter, uCombatVet;
|
2008-07-06 17:36:37 -04:00
|
|
|
|
|
|
|
{$R *.DFM}
|
|
|
|
|
|
|
|
const
|
|
|
|
{ constants referencing the value of the tag property in components }
|
|
|
|
TAG_HIDE = 1; // labels to be hidden
|
|
|
|
TAG_CLEAR = 2; // labels to be cleared
|
|
|
|
|
|
|
|
procedure TfrmPtSelDemog.ClearIDInfo;
|
|
|
|
{ clears controls with patient ID info (controls have '2' in their Tag property }
|
|
|
|
var
|
|
|
|
i: Integer;
|
|
|
|
begin
|
|
|
|
FLastDFN := '';
|
|
|
|
with orapnlMain do
|
|
|
|
for i := 0 to ControlCount - 1 do
|
|
|
|
begin
|
|
|
|
if Controls[i].Tag = TAG_HIDE then Controls[i].Visible := False;
|
|
|
|
if Controls[i].Tag = TAG_CLEAR then with Controls[i] as TStaticText do Caption := '';
|
|
|
|
end;
|
|
|
|
Memo.Clear;
|
|
|
|
end;
|
|
|
|
|
|
|
|
procedure TfrmPtSelDemog.ShowDemog(ItemID: string);
|
|
|
|
{ gets a record of patient indentifying information from the server and displays it }
|
|
|
|
var
|
|
|
|
PtRec: TPtIDInfo;
|
|
|
|
i: Integer;
|
2015-05-07 12:34:29 -04:00
|
|
|
CV : TCombatVet;
|
2008-07-06 17:36:37 -04:00
|
|
|
begin
|
|
|
|
if ItemID = FLastDFN then Exit;
|
|
|
|
Memo.Clear;
|
|
|
|
FLastDFN := ItemID;
|
|
|
|
PtRec := GetPtIDInfo(ItemID);
|
|
|
|
with PtRec do
|
|
|
|
begin
|
|
|
|
Memo.Lines.Add(Name);
|
|
|
|
Memo.Lines.Add(lblSSN.Caption + ' ' + SSN + '.');
|
|
|
|
Memo.Lines.Add(lblDOB.Caption + ' ' + DOB + '.');
|
|
|
|
if Sex <> '' then
|
|
|
|
Memo.Lines.Add(Sex + '.');
|
|
|
|
if Vet <> '' then
|
|
|
|
Memo.Lines.Add(Vet + '.');
|
|
|
|
if SCsts <> '' then
|
|
|
|
Memo.Lines.Add(SCsts + '.');
|
|
|
|
if Location <> '' then
|
|
|
|
Memo.Lines.Add(lblLocation.Caption + ' ' + Location + '.');
|
|
|
|
if RoomBed <> '' then
|
|
|
|
Memo.Lines.Add(lblRoomBed.Caption + ' ' + RoomBed + '.');
|
|
|
|
|
|
|
|
lblPtName.Caption := Name;
|
|
|
|
lblPtSSN.Caption := SSN;
|
|
|
|
lblPtDOB.Caption := DOB;
|
|
|
|
lblPtSex.Caption := Sex {+ ', age ' + Age};
|
|
|
|
lblPtSC.Caption := SCSts;
|
|
|
|
lblPtVet.Caption := Vet;
|
|
|
|
lblPtLocation.Caption := Location;
|
|
|
|
lblPtRoomBed.Caption := RoomBed;
|
|
|
|
end;
|
|
|
|
with orapnlMain do for i := 0 to ControlCount - 1 do
|
|
|
|
if Controls[i].Tag = TAG_HIDE then Controls[i].Visible := True;
|
|
|
|
if lblPtLocation.Caption = '' then
|
|
|
|
lblLocation.Hide
|
|
|
|
else
|
|
|
|
lblLocation.Show;
|
|
|
|
if lblPtRoomBed.Caption = '' then
|
|
|
|
lblRoomBed.Hide
|
|
|
|
else
|
|
|
|
lblRoomBed.Show;
|
2015-05-07 12:34:29 -04:00
|
|
|
CV := TCombatVet.Create(ItemID);
|
|
|
|
if CV.IsEligible then begin
|
|
|
|
lblCombatVet.Caption := 'CV ' + CV.ExpirationDate + ' ' + CV.OEF_OIF;
|
|
|
|
Memo.Lines.Add(lblCombatVet.Caption);
|
|
|
|
end else
|
|
|
|
lblCombatVet.Caption := '';
|
|
|
|
CV.Free;
|
2008-07-06 17:36:37 -04:00
|
|
|
Memo.SelectAll;
|
|
|
|
end;
|
|
|
|
|
|
|
|
procedure TfrmPtSelDemog.ToggleMemo;
|
|
|
|
begin
|
|
|
|
if Memo.Visible then
|
|
|
|
begin
|
|
|
|
Memo.Hide;
|
|
|
|
end
|
|
|
|
else
|
|
|
|
begin
|
|
|
|
Memo.Show;
|
|
|
|
Memo.BringToFront;
|
|
|
|
end;
|
|
|
|
end;
|
|
|
|
|
|
|
|
procedure TfrmPtSelDemog.FormCreate(Sender: TObject);
|
|
|
|
begin
|
|
|
|
FOldWinProc := orapnlMain.WindowProc;
|
|
|
|
orapnlMain.WindowProc := NewWinProc;
|
|
|
|
end;
|
|
|
|
|
|
|
|
procedure TfrmPtSelDemog.NewWinProc(var Message: TMessage);
|
|
|
|
const
|
|
|
|
Gap = 4;
|
2010-07-07 16:51:54 -04:00
|
|
|
MaxFont = 10;
|
|
|
|
var uHeight:integer;
|
|
|
|
|
2008-07-06 17:36:37 -04:00
|
|
|
|
|
|
|
begin
|
|
|
|
if(assigned(FOldWinProc)) then FOldWinProc(Message);
|
|
|
|
if(Message.Msg = WM_Size) then
|
|
|
|
begin
|
|
|
|
if(lblPtSSN.Left < (lblSSN.Left+lblSSN.Width+Gap)) then
|
|
|
|
lblPtSSN.Left := (lblSSN.Left+lblSSN.Width+Gap);
|
|
|
|
if(lblPtDOB.Left < (lblDOB.Left+lblDOB.Width+Gap)) then
|
|
|
|
lblPtDOB.Left := (lblDOB.Left+lblDOB.Width+Gap);
|
|
|
|
if(lblPtSSN.Left < lblPtDOB.Left) then
|
|
|
|
lblPtSSN.Left := lblPtDOB.Left
|
|
|
|
else
|
|
|
|
lblPtDOB.Left := lblPtSSN.Left;
|
|
|
|
|
|
|
|
if(lblPtLocation.Left < (lblLocation.Left+lblLocation.Width+Gap)) then
|
|
|
|
lblPtLocation.Left := (lblLocation.Left+lblLocation.Width+Gap);
|
|
|
|
if(lblPtRoomBed.Left < (lblRoomBed.Left+lblRoomBed.Width+Gap)) then
|
|
|
|
lblPtRoomBed.Left := (lblRoomBed.Left+lblRoomBed.Width+Gap);
|
|
|
|
if(lblPtLocation.Left < lblPtRoomBed.Left) then
|
|
|
|
lblPtLocation.Left := lblPtRoomBed.Left
|
|
|
|
else
|
|
|
|
lblPtRoomBed.Left := lblPtLocation.Left;
|
|
|
|
end;
|
2010-07-07 16:51:54 -04:00
|
|
|
if frmPtSelDemog.Canvas.Font.Size > MaxFont then
|
|
|
|
begin
|
|
|
|
uHeight := frmPtSelDemog.Canvas.TextHeight(lblPtSSN.Caption)-2;
|
|
|
|
lblPtSSN.Top := (lblPtName.Top + uHeight);
|
|
|
|
lblSSN.Top := lblPtSSN.Top;
|
|
|
|
lblPtDOB.Height := uHeight;
|
|
|
|
lblPtDOB.Top := (lblPtSSn.Top + uHeight);
|
|
|
|
lblDOB.Top := lblPtDOB.Top;
|
|
|
|
lblPtSex.Height := uHeight;
|
|
|
|
lblPtSex.Top := (lblPtDOB.Top + uHeight);
|
|
|
|
lblPtVet.Height := uHeight;
|
|
|
|
lblPtVet.Top := (lblPtSex.Top + uHeight);
|
|
|
|
lblPtSC.Height := uHeight;
|
|
|
|
lblPtSC.Top := lblPtVet.Top;
|
|
|
|
lblLocation.Height := uHeight;
|
|
|
|
lblLocation.Top := ( lblPtVet.Top + uHeight);
|
|
|
|
lblPtLocation.Top := lblLocation.Top;
|
|
|
|
lblRoomBed.Height := uHeight;
|
|
|
|
lblRoomBed.Top :=(lblLocation.Top + uHeight)+ 2;
|
|
|
|
lblPtRoomBed.Height := uHeight;
|
|
|
|
lblPtRoomBed.Top := lblRoomBed.Top ;
|
2015-05-07 12:34:29 -04:00
|
|
|
lblCombatVet.Top := (lblRoomBed.Top + uHeight) + 2;
|
2010-07-07 16:51:54 -04:00
|
|
|
end;
|
2008-07-06 17:36:37 -04:00
|
|
|
end;
|
|
|
|
|
|
|
|
procedure TfrmPtSelDemog.FormDestroy(Sender: TObject);
|
|
|
|
begin
|
|
|
|
orapnlMain.WindowProc := FOldWinProc;
|
|
|
|
end;
|
|
|
|
|
2015-05-07 12:34:29 -04:00
|
|
|
procedure TfrmPtSelDemog.FormShow(Sender: TObject);
|
|
|
|
begin
|
|
|
|
inherited;
|
|
|
|
lblCombatVet.Caption := '';
|
|
|
|
end;
|
|
|
|
|
2010-07-07 16:51:54 -04:00
|
|
|
initialization
|
|
|
|
SpecifyFormIsNotADialog(TfrmPtSelDemog);
|
|
|
|
|
2008-07-06 17:36:37 -04:00
|
|
|
end.
|