Report Major Project
Report Major Project
Report Major Project
BACHELOR OF ENGINEERING IN
Submitted by
This is to certify that the work reported in the major project entitled “MEDBLOCK: A
Blockchain Based EHR” is a record of the bonafide work done by us in the Department
Technology, Osmania University. The results embodied in this report are based on the
project work done entirely by us and not copied from any other source.
ii
ACKNOWLEDGEMENT
Our hearts are filled with gratitude to the Almighty for empowering us with courage,
wisdom and strength to complete this project successfully. We give him all the glory,
honor and praise.
We thank our Parents for having sacrificed a lot in their lives to impart the best education
to us and make us promising professionals for tomorrow.
We would like to express our sincere gratitude and indebtedness to our project supervisor
Dr Maniza Hijab for her valuable suggestions and interest throughout the course of this
project.
We are happy to express our profound sense of gratitude and indebtedness to Prof. Dr
Syed Shabbeer Ahmed, Head of the Computer Science and Engineering Department, for
his valuable and intellectual suggestions apart from educating guidance, constant
encouragement right throughout our work and making us successful.
We are pleased to acknowledge our indebtedness to all those who devoted themselves
directly or indirectly to make this project work a total success.
RAJ MOHAMMED
i
Abstract
Any developments, simple or complex, that lead to improvements in health outcomes and
patient experiences are healthcare innovations. Right now, the healthcare sector is facing
many large challenges, such as stringent regulations, privacy concerns and steeply rising
costs. Many leaders and healthcare professionals are turning to new technologies and
informatics to develop smarter and secure types of healthcare delivery. These innovations
are important because as networks of people and technology become more interconnected,
healthcare organizations are going to need better tools for solving health challenges at larger
scales. The COVID-19 pandemic in particular has demonstrated there is a strong need for
better data systems and information exchange. healthcare innovations will give clinicians and
healthcare organizations the tools they need to focus more on the needs of their patients and to
help people improve their lives.
The privacy and security of the patient’s data is at risk as there is no authority of patient over
the data collected by medical institutions leaving the data prone to transgression.
i
This system was developed using the Ethereum network using Ganache, as well as
programming languages, tools, and techniques such as Solidity and web3.js. The measured
approach suggested in this paper uses this platform to store patients’ data and execute
functions in a decentralized system using blockchain smart contracts. Transactions are
communicated through the smart contract once it has been launched, providing security and
privacy features.
v
CONTENTS
TITLE
CERTIFICATE i
DECLARATION ii
ACKNOWLEDGEMENT iii
ABSTRACT iv
1. IINTRODUCTION
1
1.1 OVERVIEW 1
1.2 PROBLEM STATEMENT 2
OBJECTIVE 3
2. LITERATURE SURVEY
4
2.1 INTRODUCTION 4
2.2 DISADVANTAGES OF TRADITIONAL EHR 4
2.2.1 PRIVACY CONCERN 4
2.2.2 INTEROPERABILITY CHALLENGE 4
2.2.3 COST OF IMPLEMENTATION CHALLEANGE 4
2.2.4 DATA INTEGRITY AND SECURITY 5
v
3. SYSTEM ANALYSIS
10
3.1 PROBLEMS WITH EXISTING SYSTEM 10
3.2 PROPOSED SYSTEM 11
3.3 FEASIBILITY STUDY 12
3.3.1 TYPES OF FEASIBILITY 12
3.3.1.1 TECHNICAL FEASIBILITY 12
3.3.1.2 OPERATIONAL FEASIBILITY 13
3.3.1.3 ECONOMICA FEASIBILITY 13
4. SYSTEM DESIGN
16
4.1 GENERAL ARCHITECTURE 16
4.2 SYSTEM ARCHITECTURE 17
4.3 PROTOCOL LAYOUT 18
4.4 SYSTEM WORKING 20
4.4.1 ETHERIUM 20
4.4.2 SMART CONTRACTS 20
4.4.3 IPFS 21
4.5 FLOWCHART 21
4.6 USECASE DIAGRAM 22
4.7 WORKFLOW DIAGRAM 23
4.8 SWIMLANE DIAGRAM 23
v
5. IMPLEMENTATION
24
5.1 BACKEND 24
5.1.1 DEPLOYING ETHERIUM BLOCKCHAIN 24
5.1.2 SMART CONTRACT CONNECTION 25
5.1.3 ACCOUNT CREATION THROUGH SMART
CONTRACTS 26
5.1.4 INSTALLING DEPENDENCIES 28
5.1.5 COMPLING AND DEPLOYING SMART CONTRACTS 29
5.2 CODE FOR QUICK SUMMARY 31
6. TESTING
38
6.1 UNIT TESTING 38
6.2 TESTING FRAMEWORKS 38
6.3 SOLIDITY FOR TESTING 39
6.4 TEST STRUCTURE 39
6.4.1 ASSERTIONS 39
6.4.2 DEPLOYED ADDRESSES 39
6.5 TESTING ETHER TRANSACTIONS 40
6.6 SOLIDITY RESTING RESULTS 40
7. SCREENSHOTS
41
8. CONCLUSION
45
9. FUTURE ENHANCEMENTS
46
10. REFERENCE
47
v
LIST OF FIGURES
v
1. INTRODUCTION
1.1 OVERVIEW
Blockchain technology is a massive scale tagging system for distributed electronic
database secured by cryptography in which it could prove the time, integrity and identity
for people and machines without relying on traditional systems. In traditional databases,
access authority is governed by the centralized authentication system. Hence, it is difficult
for many people to access the database at the same time due to limited right credentials
given by this centralized authenification system and the limited capacity. In Blockchain
like a distributed ledger, individual transactions (unique blocks) are encrypted into blocks
by the relevant encryption, added to the ledger (the chain) and never removed. The data in
Blockchain is secured primarily by a linked list of encrypted transactions that uses a hash
rather than a pointer. Hash function can create a hash value by encryption of input data in
Blockchain technology. These components, incorporating the applicable criteria that
follow.
The main benefit of Blockchain technology is that there is no central authority to control
the database, yet the database can still represent a single source of truth. Its technical
design has evolved through a number of iterations by using hash functions like human
fingerprints and a mathematical operation which creates a trace or digest of the transaction.
Hash functions are the one way to verify that fingerprint matches a specific person, but
without the ability to create the person from the fingerprint. Equivalently, a hash value
uniquely identifies data and has the ability to recreate it. Moreover, the power of network is
that it can spread the processing of the database is valid by verifying valid information over
different nodes, or processing units and trust maintained through encryption
1
1.2 Problem Statement
The healthcare industry generates and manages vast amounts of sensitive and personal
data, including patient records, clinical trial data, and medical research. However, this data
is often fragmented and siloed across various systems, making it difficult to access and
share securely. Furthermore, existing methods of storing and sharing healthcare data, such
as electronic health records (EHRs) and health information exchanges (HIEs), are often
prone to security breaches, data manipulation, and unauthorized access.
These issues highlight the need for a secure and transparent method of storing and sharing
healthcare data. Blockchain technology has the potential to address these challenges by
creating a secure, tamper-proof, and decentralized network for storing and accessing
healthcare data. However, implementing blockchain in healthcare data access presents its
own set of challenges, such as regulatory compliance, standardization, interoperability, and
user adoption.
Therefore, the problem statement for blockchain in healthcare data access is how to design
and implement a blockchain-based solution that ensures the secure and transparent sharing
of healthcare data, while also addressing the challenges of regulatory compliance,
standardization, interoperability, and user adoption. Every Medical Institution keep the
patient’s data in their respective IT Systems, prompting a divided system and databases
that are not interconnected.
The privacy and security of the patient’s data is at risk as there is no authority of the patient
over the data collected by medical institutions.
2
1.3 Objective
The objective of this study is to develop a blockchain-based system that helps in the
security and management of patient data. This system uses blockchain technology with
smart contracts to establish an iterative, secure, accessible, and decentralized healthcare
ecosystem. People will be able to freely and securely share their medical records with
doctors, hospitals, research institutions, and other groups while having complete control
over their medical data privacy.
3
2. LITERATURE SURVEY
2.1 Introduction
The literary survey of existing electronic health record (EHR) management systems
highlighted some of the most commonly used systems in the healthcare industry. However,
while these systems offer many benefits, they also have some disadvantages that may limit
their effectiveness. In recent years, blockchain technology has emerged as a potential
solution to many of the challenges faced by traditional EHR systems. This paper will
explore the disadvantages of traditional EHR systems and how blockchain technology can
address these challenges.
One of the most significant challenges facing traditional EHR systems is security and privacy
concerns. Traditional EHR systems store patient information in centralized databases that can
be vulnerable to cyber-attacks. Hackers can gain access to patient data, which can be used for
identity theft or fraud. Traditional EHR systems also raise concerns about patient privacy, as
healthcare providers have access to sensitive patient information that can be misused.
Traditional EHR systems often face interoperability challenges, as they are designed to
operate within their own closed ecosystems. This means that it can be challenging to share
patient data between different healthcare providers and systems. This can result in delays in
care delivery and can lead to medical errors, as healthcare providers may not have access to a
patient's complete medical history.
Traditional EHR systems can be expensive to implement, as they require significant upfront
costs for hardware, software, and training. Smaller healthcare providers may not have the
resources to invest in these systems, which can limit their ability to provide quality patient
4
care. Additionally, traditional EHR systems can be complex and challenging to implement,
which can lead to delays and disruptions in care delivery.
Traditional EHR systems may have data integrity and accuracy issues, as they rely on a
centralized database that is prone to errors. Healthcare providers may accidentally enter
incorrect data, which can lead to medical errors and harm patients. Additionally, traditional
EHR systems do not provide patients with full control over their data, which can lead to
concerns about data accuracy and completeness.
Epic is one of the most widely used EHR management systems in the United States. It is a
comprehensive system that includes modules for patient scheduling, medical billing, and
clinical documentation. Epic is also highly customizable, allowing healthcare providers to
tailor the system to their specific needs. However, Epic can be expensive to implement, and
some users report that the system can be difficult to use.
5
2.3.2 Cerner EHR
Cerner is another popular EHR management system that is widely used in the healthcare
industry. Like Epic, Cerner is a comprehensive system that includes modules for patient
scheduling, medical billing, and clinical documentation. Cerner is also highly customizable
and has a user-friendly interface. However, some users have reported that the system can be
slow and prone to errors.
6
2.3.4 Meditech EHR
Meditech is a comprehensive EHR management system that includes modules for patient
scheduling, medical billing, and clinical documentation. It is also highly customizable and has
a user-friendly interface. Meditech is also known for its excellent customer support. However,
some users have reported that the system can be slow and that it can be difficult to learn.
8
2.3.8 Kareo EHR
Kareo is a comprehensive EHR management system that includes modules for patient
scheduling, medical billing, and clinical documentation. It is also highly customizable and has
a user-friendly interface. Kareo is also known for its excellent customer support. However,
some users have reported that the system can be slow and that it can be difficult to learn.
Practice Fusion is a cloud-based EHR management system that is designed to be easy to use.
It includes modules for patient scheduling, medical billing, and clinical documentation.
Practice Fusion also includes a patient portal that allows patients to access their
3. SYSTEM ANALYSIS
9
3.1 Problems with existing system:
Healthcare data is highly sensitive and confidential, and its access and storage have always
been challenging. Traditional systems for healthcare data access often lack the security and
transparency that is required to protect sensitive information. These systems also suffer
from several other problems.
One of the main problems with traditional systems for healthcare data access is the lack of
interoperability. Different healthcare providers use different systems and technologies,
which makes it difficult to share information seamlessly. This can lead to delays in
diagnosis and treatment, as well as errors in medication and dosage.
Another problem with traditional systems is the risk of data breaches and cyber attacks.
Healthcare data is a valuable target for hackers, and traditional systems often lack the
security measures required to protect against these threats. This can lead to the theft of
sensitive information, which can be used for fraudulent activities.
Moreover, traditional systems often lack transparency, and patients may not have complete
control over their data. This can lead to a lack of trust between patients and healthcare
providers, which can hinder the delivery of effective healthcare.
Overall, these problems highlight the urgent need for a more secure, transparent, and
interoperable system for healthcare data access, which could be provided by blockchain
technology.
The proposed system would allow patients to have complete control over their healthcare
data, including who has access to it. The data would be encrypted and stored in a
decentralized manner on the blockchain, ensuring that it is secure and cannot be altered
without the patient's permission. Patients would be able to grant access to doctors,
hospitals, and other healthcare providers as needed, which would streamline the process of
sharing medical records and other important healthcare data.
Furthermore, blockchain technology allows for the creation of smart contracts, which are
self-executing contracts that automatically enforce the terms of an agreement. This could
be used in the proposed system to create contracts between patients and healthcare
providers, ensuring that the terms of data access and usage are clearly defined and
enforced.
The system would use a blockchain network to store encrypted healthcare data in a secure
and tamper-proof manner. Patients would have complete control over their data and could
grant access to doctors, hospitals, and other healthcare providers as needed. The use of
blockchain technology would ensure that patient data is not altered, deleted, or accessed
without the patient's consent.
Finally, MetaMask, a browser extension that enables users to interact with Ethereum
dApps, would provide an easy-to-use interface for patients to manage their healthcare data.
Patients would be able to control who has access to their data and could revoke access at
any time.
1
3.3 Feasibility Study:
The feasibility study is the test of a system proposal according to its workability, impact on
the organization, ability to meet user needs, and effective use of resources. It focuses on
the evaluation of existing systems and procedures analysis of alternative candidate system
cost estimates. A feasibility analysis was done to determine whether the system would be
feasible.
The development of a computer-based system or a product is more likely plagued by
resources and delivery dates. The feasibility study helps the analyst to decide whether
or not to proceed, amend, postpone or cancel the project, particularly important when the
project is large, complex, and costly.
Once the analysis of the user requirement is complemented, the system has to check for
the compatibility and feasibility of the software package that is
aimed. An important outcome of the preliminary investigation is the determination that the
system requested is feasible.
1. Technical Feasibility
2. Operational Feasibility
3. Economical Feasibility
The application can be developed with the current equipment and has the technical
capacity to hold the data required by the system.
1
3.3.1.2 Operational Feasibility:
This proposed system can easily be used on any device i.e, it will adapt to devices of any
screen resolution like pc, tablets, mobile, etc. The user with the knowledge of using mobile
phones or laptops can easily use the application as the user interface is very user-friendly.
If benefits outweigh costs, then the decision is made to design and implement the system.
An entrepreneur must accurately weigh the cost versus benefits before taking an action.
This system is more economically feasible and budget-friendly, so it is economically a
good project.
1
3.4 Software and platforms used:
3.4.1 Ganache
It is a local Ethereum blockchain for the rapid creation of decentralized programs. Ganache
can be used to deploy, develop, and test in a predictable and secure environment
throughout the development cycle. It works both ways: as a desktop program and as a
command-line tool (Ethereum).
3.4.2 MetaMask
It is an entry point that allows you to view the decentralized web of the future in your
browser right now. It allows you to execute Ethereum decentralized applications without
having to run a full Ethereum node in your browser.
3.4.3 Web3
Verification of transactions should be done in the chain in order to interact with the
modules in the chain. To generate and verify a transaction, a participant in the network of
another offline framework must relay it to the peer-to-peer (p2p) connection, which is an
actual network. It also includes a library collection that makes it easier for Ethereum nodes
and in-chain components to communicate. It is utilized on the server side for Node.js.
Web3 uses the Hypertext Transfer Protocol (HTTP) connection to connect to the Ethereum
network via an Ethereum node. This could be a node in ETH wallets from the local system.
MetaMask is an in-browser extension that allows you to operate from Ethereum accounts
and can be used to integrate Ethereum with the website. MetaMask is a browser-based
Ethereum wallet that connects the browser to a Web3 provider class. A Web3 provider is a
data structure that provides a link to Ethereum nodes that are publicly available. A user can
utilize, save, and maintain public and private keys that are unique to their account with the
use of MetaMask. The combination of Ethereum, MetaMask, and web3.js, as well as a web
interface, allows for back-end–front-end communication.
3.4.4 Truffle
1
as well as an asset pipeline and a test framework for the same. It has some features, such as
computation, implementation, and maintenance of smart contracts, as well as binary
dependency management. It also has an environment for testing smart contracts that is
fully automated and a deployment and migration framework that can be scripted and
expanded. It can create direct communication with the contract and a pipeline with tight
integration. The Truffle environment is used to run programs.
3.4.5 VS Code
Microsoft’s Visual Studio Code is an editor for Windows, Linux, and macOS.
Troubleshooting, Git management, GitHub, syntax underlining, smart code completion,
samples, and bug fixes are all available.
3.4.6 Languages
The front-end design of our website has been created using HTML (Hypertext Markup
Language), CSS (Cascading Style Sheets), and React.js. The server and back-end of the
website are controlled using the Solidity programming language and Node.js. There are
two tools, Truffle and Ganache, which are used for generating local Ethereum blockchains
to build the system. The Ethereum virtual interface, MetaMask (as a wallet), Truffle (as an
IDE), Yarn (command-line interface), Ganache (account creation), and Local Web3 (web
interface) are used to establish the blockchain and access or use the system.
1
4. SYSTEM DESIGN
1
4.2 System Architecture
1
4.3 Protocol layout
Explanation:
Figure 1 demonstrates the layout of the system whenever a patient chooses to view the
medical records using MetaMask or the healthcare system’s decentralized website. By
accessing the private key from the Ethereum wallet, the user is automatically logged in. The
Ethereum wallet is a cold storage wallet. As a result, when compared to other hot wallets, the
danger of compromise is quite low. Furthermore, if the gadget is misplaced, the patients can
simply be given a new one without being penalized for losing their medical records. The
wallet can be used in the same way to sign any document or for any verification needs. This
wallet can also be used to perform multiparty patient verification. It can be used to build a
role-based access control system for records as well as a blockchain-based distributed
1
property identification system. In the event of a medical emergency, a similar multiple-party
permission mechanism can be implemented to gain access to the patient’s records.
1
4.4 System working
4.4.1 Ethereum
Transactions are the means by which external entities connect with Ethereum. External
users can use it to change the status of a document or set of data on the Ethereum
blockchain network. There are some pieces that make up an Ethereum transaction, such as
the sender–author, with a 20-byte address, and the receiver, who also has a 20-byte
address. Even though there is a cost (the quantity of money transferred from the source to
the destination and gas), each transaction on the blockchain network necessitates the
payment of a cost by the author. Gas is the name given to this cost. The gas limitations and
costs are included in every transaction, and the price of gas is the amount of money that the
author of the transaction is willing to pay for gas. There is a lot of gas that can be spent on
this transaction.
A smart contract is a set of commands that can be used to carry out any transaction on the
blockchain. When users send transactions, this piece of code is run. They operate directly
on the blockchain, rendering them impervious to manipulation and modification. Smart
contracts deploy the Solidity programming language to program any form of activity on the
blockchain. The programmers can compile the required operations after they have been
programmed. They could then be run and deployed on the Ethereum blockchain after being
compiled. JavaScript is a programming language that implements Ethereum’s Solidity
language for writing the smart contract code.
2
4.4.3. Interplanetary File System (IPFS)
IPFS is a distributed data storage technology with a peer-to-peer network. Because IPFS
data is safe from alteration and assures secure data storage, any attempt to alter data saved
on IPFS can only be performed by changing the identifier. Hence, it provides a
cryptographic identity to protect data from manipulation. Every data file stored on IPFS
contains a cryptographically generated hash value. It only has one value and is used to
identify data files stored on IPFS. The IPFS protocol makes use of a peer-to-peer (P2P)
connection that includes an IPFS object, which contains data and linkages. The data is an
array of disorganized binary values, while the link is a disorderly binary value. The IPFS
protocol functions as follows:(i)IPFS files have a unique cryptographic hash allocated to
them(ii)On the IPFS network, duplicate files are not permitted
The Ethereum transaction is the next stage. Ganache is required for Ethereum transactions
since it provides addresses and private keys. The addresses are kept on file, and the
transactions are visible to all. To carry out a transaction, the private keys are utilized to unlock
these addresses. The Ethereum Virtual Machine (EVM) is used to process Ethereum
transactions. The EVM is primarily used to conduct smart contract interactions, in which all
nodes must agree that the transaction occurred every time someone interacts with the contract.
2
After that, the EVM executes an immediate post contract in accordance with the transaction’s
rules.
Ethereum retains a record of all previous transactions and the blockchain’s history, which is
kept and confirmed through consent. Ethereum’s node operators, on the other hand, keep track
of all smart contract interactions that take place on the Ethereum network. In this situation, the
miner will be turned into a bot that will process transactions automatically whenever a
transaction is received.
2
4.7 Work Flow diagram:
2
5. IMPLEMENTATION
To implement the application, we have designed all the components required
physically on paper fist then implemented the same using Etherium.
Figure 5.1.1
The first step on the back-end is to download and install Ganache Ethereum from the Truffle
Suite. The Truffle Suite is a world-class development environment for decentralized
applications (dapps) and smart contracts on the blockchain. After completing the Ganache
2
installation, you must establish a new workspace named the ehr_project. Then, in the project
directory, add the Truffle from truffle-config.js. After that, this will show secure unique
addresses, the index, balance, and corresponding private keys to create accounts for accessing
the system. The Ganache will keep the accounts’ privacy and serial numbers safe.
Figure 21 depicts the system’s connection via smart contracts. MetaMask is utilized as a smart
contract to connect to the system. Contracts are created that provide metadata about record
titles, access, and data integrity. Cryptographically signed instructions for controlling these
characteristics are included in this system’s blockchain transactions. Only legal transactions
ensuring data alternation are used by the contract’s state-transition functionalities to carry out
policies. As long as a medical record can be stored electronically, these laws can be built to
enforce any set of rules controlling it.
2
Figure 5.1.2
This smart contract, which is run on blockchain technology, might be designed to include all
of the conditions such as handling various permits and data access. It can be observed that a
number of stakeholders are involved in this scheme, each performing different tasks. This will
make it easier for doctors and patients to communicate. Smart contracts include data
authorization rules. It can also assist in tracing all activities associated with a unique ID from
the point of origin to the point of submission. Different situations have been created and
explained, as well as all of the functions and procedures that are included in the smart
contracts.
The function can be supervised and approved directly through the smart contract. There is no
need for a centralized authority to do so, which decreases the cost of the administration
significantly. To enhance efficiency, all medical record data are saved in a local database
storage.
2
Figure 5.1.3
Figure 5.1.4
2
Figure 5.1.5
Figure 5.1.
(3) Ganache Ethereum (account address), (4) addition of the private key, and (5) account creation.
Figure 23 illustrates the package installation and execution process of the system using Yarn
dependencies. Yarn package management is used to run the system from the command line. It
is simple to use and share. Yarn handles this procedure fast, safely, and consistently. It will
complete the process of connecting the system to the server at a local level.
Figure 5.1.6
2
Yarn package installation.
5.1.5 Truffle Migration and Deployment to Compile and Execute the Contracts
2
Figure 5.1.7
Users also need to require the new contract and add a deployer statement inside the function if
they want to deploy another contract from the same migration file. Two different smart
contracts will be deployed as a result of this migration. Moreover, this process executes the
smart contract for the system
3
5.2 CODE FOR QUICK SUMMARY
1)
2)
3
MIGRATION
3)
3
CSS
4)
3
Global Login Page
5)
Patient Login
3
6)
Registration Window
7)
3
Truffle Code
3
8)
Ganache Setup
3
6. Testing
The purpose of testing is to discover errors. Testing is the process of trying to discover
every conceivable fault or weakness in a work product. It provides a way to check the
functionality of components, sub-assemblies, assemblies and /or a finished product.
Test Cases: A test case is a set of conditions or variables under which a tester will
determine whether an application, software system or one of its features is working as it
was originally established for it to do.
Truffle comes standard with an automated testing framework to make testing your
contracts a breeze. This framework lets you write simple and manageable tests in two
different ways:
In Javascript and TypeScript, for exercising your contracts from the outside world, just
like your application.
In Solidity, for exercising your contracts in advanced, bare-to-the-metal scenarios.
Both styles of tests have their advantages and drawbacks. See the next two sections for a
discussion of each one.
3
6.3 Solidity for testing
Solidity test contracts live alongside Javascript tests as .sol files. When truffle test is run,
they will be included as a separate test suite per test contract. These contracts maintain all
the benefits of the Javascript tests: namely a clean-room environment per test suite, direct
access to your deployed contracts and the ability to import any contract dependency. In
addition to these features, Truffle's Solidity testing framework was built with the following
issues in mind:
Solidity tests shouldn't extend from any contract (like a Test contract). This makes your
tests as minimal as possible and gives you complete control over the contracts you write.
Solidity tests shouldn't be beholden to any assertion library. Truffle provides a default
assertion library for you, but you can change this library at any time to fit your needs.
You should be able to run your Solidity tests against any Ethereum client.
6.4.1 Assertions
Assertion functions looks like Assert.equal() are provided to you by the truffle/Assert.sol
library. This is the default assertion library, however you can include your own assertion
library so long as the library loosely integrates with Truffle's test runner by triggering the
correct assertion events. You can find all available assertion functions in Assert.sol.
The addresses of deployed contracts (i.e., contracts that were deployed as part of your
migrations) are available through the truffle/DeployedAddresses.sol library. This is
provided by Truffle and is recompiled and relinked before each suite is run to provide your
tests with Truffle's a clean room environment. This library provides functions for all of
your deployed contracts, in the form of:
3
This will return an address that you can then use to access that contract. See the example
test above for usage.
In order to use the deployed contract, you'll have to import the contract code into your test
suite. Notice import "../contracts/MetaCoin.sol"; in the example. This import is relative to
the test contract, which exists in the ./test directory, and it goes outside of the test directory
in order to find the MetaCoin contract. It then uses that contract to cast the address to the
MetaCoin type.
Test how your contracts react to receiving Ether, and script that interaction within Solidity.
To do so, your Solidity test has a public function that returns a uint, called initialBalance.
This can be written directly as a function or a public variable, as shown below. When a test
contract is deployed to the network, Truffle will send that amount of Ether from your test
account to your test contract. Your test contract can then use that Ether to script Ether
interactions within your contract under test. Note that initialBalance is optional and not
required.
4
7. SCREENSHORTS
7.1 Registration Panel
Registration Panel
4
7.2 Login Panel
Login Panel
4
7.3 Access Control Panel
Doctor’s Dashboard
(Accessing Patient’s Records)
4
7.4 Diagnostics Panel
Diagnosis Submitted
4
8. Conclusion
4
9. Future Enhancements
● Cloud services can be used to up-scale the projects to make it accessable to wider
masses.
● Diverese formats of medical records can be used to better represent and share the
medical conditions of patients.
● Another possibility is that the payment module will eventually be integrated into the
existing architecture.
● With the introduction of Ganache, we now have the opportunity to experiment with a
similar technique utilizing a private blockchain.
● Inclusion of supply chain methods for tracing the drugs flow and delivery. This will
enable the government body to keep track of medicines and drugs from point of production
to the farthest end point i.e., till it reaches the patient.
4
10. References
4
Conference on Communication and Electronics Systems (ICCES), pp. 215–219,
Coimbatore, India, 2019.
View at: Google Scholar
4
4