Aliquot Page Configuration
Got feedback or spotted a mistake?

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

Aliquot Page Configuration

Introduction

To set up the aliquot page, users should include the "aliquotsCollection" section within the "data" block specified in the JSON snippet below.

JSON code

{ "name": "common", "data": { "aliquotsCollection": [ { "title": "Aliquots", "criteria": { "rules": [ { "field": "specimen.parent.id", "op": "exists" } ] }, "enableCofrc": false, "fields": [ { "name": "specimen.parent.label", "caption": "Parent Specimen", "type": "span", "url": "specimen({specimenId: specimen.parent.id})" }, { "name": "specimen.parent.availableQty", "caption": "Parent Quantity", "type": "span", "formatType": "specimen-quantity", "specimen": "specimen.parent", "measure": "quantity", "width": "120px" }, { "name": "specimen.type", "caption": "Type", "type": "specimen-type", "specimen": "specimen", "optional": false, "width": "185px" }, { "name": "specimen.noOfAliquots", "caption": "Count", "type": "text", "pattern": "/^[1-9][0-9]*$/", "modelOpts": { "allowInvalid": true }, "optional": true, "width": "80px", "showIf": { "tabMode": true, "op": "OR", "rules": [ { "field": "viewCtx.inputLabels", "op": "==", "value": "false" } ] } }, { "name": "specimen.labels", "caption": "Labels", "type": "textarea", "optional": false, "showIf": { "tabMode": true, "op": "OR", "rules": [ { "field": "viewCtx.inputLabels", "op": "==", "value": "true" } ] }, "copyValueFn": "function(firstRowVal, currentVal) { if (!!currentVal) { return currentVal; } else { return ''; } }" }, { "name": "specimen.qtyPerAliquot", "caption": "Quantity", "type": "specimen-quantity", "specimen": "specimen", "optional": true, "width": "100px" }, { "name": "specimen.createdOn", "caption": "Created On", "type": "datetime", "optional": true, "defaultValue": "current_date" }, { "name": "specimen.createdBy", "caption": "Created By", "type": "user", "defaultValue": "current_user", "optional": true, "listSource": { "queryParams": { "static": { "excludeType": "CONTACT" } } } }, { "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 } ] } ] } },

Screenshot: Create an aliquot page after JSON-configured columns

image-20250528-115631.png

Additional Feature:

1. Add the Specimen Barcode field in the 'Create Aliquot' page

To configure the 'Create Aliquot' page with the Barcode field, simply incorporate the following code snippet within the aliquotsCollection found in the common section.

Example JSON

{ "name" : "specimen.barcodes", "caption" : "Barcodes", "type" : "textarea", "optional" : false },

For a detailed view, refer to the Example Barcode field in aliquots page.json.

It's important to note the difference between the specimen.barcodes field in the common section and the specimen.barcode field in the dictionary:

  • The ‘specimen.barcodes’ field in the aliquot section operates as a textarea field, similar to the labels field for aliquots. In this field, you can enter barcodes separated by commas, newlines, or tabs, with each barcode associated with a specific aliquot. This input effectively generates the aliquots.

  • Conversely, the ‘specimen.barcode’ field in the dictionary section is a text field intended for entering a single barcode linked to a specimen. Consequently, the barcode provided on the create aliquot page will be stored and displayed on the overview page.

2. Set defaults for the quantity, print label, and close parent fields in the aliquot collection page.

To set up the default values for the fields in the aliquot collection page, users should include the 'defaultValue' property for fields in the "aliquotsCollection" section within the "data" block specified in the JSON snippet below.

Configuration:

{ "name": "common", "data": { "aliquotsCollection": [ { "title": "Aliquots", "criteria": { "rules": [ { "field": "specimen.parent.id", "op": "exists" } ] }, "enableCofrc": false, "fields": [ { "name": "specimen.parent.label", "caption": "Parent Specimen", "type": "span", "url": "specimen({specimenId: specimen.parent.id})" }, { "name": "specimen.parent.availableQty", "caption": "Parent Quantity", "type": "span", "formatType": "specimen-quantity", "specimen": "specimen.parent", "measure": "quantity", "width": "120px" }, { "name": "specimen.type", "caption": "Type", "type": "specimen-type", "specimen": "specimen", "optional": false, "width": "185px" }, { "name": "specimen.noOfAliquots", "caption": "Count", "type": "text", "pattern": "/^[1-9][0-9]*$/", "modelOpts": { "allowInvalid": true }, "optional": true, "width": "80px", "showIf": { "tabMode": true, "op": "OR", "rules": [ { "field": "viewCtx.inputLabels", "op": "==", "value": "false" } ] } }, { "name": "specimen.labels", "caption": "Labels", "type": "textarea", "optional": false, "showIf": { "tabMode": true, "op": "OR", "rules": [ { "field": "viewCtx.inputLabels", "op": "==", "value": "true" } ] }, "copyValueFn": "function(firstRowVal, currentVal) { if (!!currentVal) { return currentVal; } else { return ''; } }" }, { "name": "specimen.qtyPerAliquot", "caption": "Quantity", "type": "specimen-quantity", "specimen": "specimen", "optional": true, "defaultValue": 1, "width": "100px" }, { "name": "specimen.createdOn", "caption": "Created On", "type": "datetime", "optional": true, "defaultValue": "current_date" }, { "name": "specimen.createdBy", "caption": "Created By", "type": "user", "defaultValue": "current_user", "optional": true, "listSource": { "queryParams": { "static": { "excludeType": "CONTACT" } } } }, { "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", "defaultValue": true, "width" : "30px" }, { "name" : "specimen.closeParent", "caption" : "Close Parent", "icon" : "fa fa-ban", "type" : "toggle-checkbox", "width" : "30px", "defaultValue" : false } ] } ] } }

Screenshot: After setting the default value for Quantity =1, Print label = checked, and close parent = unchecked.

image-20251205-041915.png

3. Inherit the parent value and show the readOnly field in the Aliquot page.

In the example below, the field defaults to its parent value and is hidden from the data entry screen. Users must include the ‘defaultValue' property for fields 'ST4' to copy the parent value to child specimens in the 'aliquotsCollection' section within the 'data’ block specified in the CP JSON file.

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": "common", "data": { "aliquotsCollection": [ { "title" : "Aliquots", "criteria" : { "rules" : [ { "field" : "specimen.parent.id", "op" : "exists" } ] }, "enableCofrc" : false, "fields" : [ { "name": "specimen.parent.label", "caption": "Parent Specimen", "type": "span", "url": "specimen({specimenId: specimen.parent.id})" }, { "name": "specimen.parent.availableQty", "caption": "Parent Quantity", "type": "span", "formatType": "specimen-quantity", "specimen": "specimen.parent", "measure": "quantity", "width": "120px" }, { "name": "specimen.type", "caption": "Type", "type" : "specimen-type", "specimen" : "specimen", "optional": false, "width": "185px" }, { "name": "specimen.noOfAliquots", "caption": "Count", "type": "text", "pattern" : "/^[1-9][0-9]*$/", "modelOpts": {"allowInvalid": true}, "optional": true, "width": "80px", "showIf": { "tabMode": true, "op": "OR", "rules": [ { "field": "viewCtx.inputLabels", "op": "==", "value": "false" } ] } }, { "name": "specimen.labels", "caption": "Labels", "type": "textarea", "optional": false, "showIf": { "tabMode": true, "op": "OR", "rules": [ { "field": "viewCtx.inputLabels", "op": "==", "value": "true" } ] }, "copyValueFn" : "function(firstRowVal, currentVal) { if (!!currentVal) { return currentVal; } else { return ''; } }" }, { "name": "specimen.qtyPerAliquot", "caption": "Quantity", "type" : "specimen-quantity", "specimen": "specimen", "optional": true, "width": "100px" }, { "name" : "specimen.extensionDetail.attrsMap.ST4", "baseField" : "specimen.extensionDetail.attrsMap.ST4", "defaultValue" : "field: specimen.parent.extensionDetail.attrsMap.ST4", "hideColumn" : true }, { "name": "specimen.createdOn", "caption" : "Created On", "type" : "date", "optional" : true, "defaultValue" : "current_date" }, { "name": "specimen.createdBy", "caption": "Created By", "type": "user", "defaultValue": "current_user", "optional": true, "listSource": { "queryParams": { "static": { "excludeType": "CONTACT" } } } }, { "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 } ] } ], "derivedSpecimens": [ { "title" : "Derived Specimens", "criteria" : { "rules" : [ { "field" : "specimen.parent.id", "op" : "exists" } ] }, "enableCofrc" : false, "fields" : [ { "name": "specimen.parent.label", "caption": "Parent Specimen", "type": "span", "url": "specimen({specimenId: specimen.parent.id})" }, { "name": "specimen.parent.type", "caption": "Parent Type", "type": "span" }, { "name": "specimen.label", "caption": "Label", "type": "text", "optional": false, "showIf": { "tabMode": true, "op": "OR", "rules": [ { "field": "viewCtx.inputLabels", "op": "==", "value": "true" } ] }, "copyValueFn" : "function(firstRowVal, currentVal) { if (!!currentVal) { return currentVal; } else { return ''; } }" }, { "name": "specimen.parent.availableQty", "caption": "Parent Quantity", "type": "span", "formatType": "specimen-quantity", "specimen": "specimen.parent", "measure": "quantity", "width": "120px" }, { "name": "specimen.type", "caption": "Type", "type" : "specimen-type", "specimen" : "specimen", "optional": false, "width": "185px" }, { "name": "specimen.initialQty", "caption": "Quantity", "type" : "specimen-quantity", "specimen": "specimen", "optional": true, "width": "100px" }, { "name": "specimen.createdOn", "caption" : "Created On", "type" : "date", "optional" : true, "defaultValue" : "current_date" }, { "name": "specimen.createdBy", "caption": "Created By", "type": "user", "defaultValue": "current_user", "optional": true, "listSource": { "queryParams": { "static": { "excludeType": "CONTACT" } } } }, { "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.createAliquots", "caption": "Create Aliquots?", "icon": "fa fa-share-alt", "type": "toggle-checkbox", "width": "30px" }, { "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 } ] } ] } },

 

Got feedback or spotted a mistake?

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