Showing/hiding fields based on the site in CDMS
Castor CDMS allows to show/hide certain fields based on the site where a certain participant was created.
There are 2 options on how you can do this:
- Using dependency and calculation field and predefined variables.
- Using our Automation Engine.
If you wish to do it by using the Automation Engine, please visit this article: Automatically hide/show visits/forms based on the site.
In this article we will explain how to perform this task using dependency and a calculation field. Follow the steps:
1. Add the calculation field that will automatically identify from which site is the user. Alternatively, you can also output a value (e.g.: 1 or 2).
We recommend adding the calculation field on the first form of the first visit of the study because the system will only be able to use the calculation to identify the site when the user opens the forms that it is in. Therefore, the system will only show the forms for that specific site once the calculation field is triggered, otherwise they will be kept hidden.
When creating the calculation field, you will need to write on the “Calculation template” exactly '{castorInstituteName}'. This template identifies the site where the participant is created.
Alternatively, if you prefer to give a value to the site abbreviation, you can use the If-Else logic to write the formula that will check the site abbreviation and output a certain value. Please, see example below:If preferred, it is also possible to use ''{instituteId}'' predefined variable which will retrieve the site ID where the participant is created.
if ('{castorInstituteAbbreviation}' == 'ABC') {
1;
} else if ('{castorInstituteAbbreviation}' == 'DEF') {
2;
} else if ('{castorInstituteAbbreviation}' == 'XYZ') {
3;
}
2. Once you have set up the calculation, you can create the dependency on the specific question that you want to appear for that site.
- Is this field dependent?: set to ‘Yes’
- Select dependency field: Select the form and the calculation field
- Show if the dependency field value is: is equal to ‘if the parent field is equal to’ or ‘if the parent field is not equal to’ and add the name of the site to trigger that question to appear. In case you have used the if-else logic to generate the site value, you will need to add the value you have given to that site instead of the name, e.g.: 1
3. When creating a new Participant in the Participants tab, only the questions according to the site where a participant is created will be shown.