{'fraction_non_alphanumeric': 0.025164769322947873, 'fraction_numerical': 0.009047333732774117, 'mean_word_length': 5.3032477341389725, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Blockchain-based Model for Health Information Exchange: A Case for Simulated Patient Referrals Using an Electronic Medical Record

Health information exchange (HIE) has been recognized as an effective mechanism to improve service delivery. The benefits are compounded with the introduction of electronic medical records (EMR). Exchanging information between health facilities remain a challenge due to the absence of an integrated health information system and issues pertaining to data integrity. The emergence of blockchain has provided an innovative solution to data sharing challenges in security, transparency and accessibility. This paper aims to develop a framework for health information exchange between health facilities with the use of EMR and blockchain-based network. The EMR was developed with functionalities such as adding and updating patient profile and health records, referring patient to another facility and monitoring patients referred. These functionalities have been simulated using hypothetical test cases. The simulation has demonstrated blockchain-related functions such as registration of health facility in the network, defining consensus rules and adding patient referral transactions in the network. The description of the proposed framework, role of blockchain and key features of the prototype EMR is summarized in the conclusion part.


Introduction
Healthcare data is one of the most valuable shared resources within the medical community. Resolving of medical cases, developing health researches and establishing health program policies are just some of the many areas that healthcare data is heavily utilized. With the development of electronic medical records (EMR), access to the health data have become much faster and its quality has been more enhanced.
Sharing of healthcare data is essential towards improving the quality of care [1]. As the patients moves from one healthcare provider to another, there is need for a unified and integrated health records to come up with proper diagnosis and treatment of medical case. This remains a challenge because the health records are often paper-based where data is stored in the local health facility and not shared with other health facilities. As such, monitoring of compliance of the patient and assuring continuity can be challenging.
Blockchain offers a practical solution to the issues relating to health information exchange [2]. With blockchain, participants (healthcare providers and patients) with appropriate permissions shall have access to the distributed ledger containing secured health data while ensuring that it is safe from tampering. While blockchain can either be public or private, sharing of health information can be best done using a consortium-based setup wherein only official providers and patient are enrolled into the  [3]. Participants in the consortium blockchain can agree on a consensus mechanism when in validating transactions being added into the blockchain.
To address the issues mentioned, this study proposes a health information exchange model for patient referral demonstrated through a prototype electronic medical record. The author has identified the following research questions: 1). What is the framework used to develop health information exchange via patient referral system? 2). How is blockchain used and integrated into the framework? 3). How can the framework be demonstrated on functional electronic medical record prototype? Target users of the system are health care service providers in Philippine public health facilities. Using simulated data sets from three different EMR instances, personal patient data such as name, date of birth and gender and medical notes in SOAP format (subjective, objective, assessment and plan) from the databases of the EMRs and receiving provider for referral cases.

Characterization of Health Information Exchange in Patient Referral System
The Philippine Service Delivery Network (SDN) manual of operations has defined steps to refer patients from one health facility to another as shown in Figure 1. A patient visits a health facility for consultation and data such as patient profile and demographics, vital signs, diagnosis and treatment are being recorded. If a referral is needed, the health service provider fills out a referral slip that the patient needs to give to the receiving health facility. Upon visiting and being seen by the receiving health facility, the patient is being sent back to the originating health facility for continuity of care.

Data Preparation
During the process of data gathering and requirements analysis, initial and baseline data libraries were collected and entered in the system's database. Among the data collected include list of all departments and sections, schedule and designated personnel for services offered and protocols for referral in and out of their facility. In addition, internationally accepted health data standards IOP Publishing doi:10.1088/1757-899X/1077/1/012059 3 such as International Coding of Diseases 10 (ICD-10) for disease classification and Current Procedural Terminologies (CPT) for coding of health services have been included in the system database. The system was hosted on a third-party web-based cloud server and can be made access via the URL https://alisonperez.net/ers. Users were registered centrally into the system and can be designated into more than one health facilities.

Development of Electronic Medical Record Prototype
The study makes use of an electronic medical record prototype developed by the author called "Electronic Health Facility Information Exchange and Referral System (ERS)" and currently hosted in https://alisonperez.tech/ers. ERS is suitable for a variety of health facilities such as hospitals, health centers and private clinics. ERS was created using PHP 7.0, Javascript and MySQL database. The forms and reports generated by system were derived from the actual forms used in Philippine public health centers. The system will be referred to as ERS EMR from here onwards.
In the development of the ERS EMR, the author makes use of agile software development methodology particularly Extreme Programming (XP). This development methodology was adopted as it requires constant changes in the system such updating of the system's features and fixing software related bugs within limited amount of time. On the other hand, lean development model was used for the the integration of blockchain using the OurSQL network. Lean development model is suitable due to short time required well as the immediate availability of readily-made third party software tool to accomplish this feature [14].
ERS EMR have multiple instances running with each instance representing a health facility. Profile of the patient (i.e. name, birthday, gender, PhilHealth ID, address), profile of the health facility (i.e. name of health facility, facility ID as defined by the Philippines' Department of Health, classification) and consultation details (i.e. consultation date, physical and diagnostic exams, diagnosis, treatment, referred to, reason for referral) are the key data sets collected and processed by ERS EMR. Only consultations that require referrals and its corresponding patient and health facility identifiers will be added by the ERS EMR to the cloud-based blockchain.

Electronic Medical Record
Electronic medical records (EMR) are computerized health information systems that is used to collect, store and a person's medical information such as health history, diagnosis, medicines, tests, allergies, immunizations and treatment plans [4]. Electronic medical records prove to be a relevant tool in transforming healthcare due to benefits such as reducing medical errors, reducing healthcare cost and promoting quality of health services [5].
According to the National Academies of Sciences and Engineering Medicine, an EMR should be able to perform eight core functions such as health information and data (i.e. patients' diagnoses, allergies, lab test results and medications), result management (i.e. accessing current and past test results), order management (i.e. storing prescriptions, test and service legibly), decision support (i.e. using prompts and alerts to improve compliance), electronic communication and connectivity (i.e. efficient and secure communication between healthcare providers and patients), patient support (i.e. providing patient access to records), administrative processes and reporting (i.e. scheduling systems) and reporting and population health (i.e. patient safety and disease surveillance) [6].

Health Information Exchange
Health Information Exchange (HIE) is a technology that shares clinical and administrative data by various healthcare providers. HIE allows physicians, nurses, other healthcare providers and patient to better track and securely share medical records thereby improving the speed, quality and cost of patient care. To allow HIE, data standards such as LOINC (for laboratories results) and RxNorm (for medication) and interoperability standards were established. Fast Health Interoperability Resources (FHIR) and Consolidated Clinical Document Architecture (C-CDA). C-CDA was designed to transfer the entire document while FHIR would only transmit piece of data based on the request made by the healthcare provider [7].
The study conducted by Mandel, et. al [8] has explored the integrated of an HIE standard FHIR into an existing health technology platform called Substitutable Medical Applications and Reusable Technologies (SMART). The project SMART on FHIR was designed and developed using clinical data models and application programming interface of FHIR. This allows medical applications to be written once and run unmodified across IT systems.
According to Sadoughi, et. al [9], although HIE can promote patient care quality and reduce cost related to resource utilization, further researches are needed to provide better understanding of this domain and to improve adoption of this technology.

Blockchain Technology and HIE
Blockchain is a shared, distributed ledger that facilitates the process of recording transactions and tracking assets in a business environment. Rather than having a central administrator, a distributed ledger has a network of replicated databases, synchronized via the Internet and visible to anyone within the network. It is a special database where transactions are added and cannot be deleted. Each block contains information such as hash of the previous block, hash of the block, information of the transaction and other information. As new blocks are added into the blockchain, all nodes should reach an agreement using consensus algorithm [10].
Among the key advantages of blockchain are impossibility to change data of the approved block (immutability), impossibility to change the data of the approved block (cryptographically secured), minimizes failure through decentralization and all transactions are documented and available for all participants (provenance) [11]. This makes the application of blockchain suitable for healthcare data sharing and information exchange.
Fan, et. al [12] proposed MedBloc, a blockchain-based information system that promotes efficient access and retrieval of patient information from EMRs. Medbloc high information security by combining blockchain features such as customized access controls protocols and symmetric cryptography.
In a study conducted by Gordon,et. al. [13] has explored the methods, potentials, risks and barriers of implementing a patient-driven interoperability using blockchain technology. Under this scenario, an individual patient's electronic data is made available to them through standard mechanisms like APIs. The study stated that blockchain could provide high-level framework on how a patient could securely interact with multiple stakeholders using mechanisms such as digital access rules management and data aggregation, availability and liquidity.
Zhang, et. al. [2] has reviewed the application of blockchain technology in sharing clinical data as required by the "Shared Nationwide Interoperability Roadmap" of the Office of the National Coordinator for Health Information Technology (ONC), USA. The study crafted FHIRChain, a blockchain-based decentralized architecture that simulates FHIR data interoperability standard. FHIRChain provides patients with more collaborative clinical environment and has complied with ONC's interoperability requirements of user identifiability and authentication, consistent format and system modularity.

Design Framework for Health Information Exchange via Patient Referral
In Figure 2, the patient visits health facility 1 and his health record is recorded in the ERS EMR. The health record is stored in both the local database and the local blockchain of health facility 1. If the patient is referred to health facility 2, the local blockchain instance in health facility 1 is shared and IOP Publishing doi:10.1088/1757-899X/1077/1/012059 5 integrated into the local blockchain of health facility 2. Data is decrypted in health facility 2 and merged into its local database. The referral transactions are formatted to make it more readable. Only referred cases intended for health facility 2 will be displayed.   Figure 3 shows the interaction between ERS EMR instances using and the blockchain server.

Figure 4. Consultation Recording Form of ERS EMR
Each blockchain transaction is signed using the prime256 ECDSA signature. For the signature to be generated, the public key and the SQL query must be sent to the MySQL proxy attached to the OurSQL server. The MySQL proxy returns a record which contains data to sign (string to sign). Using the server's private key corresponding to the public key used in the previous step, the string will be signed and shall execute a second SQL request where the signature produced is included already. Sending the transaction to other nodes (i.e. ERS EMR instances) is also being handled by the OurSQL blockchain server. If a node receives a transaction, it will check if the SQL can be executed against the consensus rules set. Once it is verified for execution, the signed transaction will be decoded using the public key and will be added into the node's own OurSQL instance.

Utilization of ERS EMR for Health Information Exchange via Patient Referral
Among most relevant features of ERS EMR includes searchable library of health facilities based on location, schedule and services available, a patient and consultation registry, integrated patient IOP Publishing doi:10.1088/1757-899X/1077/1/012059 7 dashboard and a case referral component. All transactions would start with searching an existing patient and recording his consultation details in SOAP format (Subjective-Objective-Assessment-Plan). Figure  4 shows the recording form of consultation details at ERS.
If a referral is required for the case, the end user will have to utilization the health facility search feature of ERS and then provide the referral details before sending the case to the receiving health facility. Figure 5 shows health facility search feature while Figure 6 shows the case referral form of ERS. The receiving health facility shall receive a notification if a referral has been sent. The list of incoming referrals is shown in Figure 7. By clicking the "View Consultation" link, details of patient medical history are going to be visible. The health service provider at the receiving health facility can annotate the results of the consultation done on their facility as shown in Figure 8.

Conclusion
Health information exchange via patient referral is demonstrated through a prototype electronic medical record called "Electronic Health Information Exchange and Referral System (ERS)". ERS EMR is based on a framework which features recording of data in local facility, referral of patient case, receiving of IOP Publishing doi:10.1088/1757-899X/1077/1/012059 8 patient and monitoring of patient movement. Blockchain is used as a support tool to connect the sending facility to the receiving facility, integrate referral data into a central ledger, secure transaction using the prime256 ECDSA signature and verify the integrity of transaction to the intended receiving facility. Among the key features of ERS EMR is recording of medical information, search engine of participating health facilities and sending and receiving referrals. ERS EMR features were tested using simulated cases.
As a next step, ERS EMR is to be deployed into an actual referral practice. This would aid in validating the perceived benefits of the system and could contribute to its further enhancement.