source: cprs/trunk/CPRS-Chart/fLabTest.pas@ 621

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

Initial Upload of Official WV CPRS 1.0.26.76

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