Configure derivative and aliquot page
Got feedback or spotted a mistake?

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

Configure derivative and aliquot page

 

Introduction

You have the flexibility to customize the derivative/aliquot page based on specific criteria, allowing you to eliminate unnecessary fields from these pages.

In OpenSpecimen, you can adjust the settings for the derivative/aliquot page at both the 'Collection Protocol' level and the 'System Level'.

Protocol-level configuration

To set up the derivative/aliquot page for a specific collection protocol, use the CP level workflow JSON. For detailed instructions, visit the 'Protocol Level Configuration' page to assign the JSON file to the designated CP.

For guidance on configuring the derivative and aliquot page/workflow, please refer to the pages listed below.

System-level configuration

To configure the System-Level Workflow, please refer to the 'System-Level Configuration' page.

Once you have set up the derivative or aliquot at the system level, it will affect all collection protocols within OpenSpecimen.

When selecting specimens from various collection protocols in the cart view or any other interface, and then choosing "Create Aliquots" or "Create Derivatives," a customizable table displaying derivative or aliquot data will appear.

{ "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 } ] } ], "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": true, "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": "150px" }, { "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.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 } ] } ] } },

Screenshot: Create derivatives and aliquots from the cart list view by selecting the specimens

image-20250528-113248.png

Screenshot:  Cart view page → Create Derivative Page

image-20250528-113426.png

Screenshot:  Cart view page → Create Aliquot Page

image-20250528-113534.png

Customized Workflow

Starting from version 11.x, users can create customized aliquot and derivative workflows tailored to their specific needs. These custom workflows can be linked to the aliquot and derivative buttons, allowing users to initiate the workflow simply by clicking these buttons.

For guidance on creating a custom workflow, please visit the wiki page on Workflows. To learn how to link a custom workflow, refer to the wiki page titled 'Default button'.

Note: If you require assistance with custom workflows, please submit a support ticket.

Extra features

1. Hide the 'Copy first to all' link on both pages (Deprecated from v11.x)

A 'Copy first to all' button is available on the aliquots and derivatives pages, enabling users to quickly create similar aliquots and derivatives simultaneously. However, some users may find this feature unnecessary since similar children are typically generated in a single row, making the 'Copy first to all' function confusing.

Starting from version 6.0, it is possible to conceal the 'Copy first to all' button on derived or aliquot pages. To achieve this, you can implement the following setting in JSON within the aliquotsCollection and derivedSpecimens sections.

In version 11, the functionality to hide 'Copy First To All' is not available.

{ ... "aliquotsCollection": [ ... { "title": ..., ..., "hideCopyFirstToAll": true ... }, ... ], "derivedSpecimens": [ ... { "title": ..., ..., "hideCopyFirstToAll": true ... }, ... ], ... }

Before configuring the JSON, the "Copy first to all" button is present on the Create derivative page:

After configuring the JSON, "Copy first to all" button is hidden on Create derivative page:

After configuring the JSON, the "Copy first to all" button is hidden on the Create aliquot page:

Got feedback or spotted a mistake?

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