Patient Record Management System based on blockchain technology
Running in Remix IDE
-
Intial Procedure
- Copy the code present in the
contracts/Record.sol
- Paste it in the Remix IDE inside
contracts/
folder in the<filename>.txt
- Then compile it,
- And finally deploy it.
- Copy the code present in the
-
First of all we will add doctor
-
Now we will check if Doctor was added or not.
-
Now lets go ahead and register the doctor.
-
Now its time to add patient to our contract.
-
Lets check if our Patient is added or not.
- It is same as that of checking Doctor.
- Go on and find
patients
section, provide address of patient and clickcall
button.
Suppose you are sufferring from fever and you visit the doctor and doctor examines you give you medicine. But suffering from disease is life long process and one cannot rememeber all those medication. So by this contract we are going to store the medical report of the Patients.
But before getting start, ** We only want our medical report to be update by the doctor whom we have be diagnosis** so first of all we will give Doctor permission to update our medical report and then Doctor will update and then after we will remove Doctor Permission to update medical reports.
-
Giving Permission to Doctor to update Medical Reports.
-
Checking the permission
-
Writing Medical Reports
-
Retrieving those written Medical Report
-
Lastly removing permission
You can also setup this project in you local machine, run test case and integrate with frontend of Dapp you have created.
nodejs
-
First of all install the node modules along with hardhat
npm install --save-dev hardhat
You can see that it has created a folder
node_modules
-
Compile the solidity file
npx hardhat compile
It will show "Compiled 1 solidity file successfully"
-
For testing you need to install some other packages. So go on install it
npm install --save-dev @nomiclabs/hardhat-ethers ethers @nomiclabs/hardhat-waffle ethereum-waffle chai
-
Run the test script
npx hardhat test
Inside the script folder you can find your deployment script.
-
Open two terminal
-
First of all install the require library.
npm install --save-dev @nomiclabs/hardhat-ethers ethers @nomiclabs/hardhat-waffle ethereum-waffle chai
-
One one terminal run
npx hardhat node
-
On another terminal, run:
npx hardhat run scripts/deploy_record.js --network localhost
- You will notice some change on the terminal where you have execute
npx hardhat node
command and on your working tree a folder will be created which contain the address used to deploy contract and ABI code of smart contract.