source: cprs/branches/tmg-cprs/CPRS-Chart/Encounter/fHealthFactor.pas@ 1681

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

Initial upload of TMG-CPRS 1.0.26.69

File size: 2.6 KB
Line 
1//kt -- Modified with SourceScanner on 8/8/2007
2unit fHealthFactor;
3
4interface
5
6uses
7 Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
8 fPCEBase, StdCtrls, ORCtrls, CheckLst, ExtCtrls, Buttons, uPCE, rPCE, ORFn,
9 fPCELex, fPCEOther, ComCtrls, fPCEBaseMain, DKLang;
10
11type
12 TfrmHealthFactors = class(TfrmPCEBaseMain)
13 lblHealthLevel: TLabel;
14 cboHealthLevel: TORComboBox;
15
16 procedure cboHealthLevelChange(Sender: TObject);
17 procedure FormCreate(Sender: TObject);
18 private
19 protected
20 procedure UpdateNewItemStr(var x: string); override;
21 procedure UpdateControls; override;
22 public
23 end;
24
25var
26 frmHealthFactors: TfrmHealthFactors;
27
28implementation
29
30{$R *.DFM}
31
32uses
33 fEncounterFrame;
34
35procedure tfrmHealthFactors.cboHealthLevelChange(Sender: TObject);
36var
37 i: integer;
38
39begin
40 if(NotUpdating) and (cboHealthLevel.Text <> '') then
41 begin
42 for i := 0 to lbGrid.Items.Count-1 do
43 if(lbGrid.Selected[i]) then
44 TPCEPat(lbGrid.Items.Objects[i]).Level := cboHealthLevel.ItemID;
45 GridChanged;
46 end;
47end;
48
49procedure TfrmHealthFactors.FormCreate(Sender: TObject);
50begin
51 inherited;
52 FTabName := CT_HlthNm;
53 FPCEListCodesProc := ListHealthCodes;
54 FPCEItemClass := TPCEHealth;
55 FPCECode := 'HF';
56 PCELoadORCombo(cboHealthLevel);
57end;
58
59procedure TfrmHealthFactors.UpdateNewItemStr(var x: string);
60begin
61 SetPiece(x, U, pnumHFLevel, NoPCEValue);
62end;
63
64procedure TfrmHealthFactors.UpdateControls;
65var
66 ok, First: boolean;
67 SameHL: boolean;
68 i: integer;
69 HL: string;
70 Obj: TPCEHealth;
71
72begin
73 inherited;
74 if(NotUpdating) then
75 begin
76 BeginUpdate;
77 try
78 ok := (lbGrid.SelCount > 0);
79 lblHealthLevel.Enabled := ok;
80 cboHealthLevel.Enabled := ok;
81 if(ok) then
82 begin
83 First := TRUE;
84 SameHL := TRUE;
85 HL := NoPCEValue;
86 for i := 0 to lbGrid.Items.Count-1 do
87 begin
88 if lbGrid.Selected[i] then
89 begin
90 Obj := TPCEHealth(lbGrid.Items.Objects[i]);
91 if(First) then
92 begin
93 First := FALSE;
94 HL := Obj.Level;
95 end
96 else
97 begin
98 if(SameHL) then
99 SameHL := (HL = Obj.Level);
100 end;
101 end;
102 end;
103 if(SameHL) then
104 cboHealthLevel.SelectByID(HL)
105 else
106 cboHealthLevel.Text := '';
107 end
108 else
109 begin
110 cboHealthLevel.Text := '';
111 end;
112 finally
113 EndUpdate;
114 end;
115 end;
116end;
117
118end.
Note: See TracBrowser for help on using the repository browser.