Got feedback or spotted a mistake?

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

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 64 Next »

Introduction

OpenSpecimen supports printing for specimen and visit labels. On configuring printing, OpenSpecimen generates and writes the labels as CMD files on the file system. OpenSpecimen does not actually print the labels. It only writes the required data in the CMD file format understood by the printer automation software like Bartender, NiceLabel, etc. The print software can be configured to process these CMD files in an automated fashion.

OpenSpecimen print rules support is very flexible. It supports:

  • Different types of label types
  • Different formats for different rules
  • Different folders for different rules

For configuring the printing into the OpenSpecimen please refer configuration section.

JSON files to a database table

It also writes the JSON files to a database table which can also be used to print labels. The CMD files is the most preferred and used method.


Below is the block diagram of the workflow:


FAQs

Q: Which printers and scanners are supported by OpenSpecimen?

OpenSpecimen works with any printer or scanner. The interaction with the printer is done via printer software which is explained below.

Q: Which printer software should we use?

A: BarTender is most recommended. You are free to choose any other option as long as they support automated printing. Most of them follow similar approaches and should work with OpenSpecimen.

https://www.seagullscientific.com/label-software/barcode-label-design-and-printing/bartender-automation-edition/

Q: OpenSpecimen requires the automation license running on a server or can it work with the desktop version?

A: It doesn't matter on which server/desktop the automation software is running.  As long as the automation software is able to read the files generated by the OpenSpecimen software, it could be on any server.

Q: Does any user that would like to print labels from OpenSpecimen would need a separate printer?

A: No. There could be a single printer for multiple users based on the group/network requirements. If using multiple printers that can be configured in the automation software to read the labels and send them to different printers as per the requirement.

Q: How to configure OpenSpecimen to generate labels for multiple printers?

A: One can create different rules based on the collection site, IP address. For each rule you can specify a different directory for property 'CmdFilesDir'. Then configure the automation software to link the different directories with an appropriate printer.

Q: Can only one user print per CP or do we create multiple lines for each person who would print in that CP?

A: Any number of users can print. Rules are not based on user. Ignore this field, this is just a legacy from old print rules which we are checking if we really need it.

Q: How is IP address of users used?

A: You might need to configure the same user to print to different printers located at different sites or buildings. E.g., there are two printers in two floors. Use Joe needs to print to first floor's printer when he is on the first floor and second floor's printer when he is on the second floor. This can be achieved using the IP addresses or ranges. 

You can configure printing based on IP addresses of users. E.g. some sites assign dynamic IP addresses based on location of users. You can specify range of IP address. You can leave this blank if you do not want to use this feature.

Q: Are values for label types dictated by the printer software?

A: No. It is just configurable keywords that you configure in the printer software and then use it in the rules. Example include whether label is printed for cap or slide etc

Q: Are label designs dictated by the printer?

A: No. This is same as above. However, historically, this has been used to specify the path of printer label design template

Q. Bartender Videos

Refer to the files below for help setting up a File Integration:
https://support.seagullscientific.com/hc/en-us/articles/227353867-Print-Document-Using-a-Data-File-Integration-Video-6-31-
https://support.seagullscientific.com/hc/en-us/articles/227354787-Print-Document-Using-Print-Command-Script-Video-9-40-

Also, we have two webinar with additional information:
https://support.seagullscientific.com/hc/en-us/articles/115004072388-Building-a-file-integration-using-a-CSV-file-38-26-
https://support.seagullscientific.com/hc/en-us/articles/115003215107-Building-a-file-integration-using-Print-Command-Script-27-58- 

Q Sample output files

  1. Sample file in CSV format.
  2. Sample file in CMD format.

Configuration

Step 1: Configure what needs to be printed on the specimen label

OpenSpecimen uses print_rules.csv to decide on how specimen label content should be formatted and printed. The default rules shipped with OpenSpecimen prints specimen label, type and location. The printing rules can be customized based on CP, specimen type among other attributes as explained in below table.

This can be configured in OpenSpecimen from Settings → BioSpecimen → Specimen Label Print Rules

Please make sure that the customized rules file should be present on the OpenSpecimen application server.

Rules are matched in sequential fashion and stopped at first matching rule. Users are notified with an error message when none of the rules match specimen whose label is to be printed.

FieldDescriptionExample Values
CpShortTitle

Short title of collection protocol(CP).

Default value is *, meaning any CP

Lung Cancer


VisitSite

Collection site of visit.

Default value is *, meaning any visit site

Arkansas Hospital
SpecimenClass

Specimen class.

Default value is *, meaning any specimen class

Example 1: Fluid

Example 2: Cells

SpecimenType

Specimen type.

Default value is *, meaning any specimen type

Example 1: Whole Blood

Example 2: Cryopreserved Cells

Login

Login name of OpenSpecimen user who will be printing labels.

Default value is *, meaning any user.

john@biospecimen.org
IpRange

Specifies IP address range, using CIDR notation, of workstations of users who will be issuing print label requests.

Default value is *, meaning any workstation

Example 1: 192.168.2.0/24 matches IPv4 addresses in range 192.168.2.0 to 192.168.2.255

Example 2: 2001:db8::/48 matches IPv6 addresses in range 2001:db8:0:0:0:0:0:0 to 2001:db8:ffff:ffff:ffff:ffff:ffff:ffff

LabelType

Type of label depending on how and where it will be used e.g. Cap, Slide. If specified, value of this field is written to both database table and cmd file. The printer software can read this type and print labels accordingly.

Default value is *, meaning don't care

Cap, Slide, or any other value that is used to denote type of printing the printer software needs to carry out
LabelDesign

A name of the design template to use for printing labels. This value is of interest to printer software in deciding how label content should be arranged and printed.

Default value is *, meaning don't care

Example: Cryovial Cap Label

Name of design template configured in printer software. In this instance, name specifies label design suitable for printing labels to be used for cryovial caps

LabelTokens

Specifies list of comma-separated attribute names of Participant, Visit or Specimen records that needs to be printed on labels. For detailed list of available tokens, please refer below table

Default value: specimen_label,specimen_type,specimen_location

specimen_label,specimen_type,specimen_created_on will instruct OpenSpecimen to output values of following attributes of specimen record - label, specimen type and created on date
Printer

Name of the printer. The printer name and their network addresses are configured in printer software to direct the label printing to appropriate printer

rosy, daisy

rosy and daisy are symbolic names that can be configured in printer software to send requests to printers configured at IP address 192.168.2.110 and 192.168.2.220 respectively

CmdFilesDir

Absolute path of directory on local filesystem that OpenSpecimen uses to generate cmd files. This should be a shared directory that is accessible to OpenSpecimen as well as printer software (like Bartender or Nice Label)

Default value is * indicating do not generate cmd files

E:/Printer/CmdFiles/
CmdFileFmt

The format of data content in cmd file. Supported values are "key-value" and "csv".

Default value is * indicating do not generate cmd files

Current command line formats are tested with Bartender and Nice Label software. If you use some other software and face any issue, please let us know.

NOTE: The fields are case sensitive. Use "cvs" and "key-value".

Lineage

ALIQUOTS, PARENT, or DERIVATIVE



Once the print rules file is created, users can update OpenSpecimen to use new rules file as below: 

  1. Sign-in as super-admin user
    User should be able to view Settings card on home page

  2. Click on Settings card
    Module names are displayed on left side and their corresponding configuration parameters are displayed on right side of viewport

  3. Click on Biospecimen module
    All Biospecimen configuration parameters are displayed on right side

  4. Click on "Specimen Label Print Rules"
    User should be able to see current value of configuration variable along with user and time when the variable was last updated.

  5. Upload updated print rules file to change the settings

Step 2: Configure what needs to be printed on the visit label

Similar to specimen print rules file, visit uses visit_print_rules.csv to decide on how visit label content should be formatted and printed. The default rules shipped with OpenSpecimen prints vist name, date and collection protocol(CP) short title. The printing rules can be customised based on CP, site among other attributes as specified in rule.

Rule file format is same as specimen label rule file except two specimen related fields SpecimenClass and SpecimenType.

Users can create and update new rules file as below: 

  1. Sign-in as super-admin user
    User should be able to view Settings card on home page.

  2. Click on Settings card
    Module names are displayed on left side and their corresponding configuration parameters are displayed on right side.

  3. Click on Biospecimen module
    All Biospecimen configuration parameters are displayed on right side

  4. Click on "Visit Label Print Rules"
    User should be able to see current value of configuration variable along with user and time when the variable was last updated.

  5. Upload updated print rules file to change the settings

Step 3: Configure printer software to read generated labels

There are 2 options:

  1. Generated labels are stored in database table: OS_LABEL_PRINT_JOB_ITEMS in JSON format. The printer software can be configured to poll this table at periodic intervals for new rows, read data and send it to printer. Please refer /wiki/spaces/DEV/pages/4948040 for more details

  2. Generated labels are written to cmd files saved in directory identified by CmdFilesDir rule variable value. The format of cmd file is as specified by CmdFileFmt rule variable value. Printer software can configured to poll CmdFilesDir directory at periodic intervals for new cmd files and print labels. 

Specimen Label Print Tokens

Following table lists specimen print tokens that are shipped with OpenSpecimen. Use below tokens to include their corresponding value in printed labels

Token NameDescriptionExample values
specimen_anatomic_siteAnatomic site of specimen

Abdomen, NOS

specimen_classSpecimen classTissue, Fluid
specimen_typeSpecimen typeWhole Blood, Serum, Cryopreserved Cells
specimen_ppidParticipant protocol identifier
ETP-9933

specimen_mpi

(New in OS v4.1.4)

Master patient indexRTB18388
specimen_created_onSpecimen created on date. The format of date is as per locale in use.

In US locale, 03-15-2016

Default: 15-03-2016

specimen_primary_labelPrimary specimen label. Useful for printing derivative or aliquot labels.If ETP-9933-S-01-P1 is an aliquot created from derivative of sample ETP-9933-S-01-EDTA, then this token outputs ETP-9933-S-01-EDTA
specimen_labelSpecimen labelETP-9933-S-01-P1, ETP-9933-S-01-S1
specimen_barcodeSpecimen barcode
specimen_lineageSpecimen lineageNew, Aliquot, Derivative
specimen_locationSpecimen storage location. Format is Container Name (Row x Column).

Rosy0105 (3 x 4)

Rosy0105 is container name. 3 is row number and 4 is column number

specimen_pathologySpecimen pathological status.Malignant, Metastatic
specimen_cp_shortCollection protocol short titleLung Cancer
specimen_quantitySpecimen initial quantity

2.5, 7000000

(Need to improve this token to output unit)

specimen_concentrationSpecimen concentration

10

(Need to improve this token to output unit)

specimen_requirement_codeSpecimens requirement code. Otherwise empty stringEDTA, SST, GTT, P1
specimen_collection_containerCollection container of specimenACD Vacutainer
visit_nameVisit nameETP-9933-S-01
visit_dateVisit date. The format of date is as per locale in use.

In US locale, 03-15-2016

Default: 15-03-2016

visit_cp_titleCollection protocol short title of visitLung Cancer

Adopters can implement custom print tokens by extending class AbstractLabelTmplToken and providing implementation for following methods:

  • getName() - returns unique name of token. Example: "specimen_requirement_code"
  • getReplacement(Specimen s) - returns string to be included in printed label

The custom token implementation class needs to be registered with specimenPrintLabelTokensRegistrar bean

Sample Specimen Label Formats 

Example 1: Label printed with barcode, specimen label and location

Example 2: Label printed with barcode and specimen label

Example 3: Label printed with site name, barcode and specimen label

Visit Label Print Tokens

Following table lists visit print tokens that are shipped with OpenSpecimen. Use below tokens to include their corresponding value in printed labels.

Token NameDescriptionExample
visit_nameVisit Name LP-0001-W0-PD
visit_cp_titleCollection protocol short title of visitLung Cancer
visit_dateVisit date. The format of date is as per locale in use.

In US locale, 03-15-2016

Default: 15-03-2016

  • No labels