Table of Contents
Data validation (real-time edit checks)
Data validation messages can be used to inform users about required actions or warn them about possible errors, based on the data they have entered.
Please note that the Data Validation tab is not available on the following fields:
- Time
- Remark
- Summary
- QR code
- Repeated Measure
- Randomization
- Image
- Grid
- Date and Time
- Number and Date
- Repeating Data Button
- Add a survey Button
- Link
Follow these steps to set up a validation:
- Click the Data validation tab when creating/editing a field.
-
Add the condition (the entered value) that will prompt the message (WHEN this field is), example of possible conditions are listed below and depend on the chosen field type:
>: greater than>=: greater than or equal to=: equal to<: smaller than<=: smaller than or equal to!=: not equal to
- Choose the validation message type (THEN dropdown). There are four types of messages:
- Show Information Message: A simple indication message, outlined in blue, that the user needs to take a certain action.
- Show Warning message: An orange coloured message bar appears to warn the user that something is incorrect.
- Show Error message: A red coloured message can be used to indicate that the data has been entered and is not accepted or is wrong. When the error message type is displayed, the data for that field is not saved. This means that a subsequent field cannot be dependent on a value that would trigger the Error message.
-
Show Exclusion message: A purple coloured message that excludes the subject from the study; when this message is visible to the user, it is possible to navigate to different forms in a Study form:
- If an exclusion occurs on the study form, data entry is blocked on the entire study and any repeating data instances. The Exclusion message will be displayed on every form in the study data view with the name of the form where the exclusion has been triggered.
The repeating data view will be grayed out: -
If an exclusion occurs on a repeating data instance form, data entry is blocked on that same instance, but not blocked on any other repeating data instances or study data.
You can use this for validating inclusion and exclusion criteria. Please be aware, that it's not possible to leave fields with exclusion criteria empty (user missing), nor possible to enter values which are outside the boundaries you have set.
- If an exclusion occurs on the study form, data entry is blocked on the entire study and any repeating data instances. The Exclusion message will be displayed on every form in the study data view with the name of the form where the exclusion has been triggered.
In the following example an exclusion message is set when the patient has not signed informed consent:
It is possible to configure multiple validations for fields.
When you add, change, or delete a validation rule (edit check) on a field, Castor needs to know if the data already entered by sites still complies with your new validation rule.
- If a rule becomes stricter: The system will check existing participant data. If an old data point violates the new rule, it will automatically flag it with the new validation warning.
- If a rule is relaxed or removed: The system will check the data, and if previously flagged data now passes the new rule, it will automatically clear and close the old validation warning.
- A corresponding audit trail entry will be added actioned by System user
NOTE: See below a complete list of limits to validations and fields.
| Field Name | Limits |
|---|---|
| Label | Max character length 1024 |
| Button Name | Max character length 1024 |
| Lower Limit | No min value |
| Upper Limit | Max value 99999999 |
| Lower Limit Label | Max character length 100 |
| Upper Limit Label | Max character length 100 |
| Measurement Unit | Max character length 40 |
| Calculation Template | Max character length 65535 |
| Link Template | Max character length 65535 |
| Grid Field | Max character length 65535 |
| Qr Code Data | Max character length 65535 |
| Summary Template | Max character length 65535 |
| Value (Validation tab) | Max character length 40 |
| Message (Validation Message) | Max character length 255 |
| Value (Annotation Tab) | Max character length 256 |
| Description (Annotation Tab) | Max character length 256 |
Validations cannot be configured for Retrospective study types.
Data validation for dates
It is possible set up data validations (edit checks) to compare fields, such as comparing a source Date field to a referenced Date field. These comparisons can be configured to work within the same form or across different forms.
For date fields, the following conditions (the entered value) that will prompt the message (Compare to dropdown) are possible:
- Current date (for example, to check if a date of visit is not in the future)
- Value (allows to enter specific date to compare against)
- Field (allows to select a specific field, for example to compare if first visit date is after the informed consent date field)
Data validation using partial dates
If a date field allows partial dates to be entered, you can determine how those dates will be handled by dependencies and validations in the “Date field” configuration:
- Ignore - partial values will be ignored by said validations and dependencies
- Trigger or matching - a partial match will be used for the purposes of validations and dependencies
- Round up - partial dates will be rounded up to the latest calendar day for the purposes of validations and dependencies (e.g. March 2023 is treated as 31-03-2023)
- Round down - partial dates will be rounded down to the earliest calendar day for the purposes of validations and dependencies (e.g. March 2023 is treated as 01-03-2023)
- You can learn more about partial dates by visiting Entering and managing partial dates in Castor CDMS article.
Data validations for number fields
For number fields, it is possible to add Lower and Upper limits:
When a value outside the specified range is added, an error message will appear and the data will not be saved:
Dependencies (field logic)
Please keep in mind when using dependencies after data collection has begun and if you are using, or not, the setting Clear inapplicable child fields (from within the Study Settings)
If you change this setting after data collection has begun, it won't retroactively clear inapplicable fields. Instead, newly dependent child fields will be hidden by default.
Any hidden data collected earlier will still appear in data exports (e.g., CSV, XLS).
The system does not clear pre-collected data unless the parent field is explicitly updated, which triggers the confirmation dialog.
If you want to make a field dependent on another field, e.g. only show the question "Pregnant" when the field Gender is set to "Female", take the following steps:
- Click on the Dependency tab.
- Click on the Add dependency button
-
Choose the Form where the parent field is located.
The parent field is the field that your new field will be dependent on, such as 'Blood test performed?'. - Choose the parent field.
-
Choose an operator (IS dropdown), e.g. 'equal to' or 'greater than', choose the Compare to value and then choose a Value - this is the value the parent field should have in order for the new field to appear.
In this example, the current field “Date of blood sample” is only displayed when the field "Blood test performed?", on the Form "Blood test" is set to "Yes":
Field dependencies will be displayed in the Form Builder alongside the field label - it will be shown in your Form that this field only appears when the defined rule is true:
Multiple dependencies
Currently it is only possible to select one condition for a dependency.
If you want to set multiple dependencies, e.g. show your new field based on data entered in multiple other fields, then you will need to create a calculation field and use a template described in this article: Can I make a field dependent on multiple fields?