Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents

Introduction

Using 'showIf' and 'showInOverviewIf' conditions, you can hide specific fields either from all specimens pages or from parent/child pages. You can also hide or show fields based on some other field's value.

...

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


Example 2Display specimen type field only on child pages and not on primary specimen page.

Code Block
titleExample code
{
"name": "specimen.type",
"caption": "Specimen Type",
"showInOverviewIf": "specimen.lineage != 'New'",
"type": "specimen-type",
"specimen": "specimen",
"optional": true
}

Specimen field not displayed on parent specimen page:

Image Modified

Specimen field displayed on child specimen page:

Image Modified

Hide/Set Default Value to Mandatory Fields

...

Code Block
titleAnatomic site
{
  "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'"
    } ]
  }
}

Example JSON

Download