Created
February 27, 2018 16:56
-
-
Save fabdarice/9fbc2bfc90c06cff3f84acb8f9d46476 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
import './MedicalRecord.sol'; | |
contract Hospital { | |
MedicalRecord public medicalRecord; | |
function Hospital(address _contract) public { | |
medicalRecord = MedicalRecord(_contract); | |
} | |
function enterHospital(bytes32 _fullName) public { | |
medicalRecord.addAdmissionRecord(_fullName); | |
} | |
} |
This file contains hidden or 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
contract MedicalRecord { | |
struct Visit { | |
uint admissionDate; | |
uint dischargeDate; | |
} | |
mapping(address => mapping(bytes32 => Visit)) visits; | |
function addAdmissionRecord(bytes32 _fullName) external { | |
visits[msg.sender][_fullName].admissionDate = now; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment