Derivative Page Configuration
Got feedback or spotted a mistake?

Leave a comment at the end of this page or email contact@krishagni.com

Derivative Page Configuration

Introduction

To establish the derivative page, users must incorporate the "derivedSpecimens" section within the "data" block as outlined in the JSON provided below.

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

 

Screenshot: Create Derived specimens page/workflow after JSON configured columns. 

image-20250528-114913.png

Additional Feature

1. Add the create aliquots checkbox in the 'Create Derivatives' page

The user can add the create aliquot checkbox in the derivative page to allow the user to decide whether they want to create aliquots or not.

Code:

{ "name": "specimen.createAliquots", "caption": "Create Aliquots?", "icon": "fa fa-share-alt", "type": "toggle-checkbox", "width": "30px" }

 

image-20250528-115136.png

 

2. Copy the parent value and show the readOnly field in the derived page.

In the below example, the field is defaulted to its parent value and hidden from the data entry screen.

From version 11, the hideColumn feature no longer hides fields but displays them in read-only mode. This ensures users cannot update the fields, fulfilling the feature's purpose.

Example JSON

{ "name" : "specimen.extensionDetail.attrsMap.ST4", "baseField" : "specimen.extensionDetail.attrsMap.ST4", "defaultValue" : "field: specimen.parent.extensionDetail.attrsMap.ST4", "hideColumn" : true },
Got feedback or spotted a mistake?

Leave a comment at the end of this page or email contact@krishagni.com