"Hit Policy: Priority" using tblPolicyPriorityOrder
According to the Priority Hit Policy, if multiple rules are "hit" and multiple results are collected, only one result will be returned.
The priority of the returned result is defined by the order of the output values in the header.
The tblPolicyPriorityOrder table returns a risk of disease rating of low, medium, or high based on a person's age and medical history.
This table requires two inputs, age and medHistory, and returns one result, riskRating, which must be returned in the following order:
low, medium, high.
{decisionTables: {
"tblPolicyPriorityOrder": {
inputs: ["age", "medHistory"],
outputs: ["riskRating"],
refTypes: [ "", "", "" ],
outputValues: ["low", "medium", "high"],
hitPolicy: "P",
rules: [
[">=25", "good", "medium"],
[">60", "bad", "high"],
["-", "bad", "medium"],
["<25", "good", "low"]
]
}
},
formulas: {
"Priority_Order": { formula: "tblPolicyPriorityOrder(,,61, 'bad')", finalValue: [] }
}
}
Note that according to our criteria of age = 61 and medHistory = bad, two rules are returned as successful, rule 2 (age > 60 and medHistory = "bad")
and rule 3 (age = "-" and medHistory = "bad"). Why isn't "high" returned? Because the priority list given for outputValues (low, medium, high) specifies
that "medium" should have higher priority than "high".
"Priority_Order": { "value": ["medium"] }
|