source: cprs/branches/tmg-cprs/CPRS-Chart/fLabTest.pas@ 1619

Last change on this file since 1619 was 453, checked in by Kevin Toppenberg, 16 years ago

Initial upload of TMG-CPRS 1.0.26.69

File size: 4.0 KB
Line 
1//kt -- Modified with SourceScanner on 7/19/2007
2unit fLabTest;
3
4interface
5
6uses
7 Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
8 ORCtrls, StdCtrls, ExtCtrls, ORNet, DKLang;
9
10type
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
35procedure SelectTest(FontSize: Integer);
36
37implementation
38
39uses fLabs, ORFn, rLabs;
40
41{$R *.DFM}
42
43procedure SelectTest(FontSize: Integer);
44var
45 frmLabTest: TfrmLabTest;
46 W, H: integer;
47begin
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;
65end;
66
67procedure TfrmLabTest.FormCreate(Sender: TObject);
68var
69 blood, urine, serum, plasma: string;
70begin
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);
91end;
92
93procedure TfrmLabTest.cboListNeedData(Sender: TObject;
94 const StartFrom: string; Direction, InsertAt: Integer);
95begin
96 cboList.ForDataUse(AtomicTests(StartFrom, Direction));
97end;
98
99procedure TfrmLabTest.cboSpecimenNeedData(Sender: TObject;
100 const StartFrom: string; Direction, InsertAt: Integer);
101begin
102 cboSpecimen.ForDataUse(Specimens(StartFrom, Direction));
103end;
104
105procedure TfrmLabTest.cmdOKClick(Sender: TObject);
106begin
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;
116end;
117
118procedure TfrmLabTest.cboListEnter(Sender: TObject);
119begin
120 cmdOK.Default := true;
121end;
122
123procedure TfrmLabTest.cboListExit(Sender: TObject);
124begin
125 cmdOK.Default := false;
126end;
127
128end.
Note: See TracBrowser for help on using the repository browser.