Attribute Type | Description | Example JSON |
---|
Text | Patient first name, last name should not be null. | {
"records" : [ "cpr" ],
"rules" : [
{
"expr" : "#cpr.participant.firstName != null && #cpr.participant.lastName != null",
"description" : "First name or last name should not be null"
}
]
}, |
|
Text | Allow only capital letters in the field first name | {
"records" : [ "cpr" ],
"rules" : [ {
"expr" : "#cpr.participant.firstName.matches(\"^[A-Z]+$\")",
"description" : "Only capital letters allowed for Initials"
} ]
} |
|
Numeric field | The participant’s age registered under the COVID protocol should be between 18-55 | {
"records" : [ "cpr" ],
"rules" : [ {
"when" : "#cpr.participant.extensionDetail?.getAttrsMap()?.get('min_max_age') != null && !#cpr.participant.extensionDetail?.getAttrsMap()?.get('min_max_age').isEmpty()",
"expr" : "T(java.lang.Integer).parseInt(#cpr.participant.extensionDetail?.getAttrsMap()?.get('min_max_age')) >= 18 && T(java.lang.Integer).parseInt(#cpr.participant.extensionDetail?.getAttrsMap()?.get('min_max_age')) <= 55",
"description" : "Partiicpant's age should be between 18 and 55"
} ]
} |
|
Text Custom Field | If the patient is ‘Dead’ then, specify the value ‘Cause of death.’ | {
"records" : [ "cpr" ],
"rules" : [
{
"when" : "#cpr.participant.vitalStatus == 'Dead'",
"expr" : "#cpr.participant.extensionDetail?.getAttrsMap()?.get('ST2') != null ",
"description" : "Specify Death Cause"
}
]
} |
|
Dropdown | Only male participant registrations are allowed | {
"records" : [ "cpr" ],
"rules" : [
{
"expr" : "#cpr.participant.gender != null && !#containsAny(#cpr.participant.gender, {'Female', 'Unknown', 'Undifferentiated'})",
"description" : "Only Male patient should be register"
}
]
} |
|
Multi-select field | If Race is one of (White or Asian), then Ethnicity should be 'American.' | {
"records" : [ "cpr" ],
"rules" : [
{
"when" : "#containsAny(#cpr.participant.races, {'White', 'Asian'})",
"expr" : "#cpr.participant.ethnicities.size() == 1 && #cpr.participant.ethnicities.contains('American')",
"description" : "For White/Asian races, ethnicity should be American"
}
]
} |
|
Dropdown and Muliselect | If Registration Site='MCRI Repository', then Race values is one of 'White' or 'Asian' If the patient is ‘Alive’ then Ethnicity should be ‘African’ or 'American'
| {
"records" : [ "cpr" ],
"rules" : [
{
"when" : "#cpr.site == 'MCRI Repository'",
"expr" : "#containsAny(#cpr.participant.races, {'White', 'Asian'})",
"description" : "Race should be White/Asin for 'MCRI Repository' site patient"
}
]
},
{
"records" : [ "cpr" ],
"rules" : [
{
"when" : "#containsAny(#cpr.participant.vitalStatus, {'Alive'})",
"expr" : "#containsAny(#cpr.participant.ethnicities, {'American', 'African'})",
"description" : "For alive patient, the enthicity should be American/African"
}
]
} |
|
Custom Field | The email id of the participant should be of the form ‘example@something.com’ | {
"records" : [ "cpr" ],
"rules" : [
{
"when" : "#cpr.registrationDate != null && #cpr.participant.extensionDetail?.getAttrsMap()?.get('ST6')!= null",
"expr" : "#cpr.participant.extensionDetail?.getAttrsMap()?.get('ST6') matches '^\\w+(\\.\\w+)*@\\w+(\\.\\w+)*(\\.[A-Za-z]{2,})$'",
"description" : "Please enter a valid email address"
} ]
} |
|
Custom Form Field | In the ‘Smoking History Form’ attached at the ‘Participant Forms’ level, if the value of ‘Have you ever smoked’ is ‘Yes’, the error ‘Smokers not allowed!’ should be thrown. | {
"records": ["cpr"],
"forms": {
"cpr": [ "smokingHistoryForm" ]
},
"rules": [
{
"when": "#cprForms != null && #cprForms['smokingHistoryForm'] != null",
"expr": "#cprForms['smokingHistoryForm']['haveYouEverSmoked'] != 'Yes'",
"description": "SH:Smokers not allowed!"
}
]
} |
|
Custom Form Field | ‘Male’ participants with the value of ‘Have you ever smoked?’ as ‘Yes’ are not allowed. Error ‘Male smokers not allowed!’ should be thrown. | {
"records": ["cpr"],
"forms": {
"cpr": [ "smokingHistoryForm" ]
},
"rules": [
{
"when": "#cprForms != null && #cprForms['smokingHistoryForm'] != null",
"expr": "#cpr.participant.gender != 'Male' || #cprForms['smokingHistoryForm']['haveYouEverSmoked'] != 'Yes'",
"description": "SH:Male Smokers Not allowed!"
}
]
} |
|
Custom form Date Field | ‘Date of participant signed' is a date type custom field. The date is valid if Valid Date = (Date signed ≤ Today’s Date) otherwise invalid | {
"records" : [ "cpr" ],
"rules" : [ {
"expr" : "#cmp(#cpr.participant.extensionDetail?.getAttrValue('date_participant_signed'), #currentTime()) <= 0",
"description" : "Participant date signed should be lesser than or equal to current date"
} ]
} |
|
Calculated Field (Age) | Participant age at the time of registration should be more than 18 years | {
"records" : [ "cpr" ],
"rules" : [ {
"expr" : "#yearsBetween(#cpr.participant.birthDate, #cpr.registrationDate) >= 18",
"description" : "Participant should be older than 18 years"
} ]
} |
|
Dropdown Custom Field | If the patient is ‘Dead’, enter the values for the 'Diagnosed With' field from the dropdown. | {
"records" : [ "cpr" ],
"rules" : [
{
"when" : "#cpr.participant.vitalStatus == 'Dead'",
"expr" : "#cpr.participant.extensionDetail?.getAttrsMap()?.get('DD3') != null ",
"description" : "Specify the value for Diagnosed With"
}
]
} |
|
Dropdown Multiselect (Custom Field) | If the patient is 'Alive', enter the values for the 'City lived In field from the dropdown. | {
"records" : [ "cpr" ],
"rules" : [
{
"when" : "#cpr.participant.vitalStatus == 'Alive'",
"expr" : "#cpr.participant.extensionDetail?.getAttrsMap()?.get('MLB4') != null ",
"description" : "Specify the cities where patient is lived"
}
]
} |
|
Fancy Control-User | If the user (Surgeon) is 'Krishna W' then the user needs to provide the death cause value (Custom Field) for the patient. | {
"records" : [ "cpr" ],
"rules" : [
{
"when" : "#cpr.participant.extensionDetail?.getAttrsMap()?.get('FC5') == 'Krishna W' ",
"expr" : "#cpr.participant.extensionDetail?.getAttrsMap()?.get('ST2') != null ",
"description" : "Specify the death cause if the surgeon is Krishna W"
}
]
}, |
|