Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Table of Contents

...

Show/Hide custom field – Using Regex Matching

Show the 'Lived Name' custom field only when the PPID starts with 'J'.

...

Code Block
{
  "name": "cpr.participant.extensionDetail.attrsMap.lived_name",
  "caption": "Lived Name",
  "type": "text",
  "optional": "true",
  "showIf": {
    "op": "AND",
    "rules": [
      {
        "field": "cpr.ppid",
        "op": ".search('^J') !=",  // Modify the regex in single quote as per requirement. 
        "value": "-1"
      }
    ]
  }
}

Show/Hide Custom field based on CP site

{ "name": "specimen.extensionDetail.attrsMap.post_processing_nucleated_count", "caption": "Live Nucleated Count (MCells)", "type": "text", "attr": "post_processing_nucleated_count", "optional": true, "showIf": { "op": "NOT", "rules": [ { "field": "cp.siteName", "op": "!=", "value": "'Amol site'" } ] }, "showInOverviewIf": "useShowIf"

  }

Screenshot:

image-20241018-150140.pngImage Removed

#2. When CP SiteName is not Amol site, then not show the custom field 'Live Nucleated Count (MCells)'.

Code:

{ "name": "specimen.extensionDetail.attrsMap.post_processing_nucleated_count", "caption": "Live Nucleated Count (MCells)", "type": "text", "attr": "post_processing_nucleated_count", "optional": true, "showIf":

{ "op": "NOT", "rules": [ { "field": "cp.siteName", "op": "==", "value": "'Amol site'"
}
] }, "showInOverviewIf": "useShowIf" }

Screenshot:

image-20241018-150035.pngImage Removed
Expand

#1. When CP SiteName is an Amol site, then only it will show the custom field 'Live Nucleated Count (MCells)'.

Code:

Code Block
Code Block

Example JSON

Download