Decentralized Telemedicine Framework for a Smart Healthcare Ecosystem

The healthcare sector is one of the most rapidly growing sectors globally. With the ever-growing technology, patient care, regulatory compliance, and digital transformation, there is an increased need for healthcare sectors to collaborate with all stakeholders – both within the healthcare ecosystem and in concurring industries. In recent times, telemedicine has proven to provide high quality, affordable, and predominantly adapted healthcare services. However, telemedicine suffers from several risks in implementation, such as data breach, restricted access across medical fraternity, incorrect diagnosis and prescription, fraud, and abuse. In this work, introduce blockchain-based framework that would unlock the future of the healthcare sector and improved services. Our proposed solution utilizing Ethereum smart contracts to develop a transparent, tamper-proof telemedicine healthcare framework, and ensure the integrity of sensitive patient data eliminating a central administrator. Moreover, the smart contract regulates the interaction between all the parties involved in the network and keeps the patient meticulously informed about the transactions in the network.


I. INTRODUCTION
Recently, there is a steady growth in healthcare, which has led to decreased costs in telecommunication technology. As technology has advanced and costs have dropped over the past decade, telemedicine is utilized to monitoring the patients remotely, without the need for long travels or in-person hospital visits. Also, it supports the transferring of vital biodata detected by biosensors or wearable sensors [1] , [2]. Modernized technology in healthcare utilizes the HIPAA video conferencing tools that helps to consult the patients [3], [4]. The concept of telemedicine was developed to provide effective patient care at a lower cost, and much of this growth has been in the form of feasibility study and pilot trials [3]- [5]. According to a recent study by Global Telemedicine Market [6], utilize the telemedicine concept for improving the annual growth up to 20% in 2020. The growth of information technology and internet facility are used to understand the services and tasks which is accepted by the concerned individuals who are a part of the network. The internet of things (IoT) The associate editor coordinating the review of this manuscript and approving it for publication was Leyi Wei.
is support the information technology by transmitting, processing, and storing the data [7], [8]. Telemedicine insures to make use of innovative technology in the medical field is available in remote communities and provides patients with general care without travel long distances to meet medical professionals for consultation. Remote monitoring services can help especially elderly people and chronically ill patients stay healthier while remaining in their homes [3], [6], [9]. However, digital communication is always prone to privacy, security and cyber risks and the healthcare sector is no exception. The repulsive cyber-attack -ransomware on NHS has been into chaos after being attacked by cyber criminals, who could go on to sell the patient's sensitive medical data for vast amounts of profit. There is a considerable risk in which these hackers can sell large batches of personal data for benefit on the black market [10] Medical information is far more valuable than credit cards in the deep web. Hackers can use this data to create fake identities for drug purchases or, in the worst cases, to claim sums from insurance companies. Consumers will only be able to detect these types of evidence thefts long after fraudsters have used their medical ID to film them and collect health services. Due to the VOLUME 8, 2020 This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see https://creativecommons.org/licenses/by/4.0/ increased adoption of digitization, the healthcare industry perceives a massive volume of data concerning complexity, diversity, and new opportunities. This exemplary shift will lead to an overall decrease in healthcare costs, improved patient-doctor interaction, well informed medical insurers, which eventually leads to economic growth [11]. As the traditional healthcare sector suffers from technological shortcomings and cyber threats in terms of a data breach, patient identity theft, Lack of EHR interoperability, There are several safety risks before starting telemedicine practice or service in a large scale. Telemedicine is a new concept in adaption with the health care sector which supports care coordination and effective communication which can mitigate significant challenges in the healthcare industry, which includes decentralization of medical care, imbalance in access to health care, cost-effectiveness, workforce shortages and improper handling of resources, such as specialists, in underserved or geographically remote locations. Therefore, artificial intelligence can improve healthcare services [12], [13]. Figure 1 shows the typical functioning of the telemedicine framework. As figure 1 shows, the entities, including the physician, patient, and diagnostic station members, interact via the web and carry out the consultation process with the help high-resolution images or video conferencing shared from the patients' side. If an expert opinion is needed, the high resolution images can be shared with experts to get their insight into the diagnosis, for remote monitoring of any vital signs and provide curative and preventive care. Telemedicine services can be made available to patients across the globe. It serves in various telemedicine support cares such as [3], [14]- [16]: Remote checking of weight, pulse, and glucose levels to help better administration of ceaseless sickness, for example, diabetes, hypertension, and obstructive pneumonic malady [15], Remote analysis of stroke and improve patient consideration and diminish generally speaking expenses [16], Telemedicine technology can be used to provide integral care to patients who are infected with HIV. By allowing self-care by patients and to be monitored remotely by regularising follow-ups [17], telemedicine helped obstetrics administrations to ladies with entanglements in pregnancy which diminishes neonatal mortality, decrease in various days in neonatal concentrated consideration and decreased expense of consideration [18] , access to psychological well-being administrations, which incorporates crisis psychiatry administrations using two-way audiovideo intelligent consulting sessions and counselling, Regular ophthalmologic screening of patients diagnosed with diabetes for retinopathy in their essential social insurance focus, with information translated by an expert or an ophthalmologist at an alternate area [15], use of portable computerized mammography for cooperative analysis of tumour and remote access to clinical preliminaries to improve access to disease screening device, Remote monitoring and care for patients with heart failure. Several treatment measures such as crisis prevention, treatment, stabilization and critical support for patients are highlighted in [19], [20], It is inevitable that the growth of Internet technology and web access across the world has led healthcare professionals to interact to entire work to maximize their performance. Telemedicine seems to be a promising service and will helps to grow gradually. In addition to this, Medicare Telehealth Parity Act of 2015 [21] introduced to cover urban and rural telehealth related payment systems. Observations show that there small deviation between telemedicine care and in-person treatment. Only a limited number of telemedicine claims have been reported as the number of telemedicine visits to hospitals is still low compared to individual visits. As telemedicine grows in popularity it is not difficult to tackle potential liability issues. Therefore, healthcare professionals, insurance companies and government regulatory agencies need to understand the liability issues associated with telemedicine services and practice. Table 1 shows some of the liability problems of telemedicine [22], [23].

A. BLOCKCHAIN FOR HEALTHCARE INDUSTRY
The created blockchain framework ability to resolve the decentralized and robust solution. The framework provides the excellent solution of data exchange and management process especially in financial division [28]. This block chain concept is introduced by Satoshi Nakamoto in 2008, and the technique is used to share the data in peer-to-peer network. More ever, the it helps to transmit the data to the authorized users; they can change, delete or alter the database records. During this process it has three components such as distributed network (node stores the identical copy of information), Shared Ledger (network member records the digital transactions into ledger) and digital transaction (information is stored in the cryptographic format to improve the overall security of the data) [28]. In general, healthcare sector has several sensitive information that must be secured from third party to maintain the robustness and security. Due to the sensitive information, blockchain is incorporated with the healthcare industry to manage the security in every transaction. More ever, the blockchain concept used to resolve the central administrator issue because of tangible database. The blockchain does not having any control or central administrator to manage the sensitive information. for this purpose the blockchain concept is used in this research work. This blockchain concept is further enhanced with the help of privacy and interoperability features, which is done by using the cryptographic hash functions [29]. Due to the various advantage of block chain process, it has been widely utilized in industries. Some of the applications of blockchain technology in the healthcare industry include [30]: Single, Protracted patient records -to compile visit details, record lab results, treatment details are ensured by blockchain technique that includes the wearable data assistance, ambulatory services and impatient etc. Most of the time, duplication or mis-matching has been performed while analyzing patient records. This issue is handled by hash function in blockchain process that uses the hashed ledger instead of primary key. In addition to this, supply chain management concept [19], [30], [31] is used to manage the multiple keys and multiple address related issues while managing the healthcare organizations and can confirm secure delivery, to identify counterfeit products and ensure the transaction is accurate. [30], [32], [33]. Claim Solution -As Blackchain operates on a certification-based exchange, claims can be verified automatically wherever the network agrees to the way an agreement is executed. The block chain concept further reduce the cost and data reconciliation, revolutionize issues effectively, and digitalizing of complicated processes such as healthcare coordination and payment to reduce fraud and waste [30], [32].

B. COMBINING BLOCKCHAIN AND TELEMEDICINE
Due to its immutable, decentralized, dis-intermediated, secure transaction, partisans have hailed the use of blockchain in the Healthcare industry for wide-ranging exchange and transfer of health information. Blockchain further helps to reduce operational conflict by integrating currently broken systems to produce holistic insights and better care [34]. Telemedicine and blockchain share a common vision to empower consumers through decentralization. Both models focus on providing autonomy for patients [3], [14], [35] to determine the services or processes they are willing to participate in, and they place more emphasis on streamlining the workflow for service providers. However, the continued use of blockchain in telemedicine practice is still under development and regulatory bodies have not yet emphasized the scope of blockchain for industry wide adaption. The Dubai Healthcare City, DHCC, has announced the first regulated tele-health platform in the UAE region that aims to make available physicians, medical experts and consultants, roundthe-clock through smart government applications [36]. When used in telemedicine, blockchain will lead physicians to maintain a broad patient history by combining data from different treatment stages, tests and lab results regardless of the patient's and provider's location. Blockchains can help capture IoT medical applications such as used network applications and service providers will be able to get a complete view of the patient's condition. With further data analysis, disease prevention and prevention is greatly improved and such a platform will close the way for the creation of an VOLUME 8, 2020 inaccessible public health facility that could be the key to opening the future of care and treatment.
Another notable criticism of the adoption of the telemedicine practice is its emphasis on privacy restrictions. A large number of health workers and patients are concerned about the privacy and security of their information. With highly detailed leaks and cyber hacks on medical records [37], users have grown older distrust of these services and prefer traditional methods. This mistrust has reduced the use and adoption of telemedicine applications. With the unchanging and anonymous features of the blockchain, patients can feel free from privacy concerns as the use of blockchain in telemedicine will help increase consumer confidence and reliance on systems. IPFS (Interplanetary file system) is P2P, open source; distributed worldwide and distributed by file system that can be used to store and share large amounts of files with high throughput [38]. Due to the inefficiency of the blockchain storage of large amounts of files or data the hash of files is stored in an intelligently made agreement. The hash created by storing files in IPFS is stored in a block and files can be retrieved using hash. All file types or file content, stored in IPFS are referred to using a hash in a smart contract. If there is a change in the content of the file, the hash changes indicate that the original content was modified / altered [38].
In this article, we present a block-based solution for telemedicine that can protect the sensitive healthcare data and improve interoperability features by providing data integrity delivery in telemedicine services and provide a verifiable decentralized ledger that is traceable by all authorized participants across the healthcare industry. We demonstrate how blockchain can efficaciously solve the existing problem in existing telemedicine infrastructure, practices, and services in terms of data security. Telemedicine is the being adopted in a faster manner by the healthcare industry to reach out to patients, is one of the areas where blockchain can bring about a phenomenal impact by safeguarding the rights of consumer / patient by eliminating central administrator for stimulating medical transactions; increasing transparency so that each and every participant is well aware of every action taken; improve collaboration between patients, healthcare service providers, and medical insurers; safeguard the patient identity and their personal medical details (records, images or video conferencing details) on a decentralised storage file system IPFS, with the cryptographic hash function features of blockchain. The features that smart contracts and blockchain provide can effectively regulate the interaction between various participants, eliminating the third party authenticator or administrator, and protecting and guaranteeing an authentic, secure telemedicine framework to provide high quality service for every patient involved in the network. The purpose of the paper is threefold: • To present a smart contract based telemedicine framework solution that guarantees secure transaction and rights of the patient, physician, medical insurers and healthcare provider.
• To demonstrate a design that eliminates the need for a trusted central administrator or database for medical transactions and improves transparency in the practice of telemedicine interactions among all participants.
• To present a system that utilizes IPFS to store the medical records and achieve the proof of existence by storing the hash of the book/ document in the smart contract.

II. RELATED WORK
In this section, we provide a brief background on what you are technologies and innovations for safeguarding data integrity in the telemedicine using blockchain technology. Teledermatology is a field offering a platform to improve dermatological care by using telecommunication and Internet technologies to connect remote medical centres and enable information and data exchange about skin conditions over long distances [39]. Eedy et al. [39] describe the implementation of a Teledermatology project to facilitate and improve the diagnosis and treatment of skin diseases with a blockchain based project which was developed and tested in the Sardinian region (Italy). The work done includes functionalities such as giving full access to the patient to his/her medical record abiding complete security and figuring out the diagnostics procedure. This being a novel paper on Teledermatology describing various blockchain use cases in diagnosis and derma treatments and propose a decentralised e-health platform. This article approaches the decentralised healthcare platform with a novel approach using blockchain but has not been provided with implementation details. Clinical trials are an important step in discovering new disease treatments and new ways to diagnose, diagnose, and reduce the risk of disease. Zhang et. Advanced design provides a common data-sharing solution used in a variety of IT healthcare IT applications. The FHIRChain prototype designed for authors provides patients with collaborative treatment decision support using blockchain technology and FHIR data standards. The authors developed DApp (a well-executed application) using a private testnet with no purchase costs [40]. However, this DApp would not be free if it was installed on a public block and included operating costs compared to licensing costs, as well as maintaining private medical data exchange infrastructure. Sharing of patient data for scientific research contributes greatly to improve the healthcare industry service and which would be of great help for the pharmaceutical industry, participating individuals (in terms of incentives for data sharing) and organizations involved in carrying out clinical trials and the exchange of healthcare information [41]. However, strict measures are required in safeguarding the data as clinical trial datasets comprise detailed information on the participant which when hacked may lead to detrimental effects [42], [43]. Extensive data reduction may be foreseen partly as a solution for data protection but may pose a threat to missing out details which may lead to erroneous results. The participant will be relieved of threats to his/ her privacy if the personal medical data is controlled and owned by the patient/ participant itself. Yue et al. [29] proposed a blockchain architecture based App named Healthcare Data Gateway which facilitates the patient to have control over their personal data while keeping the patient identity private. A unified Indicator -Centric schema (ICS) [29] helps in organising all kinds of patient data with ease and increased transparency. The authors further emphasize the Multi-Party Computing promises to be a robust solution to administer patient data without breaching the privacy of the patient. Ji et al. [44] examines the blockchain based architecture for location sharing for telecare medical information systems. The authors firstly define the basic requirements of blockchain and then use a merkle tree and order preserving encryption method to propose a decentralized multi-level sharing scheme. The proposed system focuses on the privacy-preserving location sharing on blockchain for medical systems that have flexibility, enhanced data security, and efficiency without the loss of information. Shubbar [45] uses an ultrasound imaging technique for breast cancer screening, patients who receive neoadjuvant chemotherapy to detect new cancer cells that may arise during the treatment. A Support Vector Machine (SVM) algorithm is employed to classify the images and to distinguish the abnormalities in tissues and to identify whether the cell is cancerous or not. Further, in an aim to constitute remote healthcare to monitor tumour related treatments, Teleradialogy and smart contracts backed by blockchain are used to achieve exceptional delivery of healthcare services to patients through medical centres and in-home treatment services [45]. The SVM algorithm deployed to design this system yields good results based on mathematical foundations for breast imaging.
Digitization of services has revolutionised the functioning of various business and service sectors in recent times. Nonetheless, due to the increased number of cyber-attacks on sensitive data, there is an alarming rise in challenges specific to privacy violations [46]. In this tech-savvy world, access to an individual's personal data has become a major concern with ever increasing hacking and privacy issues leading to adverse outcomes. Genestier et al. [47] present a blockchain based system for consent management in the e-health environment. In traditional systems, consent managed was purely based on records and each record requires the consent of the user and the entire trust was dependent on the third party. Access to an individual's personal data has become a major concern for security risk. The authors [47] emphasize the importance of patient consent in sharing of data to healthcare professionals and research organisations, as personal health records data are made available to the healthcare practitioners and the management of personal sensitive patient data must also comply with regional governmental regulations. Better and secure management of personal data can be made possible with the features of blockchain technology which keeps the patient in the network well informed about the transactions taking place in terms of data governance [47]. Attribute-Based encryption is conferred to achieve an on-demand, authentic and dynamic telemedicine system [48]. Every time the patient modifies his/her ordered service, an update on parameters is not necessary and the private healthcare data is stored in public cloud and its integrity is safeguarded from any accidental alterations of the electronic health records by any malicious user from inside the cloud. An analysis of collusion attack with multiparty authorities is done and results prove to provide enhanced performance. Insurance companies play an important role in settling the medical expenses and reimbursements for ailments. Figure 2 shows the factors during the medical billing and insurance process. The Official U.S government healthcare sector firm Medicare [49], covers various services such as inpatient hospital care, lab tests, nursing services, and home healthcare. Further, this medical insurance covers healthcare provider services, outpatient care, medical equipment costs, and preventive services. Medical insurance claims are impacted by federal regulations. The report from Chiron health [50] states that many state legislatures and private health insurance providers perceive the potentials of telemedicine to manage data, reduce costs, and keep patients healthier. Blockchain has proved to be efficient in terms of secure data management and insurance claims [34], [50]. The combination of blockchain and telemedicine is a robust structure as both of these technologies are based on decentralization. Telemedicine powered by blockchain aims to be a robust architecture with transparency, enhanced security, tamper-proof features. To sum up, telemedicine is one of the ground-breaking developments in the healthcare sector which promises to improve medical services and practices with the help of Internet based technologies [3], [5]. However, the conventional healthcare industry has been facing increasing challenges related to data security as it often takes place in the presence of central third party administrators, in order to create and manage the healthcare data transactions. The patients are unaware of any of the healthcare data transactions or where their sensitive medical data is being stored. Lindberg [51] came up with an idea to implement in-home telemedicine healthcare especially for elderly people and people with disabilities. The Telecommunications and Infrastructure Assistance Program of the United States Department of Commerce's National Telecommunications and Information Agency has aided the framework in which local cable systems are connected to a base station which is under the supervision of a skilled nurse who would monitor the patient with the help of television VOLUME 8, 2020 in the home. Several criteria for inclusion and exclusion for selection are designed such as the geography of residence, medical condition of the patient, individual's ability to adjust the position for monitoring, whether invasive procedures are needed to be done by the nurse. It is reported that [51] about 38 patients are being cared for in the Kansas region at 3 sites and the authorised nurses observe patients via telemedicine visits at customarily scheduled times during the week. Data including various checks such as overall health status, vital signs, nutritional and functional status, mental status, visit details, technical issues if any, medication changes are collected during each interaction and is still thriving at Hays Medical Center [51].
The advancement in the medical industry, digitization of the healthcare industry, and raise in Internet and telecommunication based healthcare service delivery such as mobile healthcare (commonly known to be mHealth) and telemedicine have paved way for new methodologies in the healthcare industry. Eysenbach et al. [52] proposed a tamperresistant mobile health system based on blockchain technology specifically for behavioural therapy for insomnia using an app, with which data can be collected. A tamper-resistant model is designed to prevent any form of data breach and inconsistencies. The authors [52] highlight the features of combining blockchain and mHealth to achieve transparency and robustness without a central administrator. The World Health Organization (WHO) identifies telemedicine to be one of the potential solutions to improve healthcare data management, deliver better healthcare services, cost-efficient, efficiency in performance and reduced fluctuation of diagnoses [53]- [55]. In WHO report, states that the telemedicine support to promote maternal and neonatal care in remote locations of Mongolia has reduced infant mortality rate, solves high risk pregnancy cases, used for foetal growth monitoring, details of check-ups and for the screening of abnormalities [56]- [59]. It is further identified in the WHO report that mechanisms such as evaluation, strategies, governance, and scientific developments in the telemedicine-based areas are facilitated and about 30% of responding nations have agencies to develop and endorse telemedicine and its applications. Challenges to be addressed in implementing a successful telemedicine framework are technological, skilled human resource, regulatory acceptance, and cultural barriers are also listed by WHO. Another remarkable development in the field of Telemedicine is Arizona Telemedicine Program which is mainly focussed on increasing access to healthcare in rural, deserted populations, provides people with enhanced and cost effective telemedicine services, and opportunities for training for healthcare professionals in rural areas [60]- [62]. The authors first present a private and asynchronous transfer mode network, followed by a dial up access using the public switched telephone network. The proposed system supports multiparty video conferencing with voice activated video which will be a major resource for educational activities over the network. There is a compelling need to design a trustworthy, tamper proof system where the transactions are transparent to all authorised participating entities including the patients. Since, the discovery of Bitcoin [28], blockchain has been gaining significance due to features such as decentralization, tamper-proof characteristics and has been used across many industries. In this article, we propose a blockchain based solution for telemedicine application to provide improved, secure and transparent healthcare services. The Ethereum smart contracts guarantee the legitimacy of transactions, logs transaction details, and ensure the authenticity of data stored in the decentralized file system.

III. INTRODUCED DECENTRALIZED TELEMEDICINE FRAMEWORK
In this section, we propose our solution that utilizes smart contracts powered by Ethereum blockchain, to monitor, govern and carry out the transactions taking place within the telemedicine framework. In the event that a young therapeutic professional in a remote zone could get a subsequent conclusion and counsel on the board of troublesome medicinal cases from an increasingly experienced specialist, it could be a distinct advantage. Telemedicine encourages a virtual association between a patient and a specialist, permitting both remote monitoring of clinical conditions through ECGs, X-rays and after treatment guidance. The patient's response to the treatment given can be also checked. Figure 3 shows our proposed blockchain based telemedicine framework. Our solution framework eliminates the need for trusted middlemen in the based healthcare industry by recording telemedicine based transactions with integrity, transparency, security, and reliability. This solution is aimed at utilising Ethereum smart contracts when executed will trigger events and enable all the authorised entities including the patients in the network to monitor the healthcare transactions. By adapting this setup, there is an optimal chance to achieve transparency, interoperability, and data integrity.

A. SYSTEM OVERVIEW AND DESIGN
The utilization of Ethereum smart contracts will ensure the integrity of the healthcare transactions which reduces risks, improves scalability, tractability and transparency. When applied in telemedicine, blockchain will enable doctors to keep a record of more extensive patient history by gathering data from medications, strategies, tests, and lab results. Further, our solution aims to focus on utilizing smart contracts to trigger events and facilitate all the participating entities to monitor, trace and track all the transactions in the network. The patient feels empowered as all the details about where his/her personal health data is stored and is transacted. Each of these participants has an Ethereum account with an address, public key, and private key. The main participants/ components can be summarized as follows: • Patient: The patient is the entity that creates and initiates the smart contract, following the agreement of terms by all the participating entities. All the transactions happening within the network are monitored and tracked by the patient with the help of events in the smart contract.
• Telemedicine center: Telemedicine center is one of the most important entities of the network which comprises of authorized physician and laboratories that carries out the tests and experiments on the patient. The treatment details, health condition, and the lab results are stored in the IPFS, which is a decentralized file system whose hash is made available for all the authorized entities in the smart contract. This entity also triggers an event to update the treatment and prescription details.
• Pharmacy: Pharmacy provides the patient with the prescribed medicines; updates the details on the smart contract, and records the transaction from the pharmacy's end.
• Medical Insurers: Health care coverage is a kind of protection inclusion that takes care of the expense of an individual's medical expenses, depending upon the sort of medical coverage inclusion. The telemedicine center triggers the event to instigate the insurer to pay the medical or surgical costs following the treatment.
• Research Organization: Research organizations in the healthcare sector plays a significant role in research and market analysis services for the medical and pharmaceutical sectors. They request access to patient's data through the smart contract. The patient can decide whether to or not to share the sensitive medical information and get paid with incentives for sharing his/her healthcare data. Automated events convey the transaction outcomes to all the taking part individuals and also the event of any infringement that may happen during the healthcare transactions. Our proposed framework utilizes Ethereum smart contracts, which primarily include logic that regulates the transaction among the participants required by executing code and activating events to keep track of exchange details of transactions. A smart contract on Ethereum platform consists of the following: • Variables: Variables are the values that depend upon conditions to execute. In this smart contract, IPFShashEHR, contState, number Of Requests By Telmedcenter, and number Of Approvals By MedInsurer are some of the important variables.
• Events: Any state changes that occur in the network are tracked with events. In the case of state change during the transaction, an event is logged and is transmitted to everyone within the network who is authorized to view the outcome of a specific transaction.
• Modifiers: They are utilized to change a function's performance and used to determine a condition before the execution of a function within the smart contract. If a predefined condition specified by the modifier is not met, then the smart contract aborts its execution and returns to the initial state. To ensure the safe telemedicine and blockchain-based healthcare data transactions, in this scenario, we design our framework such that the patient creates smart contract after predefined terms being accepted by all the participants. This predefined term includes the interaction of the patient with the telemedicine centre on the decentralized platform, their interactions over the web, the patient's consent to share their healthcare data to the research organization. Then the patient then fixes an appointment with a specific doctor/physician in the telemedicine centre. Following the appointment, the doctor from the telemedicine centre does video consultation, prescribes medicines, and updates details of the treatment in the IPFS, and stores the hash in the smart contract. The pharmacy then completes dispensing the medicines to the patient and updates the details of the transactions on the contract. The telemedicine centre triggers to initiate the payment, following which the insurer is instigated. The medical insurer triggers an event to get access to the treatment which is notified to the patient and is given access upon the patient's consent. The insurer provides the approval for payment settlement to the healthcare, which is broadcasted to all the entities via the events in the smart contract. The patient can give access to his / her healthcare data to the medical research organizations to carry out experiments, clinical trials, for instance, and get paid with incentives. Further, the telemedicine center receives the opinion of medical experts in particular in the highly complicated medical cases, which is becoming an in-built part of the telemedicine framework.

IV. IMPLEMENTATION AND TESTING
In this section, we demonstrate the main execution subtleties and spotlight prevalently on testing the interaction and transactions among the members within the telemedicine framework and the functionality of the smart contract. Our smart contract was executed and tested utilizing Remix IDE, which has a JavaScript EVM as a default run time environment. The code was written in Solidity using the web based IDE, Remix, which offers many highlights that make it conceivable to test and troubleshoot the smart contracts before conveying them.

A. IMPLEMENTATION DETAILS
The implementation was programmed in Solidity programming language with a web browser based Remix VOLUME 8, 2020 IDE environment. The participating entities in our proposed framework are identified using their Ethereum addresses within the network. These entities enable communication by calling functions within the smart contract in regular instances. Figure 4 explains the sequence flow for the scenario of a typical telemedicine functioning and delivery of medical services. We designed our framework in such a way that the patient has complete knowledge about the data and information exchanges that happen within the network. The patient creates the smart contract with details such as patient name, patientID, IPFShashEHR, Ethereum address of the medresearch_org, number Of Requests By Telmedcenter, number Of Approvals By MedInsurer, and contState. Once the contract is created, the patient chooses the doctor whom he/she prefers to give treatment / medical care depending upon the type of medical expertise sought. Upon completion of treatment, the telemedicine centre requests from the patient to publish the details of the patient's records on the IPFS, and the hash of the document (patient's record) is stored in the smart contract. The patient approves of publishing the medical records on the IPFS after confirming the contents of the document by comparing the hash of the text stored. Following the completion of treatment, the drug store starts the dispersal of meds to the patient. The healthcare service provider initiates the payment settlement demand for medical assistance and treatments given, and the event is communicated over every one of the members of the decentralized telemedicine structure. Figure 5 outlines the sequence diagram showing the communication between entities -medical insurers, patients, and the medical research organization. The medical insurer requests access to the patient's electronic health records to release the payment for the services provided. Following the request from the insurer, access to medical records is provided by the patient. Further, we have shown in our system that when an approved research association in the network can demand a period restricted access to the patient's EHR, the smart contract administers the exchange and enables access to the patient's record.  Next, we outline the algorithm snippets of our smart contract. The full implementation code of the smart contract is available at https://github.com/OnlineBookPublishing/ Telmed/.
We use mapping to track the address of patients and the results approved, which is represented as a key-value pair. We also maintain a mapping to record a list of approvals by the insurer and the hash provided by insurers during the approval process. Figure 6 illustrates the algorithm for the constructor used in the implementation of our Telemedicine contract. The constructor function initialises patientID, patientName and specifically the IPFS hash of the Electronic Health Record IPFSEHR. This hash stored in the constructor of the smart contract helps to prove the authenticity of the medical records later when being accessed by various entities of the network. Initially, the state of the contract is NotReady. The patient creates the contract and executes the createTelMedContract() 1 function and invokes contract Created event. The constructor also shows the initialisation of the requests for approval by medical insurers and the number of requests by the healthcare service provider to publish or access their healthcare records, represented by the variables number Of Approvals By MedInsurer and number Of Requests By Telmedcenter respectively. Figure 7 demonstrates the request To Publish(), which is the request made by the telemedicine center to publish the patient's details on the IPFS. The state of the contract is physician Selected and the telemedicine center state is Ready To Submit. The Telemedicine centre can only execute the function as it is restricted with the help of modifier Not patient. The contract state changes to Waiting To Approve To Publish and the telemedicine center state changes to Submitted For Approval. The event Requested For Approval is triggered and the telemedicine center waits for approval from the patient in order to publish the health records on IPFS. The approval of the patient to publish the medical records on the IPFS is based on the hash of the document/record that is stored initially in the smart contract. If the original hash stored in the smart contract matches the hash submitted by the telemedicine center at the time of approval request, the patient agrees with the request. Figure 8 presents the algorithm for a patient providing the approval to the telemedicine center to publish his/her medical record on IPFS. The contract state is Waiting To Approve To Publish, and the state of the telemedicine center is Submitted For Approval. Upon successful approval, the contract state changes to Approved, and the state of telemedicine center becomes Approval Success. The event Approved success is broadcasted to illustrate the successful approval of all other authorised entities of the network. Conversely, if the authorization fails state of the contract changes to Appr Failed and state of telemedicine center changes to Failed Validation and the event Revise Content is broadcasted to the telemedicine center to update correct details and appeal again. Figure 9 elucidates the function where the patient EHR access is provided to the insurer. Once the approval is provided by the patient to update details on IPFS, the pharmacy entity invokes the function to disperse medicines to the concerned patients. The medical insurer now needs to pay for the treatment and services provided by the telemedicine center and the professionals associated with it. The medical insurer requests for the patient EHR to complete the payment, and the patient agrees to provide the document details to the insurer to complete claims. It is clear from the algorithm that the contract state is Waiting For Insurer Approval, and the state of the medical insurer is approval Requested. Upon successfully matched hash, contract state changes to Approved and the medical insurer state changes to Claim Success. The event Approved success () is broadcasted to authorized participants to release the payment for the treatment done. In this work, we assume that the policies of the insurer are predefined for which the participating entities agree to work together in a decentralized platform. If the treatment doesn't fall under the category of insurance policy, the insurer rejects the claim and broadcasts the event Redirect Payment to all the participating entities and asks the patient to complete the payment.

B. TESTING
In this section, we test the interaction and functionality among system participants as shown in figure 10. Testing of the smart contract guaranteed that the progression of the agreement pursued the correct sequences dependent on the  agreement state and approvals and refusals of endorsement solicitations submitted were tested accurately. For testing purpose, we consider the Ethereum address of the patient 0xCA35b7d915458EF540aDe6068dFe2F44E8fa733c, the addresses of telemedicine center, pharmacy, medical insurer and the research organizations are 0x14723.09ACff6D2A60 DcdF7aA4AFf308FDDC160C, 0x583031.1113aD414F0257 6BD6afaBfb302140225, 0x4.0897b0513fdC7C541B6d9D7 E929C4e5364D2dB, and 0xdD870fA1b7C4700F2BD7f44 238821C26f7392148 respectively. We tested, as shown in Figure 10, the case when the telemedicine center requests the patient to publish on IPFS. The IPFShash of the electronic health record is ''QmXgm5QVTy8pRtKrTPmoWPGXNeseh CpP4jjFMTpvGamc1p''.
Firstly, we present the scenario of successful approval by the patient to publish the medical records on the IPFS as depicted in figure 11. During this testing phase, the address of the telemedicine center 0x14723.09ACff6D2A60DcdF7aA4 AFf308FDDC160C and the IPFS hash of the original medical record QmXgm5QVTy8pRtKrTPmoWPGXNesehCpP4jj FMTpvGamc1p, which is stored in the smart contract are given as an input. Upon verifying the hash, the event Permission Granted To Publish is broadcasted such that records have been viewed and confirmed by the concerned patient and finally broadcasts the Approved Success event.
Next, in figure 12, we show the scenario where the medical insurance company requests access to patients to release the claim for the medical treatment given to the patient. The medical insurer with the Ethereum addresses 0x4.0897 b0513fdC7C541B6d9D7E929C4e5364D2dB requests for the EHR by submitting the hash value along with its address as input. The event SuccessfulVerification is broadcasted, and the medical insurer is invoked to release the complete payment for the treatment given. Finally, we present the scenario in which the requests for electronic health records are made by a research organization for research activities and clinical trials. The event Provide Access To Records will invoke the function to grant time-limited access to patient records, as shown in figure 13. We tested several scenarios, including the failure scenarios in approval of requests made by the telemedicine center and research organization. We have presented some of the scenarios in this article and have made the complete implementation code in Github.

V. DISCUSSION
Advanced digital technologies are reforming the manner in which healthcare services organizations give persistent care. New technological advances can acquire understanding knowledge in this manner decreasing expenses and improve the nature of healthcare administration given. Blockchain in telemedicine quickens care, mechanizes managerial undertakings by deploying smart contracts to administer the communication between elements. We have seen humongous advancements in telecom and the web. This paved the way for telemedicine framework adaption in the healthcare industry. Henceforth with a mix of telephone, talk, and video conferencing, specialists can counsel patients and examine with experts in the medical field to give remote medical center care. In our paper, we proposed a blockchain-based telemedicine framework. We presented our basic idea of a decentralized telemedicine framework and defined the entities and their roles and functions within the network on the Ethereum platform. We checked the functionalities of the smart contract for various scenarios for both successful and failure conditions and have presented them under the testing section of this article. The study demonstrates a correlation between the industry adaption of this new digital technology and patients with enhanced transparency and data integrity. Our aim to present a decentralized solution framework solution to safeguard the data authenticity and completeness of communication between all the participants is achieved, including maintaining the privacy of patient identity. We have demonstrated a framework that eliminates the need for a central mediator to govern the healthcare transactions and how the integrity of electronic medical records is safeguarded using the IPFS hash in the decentralized network and has met the expectations, as mentioned in the introduction section of the hypothesis in this article. From the discussion, the efficiency of the Decentralized Telemedicine Framework on sensitive health care records are examined using the authentication accuracy, security accuracy, and privacy accuracy. The obtained results are depicted in figure 14 (a), (b), and (c). Figure 14, it depicted that the decentralized telemedicine framework ensures high accuracy on authentication, privacy, and security. The combination of blockchain with a decentralized structure manages the data confidentiality, which is examined in up to 600 medical records. The efficiency of the decentralized system is compared with several existing works such as the FHIR Chain prototype (FHIRCP), Attribute-Based encryption (ABE), and blockchain (BC). The improved technological advances in the field of the healthcare sector have led to the adaption of telemedicine, big data, and blockchain. However, to implement a large scale adaptation of this framework, there are several challenges to be dealt with. Many of the telecommunication technologies with video conferencing facilities of today deliver high-quality care for patients who are in remote sites. Despite this improved technological advance, there is a lack in a number of patients and has not become popular among the masses. One of the significant challenges in remote areas of developing nations is the poor quality of the video call due to technical or network issues or due to lack of reliable satellite connections, slow or non-existent broadband connections, especially in the rural areas, which may be not resolvable faster. This might lead to the cancellation of services if the situation continues. Another important hurdle in the mass adoption of telemedicine is the reimbursement by the medical insurers for the service provided. For most of the organizations in the developing nations like India [55], the medical insurance companies need to be streamlined to adapt this telecom based healthcare service. Doctors and medical staff are currently required to use several technological tools for remote patient monitoring and care. With the presence of telemedicine, there is an added amount of time to document a patient's visit and review the treatment chart, which further complicates the task of medical professionals. Legal challenges faced by the telemedicine authorities other than being HIPAA compliant [4], [26] is that the legal regulations vary from state to state for providing medical assistance without direct physical examination of the patients.
There are several shortcomings to be addressed before adopting blockchain for handling the sensitive and massive quantity of healthcare data. Scalability becomes a criterion of concern with blockchain as healthcare transactions involve a million transactions within a minute. However, the concept of delegated proof-of-stake consensus that adopts parallel processing technology which facilitates decentralised applications and transactions to be processed all at the same time without affecting the load on the network, which is done by adding processing power and devices to resource pool [56]. As blockchain is itself is a new concept, the primary challenge is the standardisation of regulations. More industry sectors can consider adopting this technology if a robust regulatory framework is established to streamline the transactions and events concerned with the healthcare industry. Adapting to new digital tools is growing day by day with the advancement in web and Internet technology. However, business organizations are reluctant to embrace new technologies as web based business transformation always poses a threat in terms of security, which can be successfully dealt with anonymization platform supported by blockchain. The Bitcoin industry witnessed a major attack, predominantly known as the DAO attack in which the attacker took away 3.6M ether, leaving the developers to create a hard fork to rescue lost funds. The only way to avoid such errors in the industry is to adapt stable programming practices. Finally, the most important obstruction to implement a blockchain based telemedicine center is effectively trained in human resources. The lack of skilled resources within this network may lead to erroneous or fatal errors as it deals with human lives. Hence a rigorous training followed by up gradation of the system.

VI. CONCLUSION
In this article, we proposed a solution framework for a decentralized telemedicine framework using Ethereum smart contracts which assures transparency, agility and data integrity of healthcare transactions. The smart contract governs all of the transactions that happen between the various entities of the healthcare network, where any participating entity can verify the transaction to ensure the secure transfer of sensitive medical data. Our solution focussed on establishing a decentralised telemedicine framework where automated payment settlement claims by the medical insurers are also a part of our solution framework. This solution can be further extended to be used for any Telehealth services which may be used to govern other remote non-clinical services. We implemented our smart contract code in the Remix IDE environment and as future work, we aim to deploy the framework on the Hyperledger network and develop front end Decentralized Applications (DApps) with various functionality inclusiveness to patients, physicians, and medical insurers.
NISHARA NIZAMUDDIN received the master's degree in computer science and engineering from VIT University. She is currently a Research Assistant with the College of Technological Innovation, Zayed University. She was working as a Researcher with Khalifa University and Abu Dhabi University, United Arab Emirates. She has published several research articles in various peer-reviewed journals. Her research interests include blockchain, distributed systems, cloud computing, and machine learning. She is also working on the projects related to blockchain healthcare information technology.
AHMAD ALI ALZUBI received the Ph.D. degree in computer networks engineering from the National Technical University of Ukraine (NTUU), in 1999. He is currently a Full Professor with King Saud University (KSU). His current research interests include computer networks, cloud computing, big data, and data extracting. He is also a Certified Member of the Board of Assessors of Quality Management System (BOA-QMS), KSU. He also served as a Consultant and a Member of the Saudi National Team for measuring E-Government in Saudi Arabia, for three years.