Versions Compared

Key

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

...

OpenSpecimen supports printing for specimen and visit labels. On configuring printing, OpenSpecimen generates and writes the labels as CMD or CSV 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.

...

Info
titleJSON 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 or CSV files is the most preferred and used method.

...

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

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

...

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

OpenSpecimen uses print_rules.csv to uses print rules 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  Refer toCreate Print Rules Via UI for more details. 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.

...

Short title of collection protocol(CP).

Default value is *, meaning any CP

...

Collection site of visit.

Default value is *, meaning any visit site

...

Specimen class.

Default value is *, meaning any specimen class

...

Example 1: Fluid

Example 2: Cells

...

Specimen type.

Default value is *, meaning any specimen type

...

Example 1: Whole Blood

Example 2: Cryopreserved Cells

...

Login name of OpenSpecimen user who will be printing labels.

Default value is *, meaning any user.

...

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

...

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

...

label

...

is

...

Example: Cryovial Cap Label

...

to be

...

printed

...

Default value: specimen_label,specimen_type,specimen_location

...

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

...

.

...

Default value is * indicating do not generate cmd files

...

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".

...

ALIQUOTS, PARENT, or DERIVATIVE

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

...

...

Step 2

...

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: 

...

: 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 CMD or CSV 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

...

Abdomen, NOS

...

specimen_mpi

(New in OS v4.1.4)

...

In US locale, 03-15-2016

Default: 15-03-2016

...

Rosy0105 (3 x 4)

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

...

2.5, 7000000

(Need to improve this token to output unit)

...

10

(Need to improve this token to output unit)

...

...

In US locale, 03-15-2016

Default: 15-03-2016

...

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

...

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.

...

In US locale, 03-15-2016

...