Table of Contents |
---|
...
Both the fields will be displayed for the child specimens (lineage: derived/aliquot).
Example 2: Display specimen type field only on child pages and not on primary specimen page.
Code Block | ||
---|---|---|
| ||
{ "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:
Specimen field displayed on child specimen page:
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 | ||
---|---|---|
| ||
{ "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 | ||
---|---|---|
| ||
{
"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 | ||
---|---|---|
| ||
{
"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'"
}
]
}
}, |