Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Logic Based on Multiple Conditions
Message
 
 
À
19/08/2008 15:14:42
Jay Johengen
Altamahaw-Ossipee, Caroline du Nord, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
Divers
Thread ID:
01340078
Message ID:
01340085
Vues:
11
>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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform