Field properties: validations (edit checks) and dependencies (field logic) in CDMS
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 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 and Add a survey.
Follow these steps to set up a message:
- Click the 'Data validation' tab when creating/editing a field.
- Choose the condition (the entered value) that will prompt the message.
- Choose the message type. There are four types of messages:
-
Message: A simple indication message, outlined in blue, that the user needs to take a certain action.
-
Warning: An orange coloured message bar appears to warn the user that something is incorrect.
-
Error: A red outlined message can be used to indicate that data has been entered is not accepted or 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.
-
Exclusion: A message in purple 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 on 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 on 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:
In the following example an exclusion message is set when the patient has not signed informed consent:
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 |
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.
Dependencies (field logic)
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 'Dependencies' tab.
- Choose 'Yes' for the 'Field is dependent' property.
- 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 'Gender'.
- Choose the parent field.
- Choose an operator, e.g. 'equal to' or 'greater than' 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 “Is patient pregnant?” is only displayed when the field "Gender", on the Form "Demographics" is set to "Female":
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?