Last active
June 14, 2020 07:52
-
-
Save zaryab2000/4ae1de26fc7a9cb0696cf96567af8ee1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Function to add a New Patient | |
function setPatientData(string memory _name, string memory _disease,string memory _ipfsHash) public payable onlyOwner{ | |
//GENERATING a UNIQUE ID for Patient | |
address pid = address(bytes20(keccak256(abi.encodePacked(msg.sender,now)))); | |
patientList[pid] = Patient(now,0,0,_name,_disease,' ',_ipfsHash,0x0000000000000000000000000000000000000000,pid,true,false); | |
// Adding Insurance Amount | |
patientList[pid].insuranceAmount = msg.value; | |
//Increasing Patient Count by 1 | |
pidCount++; | |
pidList[pidCount] = pid; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment