source: cprs/branches/foia-cprs/CPRS-Chart/fNoteCslt.pas@ 611

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

Adding foia-cprs branch

File size: 2.0 KB
RevLine 
[459]1unit fNoteCslt;
2
3interface
4
5uses
6 Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
7 fAutoSz, StdCtrls, ORCtrls, ORFn;
8
9type
10 TfrmNoteConsult = class(TfrmAutoSz)
11 Label1: TStaticText;
12 Label2: TStaticText;
13 lstRequests: TORListBox;
14 Label3: TLabel;
15 Label4: TLabel;
16 Label5: TLabel;
17 cmdOK: TButton;
18 cmdCancel: TButton;
19 Label6: TLabel;
20 Label7: TLabel;
21 procedure cmdCancelClick(Sender: TObject);
22 procedure cmdOKClick(Sender: TObject);
23 procedure lstRequestsClick(Sender: TObject);
24 private
25 { Private declarations }
26 FSelectedRequest: Integer;
27 public
28 { Public declarations }
29 end;
30
31function SelectConsult: Integer;
32
33implementation
34
35{$R *.DFM}
36
37uses rTIU;
38
39const
40 TX_NO_REQUEST = 'There are no consult requests available for this patient.' + CRLF +
41 'Another progress note title must be selected.';
42 TX_NO_REQUEST_CAP = 'No Consult Requests';
43
44function SelectConsult: Integer;
45var
46 frmNoteConsult: TfrmNoteConsult;
47 AConsultList: TStringList;
48begin
49 Result := 0;
50 frmNoteConsult := TfrmNoteConsult.Create(Application);
51 AConsultList := TStringList.Create;
52 try
53 ListConsultRequests(AConsultList);
54 if AConsultList.Count > 0 then
55 begin
56 ResizeFormToFont(TForm(frmNoteConsult));
57 frmNoteConsult.lstRequests.Items.Assign(AConsultList);
58 frmNoteConsult.ShowModal;
59 Result := frmNoteConsult.FSelectedRequest;
60 end
61 else InfoBox(TX_NO_REQUEST, TX_NO_REQUEST_CAP, MB_OK);
62 finally
63 frmNoteConsult.Release;
64 AConsultList.Free;
65 end;
66end;
67
68procedure TfrmNoteConsult.lstRequestsClick(Sender: TObject);
69begin
70 inherited;
71 if lstRequests.ItemIEN > 0 then cmdOK.Enabled := True else cmdOK.Enabled := False;
72end;
73
74procedure TfrmNoteConsult.cmdOKClick(Sender: TObject);
75begin
76 inherited;
77 FSelectedRequest := lstRequests.ItemIEN;
78 Close;
79end;
80
81procedure TfrmNoteConsult.cmdCancelClick(Sender: TObject);
82begin
83 inherited;
84 FSelectedRequest := 0;
85 Close;
86end;
87
88end.
Note: See TracBrowser for help on using the repository browser.