Building electronic medical records systems with Blockchain integration
Facing massive documents flows, companies have to accurately keep all records. However, it’s not everything that they should do to continue effectively functioning. In today’s world of the Internet and technology, there is a strong need for electronic document management system, that can enable efficient maintenance of documentation, automatic information updates, limited and shared access to data, information exchange between different organisations with no data losses and with the support of all data formats.
It is especially important in organizations where a piece of inaccurate information may cost a lot. So, there primarily insurance companies, banks, government entities, and healthcare organizations, that should think about the implementation of an electronic document management system.
And data protection is the core here, as a document, sign, or any other information must be impossible to forge, and data exchange must be safe. Hence, to achieve high security there must be used innovative tools and technologies created for this exact goal.
In this post we’ll describe a Blockchain technology-based project, used to build an electronic medical records system for a healthcare organization.
Speaking about the notion of current electronic document management we can define it as an isolated network of different systems with different data formats, which especially concerns medical systems. Unfortunately, most solutions for electronic document management work well only within a single organization or a network of institutions.
However, when it comes to data exchange between various stakeholders (hospitals, insurance companies, patients, private practices), there appear a lot of problems such as compatibility of data formats, keeping the history of changes in the patient’s card, and validating the integrity of patient data.
Organisations can have their own records systems and databases for keeping patients’ cards and health information, which significantly complicates the communication between them. Today there implemented a variety of standards for medical data exchange called Health Level 7. However, even with this set of standards systems must maintain their own patient databases and there is no any guarantee that each organization has up-to-date information.
Our task was to create a demo version of patient’s electronic medical records system providing the ability to safely and transparently make changes from an unlimited number of sources that can be geographically distributed.
Each system participant must have a latest data version, so the system must be decentralized and at the same time there must be confidence in the validity of each transaction.
The system must meet the following requirements:
- Lack of a single failure point;
- Ability to make changes in patient’s card by several participants (medical data, paid bills, insurance information);
- Automatic confirmation of each new change in a patient record by several participants in the system;
- Maintaining of a permanent history of changes in patient’s card;
- Transparent data exchange between organizations.
Another important requirement was to ensure the ability to easily connect third-party systems so that each organisation can work in their current systems, having access to up-to-date patient information.
That is our system must be based on a distributed database, providing access to all involved organizations. As data security is one of the prior issues there, we also needed to ensure the protection of databases from unauthorized access, verification and confirmation of each transaction, without having central regulatory authorities and a central database “master” copy (decentralization).
Bitcoin is a good example of distributed database suitable for all above-listed requirements. Bitcoin is a payment system and electronic currency, that doesn’t use central servers and intermediaries. And it is Blockchain technology that helps to achieve effective functioning of the entire system and can be successfully applied in other spheres, as this project demonstrates.
Blockchain is a chain of transactions built according to certain rules formed in a signed and validated block. Each subsequent block contains a link to the previous one. Each transaction added to the block is irreversible, so all the data added to the database is immune (immutable).
After a huge success of Bitcoin Blockchain started applying in different spheres connected not only with money. One of such examples is BigchainDB, a distributed database management system (DBMS) on the base of Blockchain. We chose it as the database for our system.
BigchainDB is a server that runs a Blockchain layer and NoSQL DBMS as a backend and data warehouse (Rethink or MongoDB). One such server is called node which is a Blockchain cluster participant.
Each new base record must be confirmed by the majority of servers in the cluster (BigchainDB consortium). Each node keeps a Blockchain local copy, which allows the system to be fail-active and able to work while at least one node is functioning.
Thus, the semi-open block system implemented in BigchainDB is the ideal solution for our system. So, we can seamlessly connect an unlimited number of organizations, just adding new nodes to the system. Also, each new node increases the network resilience to the break and forgery of transactions.
The implementation of the system storage
When storing data in Blockchain, it is necessary to implement the system for recording and modifying data in a special way. Each new entity change must be a separate transaction that fits well into BigchainDB.
That is the current entity state in the system is a set of events representing transactions. Even the entity removal must conceive a transaction that only marks the entity as a remote (since it’s impossible to remove anything from Blockchain).
Event sourcing suits great for such cases when all changes in the application are being recorded as a sequence of events. Each new event before writing to the database will be processed and confirmed by Blockchain cluster. So BigchainDB cluster is used as a distributed event store.
A recording scheme of patient’s card data from a client application in BigchainDB. Each change of the entity represents a Blockchain separate transaction.
The confirmation scheme of Blockchain transaction (consensus) in BigchainDB, created from the client application.
To read data we need to read all the entity related events and to sequentially apply them to the entity. Thus we can restore the current entity state from BigchainDB and we can be sure that each event in the database is authentic and valid, despite various record sources. All this is due to the Blockchain implementation in DBMS.
With such information storage organisation, we also get a complete and immune history of changes to each entity (patient’s card).
The scheme for obtaining the patient’s card from BigchainDB. Thanks to event sourcing we can get a complete history of changing the patient’s card at any time.
Each organisation has its actual database copy as well as its computing power is used to transactions confirmation along with the rest.
With BigchainDB we have a distributed fault-tolerant database management system, so that organizations are interested in medical records don’t need to spend their efforts on additional communication using Health 7 protocol.
It’s enough just to make a request to the database, get all transactions patient’s card related transactions and consistently apply them to get current card status. Also, a single DBMS enables each organization to use its own application, which in turn will work with BigchainDB.
Our solution doesn’t require to choose a certain system for processing documents – we only provide a unified database, for which each organization can choose a client application tailored to their needs.
Thus, we implemented an effective electronic medical records system, that can be referred to Blockchain solutions. The system met all requirements and business objectives. For us the project became a valuable experience in working with BigchainDB, event sourcing, and more important, with Blockchain, a cutting-edge technology, that promises to bring the revolution in many industries, starting with banking and finance.
Hope, the article was valuable to you. If you have some questions or need recommendations for your project, feel free to apply to a reliable software development company!