source: cprs/branches/tmg-cprs/CPRS-Chart/fLkUpLocation.pas@ 1328

Last change on this file since 1328 was 453, checked in by Kevin Toppenberg, 16 years ago

Initial upload of TMG-CPRS 1.0.26.69

File size: 2.3 KB
Line 
1//kt -- Modified with SourceScanner on 7/19/2007
2unit fLkUpLocation;
3
4interface
5
6uses
7 Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
8 fAutoSz, StdCtrls, ORCtrls, ORFn, DKLang;
9
10type
11 TfrmLkUpLocation = class(TfrmAutoSz)
12 lblInfo: TLabel;
13 cboLocation: TORComboBox;
14 lblLocation: TLabel;
15 cmdOK: TButton;
16 cmdCancel: TButton;
17 DKLanguageController2: TDKLanguageController;
18 procedure cmdCancelClick(Sender: TObject);
19 procedure FormCreate(Sender: TObject);
20 procedure cmdOKClick(Sender: TObject);
21 procedure cboLocationNeedData(Sender: TObject; const StartFrom: String;
22 Direction, InsertAt: Integer);
23 private
24 OKPressed: Boolean;
25 end;
26
27var
28 LocType: integer;
29
30
31procedure LookupLocation(var IEN: Integer; var AName: string; const AType: integer; const HelpInfo: string);
32
33implementation
34
35{$R *.DFM}
36
37uses rCore, uConst;
38
39procedure LookupLocation(var IEN: Integer; var AName: string; const AType: integer; const HelpInfo: string);
40var
41 frmLkUpLocation: TfrmLkUpLocation;
42begin
43 LocType := AType;
44 frmLkUpLocation := TfrmLkUpLocation.Create(Application);
45 try
46 ResizeFormToFont(TForm(frmLkUpLocation));
47 frmLkUpLocation.lblInfo.Caption := HelpInfo;
48 frmLkUpLocation.ShowModal;
49 IEN := 0;
50 AName := '';
51 if frmLkUpLocation.OKPressed then
52 begin
53 IEN := frmLkUpLocation.cboLocation.ItemIEN;
54 AName := frmLkUpLocation.cboLocation.Text;
55 end;
56 finally
57 frmLkUpLocation.Release;
58 end;
59end;
60
61procedure TfrmLkUpLocation.FormCreate(Sender: TObject);
62begin
63 inherited;
64 OKPressed := False;
65 cboLocation.InitLongList('');
66end;
67
68procedure TfrmLkUpLocation.cboLocationNeedData(Sender: TObject; const StartFrom: string;
69 Direction, InsertAt: Integer);
70begin
71 inherited;
72 case LocType of
73 LOC_ALL: cboLocation.ForDataUse(SubSetOfLocations(StartFrom, Direction));
74 LOC_OUTP: cboLocation.ForDataUse(SubSetOfClinics(StartFrom, Direction));
75 LOC_INP: cboLocation.ForDataUse(SubSetOfInpatientLocations(StartFrom, Direction));
76 end;
77
78end;
79
80procedure TfrmLkUpLocation.cmdOKClick(Sender: TObject);
81begin
82 inherited;
83 OKPressed := True;
84 Close;
85end;
86
87procedure TfrmLkUpLocation.cmdCancelClick(Sender: TObject);
88begin
89 inherited;
90 Close;
91end;
92
93end.
Note: See TracBrowser for help on using the repository browser.