Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Logic Based on Multiple Conditions
Message
 
 
To
19/08/2008 15:14:42
Jay Johengen
Altamahaw-Ossipee, North Carolina, United States
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
Miscellaneous
Thread ID:
01340078
Message ID:
01340085
Views:
10
>I have the following possible conditions. There can only be one Patient.EligRule and only one InsCarr.RuleType. The goal is determine whether to do a validation. Is there a clear way to handle the different scenarios?
>
>Some examples:
>
>EligRule is 2 then validate.
>EligRule is 1 and RuleType is 'N' then do not validate.
>EligRule is 3 then do not validate.
>
>Etc...
>
>Should this be a couple of CASE statements? The first determines the patient, then depending on that, run through the Carrier conditions?
>
>* Patient Table
>Patient.EligRule = 1 && Use Carrier Rule
>Patient.EligRule = 2 && Always Validate
>Patient.EligRule = 3 && Do Not Validate
>
>* Carrier Table
>InsCarr.RuleType = 'V' && Always Validate
>InsCarr.RuleType = 'N' && Never Validate
>InsCarr.RuleType = 'A' && Use Anniversary
>InsCarr.RuleType = 'M' && Through End of Month
>
If you need your business logic clearly defined in code then use CASE statements. If the Business rule is going to change you would need to re-code the logic.

The other solution would be to create a table like this
EligRule  I  RuleType C Validate L
with all possible combinations and maintain this table. Then you would only need to check this table to see if you need to validate or not.
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform