Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Expand
titleAdvanced specimen token type 'eval(...)' examples

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.

...