11/*
2- * =====================================================
3- * DO NOT MODIFY
4- * =====================================================
2+ * =================================
53 * Gold Standard CML Constraint Model for Medical Product
64 * =====================================================
75 */
@@ -12,7 +10,6 @@ type FamilyHealthInsurance {
1210 relation primarymember : PrimaryMember[1];
1311}
1412
15-
1613type Member {
1714 @(configurable=false)
1815 string First_Name;
@@ -30,47 +27,37 @@ type Member {
3027 @(configurable = false, domainComputation = false)
3128 string Marital_Status = ["Unmarried", "Married", "Single", "None"];
3229
33- @(configurable=false, defaultValue = "Male ",domainComputation = false)
30+ @(configurable=false, defaultValue = "Others ",domainComputation = false)
3431 string Gender = ["Male", "Female", "Others"];
3532}
3633
37-
3834type PrimaryMember : Member {
39-
40- message(Last_Name == "" || Last_Name == null, "Contact/Patient Record is required!", "Error");
4135
42- @(closeRelation=true, propagateUp=true, sequence=1 )
36+ @(closeRelation=true, propagateUp=true)
4337 relation dependentmember : Member {
4438 dependentMemberMaxAge = max(Age);
4539 dependentMemberMarriedMaritalStatusCount = count(Marital_Status == 'Married');
4640 dependentMemberSingleMaritalStatusCount = count(Marital_Status == 'Single');
4741 }
48- @(sequence=1)
4942 relation preventivecarewellness : PreventiveCareWellness[0..1];
5043
51- @(sequence=1)
5244 relation outpatient : OutPatient[0..1];
5345
54- @(sequence=2)
5546 relation criticalillnesssurgery : CriticalIllnessSurgery[0..1];
5647
57- @(sequence=2)
5848 relation chronicdisease : ChronicDisease[0..1];
5949
60-
50+ int primarymemberPCWOut_Network_Deductible_Limit = preventivecarewellness[PreventiveCareWellness].Out_Network_Deductible_Limit;
6151 // constraint #1
6252 boolean isClause1 = (Age >= 40 && Gender == "Male") || (Marital_Status == "Married");
63-
64- require(isClause1 && outpatient[OutPatient] > 0, preventivecarewellness[PreventiveCareWellness]{Deductible_Limit = 5000},
65- "If primary member is 40 years old plus male or married, and has out patient coverage, auto Add PreventiveCareWelness");
66- message(isClause1 && outpatient[OutPatient] > 0,
67- "If primary member is 40 years old plus male or married, and has out patient coverage, auto Add PreventiveCareWelness");
68-
69- require(isClause1 && outpatient[OutPatient] > 0, chronicdisease[ChronicDisease], "If primary member is 40 years old plus male or married, and has out patient coverage, auto Add Chronic Disease Coverage");
70- message(isClause1 && outpatient[OutPatient] > 0, "If primary member is 40 years old plus male or married, and has out patient coverage, auto Add Chronic Disease Coverage");
71-
72- int primarymemberPCWOut_Network_Deductible_Limit = preventivecarewellness[PreventiveCareWellness].Out_Network_Deductible_Limit;
7353
54+ require((Age >= 40 && Gender == "Male") || (Marital_Status == "Married") && outpatient[OutPatient] > 0, preventivecarewellness[PreventiveCareWellness],
55+ "If primary member is 40 years old plus male or married, and has out patient coverage, must have PreventiveCare & Welness");
56+
57+ constraint((Age >= 40 && Gender == "Male") || (Marital_Status == "Married") && outpatient[OutPatient] > 0 && preventivecarewellness[PreventiveCareWellness] > 0 -> preventivecarewellness[PreventiveCareWellness].Deductible_Limit == 5000);
58+
59+ require((Age >= 40 && Gender == "Male") || (Marital_Status == "Married") && outpatient[OutPatient] > 0, chronicdisease[ChronicDisease], "If primary member is 40 years old plus male or married, and has out patient coverage, msut have Chronic Disease Coverage");
60+
7461 // constraint #2
7562 boolean isClause2 = (Gender == 'Female') && (UserProfile == "System Administrator") && (dependentmember.dependentMemberSingleMaritalStatusCount > 0);
7663 exclude((Gender == 'Female') && (UserProfile == "System Administrator") && (dependentmember.dependentMemberSingleMaritalStatusCount > 0), criticalillnesssurgery[CriticalIllnessSurgery],"remove and disable primary member's Critical Illness Surgery'coverage");
@@ -83,9 +70,7 @@ type PrimaryMember : Member {
8370 require(Age > 40 && dependentmember.dependentMemberMaxAge < 30, chronicdisease[ChronicDisease], "Auto Add ChronicDisease for Primary member");
8471}
8572
86-
8773type DependentMember : Member {
88- message(Last_Name == "" || Last_Name == null, "Contact/Patient Record is required!", "Error");
8974
9075 relation dependentoutpatient : OutPatient[0..1];
9176
@@ -109,29 +94,29 @@ type DependentMember : Member {
10994 boolean primaryMemberHasOutPatient = parent(primaryMemberHasOutPatient);
11095
11196 // constraint #3
112- require((Age < 30 && primmemberONDL >= 250), dependentpreventivecarewellness[PreventiveCareWellness] {Annual_Out_of_Pocket_Limit = 20000},"Preventive Care Is Required OOPM is set to 20k");
97+ require((Age < 30 && primmemberONDL >= 250), dependentpreventivecarewellness[PreventiveCareWellness],"Preventive Care Is Required OOPM is set to 20k");
98+ constraint((Age < 30 && primmemberONDL >= 250) && dependentpreventivecarewellness[PreventiveCareWellness] > 0 -> dependentpreventivecarewellness[PreventiveCareWellness].Annual_Out_of_Pocket_Limit == 20000);
11399
114100 // Rule5
115101 require(primaryMemberAge > 40 && Age < 30, dependentoutpatient[OutPatient], "Autoadd out patient cov for depmember");
116- message(primaryMemberAge > 40 && Age < 30, "Autoadd outpatient cov for depmember");
117102
118103 // Rule4
119104 require(primaryMemberHasOutPatient && UserProfile == "System Administrator", dependentchronicdisease[ChronicDisease], "Autoadd chronic disease cov for dependent member");
120- message(primaryMemberHasOutPatient && UserProfile == "System Administrator", "Autoadd chronic disease cov for dependent member");
121105}
122106
123-
124- @(split = false)
125107type CriticalIllnessSurgery {
126108 @(configurable=false)
127109 int Out_Network_Diagnostic_lab_test_copay;
110+
128111 @(defaultValue="50", domainComputation=false)
129112 int Out_Network_Deductible_Limit = [0, 25, 50, 75, 100, 150, 200, 250, 300, 350, 400, 450, 500];
130113
131114 @(defaultValue = "3000")
132115 int Out_Network_Limit;
116+
133117 @(defaultValue = "0")
134118 int Out_Network_coinsurance;
119+
135120 @(domainComputation=false)
136121 int Out_Network_Annual_Out_of_Pocket_Limit = [0, 100, 500, 1000];
137122
@@ -155,24 +140,29 @@ type CriticalIllnessSurgery {
155140 int Number_of_days_covered = [0, 30, 60];
156141}
157142
158- @(split = false)
159143type ChronicDisease {
160144 @(configurable=false)
161145 int Out_Network_Diagnostic_lab_test_copay;
146+
162147 @(defaultValue = "50", domainComputation = false)
163148 int Out_Network_Deductible_Limit = [0, 25, 50, 75, 100, 150, 200, 250, 300, 350, 400, 450, 500];
164149
165150 @(defaultValue = "3000")
166151 int Out_Network_Limit;
152+
167153 @(defaultValue = "0")
168154 int Out_Network_coinsurance;
155+
169156 @(domainComputation = false)
170157 int Out_Network_Annual_Out_of_Pocket_Limit = [0, 100, 500, 1000];
171158
172159 string Out_Network_Room_Rent_limit;
160+
173161 string Out_Network_ICU_Fees;
162+
174163 @(defaultValue = "30")
175164 int Out_Network_Number_of_days_covered;
165+
176166 @(domainComputation = false)
177167 int Out_Network_Doctor_visit_copay = [0, 10, 50, 100];
178168
@@ -188,39 +178,49 @@ type ChronicDisease {
188178
189179 @(configurable=false)
190180 int Diagnostic_lab_test_copay;
181+
191182 @(defaultValue = "0")
192183 int coinsurance;
184+
193185 @(defaultValue = "5000")
194186 int Medical_Limit;
187+
195188 @(domainComputation = false)
196189 int Doctor_visit_copay = [0, 10, 25, 10000];
197190
198191 @(defaultValue = "60", domainComputation = false)
199192 int Number_of_days_covered = [0, 30, 60];
200193}
201194
202- @(split = false)
203195type PreventiveCareWellness {
204196 @(configurable=false)
205197 int Out_Network_Diagnostic_lab_test_copay;
198+
206199 @(defaultValue = "50", domainComputation = false)
207200 int Out_Network_Deductible_Limit = [0, 25, 50, 75, 100, 150, 200, 250, 300, 350, 400, 450, 500];
208201
209202 @(defaultValue = "3000")
210203 int Out_Network_Limit;
204+
211205 @(defaultValue = "0")
212206 int Out_Network_coinsurance;
207+
213208 @(domainComputation = false)
214209 int Out_Network_Annual_Out_of_Pocket_Limit = [0, 100, 500, 1000];
215210
216211 string Out_Network_Room_Rent_limit;
212+
217213 string Out_Network_ICU_Fees;
214+
218215 @(defaultValue = "30", domainComputation = false)
219216 int Out_Network_Number_of_days_covered;
217+
220218 @(domainComputation = false)
221219 int Out_Network_Doctor_visit_copay = [0, 10, 50, 100];
220+
222221 @(configurable=false)
223222 int Out_Network_Copay;
223+
224224 @(defaultValue = "5", domainComputation = false)
225225 int Deductible_Limit = [0, 5, 100, 200,5000];
226226
@@ -239,35 +239,43 @@ type PreventiveCareWellness {
239239
240240 @(defaultValue = "5000")
241241 int Medical_Limit;
242+
242243 @(domainComputation = false)
243244 int Doctor_visit_copay = [0, 10, 25, 10000];
244245
245246 @(defaultValue = "60", domainComputation = false)
246247 int Number_of_days_covered = [0, 10, 30, 60];
247248}
248249
249- @(split = false)
250250type OutPatient {
251251 @(configurable=false)
252252 int Out_Network_Diagnostic_lab_test_copay;
253+
253254 @(defaultValue = "50")
254255 int Out_Network_Deductible_Limit = [0, 25, 50, 75, 100, 150, 200, 250, 300, 350, 400, 450, 500];
255256
256257 @(defaultValue = "3000")
257258 int Out_Network_Limit;
259+
258260 @(defaultValue = "0")
259261 int Out_Network_coinsurance;
262+
260263 @(domainComputation = false)
261264 int Out_Network_Annual_Out_of_Pocket_Limit = [0, 100, 500, 1000];
262265
263266 string Out_Network_Room_Rent_limit;
267+
264268 string Out_Network_ICU_Fees;
269+
265270 @(defaultValue = "30")
266271 int Out_Network_Number_of_days_covered;
272+
267273 @(domainComputation = false)
268274 int Out_Network_Doctor_visit_copay = [0, 10, 50, 100];
275+
269276 @(configurable=false)
270277 int Out_Network_Copay;
278+
271279 @(defaultValue = "50", domainComputation = false)
272280 int Deductible_Limit = [0, 5, 50, 100, 200,5000];
273281
@@ -280,10 +288,13 @@ type OutPatient {
280288
281289 @(configurable = false)
282290 int Diagnostic_lab_test_copay;
291+
283292 @(defaultValue = "0")
284293 int coinsurance;
294+
285295 @(defaultValue = "5000")
286296 int Medical_Limit;
297+
287298 @(domainComputation = false)
288299 int Doctor_visit_copay = [0, 10, 25, 10000];
289300
0 commit comments