Got feedback or spotted a mistake?

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

Hide/Set default value to specimen fields

Introduction

The user can use the 'showIf' and 'showInOverviewIf' conditions to hide specific fields from all participant/visit/specimen pages. Additionally, these conditions allow you to hide or display fields based on the value of another field.

showIf → condition applies for edit page

showInOverviewIf → condition applies to overview page

 

How to remove the fields from data entry and overview pages?

The fields like the anatomic site, pathology status, and laterality can be hidden from the add/edit and overview pages by removing them from the dictionary section. Sometimes lab do not collect the samples which needs this information to be stored, so instead of showing those fields in the data entry/overview page, the user can remove it from JSON.

Note: These fields are defaulted to 'Not Specified' on the backend.

  1. Refer this wiki page to download the CP JSON.

  2. Serach for “dictionary“ section and remove the fields that are not needed.
    Note: Make sure you need to remove those fields from all the places like List page if those are added in that section.

  3. Import the JSON back and refresh the page to reflect the changes.

image-20240827-071050.png

 

Hide fields on Parent/Child specimen pages

Example 1: The quantity for the parent specimen is not recorded, since they are processed and stored as aliquots. Therefore, the quantity field will not be displayed for specimens with the lineage 'New' (parent) on the unplanned specimens' add, edit, or overview pages.

Code:

{ "name": "specimen.initialQty", "caption": "Initial Quantity", "showInOverviewIf": "useShowIf", //Hides field from overview pages as well if the showif conditions are not met "type": "specimen-quantity", "specimen": "specimen", "optional": true, "showIf": { "op": "AND", "rules": [ { "field": "specimen.lineage", "op": "!=", "value": "'New'" } ] } }, { "name": "specimen.availableQty", "caption": "Available Quantity", "showInOverviewIf": "useShowIf", "type": "specimen-quantity", "specimen": "specimen", "optional": true, "showIf": { "op": "AND", "rules": [ { "field": "specimen.lineage", "op": "!=", "value": "'New'" } ] } }

 

Before adding the Configuration:

image-20240827-071412.png

 

After adding the Configuration:

  1. Screenshot for the parent specimen's overview page, where the fields for quantity are hidden in edit and overview page.

  2. Both the fields will be displayed for the child specimens (lineage: derived/aliquot).

Example 2: Display specimen type field only for primary and derived overview page, and not on the aliquot overview page.

Example code

{ "name": "specimen.type", "caption": "Type", "type": "specimen-type", "specimen": "specimen", "optional": false, "showInOverviewIf": "specimen.lineage != 'Aliquot'" }

After adding the configuration:

  1. Specimen type field displayed on parent specimen overview page:

  2. Specimen type field not displayed on child specimen overview page:

Hide/Set default value to mandatory fields

By using the "defaultValue": "<value>" option, you can set a default value for any specimen field.

  1. Add the below-mentioned code block in the dictionary.

  2. In the below example, we have set the default value 'Abdomen, NOS' for the anatomic site. Also,  hide the 'Anatomical Site' field from the aliquot overview page using the "showInOverviewIf": "useShowIf" function.

Code:

{ "name" : "specimen.anatomicSite", "caption" : "Anatomical Site", "type" : "pvs", "attr" : "anatomic_site", "optional" : true, "showInOverviewIf": "useShowIf", "defaultValue" : "Abdomen, NOS", "showOnlyLeafValues" : true, "showIf" : { "op" : "AND", "rules" : [ { "field" : "specimen.lineage", "op" : "!=", "value" : "'Aliquot'" } ] } }

Screenshot:

  1. The Anatomic Site is defaulted to 'AF' as seen below screenshot,

  2. Hide the Anatomic Site from the aliquots. Please see in below screenshot,

#2. Set the Type field defaulted as “Plasma” and hide it from the data entry page by adding the false condition in ShowIf.

  1. Before adding the configuration:

  2. After adding the configuration, The specimen type field is hidden from the add/edit page.

 

  1. The value for specimen type is set to 'Plasma' by default as configured in JSON code.

 

 

Example JSON

Download

Got feedback or spotted a mistake?

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