source: cprs/trunk/CPRS-Chart/Encounter/mVisitRelated.pas@ 491

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

Initial Upload of Official WV CPRS 1.0.26.76

File size: 7.6 KB
Line 
1unit mVisitRelated;
2
3interface
4
5uses
6 Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
7 StdCtrls, ExtCtrls, rPCE, uPCE;
8
9type
10 TfraVisitRelated = class(TFrame)
11 lblSCYes: TStaticText;
12 lblSCNo: TStaticText;
13 lblSCSelect: TStaticText;
14 bvlSCFrame: TBevel;
15 chkSCYes: TCheckBox;
16 chkAOYes: TCheckBox;
17 chkIRYes: TCheckBox;
18 chkECYes: TCheckBox;
19 chkMSTYes: TCheckBox;
20 chkMSTNo: TCheckBox;
21 chkECNo: TCheckBox;
22 chkIRNo: TCheckBox;
23 chkAONo: TCheckBox;
24 chkSCNo: TCheckBox;
25 chkHNCYes: TCheckBox;
26 chkHNCNo: TCheckBox;
27 chkCVYes: TCheckBox;
28 chkCVNo: TCheckBox;
29 procedure chkClick(Sender: TObject);
30 private
31 FSCCond: TSCConditions;
32 procedure SetCheckEnable(CheckYes, CheckNo: TCheckBox; Allow: Boolean);
33 procedure SetCheckState(CheckYes, CheckNo: TCheckBox; CheckState: Integer);
34 function GetCheckState(CheckYes, CheckNo: TCheckBox): Integer;
35 public
36 constructor Create(AOwner: TComponent); override;
37 procedure GetRelated(PCEData: TPCEData); overload;
38 procedure GetRelated(var ASCRelated, AAORelated, AIRRelated,
39 AECRelated, AMSTRelated, AHNCRelated, ACVRelated: integer); overload;
40 procedure InitAllow(SCCond: TSCConditions);
41 procedure InitRelated(PCEData: TPCEData); overload;
42 procedure InitRelated(const ASCRelated, AAORelated, AIRRelated,
43 AECRelated, AMSTRelated, AHNCRelated, ACVRelated: integer); overload;
44 end;
45
46implementation
47
48{$R *.DFM}
49
50const
51 TAG_SCYES = 1;
52 TAG_AOYES = 2;
53 TAG_IRYES = 3;
54 TAG_ECYES = 4;
55 TAG_MSTYES = 5;
56 TAG_HNCYES = 6;
57 TAG_CVYES = 7;
58 TAG_SCNO = 11;
59 TAG_AONO = 12;
60 TAG_IRNO = 13;
61 TAG_ECNO = 14;
62 TAG_MSTNO = 15;
63 TAG_HNCNO = 16;
64 TAG_CVNO = 17;
65
66procedure TfraVisitRelated.chkClick(Sender: TObject);
67
68 procedure DisableCheck(ACheckBox: TCheckBox);
69 begin
70 ACheckBox.Checked := False; ACheckBox.Enabled := False;
71 end;
72
73begin
74 inherited;
75 if Sender is TCheckBox then with TCheckBox(Sender) do case Tag of
76 TAG_SCYES: if Checked then chkSCNo.Checked := False;
77 TAG_AOYES: if Checked then chkAONo.Checked := False;
78 TAG_IRYES: if Checked then chkIRNo.Checked := False;
79 TAG_ECYES: if Checked then chkECNo.Checked := False;
80 TAG_MSTYES: if Checked then chkMSTNo.Checked := False;
81 TAG_HNCYES: if Checked then chkHNCNo.Checked := False;
82 TAG_CVYES: if Checked then chkCVNo.Checked := False;
83 TAG_SCNO: if Checked then chkSCYes.Checked := False;
84 TAG_AONO: if Checked then chkAOYes.Checked := False;
85 TAG_IRNO: if Checked then chkIRYes.Checked := False;
86 TAG_ECNO: if Checked then chkECYes.Checked := False;
87 TAG_MSTNO: if Checked then chkMSTYes.Checked := False;
88 TAG_HNCNO: if Checked then chkHNCYes.Checked := False;
89 TAG_CVNO: if Checked then chkCVYes.Checked := False;
90 end;
91 if chkSCYes.Checked then
92 begin
93 DisableCheck(chkAOYes);
94 DisableCheck(chkIRYes);
95 DisableCheck(chkECYes);
96// DisableCheck(chkMSTYes);
97 DisableCheck(chkAONo);
98 DisableCheck(chkIRNo);
99 DisableCheck(chkECNo);
100// DisableCheck(chkMSTNo);
101 end else
102 begin
103 SetCheckEnable(chkSCYes, chkSCNo, FSCCond.SCAllow);
104 SetCheckEnable(chkAOYes, chkAONo, FSCCond.AOAllow);
105 SetCheckEnable(chkIRYes, chkIRNo, FSCCond.IRAllow);
106 SetCheckEnable(chkECYes, chkECNo, FSCCond.ECAllow);
107 end;
108 SetCheckEnable(chkMSTYes, chkMSTNo, FSCCond.MSTAllow);
109 SetCheckEnable(chkHNCYes, chkHNCNo, FSCCond.HNCAllow);
110 SetCheckEnable(chkCVYes, chkCVNo, FSCCond.CVAllow);
111 if chkAOYes.Checked or chkIRYes.Checked or chkECYes.Checked then //or chkMSTYes.Checked then
112 begin
113 chkSCYes.Checked := False;
114 chkSCNo.Checked := True;
115 end;
116end;
117
118constructor TfraVisitRelated.Create(AOwner: TComponent);
119begin
120 inherited;
121
122 lblSCYes.Height := 13;
123 lblSCNo.Height := 13;
124// chkHNCYes.Visible := HNCOK;
125// chkHNCNo.Visible := HNCOK;
126// if not HNCOK then
127// begin
128// height := height - chkHNCYes.height + 1;
129// bvlSCFrame.height := bvlSCFrame.height - chkHNCYes.height + 1;
130// end;
131end;
132
133function TfraVisitRelated.GetCheckState(CheckYes, CheckNo: TCheckBox): Integer;
134begin
135 Result := SCC_NA;
136 if CheckYes.Enabled and CheckYes.Checked then Result := SCC_YES;
137 if CheckNo.Enabled and CheckNo.Checked then Result := SCC_NO;
138end;
139
140procedure TfraVisitRelated.GetRelated(PCEData: TPCEData);
141begin
142 PCEData.SCRelated := GetCheckState(chkSCYes, chkSCNo);
143 PCEData.AORelated := GetCheckState(chkAOYes, chkAONo);
144 PCEData.IRRelated := GetCheckState(chkIRYes, chkIRNo);
145 PCEData.ECRelated := GetCheckState(chkECYes, chkECNo);
146 PCEData.MSTRelated := GetCheckState(chkMSTYes, chkMSTNo);
147 PCEData.HNCRelated := GetCheckState(chkHNCYes, chkHNCNo);
148 PCEData.CVRelated := GetCheckState(chkCVYes, chkCVNo);
149end;
150
151procedure TfraVisitRelated.GetRelated(var ASCRelated, AAORelated,
152 AIRRelated, AECRelated, AMSTRelated, AHNCRelated, ACVRelated: integer);
153begin
154 ASCRelated := GetCheckState(chkSCYes, chkSCNo);
155 AAORelated := GetCheckState(chkAOYes, chkAONo);
156 AIRRelated := GetCheckState(chkIRYes, chkIRNo);
157 AECRelated := GetCheckState(chkECYes, chkECNo);
158 AMSTRelated := GetCheckState(chkMSTYes, chkMSTNo);
159 AHNCRelated := GetCheckState(chkHNCYes, chkHNCNo);
160 ACVRelated := GetCheckState(chkCVYes, chkCVNo);
161end;
162
163procedure TfraVisitRelated.InitAllow(SCCond: TSCConditions);
164begin
165 FSCCond := SCCond;
166 with FSCCond do
167 begin
168 SetCheckEnable(chkSCYes, chkSCNo, SCAllow);
169 SetCheckEnable(chkAOYes, chkAONo, AOAllow);
170 SetCheckEnable(chkIRYes, chkIRNo, IRAllow);
171 SetCheckEnable(chkECYes, chkECNo, ECAllow);
172 SetCheckEnable(chkMSTYes, chkMSTNo, MSTAllow);
173 SetCheckEnable(chkHNCYes, chkHNCNo, HNCAllow);
174 SetCheckEnable(chkCVYes, chkCVNo, CVAllow);
175 end;
176end;
177
178procedure TfraVisitRelated.InitRelated(PCEData: TPCEData);
179begin
180 SetCheckState(chkSCYes, chkSCNo, PCEData.SCRelated);
181 SetCheckState(chkAOYes, chkAONo, PCEData.AORelated);
182 SetCheckState(chkIRYes, chkIRNo, PCEData.IRRelated);
183 SetCheckState(chkECYes, chkECNo, PCEData.ECRelated);
184 SetCheckState(chkMSTYes, chkMSTNo, PCEData.MSTRelated);
185 SetCheckState(chkHNCYes, chkHNCNo, PCEData.HNCRelated);
186 SetCheckState(chkCVYes, chkCVNo, PCEData.CVRelated);
187end;
188
189procedure TfraVisitRelated.InitRelated(const ASCRelated, AAORelated, AIRRelated,
190 AECRelated, AMSTRelated, AHNCRelated, ACVRelated: integer);
191begin
192 SetCheckState(chkSCYes, chkSCNo, ASCRelated);
193 SetCheckState(chkAOYes, chkAONo, AAORelated);
194 SetCheckState(chkIRYes, chkIRNo, AIRRelated);
195 SetCheckState(chkECYes, chkECNo, AECRelated);
196 SetCheckState(chkMSTYes, chkMSTNo, AMSTRelated);
197 SetCheckState(chkHNCYes, chkHNCNo, AHNCRelated);
198 SetCheckState(chkCVYes, chkCVNo, ACVRelated);
199end;
200
201procedure TfraVisitRelated.SetCheckEnable(CheckYes, CheckNo: TCheckBox;
202 Allow: Boolean);
203begin
204 CheckYes.Enabled := Allow;
205 CheckNo.Enabled := Allow;
206end;
207
208procedure TfraVisitRelated.SetCheckState(CheckYes, CheckNo: TCheckBox; CheckState: Integer);
209begin
210 if CheckYes.Enabled then
211 case CheckState of
212 SCC_NA: begin
213 CheckYes.Checked := False;
214 CheckNo.Checked := False;
215 end;
216 SCC_NO: begin
217 CheckYes.Checked := False;
218 CheckNo.Checked := True;
219 end;
220 SCC_YES: begin
221 CheckYes.Checked := True;
222 CheckNo.Checked := False;
223 end;
224 end; {case}
225 chkClick(Self);
226end;
227
228end.
Note: See TracBrowser for help on using the repository browser.