Visit Name Format
Got feedback or spotted a mistake?

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

Visit Name Format

Visit names need to be unique across protocols. By default, the system auto-generates visit names if no format is set or the user does not specify the visit name manually. The user can alternatively set the format at the protocol level to generate visit names automatically in the required format using the following tokens.


Note: Use exact tokens from the list—any changes will cause errors in OpenSpecimen.

Tokens to generate visit name

You can create and set different formats to auto-generate visit names using specific tokens.

Token name

Description

Example

Token name

Description

Example

EVENT_LABEL

Event label as specified in the collection protocol

For the visit name format '%PPI%_%EVENT_LABEL%.%EVENT_UID(2)%', the visit name will be '00011_Visit-01.01', where '00011' is the PPI, 'Visit-01' is the event label, and '01' is the unique identifier.

EVENT_CODE

Event code as specified in the collection protocol

For the visit name format '%PPI%_%EVENT_CODE%_%SYS_UID%', the visit name will be 'TT1-009_T01_39333', where 'T01' is the event code set while creating events, 'TT1-009' is the PPI, and '39333' is the unique sequence number related to a specific PPI.

EVENT_UID(n)

Assigns an identifier that is unique to an event for each PPID. The argument n is optional and specifies the number of digits in the generated identifier. No padding is done on the left side of the generated identifier when not specified.

For example:

%EVENT_UID% generates IDs like 1, 2, 3, 4, ...10,11 etc. %EVENT_UID(2)% generates IDs like 01, 02, 03, 04, ... 10, 11 etc.

For the visit name format '%PPI%_%EVENT_LABEL%.%EVENT_UID(2)%', the visit name will be 'PW-0001_Visit-01.02', where 'PW-0001' is the PPI, 'Visit-01' is the event label and '02' is the unique identifier.


PPI

Participant protocol ID

For the visit name format '%PPI%_%EVENT_LABEL%.%EVENT_UID(2)%', the visit name will be 'PW-0001_Visit-01.03', where 'PW-0001' is the PPI, 'Visit-01' is the event label, and '03' is the unique identifier.


SYS_UID(n)

The unique identifier generated by the system across all CPs.

(n): Optionally specify the number of digits. For example, if (2) is used, then the numbers generated will be 01, 02, 03, etc.

For the visit name format 'PW_%EVENT_LABEL%_%SYS_UID(2)%', the visit name will be 'PW_Visit-01_49', where 'Visit-01' is the event label and '49' is the unique identifier generated by the system


YR_OF_VISIT

Year of visit (four digits)

For the visit name format '%PPI%-%YR_OF_VISIT%-%EVENT_LABEL%.%EVENT_UID(2)%', the visit name will be 'KP-010012-2017-Visit-01.01', where 'KP-010012' is the PPI, '2017' year of visit, 'Visit-01' is the event label, and '01' is the unique event identifier.


YR_OF_VISIT2

Year of visit (two digits)

For the visit name format '%PPI%-%YR_OF_VISIT2%-%EVENT_LABEL%.%EVENT_UID(2)%', the visit name will be 'KP-010012-17-Visit-01.04' where 'KP-010012' is the PPI, '17' is the two digits year of collection, 'Visit-01' is the event label, and '04' is the unique sequence identifier.

CLINICAL_STATUS

Clinical status

For the visit name format '%PPI%-%YR_OF_VISIT2%-%EVENT_LABEL%.%EVENT_UID(2)%%CLINICAL_STATUS%', the visit name will be 'KP-010013-17-Visit-01.01Follow-up', where 'KP-010013' is the PPI, 17' is the two digits year of collection, 'Visit-01' is the event label, '01' is the unique sequence identifier, and 'Follow-up' is the clinical status of the visit

CLINICAL_STATUS_ABBR

Abbreviation for the clinical status. How to set abbreviations?

For the visit name format '%PPI%-%YR_OF_VISIT2%-%EVENT_LABEL%.%EVENT_UID(2)%_%CLINICAL_STATUS_ABBR
%', the visit name will be 'KP-010013-17-Visit-01.01_F', where 'KP-010013' is the PPI, 17' is the two digits year of collection, 'Visit-01' is the event label, '01' is the unique sequence identifier and 'F' is the abbreviation set for 'Follow-up.' clinical status

SITE_CODE

System configured code for the visit site

For the visit name format %PPI%-%SITE_CODE%-%EVENT_UID(2)%, the visit name will be KP-010013-KH-01, where 'KP-010013' is the PPID, KH is the site code configured for the site 'Kailas Hospital,' and '01' is the unique event identifier.

CUSTOM_FIELD(level, fieldName)

Include the value of any custom field identified by "fieldName" at the specified level. The field name is the same as the attribute name that appears in the custom form designer.

The allowed values of level for visit names are "visit," "CPR," and "cp".

e.g.

  1. CUSTOM_FIELD(cp, piCode) will include the value of the CP custom field "piCode" 

  2. CUSTOM_FIELD(cpr, patientId) will include the value of the registration custom field "patientId"

  3. CUSTOM_FIELD(visit, visitNum) will include the value of the visit custom field "visitNum"

PPI_UID(n)

The unique identifier generated by the system across all visits of the participant within a CP.

(n): Optionally specify the number of digits. For example, if (2) is used, then the numbers generated will be 01, 02, 03, etc.

For the visit name format '%PPI%.V.%PPI_UID(2)%', the names will be 'PW.0001.V.01', 'PW.0001.V.02', 'PW.0001.V.03' for the participant PW.0001

PUID(n)




The unique identifier generated by the system across all visits of the participant registered in multiple CPs. 

The participant will be registered with the same MRN in all protocols where it is registered, and all CPs will use the same visit token format

(n): Optionally specify the number of digits. For example, if (2) is used, then the numbers generated will be 01, 02, 03, etc.

For the visit name format '%PPI%.V.%PUID(1)%', the names will be as shown below.

Screenshot 2025-05-15 at 6.19.21 PM.png

Advanced

You can use the EVAL(expr) token to add advanced tokens at the visit level. This token includes the result of expression evaluation in the generated labels. The expression can be a field name or a complex expression. 

Please note that from v12.0 onwards, double quotes for the formatDate token are no longer supported. Please use single quotes to define the format

Token Name

Description

Example

Token Name

Description

Example

EVAL(#visit.clinicalDiagnoses[0].conceptCode)

Will include the concept code of the first clinical diagnosis.

001_CC

EVAL(#formatDate(#visit.visitDate, 'yyyy')) 

Will include the visit year in the generated visit names.

001_2023

EVAL(#formatDate(#visit.visitDate, 'MM-dd-yyyy'))

Will include the visit date in the generated visit names.

001_01-01-2023

%EVAL(#visit.registration.externalSubjectId)% 

will output the external subject ID entered for participant registration 

001_231412

%EVAL(#visit.cpEvent?.code.substring(0,#visit.cpEvent?.code.length-2))%

Getting the substring from the event.

0 → Getting string from start – First character of the parent specimen label

#specimen.parentSpecimen.label.length-2 → Calculating the length of the parent specimen minus 2

E.g.: If your parent specimen label is 20 characters, so using above, it will only get the first 18 characters



Examples

Example

Description

Example

Description

%PPI%_%EVENT_LABEL%_%SYS_UID%

Default format

%PPI%.%CLINICAL_STATUS%.%EVENT_UID(1)%

This will generate a visit name with participant protocol ID, clinical status, and a sequential number. For example, 'GC_0001.Operative.1'

Steps to configure the visit name format

  • Go to the collection protocols list page and click on the 'View Details' icon of the CP for which the PPID Format has to be set.

  • Click on the 'Settings' icon from the left side menu of the overview page and select the option 'Label Format and Print.' 

  • Set the desired visit name format and click on the 'Save' button.

Got feedback or spotted a mistake?

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