2.1 Components of PCHDM
2.1.1 Blockchain
A smart contract platform (SC) platform was incorporated into the Hyperledger system. SC stores rules relating to contract negotiations. For medical information sharing efficiently and reliably without having to rely on a single authority, we are employing Hyperledger Fabric, a permissioned blockchain based on pre-specified parties. Hyperledger Fabric offers the advantage of employing the Byzantine fault tolerance consensus protocol without requiring mining or an associated currency as a means of achieving consensus. Hyperledger blockchain uses a Merkle Directed Acyclic Graph tree structure as its state database, which can be replicated using IPFS objects. Therefore, IPFS can be used to model an off-chain and on-chain blockchain for health record storage. By implementing the PCHDMAC-SC protocol, we created a transparent, controlled access system that prevented hacking without patient consent using an Hyperledger blockchain.
2.1.2 Distributed File system
A cryptographic hash represents a unique fingerprint for each file within IPFS, a peer-to-peer (P2P) protocol. To make the contents immutable, the hash address is applied [14]. Merkle DAGs combine Merkle trees with DAGs in IPFS file storage. Rather than relying on location-based addressing, IPFS's key feature is that access to medical images can be accomplished through content-based addressing. Due to IPFS, bandwidth costs can be reduced, image download speeds can be enhanced, and a large volume of data can be distributed without duplication, which can save storage space. The hash value of an IPFS file cannot be changed so IPFS is an immutable storage mechanism.
2.1.3 Services Provided to Members
A cryptographic procedure that validates identity, generates and verifies signatures, and generates and verifies certificates, as well as verifying the identity of the user is described in [15]. This model uses Fabric-Certificate Authority (CA) as the interface for Services Provided to Members. A participating organization can, however, use an external CA.
2.2 A Background of the PCHDM System
An illustration of Health chain’s proposed architecture can be seen in Figure 1. User requests are sent to the fabric network by the Dapp through an API called the composer, which is interactively handled by the Dapp admin. Through GET calls to the composer, the Angular framework can access the on-chain database and retrieve data based on the current state as returned by the API. Smart contract composer creates decentralized applications based on blockchain business networks. With Hyperledger Fabric [16] network participants can validate medical data entries via smart contracts named chain codes. This technology was developed for distributed ledger solutions. Bitcoin [17] was created specifically for financial transactions, and Hyperledger is for storing health records.
Hyperledger Composer uses permissioned blockchain based on Hyperledger Fabric to develop web applications for single organizations using three peer nodes. Three peer nodes are used by the organization, one serving as a validating peer node, while another serves as an ordering node (Kafka) that is used to register participants. In this system, multiple peers to access the corresponding database, IPFS for distributed storage of data, a Solo Order Node, a Data Certificate Authority, a Membership Service Provider and smart contracts for blockchain connectivity. In order to verify the system's scalability, multiple peers can be added to multiple locations on different machines. Smart contractors have access to ledgers and have ledger access through this framework. Peer nodes are connected to the application, which then updates the ledger via smart. The three peer nodes in the organization are peernode0 (PE0), peernode1 (PE1), and peernode2 (PE2), each of which contains its own ledger and smart contract copies. In Hyperledger Composer, a single channel (CH) facilitates communication with peers. This network generates a transaction T1 for our application APP1 and sends it to peernode0, peernode1, and peernode2. The chain codes are installed by the peers based on the execution of a transaction. When querying or altering the ledger, the application uses chain codes to interact with peers. WLtr(r), WLph(r), and the current transaction hash WLh(r) make up a block containing a patient's health record r in the ledger. The block workload can be calculated using WLTot(r)
WLTot(r) = WLtr(r)+ WLph(r) + WLh(r) (1)
1.Health Record Structure
The health record consists of patient’s profile, Diseases Diagnosed, Address Location, Medicine, Doctor Suggestion, Next Review Notes, Doctors Name, Hospital id, Scan and Test image reports.
2.Owner of Record
Patients own their medical records. A patient will have to create chain code PCHDMAC-SC on the Hyperledger blockchain and store it there. IPFS networks allow patients to define access rights to their health data. Each PCHDMAC-SC defines this within its own context.
3.Data Uploader
Physicians may upload their medical data to Data Uploaders. Adding encrypted clinical data of the affected person to the IPFS community and confirming the preliminary transaction at the blockchain are the high responsibilities of the data uploaders.
4.Data Users
All those interested in obtaining clinical or medical data about patients, whether they are physicians, hospitals, insurance companies, or researchers, are considered Data Customers. PCHDMAC-SC contains role-based access control mechanisms that defines how patients can grant access privileges to data users.
2.3 Data Encryption
The integrity and confidentiality of blockchain data is ensured by cryptographic techniques. Figure 2 outlines how patients and doctors interact when accessing health records. Bringing up the health records stored in the IPFS, the doctor requests permission to access it. As shown in Table1 and patients approve or grant requests from permissioned users based on their roles and rules-based access privileges. Rather than sharing all the information about the patient, it creates a patient-centric view of the records based on the request. Sk is used to access records in a definite session, and the patient-centric view is encrypted and stored in IPFS with the session key. Doctors and patients receive encrypted patient-centric views and encryption session key Sk. Doctors can decrypt Sk and patient-centric views for an update on the health record. The patient has been notified after the update of his record in IPFS. If the patient commits to his health record, then the Sk and the patient-centric view will automatically be deleted.
2.4 PCHDMAC-SC
In order to obtain access to the IPFS health record of the patient, the Doctor requests permission. Role-based access control permissions enable the patient to approve or deny requests from authorized users as shown in Table 1. Users or Doctors can only access health records if their access control permissions permit them to write, read and update them. In this health chain framework, other stakeholders such as Pharmacists and Lab Managers can only access the patient-centric view of the health records for a specific session if their object ID matches the ownership ID.
Table 1 Role and Rule Based Access and Authentication
Role Name
|
Permission By Patient
|
Health Record
|
Patient
|
Authorized
|
Read and write
|
Doctor
|
Authorized
|
Read and write
|
Pharmacist
|
Authorized
|
Patient Centric view Read
|
Receptionist
|
Authorized
|
Patient Centric view Read
|
Researcher
|
Authorized
|
Patient Centric view Read
|
Insurance Agent
|
Authorized
|
Patient Centric view Read
|
Referral Doctor
|
Authorized
|
Read and write in emergency
|
Lab Technician
|
Authorized
|
Read and write
|
2.5 PCHDM Algorithm
The four participants in our framework are Pa, D, Ph, and LT, where P is the patient, D is the Doctor, Ph Pharmacist, and LT is the lab technician. Hyperledger-CA issues public key certificates to n participants including patients, doctors, lab technicians, and pharmacists. A key pair will be generated for all the participants. Algorithm 1 explains that the patients Pan give grant access to Doctors Dn to access their health record HRn based on PCHDMAC-SC. Hence the system generates a patient centric view Pacvn of the health record HR. Based on the Doctor Dn request, the attribute-based data is retrieved from the Pacvn instead of sharing whole patient health records. In other words, the patient-centric view is a subset of the health record. Patient centric view data is encrypted using key value pairs, especially medical images that are encrypted using Steganography with the session keys. To update health, record the doctor should call the method update UPacvn. Then the patient must commit to the update. Then it added to IPFS storage permanently.
Algorithm1(): Create and Update the Patient centric view of the Health Record
Input: A Doctor Dn with their DPKi with session key Sk of Health Record HR
Output: Boolean (Success or Failure)
- Procedure of storing and updating health records
- For each user u having access permission to Health Record
- Check PCHDMAC-SC
- If (permission==” ALLOW” && role==” DOCTOR”) then
- Create patient centric view Pacvn of HR in IPFS
- Pacvn à Decryption (Encryption (HR))
- Create Sk for Pan and Dn
- Create_Update ()
- HRn à Decryption (Encryption (UPacvn ))
- Pan àCommit (HRn )
- Return 1
- Else
- Permission=Deny
- End if
- End procedure
|
Algorithm 2 Create_Update () Creating and updating health record in Hyperledger blockchain
Input: A Doctor Dn with their DPKn with session key Sk
Output: Storage of health record
- Procedure Doctor DPKn
- For each Doctor having DPKn with session key Sk
- Dnß Decrypt (DPKn (Sk ))
- Dnß Decrypt (Sk (Pacvn ))
- Pacvnà UPacvn
- IPFS Storage ßEncrypt (Sk (Pacvn))
- Algorithm1()
- End procedure
|
2.6 Implementation of PCHDM Protocol
The protocol has implemented as four steps
- Add Users
- Add Records
- Assuring Authorized Users Have Access
- Records retrieval