journal article Aug 11, 2025

A Novel QR Code–Based Solution for Secure Electronic Health Record Transfer in Venous Thromboembolism Home Rehabilitation Management: Algorithm Development and Validation

Abstract
Abstract

Background
Venous thromboembolism (VTE) is a common vascular disorder requiring extended anticoagulation therapy postdischarge to reduce recurrence risk. Home rehabilitation management systems that use electronic health records from hospital care provide opportunities for continuous patient monitoring. However, transferring medical data from clinical to home settings raises significant concerns about privacy and security. Conventional methods such as manual data entry, optical character recognition, and dedicated data transmission lines face notable technical and operational challenges.


Objective
This study aims to develop a QR code–based security transmission algorithm using Avro and byte pair encoding (BPE). The algorithm supports the secure creation and transfer of out-of-hospital health records by enabling patients to scan QR codes via a dedicated mobile app, ensuring data security and user privacy.


Methods
Between January and October 2024, 300 hospitalized patients with VTE were recruited at the Sixth Medical Center of the Chinese PLA General Hospital. Post discharge, participants used a home rehabilitation app tailored for VTE management. The QR code–based security transmission algorithm was developed to securely transfer in-hospital electronic health records to the out-of-hospital app. It uses BPE, Avro, and Gzip for optimized data compression and uses ChaCha20 and BLAKE3 for encryption and authentication. Specifically, BPE tokenizes medical text, while Avro serializes JSON (JavaScript Object Notation) objects, contributing to data encryption. A proprietary tokenizer was trained, and compression efficiency was evaluated using a “Performance Benchmark Dataset.” Comparative analyses were conducted to assess the compression efficiency of JSON serialization methods (Avro and ASN.1 [Abstract Syntax Notation One]), and tokenization algorithms (BPE and unigram).


Results
The dataset consisted of JSON files from 300 patients, averaging 240.1 fields per file (range 89‐623) and 7095 bytes in size (range 2748‐17,425 bytes). Using the BPE + Avro + Gzip algorithm, the average file size was reduced to 1048 bytes, achieving a compression ratio of 6.67. This was 1.82 times more efficient than traditional Gzip compression (average file size: 1907 bytes; compression ratio: 3.66; P<.001). For Chinese medical text tokenization, BPE outperformed unigram with a compression ratio of 4.68 versus 4.55 (P<.001). Avro and ASN.1 demonstrated comparable compression ratios of 2.57 and 2.59, respectively, when used alone (P=.30). However, Avro combined with BPE and Gzip significantly outperformed ASN.1, achieving compression ratios of 6.67 versus 5.21 (P<.001). Additionally, 84.7% (254/300) of patients needed to scan only 1 QR code, requiring an average of 3.1 seconds.


Conclusions
The QR code–based security transmission algorithm using Avro and BPE efficiently compresses and transmits data in an encrypted manner and authenticates the identity of the scanning users, ensuring the privacy and security of medical data. Delivered as a software development kit, the algorithm offers straightforward implementation and usability, supporting its broad adoption across various applications.
Topics

No keywords indexed for this article. Browse by subject →

References
32
[1]
Epidemiology of venous thromboembolism

John A. Heit

Nature Reviews Cardiology 10.1038/nrcardio.2015.83
[2]
Nicholson "Prevention of venous thromboembolism in 2020 and beyond" J Clin Med 10.3390/jcm9082467
[3]
Mlačo "Provoked venous thromboembolism during ten-year follow up at the Clinical Centre University of Sarajevo" Med Glas (Zenica) 10.17392/1038-20
[4]
Hospital Pharmacy Professional Committee of the Chinese Pharmaceutical Association "Chinese expert consensus on home management of oral anticoagulants" Natl Med J China 10.3760/cma.j.cn112137-20231102-00987
[5]
Wright "Ability to generate patient registries among practices with and without electronic health records" J Med Internet Res 10.2196/jmir.1166
[6]
Batra "OCR-MRD: performance analysis of different optical character recognition engines for medical report digitization" Int J Inf Tecnol 10.1007/s41870-023-01610-2
[7]
Ujiie "Identification of adverse drug event-related Japanese articles: natural language processing analysis" JMIR Med Inform 10.2196/22661
[8]
Lin "The feasibility of QR-code prescription in Taiwan" J Clin Pharm Ther 10.1111/j.1365-2710.2012.01358.x
[9]
Nakayama Stud Health Technol Inform
[10]
Mathivanan "QR code based patient data protection in ECG steganography" Australas Phys Eng Sci Med 10.1007/s13246-018-0695-y
[11]
Mathivanan "QR code–based ECG signal encryption/decryption algorithm" Cryptologia 10.1080/01611194.2018.1549122
[12]
Lauriot Dit Prevost "“Re-Materialized” medical data: paper-based transmission of structured medical data using QR-Code, for medical imaging reports" Stud Health Technol Inform 10.3233/shti220063
[13]
Mao "QRStream: a secure and convenient method for text healthcare data transferring" Annu Int Conf IEEE Eng Med Biol Soc 10.1109/embc.2019.8856946
[14]
Bhardwaj C Garg H . An approach for enhancing data storage capacity in quick response code using zip compression technique. Presented at: 2023 International Conference on Artificial Intelligence and Smart Communication (AISC); Feb 24-25, 2023; Greater Noida, India. [doi: 10.1109/AISC56616.2023.10085559] 10.1109/aisc56616.2023.10085559
[15]
Viotti JC Kinderkhedia M . A survey of JSON-compatible binary serialization specifications. arXiv. Preprint posted online on Jan 6, 2022. [doi: 10.48550/arXiv.2201.02089]
[16]
Jackson S Cummings N Khan S . Streaming technologies and serialization protocols: empirical performance analysis. arXiv. Preprint posted online on Jul 18, 2024. [doi: 10.48550/arXiv.2407.13494] 10.1109/access.2024.3486054
[17]
Delétang G Ruoss A Duquenne PA et al. Language modeling is compression. arXiv. Preprint posted online on Sep 19, 2023. [doi: 10.48550/arXiv.2309.10668]
[18]
Gage "A new algorithm for data compression" C Users J 10.5555/177910.177914
[19]
Schmidt CW Reddy V Zhang H et al. Tokenization is more than compression. arXiv. Preprint posted online on Feb 2, 2024. [doi: 10.48550/arXiv.2402.18376]
[20]
Neural Machine Translation of Rare Words with Subword Units

Rico Sennrich, Barry Haddow, Alexandra Birch

Proceedings of the 54th Annual Meeting of the Asso... 10.18653/v1/p16-1162
[21]
Kudo T . Subword regularization: improving neural network translation models with multiple subword candidates. Presented at: Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers); Jul 15-20, 2018; Melbourne, Australia. 10.18653/v1/p18-1007
[22]
Nir Y Langley A . ChaCha20 and poly1305 for IETF protocols. Internet Engineering Task Force (IETF); 2018. [doi: 10.17487/RFC8439] 10.17487/rfc8439
[23]
Pandya M . Performance evaluation of hashing algorithms on commodity hardware. arXiv. Preprint posted online on Jul 11, 2024. [doi: 10.48550/ARXIV.2407.08284]
[24]
Tarjan "A readability analysis for QR code application in a traceability system" Comput Electron Agric 10.1016/j.compag.2014.08.015
[25]
Information capacity and versions of the QR code. QRcode.com. 2024. URL: https://www.qrcode.com/en/about/version.html [Accessed 01-10-2024]
[26]
Cumulative distribution function. Wikipedia. 2024. URL: https://en.wikipedia.org/wiki/Cumulative_distribution_function [Accessed 01-10-2024]
[27]
Kumar "Securing communication protocols in military computing" Netw Secur 10.12968/s1353-4858(24)70011-7
[28]
Kumar "Securing military computing with the blockchain" Comput Fraud Secur 10.12968/s1361-3723(24)70007-4
[29]
Sahu "A secure decentralised finance framework" Comput Fraud Secur 10.12968/s1361-3723(24)70010-4
[30]
Sahu "Telemedicine: how to achieve interoperability without compromising data security" Br J Healthc Manag 10.12968/bjhc.2024.0029
[31]
Kumar "Code of silence: cyber security strategies for combating deepfake disinformation" Comput Fraud Secur 10.12968/s1361-3723(24)70013-x
[32]
Kumar "A hybrid model of hesitant fuzzy decision-making analysis for estimating usable-security of software" IEEE Access 10.1109/access.2020.2987941
Metrics
6
Citations
32
References
Details
Published
Aug 11, 2025
Vol/Issue
12
Pages
e69230-e69230
Cite This Article
Changzhen Li, Zhi-Geng Jin, Fei Wang, et al. (2025). A Novel QR Code–Based Solution for Secure Electronic Health Record Transfer in Venous Thromboembolism Home Rehabilitation Management: Algorithm Development and Validation. JMIR Rehabilitation and Assistive Technologies, 12, e69230-e69230. https://doi.org/10.2196/69230