This project is a healthcare records management system built on the Hyperledger Fabric blockchain. It allows patients to securely store and share his records with different healthcare providers, like doctor, pharmacy, lab. Patient can even claim for insurance for a record using the same system. This ensures patient privacy and data security.
Verify that you have the following installed:
$ node -v
v16.20.0
$ npm -v
8.19.4
$ docker -v
Docker version 23.0.1, build a5ee5b1
$ docker-compose -v
Docker Compose version v2.15.1
$ git --version
git version 2.39.2
Clone the repository
$ git clone https://github.com/raj-71/heathcare-hyperledger.git
$ cd heathcare-hyperledger
Add .env file as specified in the backend folder
Start the hyperledger fabric network
$ ./fablo up fablo-config.json
$ cd backend/config
$ ./generate-ccp
Start the backend server
$ cd backend
$ npm install
$ node app.js
Start the frontend server
$ cd client
$ npm install
$ npm start
Open the frontend server in browser
http://localhost:3000
You have to add admin credentials in mongodb manually with the format given below in users file to create Doctor, Pharmacy, Lab, Insurance users
{ userName:"your_user_name" orgName: "Admin" userId:"your_user_id" password:"password" }
Incase if any of the commands fail due to configurations or the network was not brought down properly use the following commands to clear the corrupted docker images and fix the issue.
Stop the network
$ ./fablo down
Again Up the network
$ ./fablo up fablo-config.json
Stop the containers
$ docker stop $(docker ps -a -q)
Remove the containers
$ docker rm $(docker ps -a -q)
Remove all local volumns
$ docker volume prune
Remove all wallets
$ rm -rf /backend/*-wallet
Authorization error code 71 -> Regenerate all connection profies in backend
$ cd backend/config
$ ./generate-ccp
Incase of affiliation error -> authorization error code 20
Copy paste these lines in all the fabric-ca-server-config.yaml (total 6 such files) files in the network. File locations:
/fablo-target/fablo-config/fabric-ca-server-config/*.healthcare.com/fabric-ca-server-config.yaml
affiliations:
patient:
- department1
doctor:
- department1
pharmacy:
- department1
lab:
- department1
insurance:
- department1
Project Work: CS731 - Blockchain Technology and Application Professor: Angshuman Karmakar