Algorithm 5: Accessing patient’s medical records by the insurer |
Input: patientID, insurerID, Output: Records of the patient pragma solidity ^0.5.12; mapping(address => address) authorizedInsurer; if( isInsurerAuthorized(patientID)) { Get patient’s record from the database; transaction is recorded in the blockchain; } else Revert the transaction; function public isInsurerAuthorized(address patientID) public view return (bool display) { if(msg.sender == authorizedInsurer(patientID)) return true; else return false; } |