[456] | 1 | unit fNoteCslt;
|
---|
| 2 |
|
---|
| 3 | interface
|
---|
| 4 |
|
---|
| 5 | uses
|
---|
| 6 | Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
|
---|
[830] | 7 | fAutoSz, StdCtrls, ORCtrls, ORFn, VA508AccessibilityManager;
|
---|
[456] | 8 |
|
---|
| 9 | type
|
---|
| 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 |
|
---|
| 31 | function SelectConsult: Integer;
|
---|
| 32 |
|
---|
| 33 | implementation
|
---|
| 34 |
|
---|
| 35 | {$R *.DFM}
|
---|
| 36 |
|
---|
| 37 | uses rTIU;
|
---|
| 38 |
|
---|
| 39 | const
|
---|
| 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 |
|
---|
| 44 | function SelectConsult: Integer;
|
---|
| 45 | var
|
---|
| 46 | frmNoteConsult: TfrmNoteConsult;
|
---|
| 47 | AConsultList: TStringList;
|
---|
| 48 | begin
|
---|
| 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));
|
---|
[830] | 57 | FastAssign(AConsultList, frmNoteConsult.lstRequests.Items);
|
---|
[456] | 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;
|
---|
| 66 | end;
|
---|
| 67 |
|
---|
| 68 | procedure TfrmNoteConsult.lstRequestsClick(Sender: TObject);
|
---|
| 69 | begin
|
---|
| 70 | inherited;
|
---|
| 71 | if lstRequests.ItemIEN > 0 then cmdOK.Enabled := True else cmdOK.Enabled := False;
|
---|
| 72 | end;
|
---|
| 73 |
|
---|
| 74 | procedure TfrmNoteConsult.cmdOKClick(Sender: TObject);
|
---|
| 75 | begin
|
---|
| 76 | inherited;
|
---|
| 77 | FSelectedRequest := lstRequests.ItemIEN;
|
---|
| 78 | Close;
|
---|
| 79 | end;
|
---|
| 80 |
|
---|
| 81 | procedure TfrmNoteConsult.cmdCancelClick(Sender: TObject);
|
---|
| 82 | begin
|
---|
| 83 | inherited;
|
---|
| 84 | FSelectedRequest := 0;
|
---|
| 85 | Close;
|
---|
| 86 | end;
|
---|
| 87 |
|
---|
| 88 | end.
|
---|