Got feedback or spotted a mistake?

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

Configure Fields on Main Pages

Introduction

Administrators can hide unwanted fields or change field names on participant, specimen, or visit pages based on the data fields required for a collection protocol.

You can configure the JSON workflow at the collection protocol level as well as at the system level. Refer to the wiki page for more information.

The 'dictionary' section must be configured to add fields on main pages like participant, specimen, or visit. Below mentioned are a few examples: 

  1. Fields to be hidden need to be removed from the dictionary. Example: Hide SSN field.
  2. Fields to be renamed can be configured by changing 'caption'. Example: Rename 'Gender' to 'Sex'.
{
     "name" : "cpr.participant.gender",
     "caption" : "Sex",                                                                                   // Rename 'Gender' to 'Sex'
     "type" : "radio",
     "options" : ["Male","Female","Unknown","Undifferentiated"],
     "attr" : "gender",
     "optional" : true
}


3. Mark fields as mandatory by setting "optional": false.

    Example: Mark 'Registration Site' as mandatory.

Fields that are by default mandatory in OpenSpecimen have to be mandatory in the dictionary too. 


{
      "name" : "cpr.site",
      "caption" : "Registration Site",
      "type" : "dropdown",
      "optional" : false,                        // Mark the field mandatory
      "listSource" : {
        "apiUrl" : "collection-protocols/{{cp.id}}/sites",
        "displayProp" : "name",
        "selectProp" : "name",
        "queryParams" : { }
      }
    }

4. Set default values. Example: "defaultValue": "current_date".

{
           "name": "visit.visitDate",
           "caption": "Visit Date",
           "type": "date",
           "defaultValue": "current_date",
           "optional": false
}

Example JSON

Download

Got feedback or spotted a mistake?

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