-
Notifications
You must be signed in to change notification settings - Fork 0
/
doctor.sol
54 lines (38 loc) · 1.47 KB
/
doctor.sol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;
/**
* @title Medical records
* @dev Store & retreive Doctor details
*/
contract Doctor {
mapping(uint256 => doctor) doctorlist;
struct doctor{
string doctor_name;
string doctor_specialisation;
uint256 doctor_ph_no;
string doctor_address;
}
doctor d;
/**
* @dev Store doctor details
* @param doctor_id doctor id
* @param _doctor_name name of doctor
* @param _doctor_specialisation specialisation of doctor
* @param _doctor_ph_no doctor phone number
*/
function store_doctor_details(uint16 doctor_id,string memory _doctor_name,string memory _doctor_specialisation,uint256 _doctor_ph_no,string memory _doctor_address)public isOwner {
d.doctor_name = _doctor_name;
d.doctor_specialisation = _doctor_specialisation;
d.doctor_ph_no = _doctor_ph_no;
d.doctor_address = _doctor_address;
doctorlist[doctor_id] = d;
}
/**
* @dev Retreive doctor details
* @param doctor_id doctor id
* */
function retreive_doctor_details(uint16 doctor_id) public view returns (string memory,string memory,uint256,string memory){
doctor memory d = doctorlist[doctor_id];
return (d.doctor_name,d.doctor_specialisation,d.doctor_ph_no,d.doctor_address);
}
}