source: cprs/branches/tmg-cprs/CPRS-Chart/Encounter/mVisitRelated.pas@ 1085

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

CPRS v1.0.26.76

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