| 1 | //kt -- Modified with SourceScanner on 8/8/2007 | 
|---|
| 2 | unit fOptionsPatientSelection; | 
|---|
| 3 |  | 
|---|
| 4 | interface | 
|---|
| 5 |  | 
|---|
| 6 | uses | 
|---|
| 7 | Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, | 
|---|
| 8 | StdCtrls, ExtCtrls, ORCtrls, OrFn, ComCtrls, DKLang; | 
|---|
| 9 |  | 
|---|
| 10 | type | 
|---|
| 11 | TfrmOptionsPatientSelection = class(TForm) | 
|---|
| 12 | pnlBottom: TPanel; | 
|---|
| 13 | btnOK: TButton; | 
|---|
| 14 | btnCancel: TButton; | 
|---|
| 15 | cboProvider: TORComboBox; | 
|---|
| 16 | cboTreating: TORComboBox; | 
|---|
| 17 | cboTeam: TORComboBox; | 
|---|
| 18 | cboWard: TORComboBox; | 
|---|
| 19 | cboMonday: TORComboBox; | 
|---|
| 20 | cboTuesday: TORComboBox; | 
|---|
| 21 | cboWednesday: TORComboBox; | 
|---|
| 22 | cboThursday: TORComboBox; | 
|---|
| 23 | cboFriday: TORComboBox; | 
|---|
| 24 | cboSaturday: TORComboBox; | 
|---|
| 25 | cboSunday: TORComboBox; | 
|---|
| 26 | txtVisitStart: TCaptionEdit; | 
|---|
| 27 | txtVisitStop: TCaptionEdit; | 
|---|
| 28 | spnVisitStart: TUpDown; | 
|---|
| 29 | spnVisitStop: TUpDown; | 
|---|
| 30 | lblClinicDays: TLabel; | 
|---|
| 31 | lblMonday: TLabel; | 
|---|
| 32 | lblTuesday: TLabel; | 
|---|
| 33 | lblWednesday: TLabel; | 
|---|
| 34 | lblThursday: TLabel; | 
|---|
| 35 | lblFriday: TLabel; | 
|---|
| 36 | lblSaturday: TLabel; | 
|---|
| 37 | lblSunday: TLabel; | 
|---|
| 38 | lblVisitStart: TLabel; | 
|---|
| 39 | lblVisitStop: TLabel; | 
|---|
| 40 | lblVisitDateRange: TMemo; | 
|---|
| 41 | lblInfo: TMemo; | 
|---|
| 42 | lbWard: TLabel; | 
|---|
| 43 | lblTeam: TLabel; | 
|---|
| 44 | lblTreating: TLabel; | 
|---|
| 45 | lblProvider: TLabel; | 
|---|
| 46 | radListSource: TRadioGroup; | 
|---|
| 47 | grpSortOrder: TGroupBox; | 
|---|
| 48 | radAlphabetical: TRadioButton; | 
|---|
| 49 | radRoomBed: TRadioButton; | 
|---|
| 50 | radAppointmentDate: TRadioButton; | 
|---|
| 51 | radTerminalDigit: TRadioButton; | 
|---|
| 52 | radSource: TRadioButton; | 
|---|
| 53 | bvlBottom: TBevel; | 
|---|
| 54 | DKLanguageController1: TDKLanguageController; | 
|---|
| 55 | procedure FormCreate(Sender: TObject); | 
|---|
| 56 | procedure FormShow(Sender: TObject); | 
|---|
| 57 | procedure spnVisitStartClick(Sender: TObject; Button: TUDBtnType); | 
|---|
| 58 | procedure spnVisitStopClick(Sender: TObject; Button: TUDBtnType); | 
|---|
| 59 | procedure btnOKClick(Sender: TObject); | 
|---|
| 60 | procedure txtVisitStartExit(Sender: TObject); | 
|---|
| 61 | procedure txtVisitStopExit(Sender: TObject); | 
|---|
| 62 | procedure txtVisitStartKeyUp(Sender: TObject; var Key: Word; | 
|---|
| 63 | Shift: TShiftState); | 
|---|
| 64 | procedure txtVisitStopKeyUp(Sender: TObject; var Key: Word; | 
|---|
| 65 | Shift: TShiftState); | 
|---|
| 66 | procedure cboProviderExit(Sender: TObject); | 
|---|
| 67 | procedure radListSourceClick(Sender: TObject); | 
|---|
| 68 | procedure cboMondayNeedData(Sender: TObject; const StartFrom: String; | 
|---|
| 69 | Direction, InsertAt: Integer); | 
|---|
| 70 | procedure cboTuesdayNeedData(Sender: TObject; const StartFrom: String; | 
|---|
| 71 | Direction, InsertAt: Integer); | 
|---|
| 72 | procedure cboWednesdayNeedData(Sender: TObject; | 
|---|
| 73 | const StartFrom: String; Direction, InsertAt: Integer); | 
|---|
| 74 | procedure cboThursdayNeedData(Sender: TObject; const StartFrom: String; | 
|---|
| 75 | Direction, InsertAt: Integer); | 
|---|
| 76 | procedure cboFridayNeedData(Sender: TObject; const StartFrom: String; | 
|---|
| 77 | Direction, InsertAt: Integer); | 
|---|
| 78 | procedure cboSaturdayNeedData(Sender: TObject; const StartFrom: String; | 
|---|
| 79 | Direction, InsertAt: Integer); | 
|---|
| 80 | procedure cboSundayNeedData(Sender: TObject; const StartFrom: String; | 
|---|
| 81 | Direction, InsertAt: Integer); | 
|---|
| 82 | procedure cboProviderNeedData(Sender: TObject; const StartFrom: String; | 
|---|
| 83 | Direction, InsertAt: Integer); | 
|---|
| 84 | procedure txtVisitStartKeyPress(Sender: TObject; var Key: Char); | 
|---|
| 85 | procedure txtVisitStopKeyPress(Sender: TObject; var Key: Char); | 
|---|
| 86 | procedure cboProviderKeyUp(Sender: TObject; var Key: Word; | 
|---|
| 87 | Shift: TShiftState); | 
|---|
| 88 | private | 
|---|
| 89 | { Private declarations } | 
|---|
| 90 | FStartEntered: boolean; | 
|---|
| 91 | FStopEntered: boolean; | 
|---|
| 92 | FProviderSpecial: boolean;   // used to avoid duplicate action on cboProviderKeyUp | 
|---|
| 93 | public | 
|---|
| 94 | { Public declarations } | 
|---|
| 95 | procedure NextControl(Key: Char); | 
|---|
| 96 | end; | 
|---|
| 97 |  | 
|---|
| 98 | var | 
|---|
| 99 | frmOptionsPatientSelection: TfrmOptionsPatientSelection; | 
|---|
| 100 |  | 
|---|
| 101 | procedure DialogOptionsPatientSelection(topvalue, leftvalue, fontsize: integer; var actiontype: Integer); | 
|---|
| 102 |  | 
|---|
| 103 | implementation | 
|---|
| 104 |  | 
|---|
| 105 | uses rOptions, uOptions, rCore; | 
|---|
| 106 |  | 
|---|
| 107 | {$R *.DFM} | 
|---|
| 108 |  | 
|---|
| 109 | procedure DialogOptionsPatientSelection(topvalue, leftvalue, fontsize: integer; var actiontype: Integer); | 
|---|
| 110 | // create the form and make it modal, return an action | 
|---|
| 111 | var | 
|---|
| 112 | frmOptionsPatientSelection: TfrmOptionsPatientSelection; | 
|---|
| 113 | begin | 
|---|
| 114 | frmOptionsPatientSelection := TfrmOptionsPatientSelection.Create(Application); | 
|---|
| 115 | actiontype := 0; | 
|---|
| 116 | try | 
|---|
| 117 | with frmOptionsPatientSelection do | 
|---|
| 118 | begin | 
|---|
| 119 | FProviderSpecial := false; | 
|---|
| 120 | if (topvalue < 0) or (leftvalue < 0) then | 
|---|
| 121 | Position := poScreenCenter | 
|---|
| 122 | else | 
|---|
| 123 | begin | 
|---|
| 124 | Position := poDesigned; | 
|---|
| 125 | Top := topvalue; | 
|---|
| 126 | Left := leftvalue; | 
|---|
| 127 | end; | 
|---|
| 128 | ResizeAnchoredFormToFont(frmOptionsPatientSelection); | 
|---|
| 129 | ShowModal; | 
|---|
| 130 | actiontype := btnOK.Tag; | 
|---|
| 131 | end; | 
|---|
| 132 | finally | 
|---|
| 133 | frmOptionsPatientSelection.Release; | 
|---|
| 134 | end; | 
|---|
| 135 | end; | 
|---|
| 136 |  | 
|---|
| 137 | procedure TfrmOptionsPatientSelection.FormCreate(Sender: TObject); | 
|---|
| 138 | begin | 
|---|
| 139 | FStartEntered := false; | 
|---|
| 140 | FStopEntered := false; | 
|---|
| 141 | cboMonday.InitLongList(''); | 
|---|
| 142 | cboTuesday.InitLongList(''); | 
|---|
| 143 | cboWednesday.InitLongList(''); | 
|---|
| 144 | cboThursday.InitLongList(''); | 
|---|
| 145 | cboFriday.InitLongList(''); | 
|---|
| 146 | cboSaturday.InitLongList(''); | 
|---|
| 147 | cboSunday.InitLongList(''); | 
|---|
| 148 | cboProvider.InitLongList(''); | 
|---|
| 149 | ListSpecialtyAll(cboTreating.Items); | 
|---|
| 150 | ListTeamAll(cboTeam.Items); | 
|---|
| 151 | ListWardAll(cboWard.Items); | 
|---|
| 152 | end; | 
|---|
| 153 |  | 
|---|
| 154 | procedure TfrmOptionsPatientSelection.FormShow(Sender: TObject); | 
|---|
| 155 | var | 
|---|
| 156 | visitstart, visitstop: integer; | 
|---|
| 157 | mon, tues, wed, thurs, fri, sat, sun: integer; | 
|---|
| 158 | visitstartdef, visitstopdef: integer; | 
|---|
| 159 | defprovider, deftreating, deflist, defward: integer; | 
|---|
| 160 | begin | 
|---|
| 161 | rpcGetClinicUserDays(visitstart, visitstop); | 
|---|
| 162 | visitstartdef := visitstart; | 
|---|
| 163 | visitstopdef := visitstop; | 
|---|
| 164 | txtVisitStart.Tag := visitstart - 1; | 
|---|
| 165 | txtVisitStop.Tag := visitstop - 1; | 
|---|
| 166 | spnVisitStart.Tag := visitstartdef; | 
|---|
| 167 | spnVisitStop.Tag := visitstopdef; | 
|---|
| 168 | spnVisitStartClick(self, btNext); | 
|---|
| 169 | spnVisitStopClick(self, btNext); | 
|---|
| 170 |  | 
|---|
| 171 | rpcGetClinicDefaults(mon, tues, wed, thurs, fri, sat, sun); | 
|---|
| 172 | cboMonday.SelectByIEN(mon); | 
|---|
| 173 | if cboMonday.Text = '' then | 
|---|
| 174 | cboMonday.SetExactByIEN(mon, ExternalName(mon, 44)); | 
|---|
| 175 | cboTuesday.SelectByIEN(tues); | 
|---|
| 176 | if cboTuesday.Text = '' then | 
|---|
| 177 | cboTuesday.SetExactByIEN(tues, ExternalName(tues, 44)); | 
|---|
| 178 | cboWednesday.SelectByIEN(wed); | 
|---|
| 179 | if cboWednesday.Text = '' then | 
|---|
| 180 | cboWednesday.SetExactByIEN(wed, ExternalName(wed, 44)); | 
|---|
| 181 | cboThursday.SelectByIEN(thurs); | 
|---|
| 182 | if cboThursday.Text = '' then | 
|---|
| 183 | cboThursday.SetExactByIEN(thurs, ExternalName(thurs, 44)); | 
|---|
| 184 | cboFriday.SelectByIEN(fri); | 
|---|
| 185 | if cboFriday.Text = '' then | 
|---|
| 186 | cboFriday.SetExactByIEN(fri, ExternalName(fri, 44)); | 
|---|
| 187 | cboSaturday.SelectByIEN(sat); | 
|---|
| 188 | if cboSaturday.Text = '' then | 
|---|
| 189 | cboSaturday.SetExactByIEN(sat, ExternalName(sat, 44)); | 
|---|
| 190 | cboSunday.SelectByIEN(sun); | 
|---|
| 191 | if cboSunday.Text = '' then | 
|---|
| 192 | cboSunday.SetExactByIEN(sun, ExternalName(sun, 44)); | 
|---|
| 193 |  | 
|---|
| 194 | with radListSource do | 
|---|
| 195 | case DfltPtListSrc of | 
|---|
| 196 | 'P': ItemIndex := 0; | 
|---|
| 197 | 'S': ItemIndex := 1; | 
|---|
| 198 | 'T': ItemIndex := 2; | 
|---|
| 199 | 'W': ItemIndex := 3; | 
|---|
| 200 | 'C': ItemIndex := 4; | 
|---|
| 201 | 'M': ItemIndex := 5; | 
|---|
| 202 | end; | 
|---|
| 203 | radListSourceClick(self); | 
|---|
| 204 |  | 
|---|
| 205 | case rpcGetListOrder of | 
|---|
| 206 | 'A': radAlphabetical.Checked := true; | 
|---|
| 207 | 'R': | 
|---|
| 208 | begin | 
|---|
| 209 | if radRoomBed.Enabled then | 
|---|
| 210 | radRoomBed.Checked := true | 
|---|
| 211 | else | 
|---|
| 212 | radAlphabetical.Checked := True; | 
|---|
| 213 | end; | 
|---|
| 214 | 'P': | 
|---|
| 215 | begin | 
|---|
| 216 | if radAppointmentDate.Enabled then | 
|---|
| 217 | radAppointmentDate.Checked := true | 
|---|
| 218 | else | 
|---|
| 219 | radAlphabetical.Checked := True; | 
|---|
| 220 | end; | 
|---|
| 221 | 'T': radTerminalDigit.Checked := true; | 
|---|
| 222 | 'S': radSource.Checked := true; | 
|---|
| 223 | else | 
|---|
| 224 | radAlphabetical.Checked := true; | 
|---|
| 225 | end; | 
|---|
| 226 |  | 
|---|
| 227 | rpcGetListSourceDefaults(defprovider, deftreating, deflist, defward); | 
|---|
| 228 | cboProvider.SelectByIEN(defprovider); | 
|---|
| 229 | cboTreating.SelectByIEN(deftreating); | 
|---|
| 230 | cboTeam.SelectByIEN(deflist); | 
|---|
| 231 | cboWard.SelectByIEN(defward); | 
|---|
| 232 |  | 
|---|
| 233 | radListSource.SetFocus; | 
|---|
| 234 | end; | 
|---|
| 235 |  | 
|---|
| 236 | procedure TfrmOptionsPatientSelection.spnVisitStartClick(Sender: TObject; | 
|---|
| 237 | Button: TUDBtnType); | 
|---|
| 238 | var | 
|---|
| 239 | tagnum: integer; | 
|---|
| 240 | begin | 
|---|
| 241 | with txtVisitStart do | 
|---|
| 242 | begin | 
|---|
| 243 | if FStartEntered then | 
|---|
| 244 | begin | 
|---|
| 245 | if Hint = '' then Hint := 'T'; | 
|---|
| 246 | tagnum := RelativeDate(Hint); | 
|---|
| 247 | if tagnum = INVALID_DAYS then | 
|---|
| 248 | begin | 
|---|
| 249 | Text := Hint; | 
|---|
| 250 | beep; | 
|---|
| 251 | //      InfoBox('Start Date entry was invalid', 'Warning', MB_OK or MB_ICONWARNING);  <-- original line.  //kt 8/8/2007 | 
|---|
| 252 | InfoBox(DKLangConstW('fOptionsPatientSelection_Start_Date_entry_was_invalid'), DKLangConstW('fOptionsPatientSelection_Warning'), MB_OK or MB_ICONWARNING); //kt added 8/8/2007 | 
|---|
| 253 | ShowDisplay(txtVisitStart); | 
|---|
| 254 | FStartEntered := false; | 
|---|
| 255 | exit; | 
|---|
| 256 | end | 
|---|
| 257 | else | 
|---|
| 258 | begin | 
|---|
| 259 | DateLimits(SELECTION_LIMIT, tagnum); | 
|---|
| 260 | if tagnum <> INVALID_DAYS then | 
|---|
| 261 | Tag := tagnum; | 
|---|
| 262 | end; | 
|---|
| 263 | end; | 
|---|
| 264 | SetFocus; | 
|---|
| 265 | if Button = btNext then tagnum := Tag + 1 | 
|---|
| 266 | else tagnum := Tag - 1; | 
|---|
| 267 | Text := Hint; | 
|---|
| 268 | DateLimits(SELECTION_LIMIT, tagnum); | 
|---|
| 269 | if tagnum <> INVALID_DAYS then | 
|---|
| 270 | Tag := tagnum; | 
|---|
| 271 | ShowDisplay(txtVisitStart); | 
|---|
| 272 | end; | 
|---|
| 273 | FStartEntered := false; | 
|---|
| 274 | end; | 
|---|
| 275 |  | 
|---|
| 276 | procedure TfrmOptionsPatientSelection.spnVisitStopClick(Sender: TObject; | 
|---|
| 277 | Button: TUDBtnType); | 
|---|
| 278 | var | 
|---|
| 279 | tagnum: integer; | 
|---|
| 280 | begin | 
|---|
| 281 | with txtVisitStop do | 
|---|
| 282 | begin | 
|---|
| 283 | if FStopEntered then | 
|---|
| 284 | begin | 
|---|
| 285 | if Hint = '' then Hint := 'T'; | 
|---|
| 286 | tagnum := RelativeDate(Hint); | 
|---|
| 287 | if tagnum = INVALID_DAYS then | 
|---|
| 288 | begin | 
|---|
| 289 | Text := Hint; | 
|---|
| 290 | beep; | 
|---|
| 291 | //      InfoBox('Stop Date entry was invalid', 'Warning', MB_OK or MB_ICONWARNING);  <-- original line.  //kt 8/8/2007 | 
|---|
| 292 | InfoBox(DKLangConstW('fOptionsPatientSelection_Stop_Date_entry_was_invalid'), DKLangConstW('fOptionsPatientSelection_Warning'), MB_OK or MB_ICONWARNING); //kt added 8/8/2007 | 
|---|
| 293 | ShowDisplay(txtVisitStop); | 
|---|
| 294 | FStopEntered := false; | 
|---|
| 295 | exit; | 
|---|
| 296 | end | 
|---|
| 297 | else | 
|---|
| 298 | begin | 
|---|
| 299 | DateLimits(SELECTION_LIMIT, tagnum); | 
|---|
| 300 | Tag := tagnum; | 
|---|
| 301 | end; | 
|---|
| 302 | end; | 
|---|
| 303 | SetFocus; | 
|---|
| 304 | if Button = btNext then tagnum := Tag + 1 | 
|---|
| 305 | else tagnum := Tag - 1; | 
|---|
| 306 | Text := Hint; | 
|---|
| 307 | DateLimits(SELECTION_LIMIT, tagnum); | 
|---|
| 308 | Tag := tagnum; | 
|---|
| 309 | ShowDisplay(txtVisitStop); | 
|---|
| 310 | end; | 
|---|
| 311 | FStopEntered := false; | 
|---|
| 312 | end; | 
|---|
| 313 |  | 
|---|
| 314 | procedure TfrmOptionsPatientSelection.btnOKClick(Sender: TObject); | 
|---|
| 315 | var | 
|---|
| 316 | StartDays, StopDays, mon, tues, wed, thurs, fri, sat, sun: integer; | 
|---|
| 317 | PLSource, PLSort: Char; | 
|---|
| 318 | prov, spec, team, ward: integer; | 
|---|
| 319 | begin | 
|---|
| 320 | StartDays := txtVisitStart.Tag; | 
|---|
| 321 | StopDays := txtVisitStop.Tag; | 
|---|
| 322 | mon := cboMonday.ItemIEN; | 
|---|
| 323 | tues := cboTuesday.ItemIEN; | 
|---|
| 324 | wed := cboWednesday.ItemIEN; | 
|---|
| 325 | thurs := cboThursday.ItemIEN; | 
|---|
| 326 | fri := cboFriday.ItemIEN; | 
|---|
| 327 | sat := cboSaturday.ItemIEN; | 
|---|
| 328 | sun := cboSunday.ItemIEN; | 
|---|
| 329 | rpcSetClinicDefaults(StartDays, StopDays, mon, tues, wed, thurs, fri, sat, sun); | 
|---|
| 330 | case radListSource.ItemIndex of | 
|---|
| 331 | 0: PLSource := 'P'; | 
|---|
| 332 | 1: PLSource := 'S'; | 
|---|
| 333 | 2: PLSource := 'T'; | 
|---|
| 334 | 3: PLSource := 'W'; | 
|---|
| 335 | 4: PLSource := 'C'; | 
|---|
| 336 | 5: PLSource := 'M'; | 
|---|
| 337 | else | 
|---|
| 338 | PLSource := 'P'; | 
|---|
| 339 | end; | 
|---|
| 340 | if radAlphabetical.Checked then PLSort := 'A' | 
|---|
| 341 | else if radRoomBed.Checked then PLSort := 'R' | 
|---|
| 342 | else if radAppointmentDate.Checked then PLSort := 'P' | 
|---|
| 343 | else if radSource.Checked then PLSort := 'S' | 
|---|
| 344 | else PLSort := 'T'; | 
|---|
| 345 | prov := cboProvider.ItemIEN; | 
|---|
| 346 | spec := cboTreating.ItemIEN; | 
|---|
| 347 | team := cboTeam.ItemIEN; | 
|---|
| 348 | ward := cboWard.ItemIEN; | 
|---|
| 349 | rpcSetPtListDefaults(PLSource, PLSort, prov, spec, team, ward); | 
|---|
| 350 | ResetDfltSort; | 
|---|
| 351 | end; | 
|---|
| 352 |  | 
|---|
| 353 | procedure TfrmOptionsPatientSelection.txtVisitStartExit(Sender: TObject); | 
|---|
| 354 | begin | 
|---|
| 355 | with txtVisitStart do | 
|---|
| 356 | if Text = '' then | 
|---|
| 357 | begin | 
|---|
| 358 | Text := 'T-1'; | 
|---|
| 359 | Hint := 'T-1'; | 
|---|
| 360 | spnVisitStartClick(self, btNext); | 
|---|
| 361 | end; | 
|---|
| 362 | TextExit(txtVisitStart, FStartEntered, SELECTION_LIMIT); | 
|---|
| 363 | end; | 
|---|
| 364 |  | 
|---|
| 365 | procedure TfrmOptionsPatientSelection.txtVisitStopExit(Sender: TObject); | 
|---|
| 366 | begin | 
|---|
| 367 | with txtVisitStop do | 
|---|
| 368 | if Text = '' then | 
|---|
| 369 | begin | 
|---|
| 370 | Text := 'T-1'; | 
|---|
| 371 | Hint := 'T-1'; | 
|---|
| 372 | spnVisitStopClick(self, btNext); | 
|---|
| 373 | end; | 
|---|
| 374 | TextExit(txtVisitStop, FStopEntered, SELECTION_LIMIT); | 
|---|
| 375 | end; | 
|---|
| 376 |  | 
|---|
| 377 | procedure TfrmOptionsPatientSelection.txtVisitStartKeyUp(Sender: TObject; | 
|---|
| 378 | var Key: Word; Shift: TShiftState); | 
|---|
| 379 | begin | 
|---|
| 380 | txtVisitStart.Hint := txtVisitStart.Text;   // put text in hint since text not available to spin | 
|---|
| 381 | FStartEntered := true; | 
|---|
| 382 | end; | 
|---|
| 383 |  | 
|---|
| 384 | procedure TfrmOptionsPatientSelection.txtVisitStopKeyUp(Sender: TObject; | 
|---|
| 385 | var Key: Word; Shift: TShiftState); | 
|---|
| 386 | begin | 
|---|
| 387 | txtVisitStop.Hint := txtVisitStop.Text;   // put text in hint since text not available to spin | 
|---|
| 388 | FStopEntered := true; | 
|---|
| 389 | end; | 
|---|
| 390 |  | 
|---|
| 391 | procedure TfrmOptionsPatientSelection.cboProviderExit(Sender: TObject); | 
|---|
| 392 | begin | 
|---|
| 393 | with (Sender as TORComboBox) do | 
|---|
| 394 | if ItemIndex < 0 then | 
|---|
| 395 | Text := ''; | 
|---|
| 396 | end; | 
|---|
| 397 |  | 
|---|
| 398 | procedure TfrmOptionsPatientSelection.radListSourceClick(Sender: TObject); | 
|---|
| 399 | begin | 
|---|
| 400 | if radListSource.ItemIndex = 4 then | 
|---|
| 401 | begin | 
|---|
| 402 | if radRoomBed.Checked then | 
|---|
| 403 | radAlphabetical.Checked := true; | 
|---|
| 404 | radRoomBed.Enabled := false; | 
|---|
| 405 | radAppointmentDate.Enabled := true; | 
|---|
| 406 | end | 
|---|
| 407 | else | 
|---|
| 408 | begin | 
|---|
| 409 | if radAppointmentDate.Checked then | 
|---|
| 410 | radAlphabetical.Checked := true; | 
|---|
| 411 | radAppointmentDate.Enabled := false; | 
|---|
| 412 | radRoomBed.Enabled := true; | 
|---|
| 413 | end; | 
|---|
| 414 | if radListSource.ItemIndex = 5 then | 
|---|
| 415 | begin | 
|---|
| 416 | radSource.Enabled := true; | 
|---|
| 417 | radAppointmentDate.Enabled := true; | 
|---|
| 418 | radRoomBed.Enabled := false; | 
|---|
| 419 | end | 
|---|
| 420 | else | 
|---|
| 421 | radSource.Enabled := false; | 
|---|
| 422 | end; | 
|---|
| 423 |  | 
|---|
| 424 | procedure TfrmOptionsPatientSelection.cboMondayNeedData(Sender: TObject; | 
|---|
| 425 | const StartFrom: String; Direction, InsertAt: Integer); | 
|---|
| 426 | begin | 
|---|
| 427 | cboMonday.ForDataUse(SubSetOfClinics(StartFrom, Direction)); | 
|---|
| 428 | end; | 
|---|
| 429 |  | 
|---|
| 430 | procedure TfrmOptionsPatientSelection.cboTuesdayNeedData(Sender: TObject; | 
|---|
| 431 | const StartFrom: String; Direction, InsertAt: Integer); | 
|---|
| 432 | begin | 
|---|
| 433 | cboTuesday.ForDataUse(SubSetOfClinics(StartFrom, Direction)); | 
|---|
| 434 | end; | 
|---|
| 435 |  | 
|---|
| 436 | procedure TfrmOptionsPatientSelection.cboWednesdayNeedData(Sender: TObject; | 
|---|
| 437 | const StartFrom: String; Direction, InsertAt: Integer); | 
|---|
| 438 | begin | 
|---|
| 439 | cboWednesday.ForDataUse(SubSetOfClinics(StartFrom, Direction)); | 
|---|
| 440 | end; | 
|---|
| 441 |  | 
|---|
| 442 | procedure TfrmOptionsPatientSelection.cboThursdayNeedData(Sender: TObject; | 
|---|
| 443 | const StartFrom: String; Direction, InsertAt: Integer); | 
|---|
| 444 | begin | 
|---|
| 445 | cboThursday.ForDataUse(SubSetOfClinics(StartFrom, Direction)); | 
|---|
| 446 | end; | 
|---|
| 447 |  | 
|---|
| 448 | procedure TfrmOptionsPatientSelection.cboFridayNeedData(Sender: TObject; | 
|---|
| 449 | const StartFrom: String; Direction, InsertAt: Integer); | 
|---|
| 450 | begin | 
|---|
| 451 | cboFriday.ForDataUse(SubSetOfClinics(StartFrom, Direction)); | 
|---|
| 452 | end; | 
|---|
| 453 |  | 
|---|
| 454 | procedure TfrmOptionsPatientSelection.cboSaturdayNeedData(Sender: TObject; | 
|---|
| 455 | const StartFrom: String; Direction, InsertAt: Integer); | 
|---|
| 456 | begin | 
|---|
| 457 | cboSaturday.ForDataUse(SubSetOfClinics(StartFrom, Direction)); | 
|---|
| 458 | end; | 
|---|
| 459 |  | 
|---|
| 460 | procedure TfrmOptionsPatientSelection.cboSundayNeedData(Sender: TObject; | 
|---|
| 461 | const StartFrom: String; Direction, InsertAt: Integer); | 
|---|
| 462 | begin | 
|---|
| 463 | cboSunday.ForDataUse(SubSetOfClinics(StartFrom, Direction)); | 
|---|
| 464 | end; | 
|---|
| 465 |  | 
|---|
| 466 | procedure TfrmOptionsPatientSelection.cboProviderNeedData(Sender: TObject; | 
|---|
| 467 | const StartFrom: String; Direction, InsertAt: Integer); | 
|---|
| 468 | begin | 
|---|
| 469 | cboProvider.ForDataUse(SubSetOfProviders(StartFrom, Direction)); | 
|---|
| 470 | end; | 
|---|
| 471 |  | 
|---|
| 472 | procedure TfrmOptionsPatientSelection.NextControl(Key: Char); | 
|---|
| 473 | begin | 
|---|
| 474 | if Key = #13 then Perform(WM_NextDlgCtl, 0, 0); | 
|---|
| 475 | end; | 
|---|
| 476 |  | 
|---|
| 477 | procedure TfrmOptionsPatientSelection.txtVisitStartKeyPress( | 
|---|
| 478 | Sender: TObject; var Key: Char); | 
|---|
| 479 | begin | 
|---|
| 480 | if Key = #13 then | 
|---|
| 481 | begin | 
|---|
| 482 | FStartEntered := true; | 
|---|
| 483 | Perform(WM_NextDlgCtl, 0, 0); | 
|---|
| 484 | end; | 
|---|
| 485 | end; | 
|---|
| 486 |  | 
|---|
| 487 | procedure TfrmOptionsPatientSelection.txtVisitStopKeyPress(Sender: TObject; | 
|---|
| 488 | var Key: Char); | 
|---|
| 489 | begin | 
|---|
| 490 | if Key = #13 then | 
|---|
| 491 | begin | 
|---|
| 492 | FStopEntered := true; | 
|---|
| 493 | FProviderSpecial := true;    // used to avoid duplicate action on cboProviderKeyUp | 
|---|
| 494 | Perform(WM_NextDlgCtl, 0, 0); | 
|---|
| 495 | end; | 
|---|
| 496 | end; | 
|---|
| 497 |  | 
|---|
| 498 | procedure TfrmOptionsPatientSelection.cboProviderKeyUp(Sender: TObject; | 
|---|
| 499 | var Key: Word; Shift: TShiftState); | 
|---|
| 500 | begin | 
|---|
| 501 | if not FProviderSpecial then NextControl(Char(Key)); | 
|---|
| 502 | FProviderSpecial := false; | 
|---|
| 503 | end; | 
|---|
| 504 |  | 
|---|
| 505 | end. | 
|---|