Got feedback or spotted a mistake?

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

Specimen Print Rules

You can configure specimen print rules to print physical specimen labels.

  • Click on Create → ‘Specimen’ from the print rules page.

  • Refer to the Print Rules page and the table below for details and click on the ‘Create’ button

Field

Description

Example Values

Field

Description

Example Values

Collection Protocol

Short title of collection protocol(CP).

The default value is *, meaning any CP.

Lung Cancer

Visit Site

Collection site of visit.

The default value is *, meaning any visit site.

Arkansas Hospital

Lineage

All, Primary, Derived, and Aliquot

 

Specimen Types

Can select multiple values from the list of types and/or class

The default value is *, meaning any specimen type.

Example 1: All Fluid

Example 2: Frozen Tissue

How to Use Print Tokens

While setting up the Print rule, there are two types of tokens, and you can use only one type at a time.

  1. Print Tokens (Standard tokens): Here, you just need to select the right token from the dropdown; however, they are limited in number. If you need any additional information to be printed, you will have to use Advanced tokens (Eval tokens)

  2. Advanced Print Rules: Here, all Eval tokens need to be placed (you can see a comprehensive list of tokens in the 'Examples' section).

You can use the below tokens to include their corresponding value in printed labels.

Token Name

Description

Token

Example values

Token Name

Description

Token

Example values

1. Anatomic Site

Specimen anatomic site

specimen_anatomic_site

Abdomen, NOS

2. Specimen Class

Specimen class value

specimen_class

Fluid, Molecular, Tissue, Cell

3. Specimen Type

Type of specimen

specimen_type

Whole Blood, Serum, Cryopreserved Cells

4. Participant Protocol Identifier

PPID-Unique protocol-specific participant ID

specimen_ppid

ETP-9933

5. Master patient index

Participant unique ID

specimen_mpi

RTB18388

6. Created On

The date the specimen was created. The format of the date is as per locale in use.

specimen_created_on

In US locale, 03-15-2016

Default: 15-03-2016

7. Primary Specimen

Primary specimen label at any level of child specimen under it. Useful for printing derivative or aliquot labels.

specimen_primary_label

Consider below lineage of specimens:

  • Primary: ETP-9933-WB1

  • Derivative: ETP-9933-P1 

  • Aliquot: ETP-9933-P1.1, the token outputs ETP-9933-WB1 when the aliquot is printed

8. Label

Specimen label

specimen_label

ETP-9933-S-01-P1

9. Barcode

Specimen barcode

specimen_barcode

127182718

10. Lineage

Specimen lineage

specimen_lineage

New, Aliquot, Derivative

11. Location

Specimen storage location. The format is the Container Name (Row x Column).

specimen_location

Rosy0105 (3 x 4)

Rosy0105 is a container name. 3 is the row, and 4 is the column

12. Pathological Status

Specimen pathological status.

specimen_pathology

Malignant, Metastatic

13. Collection Protocol

Collection protocol short title

specimen_cp_short

Lung Cancer

14. Quantity

Specimen initial quantity

specimen_quantity

2.5, 7000000

15. Concentration

Specimen concentration

specimen_concentration

10

16. Specimen Requirement Code

Specimens requirement code, which is set in the CP.

specimen_requirement_code

EDTA, SST, GTT, P1

17. Specimen Collection Container

Collection container of specimen

specimen_collection_container

ACD Vacutainer

18. Visit Name

Visit name

visit_name

ETP-9933-S-01

19. Visit Date

The format of the date is as per locale in use.

visit_date

In US locale, 03-15-2016

Default: 15-03-2016

20. visit_cp_title

Collection protocol short title of visit

 

Lung Cancer

21. Custom fields

In v6.3, there is a generic token to include any static or custom field for printing.

 

See next section "Advanced Print Rules"

Note: When you select one or more standard tokens and then switch to advanced mode, the system will automatically convert default tokens to match the format, and thus, it might look a bit different than what appears in the above table.

Advanced Print Rules

Eval Tokens

In addition to the above tokens, you can use advanced tokens for printing listed below. The support for "advanced tokens" was added later to support any specimen/visit/participant fields. The standard fields support a very limited set of fields.

  • To include fancy control as print token output, you can refer to the following example:

 

You can also refer to the print rule configured on the server Print Rule.

Examples of the eval token

Level

Object variable

Field

Example

Description

Level

Object variable

Field

Example

Description

1. Participant

specimen

External Subject ID

eval("External Subject Id", #specimen.registration.externalSubjectId)

Evaluates participant’s External Subject Id.

2. Participant

specimen

First Name

eval("First_Name",#specimen.registration.participant.firstName)

Evaluates participant’s First Name.

3. Participant

specimen

Last Name

eval("Last_Name",#specimen.registration.participant.lastName)

Evaluates participant’s Last Name.

4. Participant

specimen

Birth Date

eval("DOB",#specimen.registration.participant.birthDate)

Evaluates participant’s Date of Birth.

5. Participant

specimen

Participant custom field

eval("Participant_Code",#specimen.registration.getExtension()?.getAttrValues()?.get("DD3"))

 

New in v7.1, evaluates participant custom field

6. Participant

specimen

Participant custom field

eval("",#specimen.registration.participant.setCpId(#specimen.registration.collectionProtocol.id)),eval("DD",#specimen.registration.participant.getExtension()?.getAttrValues()?.get("ST2"))

From v10.2 onwards custom_field("Height",cpr,height)

For versions before v7.1, evaluates participant custom field

From v10.2 onwards

Prints value for participant custom field Height.

7. Participant

specimen

Participant first, middle and last name Initials

eval("FN",#specimen.registration.participant.firstName?.trim()?.length() > 0 ? #specimen.registration.participant.firstName.charAt(0) : ""),eval("MN",#specimen.registration.participant.middleName?.trim()?.length() > 0 ? #specimen.registration.participant.middleName.charAt(0) : ""),eval("LN",#specimen.registration.participant.lastName?.trim()?.length() > 0 ? #specimen.registration.participant.lastName.charAt(0) : "")

Gives first character from first name and last name in the output.

8. Visit

specimen

Visit Name

eval("Vist name",#specimen.visit.name)

Evaluates visit name

9. Visit

specimen

Visit Date

eval("Vist date",#specimen.visit.visitDate)

Evaluates visit date

10. Visit

specimen

Visit custom field

eval("custom",#specimen.visit.getExtension()?.getAttrValues()?.get("ST2"))

From v10.2 onwards custom_field("Additional_Diagnosis",visit,additional_diagnosis)

Evaluates visit custom field

From v10.2 onwards

Prints value for visit custom field additional_diagnosis.

11. Visit

specimen

Visit custom field (Fancy Control)

eval("Organ",#specimen.visit.getExtension()?.getLabelValueMap()?.get("Anticipated Anatomic Site"))

Evaluates visit custom field (fancy control) where ‘Anticipated Anatomic Site’ is the field name

12. Specimen

specimen

Label

eval(“Label”, #specimen.label)

Evaluates the specimen label

13. Specimen

specimen

Identifier

eval(“Identifier”, #specimen.id)

Evaluates the specimen identifier

14. Specimen

specimen

Created On

eval("Created On", #formatDate(#specimen.createdOn, "MMM, yyyy"))

Expression to extract month and year from the created on the field in the specified format

15. Specimen

specimen

Container name and position

eval("Storage",#specimen.position)

Evaluates container name with position in linear or two dimensions(row & column) as per box settings

16. Specimen

specimen

Anatomic Site

eval("site",#specimen.tissueSite.value)

Evaluates the anatomic site

17. Specimen

specimen

Specimen type abbreviation

eval("type",#specimen.specimenType.props['abbreviation'])

Evaluates the specimen type abbreviation

18. Specimen

specimen

Specimen custom field

eval("Ext.Lab.Num",#specimen.getExtension()?.getAttrValues()?.get("ST21"))

From v10.2 onwards custom_field("Additive",specimen,additive)

Evaluates visit custom field ST21

From v10.2 onwards

Prints value for specimen custom field additive.

19. Specimen

specimen

SR name

eval("SR Name",#specimen.specimenRequirement?.name)

Evaluates the specimen-requirement name.

20. Specimen

specimen

Event Label

eval("Event_Label",#specimen.visit.cpEvent?.eventLabel)

Evaluates the collection protocol event label corresponding to the specimen’s visit. E.g., ‘Baseline,’ 'Follow-up'

21. Specimen

specimen

Available Quantity

eval("Available_Qty",#specimen.availableQuantity)

Evaluates the available quantity of the specimen

22. Specimen

specimen

Quantity Unit

eval("type",#specimen.specimenClass.props['quantity_unit'])

Evaluates the quantity unit based on the specimen class.

23. Specimen

specimen

Concentration Unit

eval("Conc unit",#specimen.specimenClass.props['concentration_unit'])

Evaluates the concentration unit based on the specimen class.

24. Specimen

specimen

Laterality

eval("side",#specimen.tissueSide.value)

Evaluates the laterality

25. Specimen

specimen

Received Date

eval("RD",#specimen.receivedEvent.time)

Evaluates the received date

26. Specimen

specimen

Parent SR code

eval("Parent SR Code",#specimen.parentSpecimen.specimenRequirement?.code)

Evaluates the parent specimen requirement code.

27. Collection Protocol

specimen

IRB ID

eval("IRB ID",#specimen.collectionProtocol.irbIdentifier)

Evaluates the collection protocol IRB ID

28. Collection Protocol

specimen

CP Code

eval("Code",#specimen.collectionProtocol.code)

Evaluates the collection protocol code

29. Specimen

specimen

Collection date of primary specimen at aliquot level

eval("CD",#formatDate(#specimen.primarySpecimen.collectionEvent.time,"MMM, yyyy"))

Evaluates collection date of primary specimen at child level

30. Specimen

specimen

Custom date field (server timezone)

eval("Collection date", #formatDate(T(java.util.Date).from(T(java.time.Instant).ofEpochMilli(T(Long).parseLong(#specimen.getExtension()?.getAttrValues()?.get("collection_date")))), "MM/dd/yyyy HH:mm"))

Evaluates the custom date field 'Collection Date'

If there is no value available for the date field, and if you try printing, it will throw an error. Please set it to default to the current date and time OR ensure there is always data entered for the field.

31. Specimen

specimen

Custom date field (specific timezone)

eval("Collection date", T(java.time.format.DateTimeFormatter).ofPattern("MM/dd/yyyy HH:mm").withZone(T(java.time.ZoneId).of("Asia/Kolkata")).format(T(java.time.Instant).ofEpochMilli(T(Long).parseLong(#specimen.getExtension()?.getAttrValues()?.get("collection_date")))))

Evaluates the custom date field 'Collection Date'

If there is no value available for the date field, and if you try printing, it will throw an error. Please set it to default to the current date and time OR ensure there is always data entered for the field.

32. Collection Protocol

specimen

Principal Investigator last name

eval("PI Last Name",#specimen.collectionProtocol.principalInvestigator.lastName)

Gives the Last name of Principal Investigator of the CP

33. Collection Protocol

specimen

Principal Investigator first name

eval("PI First Name",#specimen.collectionProtocol.principalInvestigator.firstName)

Gives the first name of Principal Investigator of the CP

34. Participant

specimen

Identifier

eval("Identifier",#specimen.registration.id)

Evaluates participant identifier

35. Specimen

specimen

Event Code

eval("Event_Code",#specimen.visit.cpEvent?.code)

Evaluates event code of the CP corresponding to the specimen’s visit.

36. Specimen

specimen

Ancestor Requirement Name

eval("Ancestor SR Name",#collFns.join(#specimen.getReqNames()))

Adds the ancestor requirement name on the child specimens as comma-seperated values.

This includes primary specimens and intermediate parent.

37. Specimen

specimen

Ancestor Requirement Code

eval("Ancestor SR Code",#collFns.join(#specimen.getReqCodes()))

Adds the ancestor requirement code on the child specimens as comma-seperated values.

This includes primary specimens and intermediate parent.

38. Specimen

specimen

Last character(s) of Specimen Label

eval("Last Char", #specimen.label.substring(#specimen.label.length - 1))

Gives last character from specimen label in the output.

You can replace -1 with any numbers E.g. -2 and it will give last 2 characters in the output

39. Specimen

specimen

container position

eval("Storage Position",#specimen.position != null ? (#specimen.position.container.positionLabelingMode.name() == "TWO_D" ? (#specimen.position.posTwo + ", " + #specimen.position.posOne) : #specimen.position.container.positionLabelingMode.name() == "LINEAR" ? #specimen.position.getPosition() : "Not Applicable") : "Not Stored")

Gives container position i n4 scenarios - not stored, dimensionless, linear and 2 D layouts.

  1. Specimen

specimen

Additional Label

eval("Additional_Label",#specimen.additionalLabel)

Prints the value in the field ‘Additional Label’ from v10.x onwards

  1. Specimen

Visit

Surgical Pathology Number

#specimen.visit.surgicalPathologyNumber

Prints Surgical Pathology number documented at Visit level

  1. Specimen

--

Concatenate multiple fields

eval("Specimen ID", #specimen.id + "_" + #specimen.label)

It will concatenate values of Specimen ID and Specimen label field in single column while generating print file

  1. Specimen

--

Concatenate multiple fields

eval("Participant identifier", #specimen.registration.externalSubjectId + "_" + #specimen.registration.ppid)

It will concatenate values of External Subject ID and PPID field in single column while generating print file

  1. Specimen

--

Concatenate multiple fields

eval("Participant identifier",#specimen.registration.getExtension()?.getAttrValues()?.get("UPN") + "_" + #specimen.registration.getExtension()?.getAttrValues()?.get("CPF-ID"))

It will concatenate values of registration custom fields ‘UPN’ and ‘CPF-ID’ in single column while generating print file

  1. Specimen

specimen

Parent Specimen Type

eval("Parent Type",#specimen.parentSpecimen.specimenType.value)

Generates the parent specimen type

  1. Specimen

specimen

Collection Event User

eval("CollectedUser",#specimen.primarySpecimen.collectionEvent.user.loginName)

Evaluates collection event user's 'login name'

  1. Specimen

specimen

Collection Event User

eval("CollectedUser",#specimen.primarySpecimen.collectionEvent.user.emailAddress)

Evaluates collection event user's 'Email Address'

PV Properties Tokens

From v10.2 onwards users will be able to include the abbreviation and concept code of the PV fields defined in the dropdown manager in the print rules.

Syntax - pv_prop(caption, [object_type], field, prop, [is_custom_field])

Fields

Description

Values

Fields

Description

Values

caption

Field name to be displayed for the field

 

object_type

Level of the field

visit for Visit, cpr for participant

field

Field to be printed. Variable name in the form in case of custom fields

 

prop

Property of the field to be printed

abbreviation or concept_code

is_custom_field

To define whether the field is a custom field or not

true/false

How to find the variable name in the form?

On creating a PV field in the form, the variable name is generated the system. You need to use this in the print token syntax.

Only participant, visit, specimen standard fields, custom fields, and collection/ received event fields are supported.

Got feedback or spotted a mistake?

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