In the following example, specific fields such as 'Parent Label', 'Type', 'Derived Type', and 'Yield' are displayed only when you create a derived specimen from a sample of the 'Tissue' type. JSON code {
"name": "common",
"view": null,
"ctrl": null,
"data": {
"derivedSpecimens":[
{
"title" : "Create Derivative: Solid Tissue",
"criteria": {
"op": "AND",
"rules": [{
"field": "specimen.parent.id",
"op": "exists"
},
{
"field": "specimen.parent.specimenClass",
"op": "==",
"value": "'Tissue'"
}
]
},
"enableCofrc" : false,
"fields" : [
{
"name": "specimen.parent.label",
"caption": "Parent Specimen",
"type": "span",
"url": "specimen({specimenId: specimen.parent.id})"
},
{
"name": "specimen.parent.type",
"caption": "Specimen Type",
"type": "span"
},
{
"name": "specimen.type",
"caption": "Derivative Type",
"type" : "specimen-type",
"specimen" : "specimen",
"optional": false,
"width": "170px"
},
{
"name": "specimen.concentration",
"caption": "Concentration",
"type": "specimen-quantity",
"specimen" : "specimen",
"measure": "concentration",
"optional": true,
"width": "120px"
},
{
"name": "specimen.extensionDetail.attrsMap.ST15",
"baseField": "specimen.extensionDetail.attrsMap.ST15",
"width": "80px"
},
{
"name": "specimen.initialQty",
"caption": "Volume",
"type" : "specimen-quantity",
"specimen": "specimen",
"optional": true,
"width": "80px"
},
{
"name": "specimen.extensionDetail.attrsMap.ST16",
"baseField": "specimen.extensionDetail.attrsMap.ST16",
"width": "90px"
},
{
"name": "specimen.extensionDetail.attrsMap.ST17",
"baseField": "specimen.extensionDetail.attrsMap.ST17",
"width": "90px"
},
{
"name": "specimen.storageLocation",
"caption": "Location",
"type" : "storage-position",
"optional": true,
"cpId": "specimen.cpId",
"entity": "specimen",
"width": "240px",
"copyValueFn": "function(firstRowVal, currentVal) { if ((!!currentVal && !!currentVal.reservationId) && (!!firstRowVal && !!firstRowVal.reservationId)) { return currentVal;} else if (firstRowVal) { return { id: '', name: firstRowVal.name, mode: firstRowVal.mode, positionX: '', positionY: '', position: '', reservationId: '' };} else { return {}; }}"
},
{
"name": "specimen.printLabel",
"caption": "Print",
"icon": "fa fa-print",
"type": "toggle-checkbox",
"width": "30px"
},
{
"name": "specimen.closeParent",
"caption": "Close Parent",
"icon": "fa fa-ban",
"type": "toggle-checkbox",
"width": "30px",
"defaultValue": true /*Close parent sample checkbox configuration, checked when set to true, unchecked when set to false
}
]
},
{
"title" : "Create Derivative: Biofluid",
"criteria": {
"op": "AND",
"rules": [{
"field": "specimen.parent.id",
"op": "exists"
},
{
"field": "specimen.parent.specimenClass",
"op": "==",
"value": "'Fluid'"
}
]
},
"enableCofrc" : false,
"fields" : [
{
"name": "specimen.parent.label",
"caption": "Parent Specimen",
"type": "span",
"url": "specimen({specimenId: specimen.parent.id})"
},
{
"name": "specimen.parent.type",
"caption": "Specimen Type",
"type": "span"
},
{
"name": "specimen.extensionDetail.attrsMap.DD11",
"baseField": "specimen.extensionDetail.attrsMap.DD11",
"width": "120px"
},
{
"name": "specimen.type",
"caption": "Derivative Type",
"type" : "specimen-type",
"specimen" : "specimen",
"optional": false,
"width": "170px"
},
{
"name": "specimen.initialQty",
"caption": "Volume",
"type" : "specimen-quantity",
"specimen": "specimen",
"optional": true,
"width": "80px"
},
{
"name": "specimen.concentration",
"caption": "Concentration",
"type": "specimen-quantity",
"specimen" : "specimen",
"measure": "concentration",
"optional": true,
"width": "120px"
},
{
"name": "specimen.extensionDetail.attrsMap.DD24",
"baseField": "specimen.extensionDetail.attrsMap.DD24",
"width": "150px"
},
{
"name": "specimen.extensionDetail.attrsMap.DP25",
"baseField": "specimen.extensionDetail.attrsMap.DP25",
"width": "150px",
"type" : "date",
"optional" : true
},
{
"name": "specimen.printLabel",
"caption": "Print",
"icon": "fa fa-print",
"type": "toggle-checkbox",
"width": "30px"
},
{
"name": "specimen.closeParent",
"caption": "Close Parent",
"icon": "fa fa-ban",
"type": "toggle-checkbox",
"width": "30px",
"defaultValue": true
}
]
}
]
}
}