Skip to main content

Converting pheno-clinical data to 2D-barcodes

As a proof of concept, we created companion command-line utilities that encode/decode the Pheno-Ranker format to QR codes.

About the utility of QR codes

2D barcodes are straightforward and easy to scan, typically using a smartphone camera. They offer the convenience of encoding various data. Below are a few examples:

  • Enrolling in clinical trial or health data program via QR
  • Patient-doctor transfer of information
  • Medical reports with augmented data
  • Clinical trials reports (see example below)

Of course if you plan to use Pheno-Ranker with non pheno-clinical data you will need to come up with your own examples 😄.

Ok, let's convert Pheno-Ranker data to QRs.

Experimental feature

This feature serves as a proof of concept. The generated QR code images exclusively encode Pheno-Ranker data and do not include any clinical information. To decode these images back into phenotypic-clinical data, a specific template is required. In a production environment, implementing an additional security layer, such as AES encryption, is recommended to enhance data safety.

The first thing is to run Pheno-Ranker with your data, but using the flag --export:

./pheno-ranker -r individuals.json --export my_export_name

This will create a set of files, including my_export_name.glob_hash.json and my_export_name.ref_binary_hash.json.

Now you can run the following command:

./pheno-ranker2barcode -i my_export_name.ref_binary_hash.json -o my_fav_dir --no-compress

About compression

If you don't include the --no-compress option, by default the binary digit string will be compressed using zlib and then encoded in base64. This reduces the string size, allowing more variables to be encoded in the QR code.

This will create 1 png image (inside my_fav_dir) for each individual in individuals.json. Like this one:

Pheno-Ranker
QR code from Pheno-Ranker