EMR-Chain: Decentralized Electronic Medical Record Exchange System
Abstract
1. Introduction
2. Background and Related Works
2.1. The Evolution and Current State of Electronic Medical Records (EMR)
2.2. The Application and Potential of Blockchain Technology in EMR Systems
2.2.1. Patient-Centric Data Governance and Autonomy
2.2.2. Immutable Auditability and Data Provenance
2.2.3. A Shared Metadata Layer for Interoperability
2.2.4. Real-World Implementations and Future Outlook
2.3. Related Research
3. System Design
3.1. High-Level System
- Decentralized Identity (DID) Chain: Adapted from the architecture presented by Hsieh et al. [20], the DID-chain provides a self-sovereign identity management system. It operates independently of any central authority, granting users complete control over their personal identity data and mitigating the risks of centralized data breaches.
- Application (EMR) Chain: This Hyperledger Fabric-based blockchain governs access control, data authorization, and maintains an immutable audit trail of all transactions. Any personally identifiable information on the EMR-chain undergoes de-identification to protect user privacy.
- Hospital FHIR Servers: Each participating hospital operates its own FHIR server, a distributed, interoperable repository for patient medical records. Adherence to the FHIR standard ensures a unified data exchange format across disparate healthcare institutions.
3.2. DID-Chain: A Global Identity Management System
3.3. EMR-Chain: The Application-Specific Governance Layer
3.3.1. The IdentityManagement Channel
3.3.2. The AccessControl Channel
3.3.3. The TransactionRecord Channel
3.4. FHIR Server: The Interoperable Data Layer
- Read-Only Access: The FHIR server endpoints are configured for read-only operations to prevent any unauthorized modification of the source medical records.
- Token-Based Authentication: A mandatory Token Validator module is integrated into the server’s access layer. This module intercepts every request to validate the associated JSON Web Token (JWT), confirming its signature, expiration, and the holder’s authorization. Access to medical records is granted only upon successful validation; all other requests are denied.
3.5. Smart Contract Design
3.5.1. Smart Contracts on the DID-Chain
- IdentityManager Contract: This contract functions as a public, on-chain registry. Its primary responsibilities are to record verified Main Identities and to provide a universal authentication interface for external applications.
- Personal Contract: In contrast, the Personal Contract serves as a private, user-specific data vault. It is programmatically linked to the user’s primary identity but remains under their exclusive control. It is used for storing sensitive information such as encrypted private keys for other applications.
3.5.2. Chaincodes on the EMR-Chain
- IDM Chaincode: Governs application-specific identity and role management.
- ACL Chaincode: Manages fine-grained access control policies for medical records.
- TSR Chaincode: Maintains a non-repudiable audit trail of all access events.
3.6. Role-to-Function Permission Mapping
4. Implementation and Demonstration
4.1. DID-Chain Network
4.1.1. MainIdentity Create
4.1.2. Binding Wallet to MainIdentity
4.1.3. App-Chain Private Key Upload
4.2. EMR-Chain Network
4.2.1. EMR-Chain Network Architecture
Color/Shape | Element Type | Meaning/Label Example |
---|---|---|
Blue oval/rectangle | Channel | AccessControl channel (c1, cc1) |
Red oval/rectangle | Channel | TransactionRecord channel (c2, cc2) |
Green oval/rectangle | Channel | IdentityManagement channel (c3, cc3) |
Yellow square | Organization | org1 |
Blue square | Organization | org2(Healthcare Certification Authority) |
Green square | Organization | org3 |
Orange square | Certificate Authority | CA1, CA2, CA3 |
Light orange rectangle | HCA Peer | p1, p2 |
Gray square | Ordering Service | O |
Small red rectangle | Smart Contract | SC |
Small green rectangle | Ledger | L1, L2, L3 |
Beige rectangle | Application | A1, A2 |
Gray rectangle (bottom) | Legend block | Used for symbol explanation |
4.2.2. EMR-Chain Identity Create and ACL Instance Create
4.2.3. EMR-Chain Login and Logout Process
4.2.4. Consent/Revoke Identity
4.2.5. Transaction Submission
4.2.6. Authorization
4.2.7. Authorization Verification and Audit Logging
5. Experimental Evaluations
5.1. Environment Setup
5.2. Gas Fee Consumption
5.3. Function Throughput
Send Rate (Requests/Sec) | Login | Validate Hash | Update Instance | Validate Hash | Authorization |
---|---|---|---|---|---|
10 | 10 | 9.9 | 9.9 | 9.9 | 10 |
15 | 14.6 | 14.3 | 14.3 | 14.6 | 14.4 |
20 | 19.2 | 19 | 18.9 | 19.8 | 19.4 |
25 | 24.1 | 23.9 | 23.7 | 24 | 24.4 |
5.4. Security Analysis
5.4.1. Distributed Denial-of-Service (DDoS) Attack
5.4.2. 51% Attack
5.4.3. Smart Contract Vulnerabilities
5.4.4. Defense Against Token Replay and Time-Based Attacks
5.5. Detailed Performance Evaluation Table
- Index Upload Throughput (updateInstance()): The function responsible for medical record index uploads sustained a stable throughput of approximately 40 transactions per second (TPS). When compared against the peak national demand of 6.7 TPS, our system demonstrates a capacity that exceeds the required benchmark by a factor of nearly six. This confirms its capability to handle high-volume index uploads with significant headroom.
- Query Authorization Throughput (authorization()): The authorization() function, which orchestrates the complex process of medical record queries, achieved an even higher throughput of approximately 49 TPS. This performance was benchmarked against the national peak query load of 4.7 requests per minute (≈0.08 TPS). The system’s query-handling capacity is therefore several orders of magnitude greater than the observed real-world requirement. This substantial performance margin ensures high responsiveness and low latency, even during periods of high concurrency.
5.6. Practical Significance and Impact of Numerical Results
6. Conclusions and Future Work
6.1. Conclusions
6.2. Future Work
Supplementary Materials
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Acknowledgments
Conflicts of Interest
Appendix A
Appendix A.1. Smart Contracts Detail Design on the DID-Chain
Appendix A.1.1. IdentityManager
Algorithm A1 IdentityManager contract |
1: function addUser(DID) ▷DID: Decentralized Identifier |
2: if DID is not enrolled then |
3: Mark this DID as enrolled. |
4: Create an Identity for the user. |
5: else |
6: Reject the enrollment request. |
7: end if |
8: end function |
9: |
10: function bindWallet(DID, walletAddress, userType) ▷Ensure DID and wallet are unique |
11: Check if the DID is registered. |
12: Check if the wallet address is already bound. |
13: Check if the DID is already bound. |
14: Bind the DID and wallet address. |
15: Create a personalIdentity contract for the user. |
16: Record the personalIdentity contract address in IdentityInfo. |
17: end function |
18: |
19: function authentication(DID, hashedmessage, signature) ▷ECDSA: Elliptic Curve Digital Signature Algorithm |
20: Verify signer using ECDSA.recover() |
21: if Verification successful then |
22: result ← true |
23: else |
24: result ← false |
25: end if |
26: return result |
27: end function |
28: |
29: function getId() ▷Retrieve user’s decentralized identifier |
30: Return the user DID |
31: end function |
32: |
33: function getUserType() ▷Retrieve type of user |
34: Return the user type of the user |
35: end function |
36: |
37: function getPersonalAddress(address) ▷Retrieve user’s personal contract address |
38: Return the personal contract address of the user |
39: end function |
Appendix A.1.2. Personal
Algorithm A2 Personal contract |
1: function set-app-private(app, encryptedData) ▷ Store encrypted application-specific data |
/Store encrypted application data |
2: Record the app→encryptedData mapping to appPrivate |
3: end function |
4: |
5: function get-app-private() ▷ Retrieve encrypted user data/Retrieve encrypted application data |
6: Return the encryptedData of user |
7: end function |
Appendix A.2. Smart Contracts Detail Design on the EMR-Chain
Appendix A.2.1. IDM Chaincode
Algorithm A3 IDM chaincode |
1: function beforeTransaction() |
2: commit_id ← user id on the x509credential ▷ Extract user identity from credential |
3: msp_id ← organization id on the x509credential |
4: func ← function name of the user call |
5: Check if commit_id and msp_id match the access control of the function. |
6: end function |
7: |
8: function verify_role(appId) |
9: return the appId’s role |
10: end function |
11: |
12: function create_identity(ctx, p_key, app_id, did, x509Cipher) ▷ Create a new identity |
13: Create an identity for user. |
14: end function |
15: |
16: function authenticate_identity(ctx, p_key, signature, patientId) ▷ Verify user identity and role |
17: buffer ← await ctx.stub.getState(p_key) |
18: if (!buffer or !buffer.length) return { error: "Please register first!!" } |
19: isVerified ← Verify the signature. ▷ Check if patient registered |
20: if (isVerified) and (User’s role == "patient" or "doctor") |
21: return User’s role |
22: else |
23: return "Authenticate Fail!!!" |
24: end if |
25: end function |
26: |
27: function login(ctx, p_key, signature, message) ▷ Login using signature verification |
28: isVerified ← Verify the signature. |
29: if (isVerified) return User’s x509Cipher |
30: else return { error: "Verify Failed! You are not the user!!" } |
31: end function |
- beforeTransaction(): This function is invoked prior to any other function call within the chaincode. Diverging from conventional implementations, its primary role here is to verify the transaction submitter’s authorization to access the requested function.
- verify_role(): This function returns the role of the transaction submitter. It is integral to the chaincodes of both the AccessControl and Transaction channels, where it is used to validate whether a submitter possesses the requisite authority to execute a specific function.
- create_identity(): This function establishes a new identity on the EMR-chain and stores the user’s X.509Cipher. This X.509Cipher is generated by encrypting the user’s X.509 credential and the identity’s private key with a user-defined key. The resulting cipher serves as the primary credential for logging into the EMR exchange system.
- Role Management Functions: Role management is handled by a set of dedicated functions. The consent_doc_role() and consent_sup_role() functions are used to grant the “doctor” and “supervisor” roles to healthcare providers and hospital administrative units, respectively. Conversely, the revoke_doc_role() and revoke_sup_role() functions enable designated authorities, namely the HCA (Healthcare Authority) and MOHW (Ministry of Health and Welfare), to revoke these roles.
- authenticate_identity(): This function is crucial for verifying the identities of both patients and healthcare providers during EMR exchanges. Leveraging the user’s public key, which is recorded on the IdentityManagement channel, this function performs digital signature verification. This process validates that a signature originates from the claimed submitter and confirms that the identity holds a valid role (i.e., “doctor” or “patient”) for participation in the exchange.
- login(): Finally, the login() function validates two conditions: first, that the submitted signature corresponds to the caller’s identity, and second, that this identity is registered on the EMR-chain. If the user’s identity is not found, the system requires them to complete the registration process before granting access.
Appendix A.2.2. ACL Chaincode
- create_patient_instance(): Invoked upon a user’s initial registration with the EMR-chain, this function provisions an empty record instance for that user on the ledger.
- update_instance() and update_hash(): These functions facilitate the uploading of new medical record instances and their corresponding hash values to the ledger.
- consent_access() and revoke_access(): These functions are employed to dynamically grant or revoke a healthcare provider’s access to a patient’s medical record by modifying the on-chain ACL.
Algorithm A4 ACL chaincode |
1: function beforeTransaction(ctx) |
2: input ← ctx.stub.getFunctionAndParameters() ▷ Parse function and parameters |
3: commit_id ← ctx.clientIdentity.getAttributeValue("user_id") |
4: Check if commit_id matches the access control of the function. |
5: end function |
6: |
7: function create_patient_instance(ctx, patient_id) ▷ Initialize empty ACL instance |
8: New an empty ACL instance for patient_id |
9: end function |
10: |
11: function update_instance(ctx, patient_id, hospital_id, pointer, hash) ▷ Update ACL attributes |
12: Setup the level, open_access, pointer, hash attribute for patient |
13: Update patient’s instance |
14: end function |
15: |
16: function update_hash(ctx, patient_id, hospital_id, new_hash) ▷ Update medical record hash |
17: Update the medical record hash value |
18: end function |
19: |
20: function consent_access(ctx, patient_id, hospital_id) ▷ Relax access control rules |
21: Change ACL to less stringent rules ▷ Update patient’s medical record reference |
22: end function |
23: |
24: function revoke_access(ctx, patient_id, hospital_id) ▷ Tighten access control rules |
25: Change ACL to more stringent rules |
26: end function |
27: |
28: function authorization(ctx, patient_id, patient_p_key, doctor_p_key, patient_signature, doctor_signature, self_level, request_id, hospitalDID) ▷ Authorize doctor with JWT token |
29: Authenticate signature and role via IDM.authenticate_identity |
30: Randomly create token key pair |
31: Setup JWT Header and Payload |
32: Use patient’s ACL to check doctor access rights |
33: if doctor has access right then |
34: Sign JWT with private key of token key pair |
35: Record public key of token key pair for validation |
36: return token and address |
37: else |
38: return "Reject Access!!!" |
39: end if ▷ Generate JWT token if doctor authorized |
40: end function |
41: |
42: function validate_hash(ctx, patient_id, hash_obj) ▷ Validate consistency of hashes |
43: Compare hash values of chain and holders |
44: if different, return "UPDATE" |
45: end function |
Appendix A.2.3. TSR Chaincode
Algorithm A5 TSR chaincode |
1: function beforeTransaction(ctx) |
2: input ← ctx.stub.getFunctionAndParameters() |
3: commit_id ← ctx.clientIdentity.getAttributeValue("user_id") |
4: Check if commit_id matches the access control of the function. |
5: end function |
6: |
7: function record(ctx, patient_id, dp, dc, resource, purpose, status) |
8: Record the purpose and status of access request. |
9: Record the access request log by patient id. |
10: end function |
Appendix B
Explanation of Technical Terms and Abbreviations
- IdentityManagement Channel: Establishes an application-specific identity system to manage roles (patient, doctor, supervisor) within the EMR ecosystem.
- AccessControl Channel: Manages access permissions for medical records, creating an independent data instance for each patient-hospital relationship. It contains the Access Control List (ACL), the cryptographic hash of the off-chain medical record, and the network address of the off-chain FHIR resource.
- TransactionRecord Channel: Provides an immutable and non-repudiable audit trail of all data access requests, used for patient monitoring of record access and as evidence in case of disputes.
- IDM Chaincode: Manages application-specific identities and roles.
- ACL Chaincode: Manages fine-grained access control policies for medical records.
- TSR Chaincode: Maintains a non-repudiable audit trail of all access events.
Appendix C
Table 1: Abbreviation Legend
- IM (Identity Management): Refers to systems that manage user identities, typically via smart contracts on a Decentralized Identity Blockchain (DID-Chain). The proposed EMR-Chain system, for instance, includes an IdentityManagement channel that establishes an application-specific identity system to manage roles within the EMR ecosystem.
- SE (Security): Pertains to measures and architectures to enhance system resilience, data protection, and overall security. This includes cryptographic security, immutability, and de-identification protocols to keep personal details confidential. The EMR-Chain’s security posture is analyzed against various attack vectors, including DDoS attacks and smart contract vulnerabilities.
- Aut. (Authorization): Denotes the process of managing access permissions to medical records. The proposed system achieves this through fine-grained access control via smart contracts, which authorize doctors to access records based on patient-defined permissions. For example, the Authorization () function evaluates access requests against a patient’s Access Control List (ACL).
- Int. (Interoperability): Highlights the capability of different healthcare systems to exchange data seamlessly. The proposed system is developed based on the Fast Healthcare Interoperability Resources (FHIR) standard, which acts as a common language for cross-platform data exchange. Blockchain can also serve as a shared metadata layer to connect disparate institutions.
- Pri. (Privacy): Refers to the protection of patients’ personal medical data. This is achieved through stringent de-identification protocols, fine-grained access controls, and enabling patients to maintain control over their data. The system aims to improve privacy significantly through enhanced access controls.
- S-Aut. (Sub-authorization): Represents the concept of more granular Authorization controls that extend beyond general access, such as department-specific access or resource type-based authorization. This feature aims to give patients more precise control over their medical data and enhance privacy protection.
- SC.-AC. (Smart Contract Access Control): Utilizes smart contracts to define and enforce granular access rules for medical records. The EMR-Chain, for instance, implements Role-Based Access Control (RBAC) via its chaincodes (smart contracts) to ensure only authorized roles can execute specific functions.
- St.-For. (Standardized Format): Indicates adopting a unified standard for data exchange to ensure consistency and smooth communication between different medical systems. The system mandates the use of the FHIR standard for this purpose.
- Cen. (Centralized): Describes architectural models, such as the existing Electronic Medical Record Exchange Center (EEC) in Taiwan, which rely on a central server. Such architectures are noted for potential performance bottlenecks, single points of failure, and limited patient consent over data.
- Dcen. (Decentralized): Refers to the architecture leveraged by the proposed system, built on two interconnected blockchains (DID-Chain and EMR-Chain). This design aims to overcome the limitations of centralized systems by enhancing resilience, data privacy, and patient autonomy.
References
- National Health Insurance Administration, Ministry of Health and Welfare, Taiwan. Tracking Report on the Overall Effectiveness of the Phased Medical Care System in 2023. 2023. Available online: https://www.nhi.gov.tw/english/Content_List.aspx?n=C885175F6D559A83&topn=C885175F6D559A83 (accessed on 31 July 2024).
- Electronic Medical Record Exchange Center, Ministry of Health and Welfare, Taiwan. Introduction to the Electronic Medical Records Exchange Center. 2024. Available online: https://eec.mohw.gov.tw/new/Home/Brief (accessed on 31 July 2024).
- Li, Y.-C.J.; Yen, J.-C.; Chiu, W.-T.; Jian, W.-S.; Syed-Abdul, S.; Hsu, M.-H. Building a national electronic medical record exchange system–experiences in Taiwan. Comput. Methods Programs Biomed. 2015, 121, 14–20. [Google Scholar] [CrossRef] [PubMed]
- Voigt, P.; von dem Bussche, A. The EU general data protection regulation (GDPR). In A Practical Guide; Springer International Publishing: Cham, Switzerland, 2017; pp. 1–55. [Google Scholar] [CrossRef]
- Weed, L.L. Medical records that guide and teach. N. Engl. J. Med. 1968, 278, 652–657. [Google Scholar] [CrossRef] [PubMed]
- Permanente, K. About KP HealthConnect®. Available online: https://healthy.kaiserpermanente.org/content/dam/kporg/final/documents/community-providers/national/ever/ola-complete-user-registration-guide-en.pdf (accessed on 23 August 2024).
- Kohn, L.T.; Corrigan, J.M.; Donaldson, M.S. (Eds.) To Err Is Human: Building a Safer Health System; National Academies Press: Washington, DC, USA, 2000. [Google Scholar]
- Blumenthal, D.; Tavenner, M. The ‘meaningful use’ regulation for electronic health records. N. Engl. J. Med. 2010, 363, 501–504. [Google Scholar] [CrossRef] [PubMed]
- Al Mamun, A.; Azam, S.; Gritti, C. Blockchain-based electronic health records management: A comprehensive review and future research direction. IEEE Access 2022, 10, 5768–5789. [Google Scholar] [CrossRef]
- Rosar, M.; Chuang, K.-T. Using Blockchain for Incentive-Driven FHIR-based Health Record Exchange. In Proceedings of the 39th ACM/SIGAPP Symposium on Applied Computing, Ávila, Spain, 8–12 April 2024; pp. 298–299. [Google Scholar] [CrossRef]
- Mishra, A.K.; Sharma, R.; Singh, J.; Singh, P.; Diwakar, M.; Tiwari, M. Smart Contract-Enabled Blockchain Framework for Electronic Medical Health Records. In Proceedings of the 2024 14th International Conference on Cloud Computing, Data Science & Engineering (Confluence), Noida, India, 18–19 January 2024; pp. 124–129. [Google Scholar] [CrossRef]
- Lax, G.; Nardone, R.; Russo, A. Enabling secure health information sharing among healthcare organizations by public blockchain. Multimed. Tools Appl. 2024, 83, 64795–64811. [Google Scholar] [CrossRef]
- Bach, T.; Aravazhi, A.; Konovalenko, A. Blockchain Technology for Electronic Health Records: Challenges & Opportunities. SINTEF Rep. 2020, 2020, 01250. Available online: https://hdl.handle.net/11250/2722951 (accessed on 31 July 2024).
- Yang, X.; Zhang, K.; Jia, K.; Zhao, P. A personalized and efficient EMR sharing and management scheme based on smart contracts. Peer-to-Peer Netw. Appl. 2024, 17, 1569–1587. [Google Scholar] [CrossRef]
- Velmurugan, S.; Prakash, M.; Neelakandan, S.; Martinson, E.O.; El Kafhali, S. An Efficient Secure Sharing of Electronic Health Records Using IoT-Based Hyperledger Blockchain. Int. J. Intell. Syst. 2024, 2024, 6995202. [Google Scholar] [CrossRef]
- Ali, A.; Rahim, H.A.; Ali, J.; Pasha, M.F.; Masud, M.; Rehman, A.U.; Chen, C.; Baz, M. A novel secure blockchain framework for accessing electronic health records using multiple certificate authority. Appl. Sci. 2021, 11, 9999. [Google Scholar] [CrossRef]
- Jakhar, A.K.; Singh, M.; Sharma, R.; Viriyasitavat, W.; Dhiman, G.; Goel, S. A blockchain-based privacy-preserving and access-control framework for electronic health records management. Multimed. Tools Appl. 2024, 83, 84195–84229. [Google Scholar] [CrossRef]
- Kaur, J.; Rani, R.; Kalra, N. Attribute-based access control scheme for secure storage and sharing of EHRs using blockchain and IPFS. Clust. Comput. 2024, 27, 1047–1061. [Google Scholar] [CrossRef]
- Cui, B.; Chen, Z. Research on Fine-grained Security Sharing Model of Medical Information Based on Blockchain. In Proceedings of 2023 IEEE 29th International Conference on Parallel and Distributed Systems (ICPADS), Ocean Flower Island, China, 17–21 December 2023; pp. 2840–2841. [Google Scholar] [CrossRef]
- Hsieh, Y.-H.; Guan, X.-Q.; Liao, C.-H.; Yuan, S.-M. Physiological-chain: A privacy preserving physiological data sharing ecosystem. Inf. Process. Manag. 2024, 61, 103761. [Google Scholar] [CrossRef]
- National Health Insurance Administration, Ministry of Health and Welfare. Why Promote the Phased Medical Care System? 2018. Available online: https://www.nhi.gov.tw/english/Content_List.aspx?n=8447881E9A47533E&topn=C885175F6D559A83 (accessed on 23 August 2024).
- iThome. Medical IT Will Undergo Two Major Changes! The Ministry of Health and Welfare Announced That the Electronic Medical Records Exchange Center Will Transition to an FHIR Framework and Will Also Submit a Draft Proposal to Move Electronic Medical Records to the Cloud. 2021. Available online: https://www.ithome.com.tw/news/144262 (accessed on 23 August 2024).
- FHIR Taiwan Community. FHIR Taiwan Public Test Server. Available online: https://hapi.fhir.tw/ (accessed on 23 August 2024).
- Hyperledger Labs. Fablo. Available online: https://github.com/hyperledger-labs/fablo (accessed on 31 July 2024).
- The Apache Software Foundation. Apache JMeter. Available online: https://jmeter.apache.org/ (accessed on 31 July 2024).
- Truffle Suite. Truffle. Available online: https://trufflesuite.com/docs/truffle/ (accessed on 31 July 2024).
Author | IM | SE | Aut. | Int. | Pri. | S-Aut. | SC.-AC. | St.-For. |
---|---|---|---|---|---|---|---|---|
M. Rosar and K.-T. Chuang [10] | X | V | V | V | V | X | X | V |
A. K. Mishra et al. [11] | Cen. | X | V | V | X | X | X | V |
G. Lax et al. [12] | Cen. | V | V | V | V | X | X | V |
T. Bach et al. [13] | Dcen. | V | X | V | V | X | X | V |
X. Yang et al. [14] | Dcen. | V | V | V | V | X | V | V |
Velmurugan et al. [15] | Dcen. | V | V | V | V | X | X | V |
S. Vidhya and V. Kalaivani [16] | Dcen. | V | V | V | V | X | V | V |
A. K. Jakhar et al. [17] | Cen. | V | V | V | V | X | V | V |
J. Kaur et al. [18] | Cen. | V | V | V | V | X | X | V |
Our Research | Dcen. | V | V | V | V | V | V | V |
Function | Description | Permitted Roles |
---|---|---|
IdentityManager— addUser() | A unique Main Identity is generated using the hash of the user’s national identification number. | Government Agency: Upon successful verification of the user’s identity, the government agency initiates a request to generate the Main Identity. |
IdentityManager— bindWallet() | The user’s digital wallet is linked to their Main Identity, and a Personal contract is created accordingly. | Government Agency: After the user submits their wallet address along with the unique identifier of their Main Identity to the appropriate government agency, the agency proceeds to issue a binding request. |
IdentityManager— authentication() | Enables application providers to verify the user’s digital signature as part of the authentication process. | Application providers, such as EMR-Chain service providers or affiliated hospitals. |
IdentityManager— getId() | Extract the user’s Decentralized Identifier (DID). | Any entity requiring verification or query of the DID, such as application providers and end users through the dashboard interface. |
IdentityManager—getUserType() | Extract the type of the user’s identity. | Any entity requiring verification or query of the user’s identity type. |
IdentityManager—getPersonalAddress() | Extract the address of the user’s Personal smart contract. | Any entity requiring access to the Personal contract address, such as application providers and end users through the dashboard interface. |
Personal—set-app-private() | Enables users to securely store their application chain private key or other personal information within the Personal contract, with all data encrypted prior to upload. | Patient/Data Owner: As an integral part of their decentralized identity, the patient retains full control over this contract. |
Personal—get-app-private() | Enables users to retrieve encrypted information stored within their Personal contract. | Patient/Data Owner |
Function | Description | Permitted Roles |
---|---|---|
IDM—beforeTransaction() | Executed prior to any function invocation, this is used to enforce access control for the chaincode functions. | System-internal mechanism: Automatically triggered by the chaincode. |
IDM—verify_role() | Retrieves the role of the transaction submitter. | System internal mechanism: Frequently utilized by the AccessControl and TransactionRecord chaincodes to check if the submitter possesses the necessary authorization. |
IDM—create_identity() | Generate an EMR-chain identity for the user and store their encrypted X.509 certificate. | Service Provider (Hospital): Upon the user’s application, the service provider verifies the DID-Chain identity and subsequently registers the identity with the MOHW’s Certificate Authority (CA). |
IDM—consent_doc_role()/consent_sup_role() | Modify the roles of medical service providers and hospital administrative units within the IdentityManagement channel to either “Doctor” or “Supervisor”. | Healthcare Certification Authority (HCA): Responsible for validating medical personnel licenses and assigning the role of “Doctor.” Ministry of Health and Welfare (MOHW): Responsible for validating hospital licenses and assigning the role of “Supervisor.” |
IDM—revoke_doc_role()/revoke_sup_role() | Enables HCA and MOHW to revoke the roles assigned to medical service providers and hospital administrative units. | HCA (Healthcare Certification Authority): Revokes the role of medical personnel. MOHW (Ministry of Health and Welfare): Revokes the role of administrative staff. |
IDM—authenticate_identity() | Perform the digital signature verification procedure to validate that the signature is from the asserted identity and verify that the identity’s role is either “Doctor” or “Patient.” | System internal mechanism: Mainly called by other chaincodes, such as the authorization() function of the ACL chaincode, to authenticate identities involved in the medical record exchange process. |
IDM—login() | Verify that the submitted signature corresponds to the caller’s identity and confirm that the identity is enrolled in the EMR-chain. | User (submits the digital signature through the web service provided by the service provider or hospital). |
Function | Description | Permitted Roles |
---|---|---|
ACL—beforeTransaction() | As with the IDM chaincode, this mechanism is executed prior to any function invocation to enforce access control and validate the permissions of the caller. | System internal mechanism: Automatically triggered by the chaincode. |
ACL— create_patient_instance() | Activated upon a user’s initial enrollment in the EMR-chain, creating a blank instance for that user. | Service Provider (Hospital): Responsible for creating an instance for the patient upon completion of identity registration. |
ACL—update_instance()/update_hash() | Function used for uploading new medical record instances or their hash values to the ledger. | Doctor: Access to this function is limited exclusively to users with the “Doctor” role. |
ACL—consent_access()/ revoke_access() | Enable patients to modify the Access Control List (ACL) of their medical records at a specific hospital. Patients can grant or revoke access permissions. | Patients: This functionality is restricted to users with the ‘Patient’ role only. |
ACL—validate_hash() | Compare the hash value held by the healthcare provider with the hash value recorded on the blockchain. | Data requester (healthcare provider). |
ACL—authorization() | Assess whether access authorization should be granted. If approved, generate a JWT and return it along with the data address to the data requester. This process requires verification of the identities and roles of both the data owner and the data requester. | Data requester (healthcare provider) and data owner (patient): The data requester initiates the request, and the patient provides a digital signature to indicate consent. |
Function | Description | Permitted Roles |
---|---|---|
TSR—beforeTransaction() | Similarly to ACL smart contracts, it is used to verify whether a user has permission to access specific functionalities. | Internal system mechanism: automatically executed by the chaincode. |
TSR—record() | Log the access requests. | Hospital administration unit: Only hospital administrative personnel with the ‘Supervisor’ role are authorized to perform this operation. |
Parameter | Description |
---|---|
CPU | Intel(R) Core(TM) i5-8400 CPU @ 2.80 GHz |
Cores | 6 |
RAM | 48 GB |
OS | Ubuntu 20.04 |
Parameter | Description |
---|---|
Number of nodes | 1 |
Number of miners | 1 |
State datebase | LevelDB |
Consensus algorithm | PoA |
Block time | 0.5 s |
Parameter | Description |
---|---|
Consensue algorithm | Solo |
Database | CouchDB |
Number of channels and peer nodes | 3 channels, 2 nodes in AccessControl channel and TransactionRecord channel, 4 nodes in IdentityManagement channel |
Year | 2018 | 2019 | 2020 |
---|---|---|---|
Upload Medical Record Index | 211,438,234 | 190,340,272 | 179,737,101 |
Query History Count | 2,465,295 | 1,771,995 | 1,714,692 |
Category | Function Tested | Performance Metric (Throughput) | Comparison with 2018 Taiwan Average Demand |
---|---|---|---|
Execution Speed | Medical Record Index Upload updateInstance() | Approx. 40 TPS (at a 50 rps request rate) | Significantly Higher than the average of 6.7 requests per second. |
Execution Speed | Medical Record Query authorization() | Approx. 49 TPS (at a 50 rps request rate) | Achieved a throughput of 49 TPS. This figure is substantially higher than Taiwan’s 2018 average demand of approximately 4.7 query requests per minute (or 0.08 TPS). |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2025 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Tseng, C.-H.; Hsieh, Y.-H.; Lin, H.-Y.; Yuan, S.-M. EMR-Chain: Decentralized Electronic Medical Record Exchange System. Technologies 2025, 13, 446. https://doi.org/10.3390/technologies13100446
Tseng C-H, Hsieh Y-H, Lin H-Y, Yuan S-M. EMR-Chain: Decentralized Electronic Medical Record Exchange System. Technologies. 2025; 13(10):446. https://doi.org/10.3390/technologies13100446
Chicago/Turabian StyleTseng, Ching-Hsi, Yu-Heng Hsieh, Heng-Yi Lin, and Shyan-Ming Yuan. 2025. "EMR-Chain: Decentralized Electronic Medical Record Exchange System" Technologies 13, no. 10: 446. https://doi.org/10.3390/technologies13100446
APA StyleTseng, C.-H., Hsieh, Y.-H., Lin, H.-Y., & Yuan, S.-M. (2025). EMR-Chain: Decentralized Electronic Medical Record Exchange System. Technologies, 13(10), 446. https://doi.org/10.3390/technologies13100446