Algorithm 3: Update patient prescription |
Input: patientID, doctorID, prescription Output: Patient record update with new prescription pragma solidity ^0.5.12; mapping(address => address) authorizedDoctor; if( isDoctorAuthorized(patientID)) { Update the prescription in the corresponding patient’s record; transaction is recorded in the blockchain; } else Revert the transaction; function public isDoctorAuthorized(address patientID) public view return (bool display) { if(msg.sender == authorizedDoctor(patientID)) return true; else return false; } |