Got feedback or spotted a mistake?

Leave a comment at the end of this page or email contact@krishagni.com

Subset PVs and User Dropdown

You can use this feature when the list of permissible values for a dropdown is long and you want to display only a few values in a specific study.

Subset PVs

Example 1: Visit site dropdown to show only required sites

{
  "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'"
               }
         ]
                      }
}

After configuring in the JSON workflow, the 'Site' dropdown shows only selected sites:

Example 2: Display only two values for gender

{
  "name": "cpr.participant.gender",
  "caption": "Gender",
  "type": "pvs",
  "attr": "gender",
  "optional": true,
  "defaultValue": "Female Gender",
    "options": [
          {"value": "Male Gender", "conceptCode": "M"},
          {"value": "Female Gender", "conceptCode": "F"}
               ]
}

After configuring the JSON workflow, the 'Gender' dropdown shows only two genders, "Male" and "Female":

Example 3: Show only 'Whole Blood' value under 'Fluid' and 'Fixed Tissue Block' under 'Tissue' class

{
  "name": "specimen.type",
  "caption": "Type",
  "type": "specimen-type",
  "specimen": "specimen",
  "optional": false,
  "defaultValue": "Whole Blood",
    "options": [
    {
      "specimenClass": "Fluid",
      "type": "Whole Blood"
    },
    {
      "specimenClass": "Tissue",
      "type": "Fixed Tissue Block"
    }
  ]
}

After configuring the JSON workflow, the 'Type' dropdown shows only the selected specimen type:

Subset User Dropdown

You can configure a user list. This feature helps you to speed up the data entry. If there are only 4-5 users to select from, you don't have to search every time from the list of all users.

Example: List the subset of the users that belongs to the biobank technician

The user dropdown field 'Biobank Technician' only has 4-5 users to select. Instead of searching from the users' list, you can create a subset of the users that belong to the biobank technician.

{
            "name": "specimen.extensionDetail.attrsMap.biobank_technician",
            "caption": "Biobank Technician",
            "type": "user",
            "selectProp": "id",
            "listSource": {
              "options": [
                {
                  "id": 6042,
                  "firstName": "1Oncolife",
                  "lastName": "IA RP"
                },
                {
                  "id": 5963,
                  "firstName": "2",
                  "lastName": "Testing"
                },
                {
                  "id": 6041,
                  "firstName": "2OncoLife",
                  "lastName": "IA RP"
                }
              ]
            }
          }

After configuring the user subset in the JSON workflow, the 'Biobank Technician' user dropdown shows only listed users:

Example JSON

Download

Example 4: Restrict Collector user list based on the Institue they belong to

Collector

The below code is only applicable for unplanned collections(+Add Specimen button). It won't affect on the planned specimen collection page.

{
  				"name" : "specimen.collectionEvent.user",
  				"caption" : "Collector",
  				"type" : "user",
  				"defaultValue" : "current_user",
  				"listSource": {
    			"queryParams": {
      			"static": {
        	"institute": "Columbia University"
      }
    }
  },"showIf": {
             "op": "AND",
             "rules": [
               {
                 "field": "specimen.lineage",
                 "op": "==",
                 "value": "'New'"
               },
               {
                 "field" : "specimen.status",
                 "op" : "==",
                 "value" : "'Collected'"
               }
             ]
           },
           "subFields": [
             {
               "name": "emailAddress",
               "caption": "Collector Email Address"
             }
           ]

}



Got feedback or spotted a mistake?

Leave a comment at the end of this page or email contact@krishagni.com