GithubHelp home page GithubHelp logo

grezniczek / redcap-barcodes Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 260 KB

A REDCap external module that transforms text fields to barcodes

License: MIT License

PHP 14.60% JavaScript 85.40%
redcap redcap-external-module redcap-repo

redcap-barcodes's Introduction

Barcodes

A REDCap external module that transforms text fields to barcodes on data entry forms and surveys.

Installation

  • Clone this repo into <redcap-root>/modules/redcap_barcodes_<version-number>, or
  • Obtain this module from the Consortium REDCap Repo via the Control Center.
  • Go to Control Center > Technical / Developer Tools > External Modules and enable Barcodes.

Requirements

  • REDCap 14.0.0 or newer

Configuration

  • There are no module-specific system or project configuration options.
  • All action is controlled by the .... action tags ;)

Use case

Whenever you want to display a barcode on a data entry forms or survey pages, this is the right module for the job ;)

Action Tags

@BARCODE="Type"

where Type is one of:

  • Code 39
  • Code 39 Extended
  • Code 128
  • EAN/UPC (wide range of EAN and UPC barcodes, including addons)
  • QR (QR Code; 2D)
  • DM (Datamatrix; 2D)

Add Text (with a leading space) to any of the 1D barcodes to display the encoded string below the barcode. For EAN/UPC barcodes, text will always be displayed.

Separated by commas, optionally add the size (integer values only)and whether the barcode should act as a hyperlink (L; QR and DM only). The default sizes are 48 for Code 39 and Code 128, and 128 for EAN/UPC and the 2D barcodes, respectively.

Apply this action tag to a field of type Text Box only. The barcode will be shown instead of the input element. If you want to have the field editable on the page, use the @BARCODE action tag on a different field that "pipes" in the value with @CALCTEXT or @CALCDATE. If you need the barcode piped to some place, use the field embedding feature.

EAN/UPC barcodes must be valid codes. Optionally, the check digit can be replaces with a ?. Check here for details, and the examples below.

For the intricacies of Code 39 vs. Code 39 Extended, see this article. For more info on Code 128, see this article.

Examples:

  • @BARCODE="Code 39 Text, 40 = Code 39 with text, text size 40px
  • @BARCODE="QR, 100, L = A somewhat reduced size QR code (default size = 128) that is a hyperlink
  • @BARCODE="EAN/UPC = EAN-8, EAN-13, UPC-A, UPC-E barcodes with otional addons. The check digit can be replaces with ?.

Here is a list of valid EAN/UPC example values (D = a digit):

Symbol Pattern Example
EAN-13 DDDDDDDDDDDD? 001234567890?
EAN-13 DDDDDDDDDDDDD 0012345678905 (5 is the correct check digit)
EAN-8 DDDDDDD? 1234567?
EAN-8 DDDDDDDD 12345670 (0 is the correct check digit)
UPC-A DDDDDDDDDDD? 01234567890?
UPC-A DDDDDDDDDDDD 012345678905 (5 is the correct check digit)
UPC-E (short) xDDDDDD? x123455?
UPC-E (short) xDDDDDDD x1234558 (8 is the correct check digit)
UPC-E (long) XDDDDDDDDDDD? X09840000075?
UPC-E (long) XDDDDDDDDDDDD X098400000751 (1 is the correct check digit)
2-digit add-on -DD -34
5-digit add-on -DDDDD -87613
EAN-13+2 DDDDDDDDDDDD?DD 001234567890?12
EAN-13+2 DDDDDDDDDDDDDDD 001234567890512
EAN-13+5 DDDDDDDDDDDD?DDDDD 001234567890?12345
EAN-13+5 DDDDDDDDDDDDDDDDDD 001234567890512345

Notes & Limitations

This will not work for PDFs, emails, etc., but for form display only, as all the magic happens in the client's browser!

Have a look at the QRCode EM if you need to include QR codes in other places than data entry forms and surveys.

Changelog

Version Description
v1.0.0 Initial release.

redcap-barcodes's People

Contributors

grezniczek avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.