Patient data management solution built on Hyperledger Fabric provides a highly secure and scalable platform for sharing patient data across healthcare providers.
With advanced features such as smart contracts, access control, and consent management, we ensure that patient data is accessed only by authorized parties and in a transparent manner
Our solution is designed to integrate seamlessly with existing healthcare systems, allowing healthcare providers to access patient data without disrupting their workflows. With a focus on patient privacy and security, our solution empowers healthcare providers to make informed decisions and deliver the best possible care to their patients..
Follow the instructions given in the link to install necessary tools and to configure the system: https://hyperledger-fabric.readthedocs.io/en/latest/prereqs.html
Follow the instructions to successfully setup the hospital network.
- Clone / Download the repository
$ git clone https://github.com/salaimuniselvam-s/patient-data-management-using-hyperledger-fabric
-
Before starting with the network is set-up start the docker.
-
Run the following command to pull the docker images.
$ curl -sSL https://bit.ly/2ysbOFE | bash -s -- 2.0.1 1.5.5 -s -b
It will pull the respective fabric docker images for the binaries.
- Change the working directory to hospital-network
$ cd ./hospital-network
- Use the following command to start the network, with 2 organization hospital1 and hospital2 with one peer each (peer0) and an Orderer node & then create an hospital-channel & deploy & Instantiate the hospital Contract on two peers.
$ ./hospitalNetwork.sh up
- Use the Following Command to test the Chaincode is Successfully Installed & Instantiated on Two Peers
$ ./hospitalNetwork.sh validate
- Use the Following Command to Pause the hospital network (it will stop all the containers but does not remove the ledger details)
$ ./hospitalNetwork.sh pause
- Use the Following Command to Start the paused network
$ ./hospitalNetwork.sh start
- Use this command to bring the network down
(Note: this will remove all the ledger details )
$ ./hospitalNetwork.sh down
Hospital Node Server is a Node.js server for connecting Client apps to hospital fabric network for interacting with hospital chaincode using http api endpoints.
- Change the working directory to /hospital-sdk/fabric-network
$ cd ./hospital-sdk/fabric-network
- Install dependencies
$ npm install
this will install the packages used for connecting fabric-client to the fabric network
- Change the working directory to /hospital-sdk/node-server
$ cd ./hospital-sdk/node-server
- Install dependencies
$ npm install
- Set up environment variables
$ cp .env.example .env
It will set the admin credentials for the mongodb containers into the .env file.
(Note: Modification of the credientials in the .env file will lead to connection error with the mongodb container.)
- Start the server
$ npm start
This will start the server on port 3001.
- Register and Enroll the Users. In Another Terminal, run the following command.
$ npm enroll
This will register,enroll and Create Wallet for Test users.
- Access the Swagger documentation
$ http://localhost:3001/api-docs/
This will open the Swagger UI, which provides an easy way to explore and test the API.
This is a web application for a hospital client to interact with the hospital chaincode deployed on hospital Fabric Network for managing Patient Data. It is built with Next.js, React, Redux, and other popular libraries.
To get started with this project, you will need to have Node.js installed on your computer.
- Change the working directory to /hospital-client
$ cd ./hospital-client
- Install dependencies
$ yarn
- After installing the dependencies, you can start the development server with the following command:
$ npm run dev
The development server will start at http://localhost:3000 by default. Open this URL in your web browser to view the application.
Below Test User Credentials are Created When running npm enroll in the hospital Node Server.
username | password | role |
---|---|---|
hosp1admin | hosp1adminpw | admin |
hosp2admin | hosp2adminpw | admin |
Raj Kumar | temp-password | patient |
Deepan Raj | temp-password | patient |
Mahesh Kumar | temp-password | patient |
Viki | temp-password | patient |
Ramesh | temp-password | patient |
Rajesh Kumar | temp-password | doctor |
Kailash Balaji | temp-password | doctor |
Deepak | temp-password | doctor |
Mahesh Babu | temp-password | doctor |
hosp2doctor | temp-password | doctor |
- To start the network with hospital-client and hospital-sdk as a docker container, you can use the following command.
$ cd ./hospital-network
$ ./hospitalNetwork.sh quickstart
It will setup the hospital-fabric-network, and also start the hospital-client web app in a container.
You can access the hospital-web-app in localhost:3000
- Use the follwing command to bring down the hospital-network, hospital-client and sdk containers
$ ./hospitalNetwork.sh shutdown
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 containers.
$docker stop $(docker ps -a -q)
- Remove the containers
$docker rm -f $(docker ps -aq)
- Remove all unused images not just dangling ones
$docker system prune -a
- Remove all unused local volumes
$docker volume prune
-
Restart the docker.
-
Once the docker is up ,open a new terminal and download the images. (same as Step 3 in Bring up the network section)
$ curl -sSL https://bit.ly/2ysbOFE | bash -s -- 2.0.1 1.5.5 -s -b
We would like to express our gratitude to the following individuals and organizations for their contributions and support to our Fabric project:
- The Hyperledger Fabric community for developing and maintaining such a powerful and flexible platform for enterprise blockchain solutions.
- The authors and contributors of the following open-source projects, which we used extensively in our project:
- Network Samples by Hyperledger Fabric
- Patient Data Management Project by Sgirdhar, Vineet Bhat, Towfi Caziz and Faraz Shamim
-
This project is not yet production-ready and is intended for learning purposes only.
-
This project is a Hyperledger Fabric network implementation that showcases the basic features of Fabric and demonstrates how to interact with the network using chaincodes.
-
We created this project as a learning exercise to help us understand the basics of Fabric and how to build decentralized applications using the platform. We hope that it can serve as a starting point for others who are also interested in learning more about Fabric.
-
Please keep in mind that this project is a work in progress and may contain bugs or other issues. We welcome feedback and contributions from the community to help improve the project.