[453] | 1 | //kt -- Modified with SourceScanner on 7/19/2007
|
---|
| 2 | unit fLabTest;
|
---|
| 3 |
|
---|
| 4 | interface
|
---|
| 5 |
|
---|
| 6 | uses
|
---|
| 7 | Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
|
---|
| 8 | ORCtrls, StdCtrls, ExtCtrls, ORNet, DKLang;
|
---|
| 9 |
|
---|
| 10 | type
|
---|
| 11 | TfrmLabTest = class(TForm)
|
---|
| 12 | pnlLabTest: TORAutoPanel;
|
---|
| 13 | cmdOK: TButton;
|
---|
| 14 | cmdCancel: TButton;
|
---|
| 15 | cboList: TORComboBox;
|
---|
| 16 | cboSpecimen: TORComboBox;
|
---|
| 17 | lblTest: TLabel;
|
---|
| 18 | lblSpecimen: TLabel;
|
---|
| 19 | lblSpecInfo: TLabel;
|
---|
| 20 | DKLanguageController1: TDKLanguageController;
|
---|
| 21 | procedure FormCreate(Sender: TObject);
|
---|
| 22 | procedure cboListNeedData(Sender: TObject; const StartFrom: string;
|
---|
| 23 | Direction, InsertAt: Integer);
|
---|
| 24 | procedure cboSpecimenNeedData(Sender: TObject; const StartFrom: string;
|
---|
| 25 | Direction, InsertAt: Integer);
|
---|
| 26 | procedure cmdOKClick(Sender: TObject);
|
---|
| 27 | procedure cboListEnter(Sender: TObject);
|
---|
| 28 | procedure cboListExit(Sender: TObject);
|
---|
| 29 | private
|
---|
| 30 | { Private declarations }
|
---|
| 31 | public
|
---|
| 32 | { Public declarations }
|
---|
| 33 | end;
|
---|
| 34 |
|
---|
| 35 | procedure SelectTest(FontSize: Integer);
|
---|
| 36 |
|
---|
| 37 | implementation
|
---|
| 38 |
|
---|
| 39 | uses fLabs, ORFn, rLabs;
|
---|
| 40 |
|
---|
| 41 | {$R *.DFM}
|
---|
| 42 |
|
---|
| 43 | procedure SelectTest(FontSize: Integer);
|
---|
| 44 | var
|
---|
| 45 | frmLabTest: TfrmLabTest;
|
---|
| 46 | W, H: integer;
|
---|
| 47 | begin
|
---|
| 48 | frmLabTest := TfrmLabTest.Create(Application);
|
---|
| 49 | try
|
---|
| 50 | with frmLabTest do
|
---|
| 51 | begin
|
---|
| 52 | Font.Size := FontSize;
|
---|
| 53 | W := ClientWidth;
|
---|
| 54 | H := ClientHeight;
|
---|
| 55 | ResizeToFont(FontSize, W, H);
|
---|
| 56 | ClientWidth := W; pnlLabTest.Width := W;
|
---|
| 57 | ClientHeight := H; pnlLabTest.Height := H;
|
---|
| 58 | lblSpecInfo.Height := cboList.Height;
|
---|
| 59 | lblSpecInfo.Width := pnlLabTest.Width - cboList.Left - cboList.Width -10;
|
---|
| 60 | ShowModal;
|
---|
| 61 | end;
|
---|
| 62 | finally
|
---|
| 63 | frmLabTest.Release;
|
---|
| 64 | end;
|
---|
| 65 | end;
|
---|
| 66 |
|
---|
| 67 | procedure TfrmLabTest.FormCreate(Sender: TObject);
|
---|
| 68 | var
|
---|
| 69 | blood, urine, serum, plasma: string;
|
---|
| 70 | begin
|
---|
| 71 | RedrawSuspend(cboList.Handle);
|
---|
| 72 | cboList.InitLongList('');
|
---|
| 73 | RedrawActivate(cboList.Handle);
|
---|
| 74 | RedrawSuspend(cboSpecimen.Handle);
|
---|
| 75 | cboSpecimen.InitLongList('');
|
---|
| 76 | SpecimenDefaults(blood, urine, serum, plasma);
|
---|
| 77 | //cboSpecimen.Items.Add('0^Any'); <-- original line. //kt 7/19/2007
|
---|
| 78 | cboSpecimen.Items.Add('0^'+DKLangConstW('fLabTest_Any')); //kt added 7/19/2007
|
---|
| 79 | //cboSpecimen.Items.Add(serum + '^Serum'); <-- original line. //kt 7/19/2007
|
---|
| 80 | cboSpecimen.Items.Add(serum + '^'+DKLangConstW('fLabTest_Serum')); //kt added 7/19/2007
|
---|
| 81 | //cboSpecimen.Items.Add(blood + '^Blood'); <-- original line. //kt 7/19/2007
|
---|
| 82 | cboSpecimen.Items.Add(blood + '^'+DKLangConstW('fLabTest_Blood')); //kt added 7/19/2007
|
---|
| 83 | //cboSpecimen.Items.Add(plasma + '^Plasma'); <-- original line. //kt 7/19/2007
|
---|
| 84 | cboSpecimen.Items.Add(plasma + '^'+DKLangConstW('fLabTest_Plasma')); //kt added 7/19/2007
|
---|
| 85 | //cboSpecimen.Items.Add(urine + '^Urine'); <-- original line. //kt 7/19/2007
|
---|
| 86 | cboSpecimen.Items.Add(urine + '^'+DKLangConstW('fLabTest_Urine')); //kt added 7/19/2007
|
---|
| 87 | cboSpecimen.Items.Add(LLS_LINE);
|
---|
| 88 | cboSpecimen.Items.Add(LLS_SPACE);
|
---|
| 89 | cboSpecimen.ItemIndex := 0;
|
---|
| 90 | RedrawActivate(cboSpecimen.Handle);
|
---|
| 91 | end;
|
---|
| 92 |
|
---|
| 93 | procedure TfrmLabTest.cboListNeedData(Sender: TObject;
|
---|
| 94 | const StartFrom: string; Direction, InsertAt: Integer);
|
---|
| 95 | begin
|
---|
| 96 | cboList.ForDataUse(AtomicTests(StartFrom, Direction));
|
---|
| 97 | end;
|
---|
| 98 |
|
---|
| 99 | procedure TfrmLabTest.cboSpecimenNeedData(Sender: TObject;
|
---|
| 100 | const StartFrom: string; Direction, InsertAt: Integer);
|
---|
| 101 | begin
|
---|
| 102 | cboSpecimen.ForDataUse(Specimens(StartFrom, Direction));
|
---|
| 103 | end;
|
---|
| 104 |
|
---|
| 105 | procedure TfrmLabTest.cmdOKClick(Sender: TObject);
|
---|
| 106 | begin
|
---|
| 107 | if cboList.ItemIndex = -1 then
|
---|
| 108 | // ShowMessage('No test was selected.') <-- original line. //kt 7/19/2007
|
---|
| 109 | ShowMessage(DKLangConstW('fLabTest_No_test_was_selectedx')) //kt added 7/19/2007
|
---|
| 110 | else
|
---|
| 111 | begin
|
---|
| 112 | frmLabs.lblSingleTest.Caption := cboList.Items[cboList.ItemIndex];
|
---|
| 113 | frmLabs.lblSpecimen.Caption := cboSpecimen.Items[cboSpecimen.ItemIndex];
|
---|
| 114 | Close;
|
---|
| 115 | end;
|
---|
| 116 | end;
|
---|
| 117 |
|
---|
| 118 | procedure TfrmLabTest.cboListEnter(Sender: TObject);
|
---|
| 119 | begin
|
---|
| 120 | cmdOK.Default := true;
|
---|
| 121 | end;
|
---|
| 122 |
|
---|
| 123 | procedure TfrmLabTest.cboListExit(Sender: TObject);
|
---|
| 124 | begin
|
---|
| 125 | cmdOK.Default := false;
|
---|
| 126 | end;
|
---|
| 127 |
|
---|
| 128 | end.
|
---|