Overview
Rule Studio is the centralized rule management app for defining and enforcing validation logic and business rules across your clinical trial studies. Rules can be scoped to an individual CRF (form-level) or to an entire study (study-level), allowing flexible control over data quality and workflow automation.
Common use cases include:
- Auto-calculated fields — e.g., compute BMI from height and weight, or age from date of birth
- Range validations — flag values outside expected clinical ranges
- Conditional field visibility — show/hide fields based on other answers
- Default value population — pre-fill fields based on context
Access Rule Studio from: Home → Rule Studio (in the top navigation or app launcher).
Or from within a study: Home → Study Name → Build → Manage Rules → Create Rule.
Manage Rules
The main page displays a table of all rules across your accessible studies.
Rule List Columns
| Column | Description |
|---|---|
| Name | The name of the rule |
| Description | Optional description of the rule's purpose |
| Type | Scope of the rule — CRF (form-level) or Study (study-level) |
| Applies to | The study or CRF the rule is associated with |
| Created On | Date and time the rule was created |
| Created By | User who created the rule |
| Last Updated Date | Date and time the rule was last modified |
| Enabled | Whether the rule is currently active |
| Stop Other Rules | If enabled, this rule will halt execution of subsequent rules when triggered |
| Action | Edit or Delete the rule |
Search & Pagination
- Use the Search bar to filter rules by name.
- The pagination controls at the bottom show the current range (e.g., Rule 1 – 10 / 10) and allow navigation between pages.
- The Page Size dropdown controls how many rules are displayed per page.
Creating a Rule
- Click Create Rule in the top-right area of the page.
- In the dialog, fill in the following fields:
| Field | Required | Description |
|---|---|---|
| Scope | Yes | Select Scope for CRF (form-level) or Scope for Study (study-level) |
| Select CRF | Yes (if CRF scope) | Choose the target CRF form |
| Select Study | Yes (if Study scope) | Choose the target study |
| Rule Name | Yes | A unique name to identify the rule |
| Description | No | Optional explanation of the rule's purpose |
- Click Submit to create the rule, or Cancel to discard.
After creating the rule, you can configure its conditions and actions by clicking Edit.
Editing a Rule
Click the Edit button on any rule row to navigate to the rule editor at:
/apps/rule-studio/edit-rule/[ruleId]
The editor is divided into four main sections: Basic Information, Action, Condition, and an Items reference panel.
Header Bar
The top of the editor shows the rule name and its type (e.g., CRF or Study). Two buttons are available:
- SAVE — saves all changes to the rule
- CANCEL — discards changes and returns to the rule list
Reference Panel — Functions, Constants & Operators
A reference panel is always visible, listing all available expressions you can use when building rule logic:
Functions
| Function | Description |
|---|---|
floor(string) | Round down to nearest integer |
ceil(string) | Round up to nearest integer |
round(string) | Round to nearest integer |
toString(string) | Convert to string |
toInt(string) | Convert to integer |
toFloat(string) | Convert to float |
getYear(string) | Extract year from a date |
getMonth(string) | Extract month from a date |
getDay(string) | Extract day from a date |
getHour(string) | Extract hour from a datetime |
getMinute(string) | Extract minute from a datetime |
getSecond(string) | Extract second from a datetime |
toUpperCase(string) | Convert string to uppercase |
toLowerCase(string) | Convert string to lowercase |
substring(string, startIndex, endIndex) | Extract a portion of a string |
getLength(string) | Get string length |
concat(string1, string2, ...) | Concatenate multiple strings |
isEmpty(string) | Check if a string is empty |
list(string) | Create a list |
Constants
| Constant | Value |
|---|---|
STRING | String |
NUMBER | Number |
TRUE | True |
FALSE | False |
CURRENT_DATE | Current Date |
CURRENT_DATETIME | Current Date Time |
CURRENT_TIME | Current Time |
Operators
| Operator | Meaning |
|---|---|
+ | Add |
- | Subtract |
× | Multiply |
/ | Divide |
% | Modulo |
= | Equal |
≠ | Not Equal |
> | Greater than |
< | Less than |
≥ | Greater than or equal |
≤ | Less than or equal |
Basic Information
| Field | Required | Description |
|---|---|---|
| Rule Name | Yes | The name of the rule |
| Description | No | Optional free-text description |
| Stop other rules | No | When checked, this rule halts execution of all subsequent rules if triggered |
Action
This is where rules are set to perform specific actions like sending notification emails, automatically creating queries, performing automatic calculations, etc.
You can define one or more actions on a rule. All actions share the same conditions and exceptions. If actions have different conditions, it is recommended to create separate rules.
For each action:
| Field | Description |
|---|---|
| Action Type | The type of action to perform (e.g., Set default value to an Item) |
| Target Item | The CRF item the action applies to |
| Expression | The value or formula to apply — built using the code editor with access to Functions, Constants, Operators, and CRF Items |
Use the Add Action button to add additional actions to the same rule.
Click Submit to confirm an individual action's configuration.
Condition
Conditions control when and whether a rule executes. This section has three parts:
Trigger
Defines the event that causes the rule to fire.
- Select a Trigger action from the dropdown (e.g., When a form is ready)
- Click Add Trigger to add multiple triggers
Condition
Specifies additional conditions that must be met for the rule to execute after it is triggered.
- Click Add Condition to define one or more conditions
- Conditions are built using CRF items, operators, and values
Exception
Defines cases where the rule should be skipped even if triggered and conditions are met.
- Click Add Exception to define exceptions
Items Panel
The right-side Items panel lists all available CRF items for the selected form. Each item shows:
- Item ID (e.g.,
CDS_ITEM_4) - Label (e.g.,
Number) - Data type (e.g.,
String,Integer,Date,Time,Date time,File)
Use the Search box to filter items by name, and Refresh to reload the item list after form changes.
Deleting a Rule
Click Delete on a rule row to permanently remove the rule. This action cannot be undone.
Rule Types
| Type | Description |
|---|---|
| CRF | The rule applies to a specific CRF (electronic data capture form). Triggered when data is entered or updated on that form. |
| Study | The rule applies at the study level, across subjects and events in the selected study. |
Stop Other Rules
Each rule has a Stop Other Rules toggle (checkbox). When enabled, if this rule is triggered, no further rules in the sequence will be evaluated. This is useful for setting up priority-based rule chains.
Expression Reference
Item Reference Syntax
To reference a CRF field in an expression, use the Item[OID] notation where OID is the field's unique identifier:
Item[HEIGHT_CM]
Item[WEIGHT_KG]
Item[DATE_OF_BIRTH]
Full qualified form (when referencing an item in a different event or form):
Event[@oid=EVENT_OID].Crf[@oid=CRF_OID].Item[ITEM_OID]
The short form Item[OID] is sufficient when the item is in the same CRF as the rule.
Real-World Examples
Auto-calculate BMI
Calculates BMI (kg/m²) from height (cm) and weight (kg). Uses multiplication by 10000 to avoid operator precedence issues:
round(10000 * Item[WEIGHT_KG] / Item[HEIGHT_CM] / Item[HEIGHT_CM])
| Setting | Value |
|---|---|
| Action Type | Set value to an Item using Calculate Expression |
| Target Item | BMI |
| Trigger Action | Item On Change |
| Trigger Items | HEIGHT_CM, WEIGHT_KG |
Why this formula? The expression engine evaluates left-to-right.
10000 * W / H / H=(10000 × W / H) / H=W × 10000 / H²= BMI. Using parentheses likeW / (H/100 * H/100)can produce unexpected results due to parser reordering.
Auto-calculate Age at Consent
Calculates age in years from the participant's date of birth:
getYear(CURRENT_DATE) - getYear(Item[DATE_OF_BIRTH])
| Setting | Value |
|---|---|
| Action Type | Set value to an Item using Calculate Expression |
| Target Item | AGE_AT_CONSENT |
| Trigger Action | Item On Change |
| Trigger Items | DATE_OF_BIRTH |
Trigger Types
| Trigger Type | When it fires |
|---|---|
| Item On Change | Immediately when the field value changes |
| Item On Blur | When the user leaves (clicks away from) the field |
Adding Trigger Items
- Select the Trigger action type (e.g., Item On Change) from the dropdown. A drop zone appears.
- In the Items panel on the right, find the item you want to use as a trigger.
- Drag the item from the Items panel into the trigger drop zone.
- Repeat for each additional trigger item.
Related
- Configuration — App-level configuration settings for Rule Studio