This module provides management of validation rules. A validation rule is based on an expression which defines a relationship between a number of data elements. The expression has a left side, a right side and an operator which defines whether the former must be less than, equal to or greater than the latter. The expression forms a condition which should assert that certain logical criteria are met. For instance, a validation rule could assert that the total number of vaccines given to infants is less than or equal to the total number of infants.
To add a validation rule, just follow these steps from the Data Quality -> Validation Rule dialog:
Click on the Add new button
Provide a descriptive Name for the validation rule. The name must be unique among the validation rules.
Provide a Description for the validation rule.
Select the Importance you wish to assign to the validation rule: high, medium or low.
Select the Rule type. For validating correct data, choose Validation. For monitoring data according to a rule, choose Surveillance and follow the extra instructions below.
Select the Period type for the data being validated.
Select an Operator. The operator options are equal (==), not equal (!=), greater than (>), greater than or equal (>=), less than (<), less than or equal to (>=), a compulsory pair or an exclusive pair.
The compulsory pair operator allows you to require that data values must be entered for a form for both left and right sides of the expression, or for neither side. In other words, you can require that if one field in a form is filled, then one or more other fields must also be filled.
The exclusive pair operator allows you to assert that if any value exist on the left side then there should be no values on the right side (or vice versa). Stated another way, this means that data elements which compose the rule on either side should be mutually exclusive from each other, for a given time period / organisation unit /attribute option combo.
Define the left side and right side of the validation rule expression. First, provide a description for the expression. Second, build the expression with the expression builder. The expression is mathematical and contain data elements as well as integers and mathematical operators. Data elements can be included by double-clicking one in the available data elements list to the right. Alternatively one can select a data element and click the insert button. Mathematical operators can be included by clicking the corresponding button under the expression builder area.
There are three states which can be set to alter how the validation rule will be evaluated if there is any missing data.
Skip if any value is missing: The rule will be skipped if any of the values which compose the expression are missing. This is the default option. This option should always be selected if you are using the "Exclusive" or "Compulsory" pair operator.
Skip if all values are missing: The rule will be skipped only if all of the operands which compose it are missing.
Never skip: The rule will never be skipped in case of missing data, and all missing operands will be treated effectively as a zero.
Save each expression by clicking Save, then save the validation rule by clicking Save.
To edit a validation rule, click the name the relevant validation rule in the list and select "Edit" from the context menu. Then follow the same procedures as above when creating a new rule.
To delete a validation rule, click the name of the validation rule to be deleted, and select "Remove" from the context menu.
Validation rule names can be translated to other languages by selecting the name of the validation rule and selecting "Translate" from the context menu.
To view validation rule details, click the name of the validation rule, and then select "Show details" from the context menu.