Leave a comment at the end of this page or email contact@krishagni.com
Subset PVs & User Dropdown
This feature is useful when a dropdown has a long list of values, but you want to show only a limited set of options for a specific study.
Change in dropdown option format (from v11.x)
Before v11.x, dropdown sub-setting was done via a list of values. From v11.x onwards, dropdown options must be defined using the structured format. Since only a few customers use this feature, it is not handled automatically during upgrades.
Old Configuration (Before v11.x):
{
"name": "visit.site",
"caption": "Site",
"type": "dropdown",
"multiple": false,
"optional": false,
"listSource": {
"options": [ "Test Ankita v8.1", "Training Site Ankita", "Testing v8.1" ]
},
"showIf": {
"op": "AND",
"rules": [
{
"field": "visit.status",
"op": "!=",
"value": "Missed Collection"
}
]
}
},Updated Configuration (After v11.x):
{
"name": "visit.site",
"caption": "Site",
"type": "dropdown",
"multiple": false,
"optional": false,
"listSource": {
"options": [
{ "value": "Test Ankita v8.1" },
{ "value": "Training Site Ankita" },
{ "value": "Testing v8.1" }
],
"displayProp": "value",
"selectProp": "value"
},
"showIf": {
"op": "AND",
"rules": [
{
"field": "visit.status",
"op": "!=",
"value": "Missed Collection"
}
]
}
}Subset PVs
Please find the examples below to show the specific/restricted values in the field dropdown for the PV fields.
Show few sites in visit site dropdown
It is possible to restrict the visit site to show only a few sites as per the user needs.
Display only two values for gender
Restrict dropdown values for gender up to two ‘Male’ and ‘Female’.
Show 'Whole Blood' value under 'Fluid' and 'Fixed Tissue Block' under 'Tissue' class
Restrict specimen type to specific class.
Subset User Dropdown
You can configure a limited user list to simplify and speed up data entry. If only 4–5 users need to be selected, this avoids the need to search through the entire list of users each time.
List a subset of users in biobank technician dropdown
It is possible to restrict ‘Biobank Technician’ dropdown values to 4-5 users for easy search.
Restrict 'Collector' list based on the Institute
Based on Institute they belong to, ‘Collector’ user list can be restricted.
Collector - The code below is only applicable for unplanned collections (with the +Add Specimen button). It won't affect the planned specimen collection page.
Display restricted values in Cohort field
Show cohort dropdown values based on event label
You can show different Cohort dropdown values based on the Event Label of the visit.
There are two ways to configure this:
1. Using the default Cohort field
You can use the default cohort field and configure the JSON to display different values based on the Event Label.
For example:
If Event Label = Baseline, show Bipolar and Birth study
If Event Label = Follow-up, show Placebo and Study Group A
This approach works well when there are only a few Cohort values. If there are many values, maintaining them in the JSON can become difficult.
2. Using a PV custom field
You can also create a PV custom field with a parent-child relationship.
In this approach, the Event Label is used as the parent value, and the Cohort values are added as child values.
For example:
Baseline
├── Bipolar
└── Birth study
Follow-up
├── Placebo
└── Study Group ASteps
Create a PV called Event Cohort.
Add the event labels as parent values:
Baseline
Follow-up
Add the Cohort values under the corresponding parent:
Under Baseline → Bipolar, Birth study
Under Follow-up → Placebo, Study Group A
Create a visit-level custom field using the Event Cohort PV.
Add the following configuration in the JSON dictionary:
The parentValueExpr uses the visit's Event Label to select the corresponding parent value. The dropdown then displays only the child values under that parent.
For example:
Baseline → Bipolar, Birth study
Follow-up → Placebo, Study Group A
This approach is useful when the Cohort values need to be maintained through permissible values instead of putting all the values directly in the JSON.