Skip to content

Hack-the-epidemic hackathon project for preventing prescription fraud using blockchain.

License

Notifications You must be signed in to change notification settings

pi0neerpat/Pharma-Sign

Repository files navigation

Pharma-Sign

logo

Table of Contents

Introduction

Project for preventing prescription fraud using the Ethereum blockchain, as part of the "Hack the Epidemic" hackathon co-sponsored by ConsenSys Health and Booz Allen Hamilton (October 12-14, 2018).

Mission statement

To prevent fraud, reduce costs, and improve experiences for Providers, Pharmacies, and Patients in the prescription issuance process.

Key features

  • Fill out prescription data via ReactJS web form
  • Encrypt prescription data with pharmacy's public key
  • Upload encrypted prescription data to IPFS
  • Store the IPFS location hash in smart contract on ETH-public
  • Encode address of ETH-public smart contract in QR code

Planned features

  • Add Truffle/JS tests to ensure successfull encryption and decryption of prescriptions
  • Validate preferred pharmacy against External Pharmacy Registry via smart contract
  • Validate doctor's National Provider Identifier (NPI) number against External Provider Registry
  • Enforce prescription expiry date and number of refills
  • Test Pharma-Sign system on consortium blockchain
  • Send generated QR codes to patient's mobile app, wallet, or uPort account
  • Use AI/Machine Learning to identify patterns and detect fraud/waste/abuse in prescription data

Users, Roles, and Actions

logo

Running the app

To clone and run this application, you'll need Git and Node.js (which comes with npm) installed on your computer. From your command line:

# Clone this repository
$ git clone https://github.com/blockchainbuddha/Pharma-Sign

# Go into the repository
$ cd Pharma-Sign

# Install dependencies
$ npm install

# Run the app
$ npm start

A local Ganache blockchain server will start concurrently for testing purposes.

Smart contract example - PrescriptionsRegistry.sol

// This method creates a ledger in the chain for all Rx
// The prescriptionHash represents a pointer to the IPFS resource as well as the contents of the resource

function createPrescription(string prescriptionHash) public {

  require(stringNotNullNorEmpty(prescriptionHash), 'A prescription hash must be provided');

  // Require the hash is unique
  require(!_prescriptionHashesInUse[prescriptionHash], 'The prescription hash is already in use.');

  _prescriptions[prescriptionHash].PrescriptionHash = prescriptionHash;
  _prescriptions[prescriptionHash].PrescriberAddress = msg.sender;      
  _prescriptionHashesInUse[prescriptionHash] = true;
        
  // Increment prescription count
  _count++;
}
    
function getPrescriptionPrescriber(string prescriptionHash) public view returns (address) {
  return _prescriptions[prescriptionHash].PrescriberAddress;
}

Credits

This software uses the following development frameworks and open source packages:

  • Truffle - A development framework for Ethereum which makes it easy to deploy contracts to both public and private networks.
  • Ganache - Quickly fire up a personal Ethereum network to run tests, execute commands and inspect state.
  • Web3 - A javascript API to allow decentralized applications to talk with a node. Maintained and managed by the core Ethereum project.
  • IPFS - A protocol and network designed to create a content-addressable, peer-to-peer method of storing and sharing hypermedia in a distributed file system.
  • Metamask - A browser extension that makes it easy for users to interact and sign transactions for decentralized applications.

Contact

About

Hack-the-epidemic hackathon project for preventing prescription fraud using blockchain.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •