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

QR codes can attach an encoded profile to a report or transfer it between controlled systems. Possible uses include:

  • Enrolling in a clinical trial or health data program
  • Transferring information between a patient and doctor
  • Medical reports with augmented data
  • Clinical trial reports (see example below)
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