# Running rules

The InForm application enables you to run selected rules of the Form Rule type. This is helpful when you are testing rules under development.

1. In the navigation toolbar, click Admin.
2. Click Rules.

   The Rules page appears.

3. Click Select Rules to Run.

   The Select Rules to Run page appears. For a description of the fields on this page, see Select Rules to Run page.

4. Select each rule that you want to run.
5. Click Run Rules.

   The Rules Selected for Running page appears. For a description of the fields on this page, see Rules Selected for Running page.

6. Verify your rule selection.
7. Click Start Running Rules.

   Running the rules may take a long time. When the rules finish running, you can check the applicable items of subject data to ensure that the rules produced the expected results.

# Considerations - split into sep topics

- Batch Run Form Rules and Calculations are only running when the trial is up and running.

- ATTACHRULESET MedML element designates the key context for the Form Rules/Calculations.
  - When Generic Visit context is used, the Calculation Rule will be run for the item in every visit the item appears in.
  - When Generic Form context is used, the Calculation Rule will be run for the item in every form the item appears in.
  - When Generic Item context is used, the Calculation Rule will always be run for the item in Patient’s Casebook
  - When the visit key context is a repeating visit, InForm rule engine will iterate through every visit instance and use each visit instance as key context for rule execution in every iteration.
  - When the form key context is a repeating form, InForm rule engine will iterate through every form instance and use each form instance as key context for rule execution in every iteration
  - When the item key context is in an itemset, InForm rule engine will iterate through every Itemset row and use each itemset row instance as key context for rule execution in every iteration.

- ATTACHRULEDEPEND MedML element with ATTACHTYPE=DEPENDENCY is used to designate rule dependencies which means that the rule will only be run if all the dependency items have values. The rule will not run if one or more items in this dependency type is empty.
- The calculation rule will not be run on a repeating form when the current form key context is deleted.
- The calculation rule will not be run on an itemset when the current itemset row key context is deleted.
- To process Batch Run Rules, InForm will iterate through the Patient list in the order of ascending InForm Patient DBUID
- Batch Run Rules and Frozen and Locked CRB statues:
  - Batch Run Calculations will skip Frozen/Locked CRBs
  - Batch Run Form Rules will skip Locked CRB
    - New Queries could be opened in Frozen CRBs
- Batch Run Rules with UnFrozen and UnLocked CRB, but with individually Frozen/Locked CRFs:
  - Locked CRFs: An error will be encountered when setting calculation values on Locked CRFs. The error will be logged in Batch Run Status
  - Frozen CRFs: An error will be encountered when setting calculation values on Frozen CRFs, unless the ‘Sponsor Edit Frozen’ trial setting is enabled and the user performing Batch Run Calculations has Sponsor role. The error, if any, will be logged in Batch Run Status
- Patients Scope: All patients in the trial will have the selected Form Rules/Calculations run on.
- Audit trial for the modified Item values will have the user running Batch Run Calculations; NOT the original user who submitted the original data values.
- Error handling: Batch Run Rules would continue processing after logging errors during processing of Rule Contexts. In the event that the errors cause the trial/rule package to crash, the Batch Run Rule will enter incomplete state.
- The following will be performed on Data Values set by Calculations:
  - Data is validated against its item control type. Please refer to InForm.Iceland.Core Submit COM Object.Design Specification.docx Section 2.7 for validation of different control types.
  - Known items with special UUIDs will be handled:
    - Subject Number item: Subject Number item set by calculation will be tested for duplicates (based on trial configuration settings). The patient object will be updated accordingly (this could be confirmed on the list of Patients/CRB View).
    - Subject Initials item: Subject Initials item set by calculation will be tested for duplicates of Initials-DOB combination (based on trial configuration settings). The patient object will be updated accordingly (this could be confirmed on the list of Patients/CRB view).
    - DOV items are tested for completeness. Missing Month and/or Year components will cause an error.
    - Randomization Item is tested and error will occur if it is being set to an empty string/cleared.
    - Setting value to an item marked Incomplete/Not Done will cause an error
  - ItemSet SV status (when marked SVed) is preserved when calculations set values to Non-SDVRequired items within the itemset.
  - Update to DOV items would be reflected in the patient object. The update could be confirmed by looking at the PF_SUBJECTVECHAPTER_CUR.ACTUALDATETIME.

Copyright © 2009 - 2012 Oracle and/or its affiliates. All rights reserved.