Factory Calc Rules
A calc rule adds information to each record of a data set by applying an expression to a subset of other rules in the same data set.
Example:
calc-rule "Admission" `value("Patient Type") = "Inpatient" and value("Admit Date") != null`
This rule is stated in the data-set block and can be called from within a measure block. For example:
measures { category "Volumes" { measure "Admissions" `count()` filter=`value("Admission")` { view "Admissions" } } }
In this example, the measure uses the Admission calc rule as its filter.
It can seem confusing to use the same name for the rule, measure, and scope. But the Measure Factory keeps it all straight. This could be coded as follows:
measures {
category "Volumes" {
measure "Admissions Measure" `count()` filter=`value("Admission Rule")` {
scope "Admissions Scope"
}
}
}
But things can get wordy quickly. As you work with the factory, you will start to recognize what is a measure name versus a rule name or a scope name, based on where the words appear in the script or the Measure Factory Editor.
See also: