1 | //kt -- Modified with SourceScanner on 7/19/2007
|
---|
2 | unit fNoteCslt;
|
---|
3 |
|
---|
4 | interface
|
---|
5 |
|
---|
6 | uses
|
---|
7 | Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
|
---|
8 | fAutoSz, StdCtrls, ORCtrls, ORFn, DKLang;
|
---|
9 |
|
---|
10 | type
|
---|
11 | TfrmNoteConsult = class(TfrmAutoSz)
|
---|
12 | Label1: TStaticText;
|
---|
13 | Label2: TStaticText;
|
---|
14 | lstRequests: TORListBox;
|
---|
15 | Label3: TLabel;
|
---|
16 | Label4: TLabel;
|
---|
17 | Label5: TLabel;
|
---|
18 | cmdOK: TButton;
|
---|
19 | cmdCancel: TButton;
|
---|
20 | Label6: TLabel;
|
---|
21 | Label7: TLabel;
|
---|
22 | procedure cmdCancelClick(Sender: TObject);
|
---|
23 | procedure cmdOKClick(Sender: TObject);
|
---|
24 | procedure lstRequestsClick(Sender: TObject);
|
---|
25 | private
|
---|
26 | { Private declarations }
|
---|
27 | FSelectedRequest: Integer;
|
---|
28 | public
|
---|
29 | { Public declarations }
|
---|
30 | end;
|
---|
31 |
|
---|
32 | function SelectConsult: Integer;
|
---|
33 |
|
---|
34 | implementation
|
---|
35 |
|
---|
36 | {$R *.DFM}
|
---|
37 |
|
---|
38 | uses rTIU;
|
---|
39 |
|
---|
40 | //const
|
---|
41 | //TX_NO_REQUEST = 'There are no consult requests available for this patient.' + CRLF + <-- original line. //kt 7/19/2007
|
---|
42 | // 'Another progress note title must be selected.'; <-- original line. //kt 7/19/2007
|
---|
43 | //TX_NO_REQUEST_CAP = 'No Consult Requests'; <-- original line. //kt 7/19/2007
|
---|
44 |
|
---|
45 | //kt Begin Mod (change Consts to Vars) 7/19/2007
|
---|
46 | var
|
---|
47 | TX_NO_REQUEST : string; //kt
|
---|
48 | TX_NO_REQUEST_CAP : string; //kt
|
---|
49 | //kt End Mod -------------------
|
---|
50 |
|
---|
51 |
|
---|
52 | procedure SetupVars;
|
---|
53 | //kt Added entire function to replace constant declarations 7/19/2007
|
---|
54 | begin
|
---|
55 | TX_NO_REQUEST := DKLangConstW('fNoteCslt_There_are_no_consult_requests_available_for_this_patientx') + CRLF +
|
---|
56 | DKLangConstW('fNoteCslt_Another_progress_note_title_must_be_selectedx');
|
---|
57 | TX_NO_REQUEST_CAP := DKLangConstW('fNoteCslt_No_Consult_Requests');
|
---|
58 | end;
|
---|
59 |
|
---|
60 | function SelectConsult: Integer;
|
---|
61 | var
|
---|
62 | frmNoteConsult: TfrmNoteConsult;
|
---|
63 | AConsultList: TStringList;
|
---|
64 | begin
|
---|
65 | SetupVars; //kt added 7/19/2007 to replace constants with vars.
|
---|
66 | Result := 0;
|
---|
67 | frmNoteConsult := TfrmNoteConsult.Create(Application);
|
---|
68 | AConsultList := TStringList.Create;
|
---|
69 | try
|
---|
70 | ListConsultRequests(AConsultList);
|
---|
71 | if AConsultList.Count > 0 then
|
---|
72 | begin
|
---|
73 | ResizeFormToFont(TForm(frmNoteConsult));
|
---|
74 | frmNoteConsult.lstRequests.Items.Assign(AConsultList);
|
---|
75 | frmNoteConsult.ShowModal;
|
---|
76 | Result := frmNoteConsult.FSelectedRequest;
|
---|
77 | end
|
---|
78 | else InfoBox(TX_NO_REQUEST, TX_NO_REQUEST_CAP, MB_OK);
|
---|
79 | finally
|
---|
80 | frmNoteConsult.Release;
|
---|
81 | AConsultList.Free;
|
---|
82 | end;
|
---|
83 | end;
|
---|
84 |
|
---|
85 | procedure TfrmNoteConsult.lstRequestsClick(Sender: TObject);
|
---|
86 | begin
|
---|
87 | inherited;
|
---|
88 | if lstRequests.ItemIEN > 0 then cmdOK.Enabled := True else cmdOK.Enabled := False;
|
---|
89 | end;
|
---|
90 |
|
---|
91 | procedure TfrmNoteConsult.cmdOKClick(Sender: TObject);
|
---|
92 | begin
|
---|
93 | inherited;
|
---|
94 | FSelectedRequest := lstRequests.ItemIEN;
|
---|
95 | Close;
|
---|
96 | end;
|
---|
97 |
|
---|
98 | procedure TfrmNoteConsult.cmdCancelClick(Sender: TObject);
|
---|
99 | begin
|
---|
100 | inherited;
|
---|
101 | FSelectedRequest := 0;
|
---|
102 | Close;
|
---|
103 | end;
|
---|
104 |
|
---|
105 | end.
|
---|