Inspiration

For decades, medical records are under the ownership of hospitals. It often it takes days to request a hospital to transfer a record, and sometimes impossible to transfer across countries.

When arrived at US for college, Jeffrey tried to transfer records of Covid vaccination from China, but rejected by local hospitals. He had to take two more dozes of Pfizer, suffering days of side effects like fever.

We want to change that. And that’s why we created MedChain - a true ownership of our medical records powered by blockchain technology.

What it does

MedChain is a blockchain-based electrical medical records (EMR) decentralized application (Dapp).

MedChain is powered by IPFS, where patients’ medical records are stored on the distributed file system, not owned by any centralized entity. A patient can access his or her records by interacting with a smart contract on the Ethereum blockchain, forming a digital identity of the patient on the decentralized network.

A healthcare provider can register using a crypto wallet like Metamask. The healthcare provider can register a patient by using the public address of the patient’s wallet , usually provided during an appointment.

The health provider can search for a patient’s records using the address, and upload a new record for the patient. The patient can also view his or her records, after connected with a wallet which address is registered by the health provider.

How we built it

There are three major components of MedChain:

  1. React client (connected with crypto wallet)
  2. Solidity smart contract on Ethereum (ETH) blockchain
  3. Interplanetary file system (IPFS)

The client first connects with crypto wallet, and use smart contract to mint a patient or doctor block if the public address of the user’s wallet is not registered.

The client can upload a record file to IPFS, which address is linked to a patient block in ETH chain. The client can get all record addressed stored in a patient block from smart contract, and get a record file by its address from IPFS.

Challenges we ran into

When incorporating web3.js to interact with smart contracts, some dependencies were incompatible with the default webpack configuration by create-react-app CLI. We searched for many solutions online but none could fix the problem.

Then we ran into a boiler template provided by Truffle for react with the Webpack configuration ready for web3.js. We decided to create a new project and github repository using that template, and migrated our existing changes to the new project. Although the migration took a while, we finally got our web3.js working.

Accomplishments that we're proud of

We were interested in blockchain and learned the concepts, but it's our first time developing a blockchain application. Although we spent two days and nights learning, coding, and debugging, it’s exciting to see the application turned out working as we planned.

We are also excited that our product could potentially help many people, especially healthcare providers, have an easier time accessing medical records. We hope our project can help push revolutionizing the current centralized, bureaucratic ownership of medical records held by hospitals and healthcare departments.

What we learned

We learned a lot of things during this hackathon:

  • Develop Solidity smart contracts and interact with them in React using web3.js
  • Run local blockchain network and debug smart contracts using Truffle and Ganache
  • Implement interaction with IPFS in React using Infura and ipfs-http-client
  • Configure webpack to deal with resolving fallback, plugins, etc.
  • Make a good demo video using Loom - it’s interesting :)

What's next for MedChain

  • Improve medical records with more customizable fields
  • Build more features to make MedChain as a complete EMR application, such as making appointments and transactions with healthcare providers
  • Develop mobile apps for patients’ use when having appointments with healthcare providers

Built With

Share this project:

Updates