Algorithm 4: Accessing patient’s prescription |
Input: patientID, pharmaID, Output: Prescription of the patient pragma solidity ^0.5.12; mapping(address => address) authorizedPharma; if( isPharmacyAuthorized(patientID)) { Get prescription of the patient from the database transaction is recorded in the blockchain; } else Revert the transaction; function public isPharmacyAuthorized(address patientID) public view return (bool display) { if(msg.sender == authorizedPharma(patientID)) return true; else return false; } |