Where do Rules for Cross Field/Form Edit Checks Run?
OpenClinica provides several ways to run Rules for Edit Checks
- Data Entry
When rules for edit checks are configured correctly, they will run automatically when Data Entry is happening. OpenClinica supports multiple forms of data entry which include Initial Data Entry, Double Data Entry and Administrative Data Entry. When building your rules, you can specify during which phase or phases of data entry the rules should execute.
For those familiar with how our data entry pages are setup, you must hit Save on a section to complete the CRF, or move onto another section. Rules for Edit Checks will run when you hit save and there is an item in that section set as a target for a specific Rule. The rule will run and provide a result; the result of the rule will dictate the number of actions to be executed. If the number of actions is greater than zero the user will see the Action’s message on the screen. For the first pass the rules have run but the actions have not been executed. Only the messages are displayed on the screen. We also refer to this as a dryRun When the user hits save again, the actions will be executed automatically and the user will be moved to the next section if applicable. See the document below to see the workflow.
- Bulk Execution (Rules in Manage Study Module)
You will see a table, which contains all of the rule assignments specific to the Study you are in. Each row will show the target, which can be made up of (Study Event definition, CRF Name, Item Groups and Items), or just the Item, and the rules/action combination attached to that target. In addition to managing the Rule Assignments / Rules you can also execute them. You can run one RuleDef at a time, but all the actions associated with the RuleDef will execute. Once you have pressed the execute button a dryRun will occur and you will see a summary page previewing what actions will be executed. If you are happy with those results, press the Submit button in which case the actions will be executed.
- Bulk Execution (CRFs in Manage Study Module )
You can also view and run rules from the Manage CRFs Screen. By choosing to view a specific CRF you will also see a link to Run All the Rules, or View All the Rules for the CRF in that study. Once you have pressed the run button a dryRun will occur and you will see a summary page previewing what actions will be executed. If you are happy with those results, press the Submit button in which case the actions will be executed.
Rule expressions are designed to evaluate to true or false, However, if any of the inputs to a rule expression are missing (null or not entered) or has a missing code (like UNK or NPE), the rull expression will evaluate to ‘FAIL’ and no actions willl be taken. This treatment of unknown (aka null) values is consistent with how nulls are treated in most databases, where A + NULL = NULL See for example here and here.
Consider a rule such as (a + b + c) gt 100 where items a,b, and c are integers and one or more is missing (null or not entered) or has a missing code (like UNK or NPE). You can confirm using the ‘Test Rule’ interface (OC 3.0.4 or later) for an expression like the example with ‘NPE’ or a blank as an input to the test will produce the following results… indicating the rule evaluates to FAIL when there is any non-integer value as an input to the expression.
Rule Validation: Valid
Expression Evaluates To: FAIL OCRERR_0001 : Logic Error, a and b cannot be used with the PLUS operator.
Actions Fired: N Ran in: 0.022 seconds
Action Summary: No actions will be executed (0017083)