1 | //kt -- Modified with SourceScanner on 8/8/2007
|
---|
2 | unit fPCELex;
|
---|
3 |
|
---|
4 | interface
|
---|
5 |
|
---|
6 | uses
|
---|
7 | Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
|
---|
8 | fAutoSz, StdCtrls, ORFn, ORCtrls, DKLang;
|
---|
9 |
|
---|
10 | type
|
---|
11 | TfrmPCELex = class(TfrmAutoSz)
|
---|
12 | txtSearch: TCaptionEdit;
|
---|
13 | cmdSearch: TButton;
|
---|
14 | cmdOK: TButton;
|
---|
15 | cmdCancel: TButton;
|
---|
16 | lblSearch: TLabel;
|
---|
17 | lblSelect: TLabel;
|
---|
18 | lstSelect: TORListBox;
|
---|
19 | procedure cmdSearchClick(Sender: TObject);
|
---|
20 | procedure cmdCancelClick(Sender: TObject);
|
---|
21 | procedure FormCreate(Sender: TObject);
|
---|
22 | procedure cmdOKClick(Sender: TObject);
|
---|
23 | procedure lstSelectClick(Sender: TObject);
|
---|
24 | procedure txtSearchChange(Sender: TObject);
|
---|
25 | procedure lstSelectDblClick(Sender: TObject);
|
---|
26 | private
|
---|
27 | FLexApp: Integer;
|
---|
28 | FCode: string;
|
---|
29 | FDate: TFMDateTime;
|
---|
30 | procedure SetApp(LexApp: Integer);
|
---|
31 | procedure SetDate(ADate: TFMDateTime);
|
---|
32 | end;
|
---|
33 |
|
---|
34 | procedure LexiconLookup(var Code: string; LexApp: Integer; ADate: TFMDateTime = 0);
|
---|
35 |
|
---|
36 | implementation
|
---|
37 |
|
---|
38 | {$R *.DFM}
|
---|
39 |
|
---|
40 | uses rPCE,UBAGlobals;
|
---|
41 |
|
---|
42 | procedure LexiconLookup(var Code: string; LexApp: Integer; ADate: TFMDateTime = 0);
|
---|
43 | var
|
---|
44 | frmPCELex: TfrmPCELex;
|
---|
45 | begin
|
---|
46 | frmPCELex := TfrmPCELex.Create(Application);
|
---|
47 | try
|
---|
48 | ResizeFormToFont(TForm(frmPCELex));
|
---|
49 | frmPCELex.SetApp(LexApp);
|
---|
50 | frmPCELex.SetDate(ADate);
|
---|
51 | frmPCELex.ShowModal;
|
---|
52 | Code := frmPCELex.FCode;
|
---|
53 | finally
|
---|
54 | frmPCELex.Free;
|
---|
55 | end;
|
---|
56 | end;
|
---|
57 |
|
---|
58 | procedure TfrmPCELex.FormCreate(Sender: TObject);
|
---|
59 | begin
|
---|
60 | inherited;
|
---|
61 | FCode := '';
|
---|
62 | end;
|
---|
63 |
|
---|
64 | procedure TfrmPCELex.SetApp(LexApp: Integer);
|
---|
65 | begin
|
---|
66 | FLexApp := LexApp;
|
---|
67 | case LexApp of
|
---|
68 | LX_ICD: begin
|
---|
69 | // Caption := 'Lookup Diagnosis'; <-- original line. //kt 8/8/2007
|
---|
70 | Caption := DKLangConstW('fPCELex_Lookup_Diagnosis'); //kt added 8/8/2007
|
---|
71 | // lblSearch.Caption := 'Search for Diagnosis'; <-- original line. //kt 8/8/2007
|
---|
72 | lblSearch.Caption := DKLangConstW('fPCELex_Search_for_Diagnosis'); //kt added 8/8/2007
|
---|
73 | end;
|
---|
74 | LX_CPT: begin
|
---|
75 | // Caption := 'Lookup Procedure'; <-- original line. //kt 8/8/2007
|
---|
76 | Caption := DKLangConstW('fPCELex_Lookup_Procedure'); //kt added 8/8/2007
|
---|
77 | // lblSearch.Caption := 'Search for Procedure'; <-- original line. //kt 8/8/2007
|
---|
78 | lblSearch.Caption := DKLangConstW('fPCELex_Search_for_Procedure'); //kt added 8/8/2007
|
---|
79 | end;
|
---|
80 | end;
|
---|
81 | end;
|
---|
82 |
|
---|
83 | procedure TfrmPCELex.SetDate(ADate: TFMDateTime);
|
---|
84 | begin
|
---|
85 | FDate := ADate;
|
---|
86 | end;
|
---|
87 |
|
---|
88 | procedure TfrmPCELex.txtSearchChange(Sender: TObject);
|
---|
89 | begin
|
---|
90 | inherited;
|
---|
91 | cmdSearch.Default := True;
|
---|
92 | cmdOK.Default := False;
|
---|
93 | end;
|
---|
94 |
|
---|
95 | procedure TfrmPCELex.cmdSearchClick(Sender: TObject);
|
---|
96 | begin
|
---|
97 | inherited;
|
---|
98 | if Length(txtSearch.Text) = 0 then Exit;
|
---|
99 | //StatusText('Searching clinical lexicon...'); <-- original line. //kt 8/8/2007
|
---|
100 | StatusText(DKLangConstW('fPCELex_Searching_clinical_lexiconxxx')); //kt added 8/8/2007
|
---|
101 | ListLexicon(lstSelect.Items, txtSearch.Text, FLexApp, FDate);
|
---|
102 | if lstSelect.GetIEN(0) = -1 then
|
---|
103 | begin
|
---|
104 | lblSelect.Visible := False;
|
---|
105 | txtSearch.SetFocus;
|
---|
106 | txtSearch.SelectAll;
|
---|
107 | cmdOK.Default := False;
|
---|
108 | cmdSearch.Default := True;
|
---|
109 | end else
|
---|
110 | begin
|
---|
111 | lblSelect.Visible := True;
|
---|
112 | lstSelect.SetFocus;
|
---|
113 | cmdSearch.Default := False;
|
---|
114 | end;
|
---|
115 | StatusText('');
|
---|
116 | end;
|
---|
117 |
|
---|
118 | procedure TfrmPCELex.lstSelectClick(Sender: TObject);
|
---|
119 | begin
|
---|
120 | inherited;
|
---|
121 | if(lstSelect.ItemIndex > -1) and (lstSelect.ItemIEN > 0) then
|
---|
122 | begin
|
---|
123 | cmdSearch.Default := False;
|
---|
124 | cmdOK.Default := True;
|
---|
125 | end;
|
---|
126 | end;
|
---|
127 |
|
---|
128 | procedure TfrmPCELex.cmdOKClick(Sender: TObject);
|
---|
129 | begin
|
---|
130 | inherited;
|
---|
131 | if(lstSelect.ItemIndex = -1) or (lstSelect.ItemIEN <= 0) then Exit;
|
---|
132 | with lstSelect do
|
---|
133 | begin
|
---|
134 | if BAPersonalDX then
|
---|
135 | FCode := (LexiconToCode(ItemIEN, FLexApp, FDate) + U + DisplayText[ItemIndex] + U + IntToStr(ItemIEN) )
|
---|
136 | else
|
---|
137 | FCode := LexiconToCode(ItemIEN, FLexApp, FDate) + U + DisplayText[ItemIndex];
|
---|
138 | Close;
|
---|
139 | end;
|
---|
140 | end;
|
---|
141 |
|
---|
142 | procedure TfrmPCELex.cmdCancelClick(Sender: TObject);
|
---|
143 | begin
|
---|
144 | inherited;
|
---|
145 | FCode := '';
|
---|
146 | Close;
|
---|
147 | end;
|
---|
148 |
|
---|
149 | procedure TfrmPCELex.lstSelectDblClick(Sender: TObject);
|
---|
150 | begin
|
---|
151 | inherited;
|
---|
152 | lstSelectClick(Sender);
|
---|
153 | cmdOKClick(Sender);
|
---|
154 | end;
|
---|
155 |
|
---|
156 | end.
|
---|
157 |
|
---|