...
Note |
---|
The rules added for skip logic are only reflected on add/edit pages. The overview page is a superset of all fields described in the data dictionary. |
...
1. Show custom field based on value of another custom field
Example: Show
...
the field
...
'Relation
...
To Proband
...
' only if the value
...
of field 'Proband'
...
is equal to 'No'.
Expand |
---|
Code Block |
---|
| {
"name": "cpr.participant.extensionDetail.attrsMap.DD15",
"caption": "Relation To Proband",
"type": "dropdown",
"optional": true,
"showIf": {
"op": "AND",
"rules": [
{
"field": "cpr.participant.extensionDetail.attrsMap.RB10",
"op": "==",
"value": "'No'"
}
]
},
"listSource": {
"apiUrl": "forms/permissible-values",
"selectProp": "value",
"displayProp": "value",
"queryParams": {
"dynamic": {},
"static": {
"formName": "kMCParticipantExtension",
"controlName": "DD15"
}
}
}
} |
Screenshot when the field is hidden:
Screenshot when the field is shown:
|
...
2. Show custom field only on create aliquots page
Example: Display the custom field 'Storage tube'
...
field
...
while creating the
...
aliquots
Expand |
---|
Code Block |
---|
| {
"name": "specimen.extensionDetail.attrsMap.ST3",
"caption": "Storage tube",
"type": "text",
"optional": "true",
"showIf": {
"op": "AND",
"rules": [
{
"field": "specimen.lineage",
"op": "==",
"value": "'Aliquot'"
}
]
}
} |
|
...
3. Show custom field when the visit date is greater than specified date
Example: Show 'COVID-19 Test Date'
...
custom field only when the visit date is after
...
23 January, 2020
...
.
Expand |
---|
Code Block |
---|
language | js |
---|
title | Example code |
---|
| {
"name" : "visit.extensionDetail.attrsMap.DP13",
"caption" : "COVID-19 Test Date",
"type" : "date",
"dateOnly" : true,
"optional" : true,
"showIf" : {
"op" : "AND",
"rules" : [ {
"field" : "visit.visitDate",
"op" : ">=",
"value" : "1579717800000"
} ]
},
"showInOverviewIf" : "useShowIf"
} |
Info |
---|
"1579717800000" is the number of milliseconds elapsed since Unix time Epoch on 23/01/2020 at 00:00:00 hrs UTC. |
|
4. Show custom field based on specimen lineage and type
Example
...
:
...
Display 'Upload image'
...
custom field when
...
the specimen lineage is 'New' and the specimen type is 'Whole Blood'.
Expand |
---|
Code Block |
---|
| {
"name" : "specimen.extensionDetail.attrsMap.FU2",
"caption" : "Upload image",
"type" : "file",
"optional" : true,
"showInOverviewIf" : "useShowIf",
"showIf" : {
"op" : "AND",
"rules" : [ {
"field": "specimen.lineage",
"op": "==",
"value": "'New'"
},{
"field" : "Specimen.type",
"op" : "==",
"value" : "'Whole Blood'"
} ]
}
}, |
The field looks like below on the specimen overview page:
|