Can I make a field dependent on multiple fields in EDC/CDMS?
When creating or editing a field, it is possible to make it dependent on only one field. However, using hidden calculation fields, you can also create dependencies on multiple fields.
For example, I want my Field_4 to be dependent on both Field_1 and Field_2 being answered with "Yes". In this case, my fields 1 and 2 are radio button fields, with options "Yes" (option value 1) and "No" (option value 0). I create a calculation field (Field_3) between Field_2 and Field_4 and I will select the option to hide it (because I don't want it to be visible to my participants); it will only be executed in the background.
This is the calculation template:
if ({Field_1} == 1 && {Field_2} == 1) {
1;
} else {
0;
};
This means that if fields 1 and 2 are answered with yes (=1), this calculation will return a 1, if not it will return a 0.
You can add as many fields as you want in your if clause and you can also change the && (meaning AND; dependency on both values) to || (meaning OR; dependency on either value).
You can also check for multiple values of the same variable.
For example, if you want to make Field_4 be dependent on Field_1 being answered with "Yes" or "Maybe", then I will create the same calculation field as above, only using a slightly different template:
if ({Field_1} == 1 || {Field_1} == 2) {
1;
} else {
0;
};
Then, I will make my Field_4 dependent on this calculation field, Field_3, being equal to 1.
For example:
Here is the calculation template to check if all of the inclusion criteria are met.
A dependency is set on the next field, named “Patient can be randomized (go to 'Randomization' section)" on the calculation result:
The structure in the ‘Study forms’ tab will look as shown in the screenshot below:
In the data entry view, the field “How many calories per day?" will appear only if