Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Info

Configure this section outside the dictionary section.

Example use cases:

  1. Display “Tissue Review Event” only for tissue specimens.

  2. Display “Breast Pathology Annotation form” only if the anatomic site is “Breast”.

  3. Display “Screening form” only for “Screening” visits.

  4. Display “Consent forms” only for the “Consent Collector” role.

Template of Code

Code Block
languagejson
[
  /* 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
languagejson
[
  {
    "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.

...

languagejson

...

: "cpr.participant.gender != 'Female'",
     	       "

...

forms" : 

...

2. Participant

...

Shows forms based on the participant's core fields at the participant level.

...

languagejson

...

[ "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

"specimen" : [

"specimen" : [

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.

"participant"
Code Block
languagejson
Code Block
languagejson
 "participant" :  [ 
{
    "when" : "cpr.participant.extensionDetail.attrsMap.DD2cp.shortTitle == 'MarriedTesting rule CP'",
    "forms" : [ "partnerSDetailsXYZForm"]
] }, {
    "when" : "cpr.participant.extensionDetail.attrsMap.DD2 == 'Married' && 
]

2. Participant

Shows forms based on the participant's core fields at the participant level.

Code Block
languagejson
"participant" :  [ 
{
      "when" : "cpr.participant.gender == 'FemaleMale'",
      "forms" : [ "partnerSDetailssmokingHistoryForm" ]
 }
]

4. Participant

Shows forms based on user role at the participant level.

Code Block
languagejson
"participant" : [
{, 
 {
      "when" : "user.hasRole('Coordinator')",cpr.participant.gender == 'Female'",
      "forms" : [ "participantRuleFormpregnancyTestForm"]
} ]

5. Participant

Show forms based on value exist or not in another field.

Code Block
languagejson
"participant"
: [
      }, {
        "when" : "cpr.participant.gendervitalStatus !== null'Alive'",
 
      "forms" : [ "XYZFormparticipantFamilyHistory" ]
    
 },
      {
        "when": "cpr.participant.gender == null",
   
]

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.


Code Block
languagejson
"participant" :  [ 
{
    "formswhen" : ["ABCForm"]
 "cpr.participant.extensionDetail.attrsMap.DD2 == 'Married'",
    }
]

6. Visit

Shows forms based on CP’s field at the visit level.

Code Block
languagejson
"visit"forms" :  [ "partnerSDetails" ]
  }, {
 
     "when" : "cp.shortTitlecpr.participant.extensionDetail.attrsMap.DD2 == 'Testing rule CP'",
   Married' && cpr.participant.gender == 'Female'",
    "forms" : [ "XYZFormpartnerSDetails" ]
   
}
]

74. VisitParticipant

Shows forms based on participant's and visit's core fields user role at the visit participant level.

Code Block
languagejson
"visitparticipant" :  [ 
    {
      "when": "visit.status == 'Complete'",
   user.hasRole('Coordinator')",
  "forms": ["visitFormRuleparticipantRuleForm"]
}
]

5. Participant

Show forms based on value exist or not in another field.

Code Block
languagejson
"participant" : [
 },     {
        "when": "cpr.participant.gender !== 'Male'null",
        "forms": ["visitInfoCollectedByCoordinatorXYZForm"]
      }
]

8. Visit

Shows forms based on the visit's custom fields at the visit level.

Code Block
languagejson
"visit" :  [ 
      ,
      {
        "when": "visitcpr.extensionDetailparticipant.attrsMap.CB8gender == 'Yes'null",
        "forms": ["visitInfoCollectedByCoordinatorABCForm"]
      }
]

96. Visit

Shows forms based on user role CP’s field at the visit level.

Code Block
languagejson
"visit" :  [ 
    {
        "when" : "user.hasRole('Coordinator'),
cp.shortTitle == 'Testing rule CP'",
       "forms" : [ "visitInfoCollectedByCoordinatorXYZForm" ]
    }
]

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
languagejson
Code Block
languagejson
"visit" :  [ 
    {
      "when": "visit.status == 'Complete'",
      "forms": ["visitFormRule"]
    },
    {
       "when": "cpr.participant.gender == 'Male'",
       "forms": ["visitInfoCollectedByCoordinator"]
    }
]

8. Visit

Shows forms based on the visit's custom fields at the visit level.

Code Block
languagejson
"visit" :  [ 
      {
        "when": "visit.extensionDetail.attrsMap.CB8 == 'Yes'",
        "forms": ["visitInfoCollectedByCoordinator"]
      }
]

9. Visit

Shows forms based on user role at the visit level.

Code Block
languagejson
"visit" :  [ 
    {
        "when" : "user.hasRole('Coordinator'),
        "forms" : [ "visitInfoCollectedByCoordinator" ]
    }
]

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


Code Block
languagejson
"specimen" :  [ 
  {
        "when": "specimen.type == 'Whole Blood'",
        "forms": ["fluidInfoForm"]
  },
  {
        "when": "specimen.type == 'DNA' || specimen.type == 'RNA'",
        "forms": ["support_6200", "cPOneSpecimenForm"]
  },
  {
        "when": "specimencpr.participant.typegender == 'Whole BloodFemale'",
        "forms": ["fluidInfoFormspecimenAdditionalRule"]
  },
  {
        "when": "specimen.type == 'DNA' || specimen.typevisit.clinicalStatus == 'RNAFollow-up'",
        "forms": ["support_6200", "cPOneSpecimenFormfluidInfoForm"]
  },
  {
        "when": "cprspecimen.participant.genderlineage == 'FemaleNew'",
        "forms": ["specimenAdditionalRuletechSpecimenForm"]
  },
  {
        "when": "visit.clinicalStatuscpr.participant.gender == 'Female' && visit.clinicalStatus == 'Follow-up' && specimen.lineage == 'Follow-upNew'",
        "forms": ["specimenAdditionalRule","fluidInfoForm","techSpecimenForm"]
  }
]

11. Specimen

Shows forms based on the specimen's custom fields at the specimen level.

Code Block
languagejson
"specimen" :  ["fluidInfoForm"]
 
},   {
        "when": "specimen.lineageextensionDetail.attrsMap.DD4 == 'NewA'",
         "forms": ["fluidInfoForm"]
    }
]

12. Specimen

Shows forms based on user role at the specimen level.

Code Block
languagejson
  "formsspecimen" :  ["techSpecimenForm"] 
 },   {
        "when": "cpr.participant.gender == 'Female'user.hasRole('Technician') && visit.clinicalStatus == 'Follow-up' && specimen.lineage == 'New'",
        "forms": ["specimenAdditionalRule","fluidInfoForm","techSpecimenForm"]
   }
]

1113. Specimen

Shows forms based on the specimen's custom fields at the specimen levelbased on a range of availability field.

Code Block
languagejson
"specimen" :  [ 
    {
        "when": "specimen.extensionDetail.attrsMap.DD4 == 'A'availableQty > 5",
        "forms": ["fluidInfoFormspecimenAdditionalRule"]
    }
]

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.

Code Block
languagejson
  "specimenspecimenEvent" :  [
    {
        "when": "user.hasRole('Technician') && specimen.lineagespecimenClass == 'NewTissue'",
        "forms": ["techSpecimenFormSpecimenTissueReviewEvent"]
    }
]

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

Code Block
languagejson
"specimenspecimenEvent" :  [ 
    {
        "when": "specimen.availableQty > 5: "cpr.participant.gender == 'Female' && visit.clinicalStatus == 'Follow-up' && specimen.specimenClass == 'Tissue'",
        "forms": ["specimenAdditionalRuleSpecimenTissueReviewEvent"]
    }
]

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

Code Block
languagejson
"specimenEventspecimen" : [
    {
        "when" : "specimen.specimenClasslineage == 'TissueDerived'",
 
      "forms" : [ "SpecimenTissueReviewEvent" ]
    } 
]

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

Code Block
languagejson

"specimenEvent

{
    "name": 

[

"formDataEntryRules",
    "data": {
    "visit": [
	{
      "when": "

cpr.participant.gender == 'Female' &&

visit.

clinicalStatus

status == '

Follow-up

Complete' && 

specimen

visit.

specimenClass

eventLabel == '

Tissue

BASELINE'",


      

"forms": ["

SpecimenTissueReviewEvent

rde_visit_testing"]
    }

]

16. No Forms

It does not show any forms at the derivative level

Code Block
languagejson
, {
      "when"

: "

specimen

visit.

lineage

status == '

Derived

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
languagejson
{
"participant" :  [ 
    {
        "
name
when": "
formDataEntryRules
user.hasRole('Consent Collector')",

  
"data":
 
{
     "
visit
forms": ["consentForm"]
{
    } 
"when": "visit.status == 'Complete' && visit.eventLabel == 'BASELINE'",
]
  1. Specimens

Shows form based on CP title

Code Block
languagejson
"specimen" :  [ 
    {
      "
forms
when":  "[
"rde_visit_testing"] }, { "when": "visit.status == 'Complete'",
'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
languagejson

"

...

specimen" :  [ 
    {

...


      "when": 

...

 "['101_Translational\\'s', '51Legacy', 'More CP names separated by comma'].indexOf(cp.shortTitle) >= 0"
       "forms": ["consentForm"]
    } 
]

Example JSON

View file
nameST_6868.json

...