Versions Compared

Key

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

Table of Contents

...

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

#1. You can provide the default values for any mandatory fields like specimen type, anatomic site by adding "defaultValue": "<value>" as below:

...

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

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

Code Block
titleType
{
      "name" : "specimen.type",
      "caption" : "Type",
      "defaultValue" : "Plasma",
      "type" : "specimen-type",
      "attr" : "specimen_type",
      "specimen" : "specimen",
      "optional" : false,
      "showIf" : {
        "op" : "AND",
        "rules" : [ {
          "field" : "specimen.lineage",
          "op" : "!=",
          "value" : "'Aliquot'"
        }, {
          "field" : "specimen.type",
          "op" : "!=",
          "value" : "'Plasma'"
        } ]
      }
},

#3. Set Anatomic Site field defaulted as "Plasma" and hide it from the data entry page by adding the false condition in ShowIf.

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



Example JSON

Download