- Introduction
- Mission statement
- Key Features
- Planned Features
- Running the app
- Smart contract example
- Credits
- Contact
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).
To prevent fraud, reduce costs, and improve experiences for Providers, Pharmacies, and Patients in the prescription issuance process.
- 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
- 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
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.
// 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;
}
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.