...
Info |
---|
Configure this section outside the dictionary section. |
Example use cases:
Display “Tissue Review Event” only for tissue specimens.
Display “Breast Pathology Annotation form” only if the anatomic site is “Breast”.
Display “Screening form” only for “Screening” visits.
Display “Consent forms” only for the “Consent Collector” role.
Template of Code
Code Block | ||
---|---|---|
| ||
[ /* Other workflows */ { "name": "formDataEntryRules", "data": { "participant": [ /* Rules for participant form data entry */ /* Records available for use in rule conditions are user, cpr, and cp */ ], "visit": [ /* Rules for visits form data entry */ /* Records available for use in rule conditions are user, cp, cpr, and visit */ ], "specimen": [ /* Rules for specimens form data entry */ /* Records available for use in rule conditions are user, cp, cpr, visit, and specimen */ ], "specimenEvent": [ /* Rules for specimens form data entry */ /* Records available for use in rule conditions are user, cp, cpr, visit, and specimen */ ] } }, /* Other workflows */ ] |
...
Code Block | ||
---|---|---|
| ||
[ { "name": "formDataEntryRules", "data": { "participant" : [ { "when" : "cpr.participant.gender !== 'MaleFemale'", "forms" : [ "pregnancyTestForm" ] } ] { } "when" } ] |
Examples
...
Level
...
Case and Description
...
Example JSON
...
1. Participant
...
Shows forms based on CP’s field at the participant level.
...
language | json |
---|
...
: "cpr.participant.gender != 'Female'", " |
...
forms" : |
...
2. Participant
...
Shows forms based on the participant's core fields at the participant level.
...
language | json |
---|
...
[ "generalInformation" ] // If you have multiple forms, please add the condition to show those } ] |
...
|
...
} |
...
}
] |
User needs to provide the False condtion when they want to show the different forms if first condtion is not satisfied.(See below example)
Code Block |
---|
{ "name" : "formDataEntryRules", "view" : null, "ctrl" : null, "data" : { "participant" : [ { "when" : "cpr.ppid == ' |
...
1'", "forms" : [ " |
...
cbrc_fields" ] }, { "when" : "cpr. |
...
ppid != |
...
' |
...
1'", "forms" : [ "consent_withdrawal" |
...
," |
...
trackingForm" ] } ] |
...
}
}, |
Examples
Level | Case and Description | Example JSON | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1. Participant | Shows forms based on the participant's custom fields CP’s field at the participant level. Add multiple conditions with the help of 'AND(&&)' and 'OR (||)' operators. |
| |||||||||||||||||||||
2. Participant | Shows forms based on the participant's core fields at the participant level. |
| 4. Participant | Shows forms based on user role at the participant level. |
| 5. Participant | Show forms based on value exist or not in another field. |
| |||||||||||||||
3. Participant | Shows forms based on the participant's custom fields at the participant level. Add multiple conditions with the help of 'AND(&&)' and 'OR (||)' operators. |
| 6. Visit | Shows forms based on CP’s field at the visit level. |
| ||||||||||||||||||
74. VisitParticipant | Shows forms based on participant's and visit's core fields user role at the visit participant level. |
| |||||||||||||||||||||
5. Participant | Show forms based on value exist or not in another field. |
| 8. Visit | Shows forms based on the visit's custom fields at the visit level. |
| ||||||||||||||||||
96. Visit | Shows forms based on user role CP’s field at the visit level. |
| |||||||||||||||||||||
107. SpecimenVisit | Shows forms based on participant’s, visitparticipant's , and specimenvisit's core fields at the specimen visit level. Add multiple conditions with the help of 'AND(&&)' and 'OR (||)' operators Code Block | | |||||||||||||||||||||
|
| ||||||||||||||||||||||
8. Visit | Shows forms based on the visit's custom fields at the visit level. |
| |||||||||||||||||||||
9. Visit | Shows forms based on user role at the visit level. |
| |||||||||||||||||||||
10. Specimen | Shows forms based on participant’s, visit's, and specimen's core fields at the specimen level. Add multiple conditions with the help of 'AND(&&)' and 'OR (||)' operators |
| |||||||||||||||||||||
11. Specimen | Shows forms based on the specimen's custom fields at the specimen level. |
| |||||||||||||||||||||
12. Specimen | Shows forms based on user role at the specimen level. |
| |||||||||||||||||||||
1113. Specimen | Shows forms based on the specimen's custom fields at the specimen levelbased on a range of availability field. |
| |||||||||||||||||||||
1214. Specimen Shows forms based on user role at the specimen levelEvent | If CP collects the tissue samples from the participants, then that CP has the 'Tissue Review Event' form under the specimen. |
| |||||||||||||||||||||
1315. Specimen Event | Shows forms based on a range of availability field.participant's, visit's, and specimen's core fields at the specimen event level. Add multiple conditions with the help of 'AND(&&)' and 'OR (||)' operators |
| |||||||||||||||||||||
1416. Specimen EventIf CP collects the tissue samples from the participants, then that CP has the 'Tissue Review Event' form under the specimen.No Forms | It does not show any forms at the derivative level |
| |||||||||||||||||||||
1517. Specimen Event Shows forms based on participant's, visit's, and specimen's core fields at the specimen event level. Add multiple conditions with the help of 'AND(&&)' and 'OR (||)' operatorsVisit | Show form based on event label |
| 16. No Forms | It does not show any forms at the derivative level | Code Block | | |||||||||||||||||
|
, { "when" |
: " |
visit. |
status == ' |
Complete'", "forms" |
: [ |
"" |
] } ] } } |
1718. VisitShow form based on event labelConsent
Consent forms should be displayed to those who have access to the consent form. For example, ‘Consent Collector’.
Code Block | ||
---|---|---|
|
"participant" : [ { " |
when": " |
user.hasRole('Consent Collector')", |
|
|
" |
forms": ["consentForm"] |
} |
] |
Specimens
Shows form based on CP title
Code Block | ||
---|---|---|
| ||
"specimen" : [ { " |
when": "[ |
'101_Translational', '51Legacy', 'More CP names separated by comma'].indexOf(cp.shortTitle) >= 0" "forms": ["consentForm"] } |
] |
18. Consent
Consent forms should be displayed to those who have access to the consent form. For example, ‘Consent Collector’.Info |
---|
How to Escape single quote in code? You need to use the double slash \\ before the chararcher as below |
Code Block | ||
---|---|---|
| ||
" |
...
specimen" : [ { |
...
"when": |
...
"['101_Translational\\'s', '51Legacy', 'More CP names separated by comma'].indexOf(cp.shortTitle) >= 0" "forms": ["consentForm"] } ] |
Example JSON
View file | ||
---|---|---|
|
...