Modernizing the Legacy Healthcare System to Decentralize Platform Using Blockchain Technology

: The use of blockchain technology is expanding in various industries, including ﬁnance, supply chain management, food, energy, IoT, and healthcare. The article aims to address the challenges of complex medical procedures, large-scale medical data management, and cost optimization in the healthcare industry. By employing blockchain technology, the article aims to enhance data security and privacy while ensuring the integrity and efﬁciency of the healthcare system. This article focuses on the application of blockchain technology in the healthcare system by reviewing the existing literature and proposing multiple workﬂows for better data management. These workﬂows were implemented using the Ethereum blockchain platform and involve complex medical procedures such as surgery and clinical trials, as well as managing a large amount of medical data. The feasibility of the proposed system is analyzed in terms of associated costs, and a model-driven engineering approach is used to recover the architecture of traditional healthcare systems. The aim is to provide stakeholders in the healthcare system with better healthcare services and cost optimization. The solution being proposed automates interactions between different parties involved. Smart contracts were created using Solidity language, and their functions were tested using the Remix IDE. This paper illustrates that our smart contract code was designed to avoid common security vulnerabilities and attacks. To test the framework, a prototype of the smart contract was deployed on an Ethereum TESTNET blockchain in a Windows environment. This study found that the proposed approach is both practical and efﬁcient.


Introduction
Recently, the healthcare industry has witnessed the emergence of blockchain technology as a pivotal force in its digital transformation.Numerous research studies have acknowledged the immense potential of this technology in revolutionizing healthcare practices [1,2].Blockchain technology holds the potential to bring about a paradigm shift in traditional medical systems and long-standing businesses within the healthcare sector [3].Information and communication technologies (ICTs) and blockchain are instrumental in decentralizing and digitizing healthcare institutions, leading to a modern and digitized healthcare ecosystem for patients and service providers [4].The use of blockchain in healthcare data management provides various benefits to patients, doctors, and healthcare organizations, including access and control of patient records, management of claims and payments, and medical IoT security management [5,6].
With the remarkable success of Bitcoin, blockchain technology has emerged as one of the most promising advancements.In this decentralized system, miner nodes play a crucial role by maintaining a copy of the blockchain ledger and conducting activities such as digitally signing, verifying, and validating each transaction.The outcome is the creation of temper-proof ledgers that offer decentralization, security, accurate timestamping, and the ability to be shared among participants [7].Various industries have implemented blockchain technology, such as banking, healthcare, supply chain, logistics, document management, and accounting [8].Blockchain technology is employed to address trust, efficiency, privacy, and data-sharing challenges due to its strong and decentralized infrastructure [9,10].A blockchain mining node executes, validates, and stores data in blocks, unlike Bitcoin, which verifies digital currency.In order to activate a smart contract, a transaction is assigned to the Ethereum address associated with it, and the contract is executed using the provided input for that particular transaction.Ethereum, as a distributed platform built on blockchain technology, offers open-source functionality and enables the execution of smart contracts [11].Custom apps can be created by users on the Ethereum platform by writing their code.
In blockchain networks, a set of transactions is assembled into blocks that are linked together in a chain by using the hash of the previous block's record.This results in the property of immutability, which is a fundamental security feature of blockchain networks.The data included in blocks that are additionally protected further along the chain from alterations.Attempting to modify any of the keys would invalidate the local register, since the hash values within the headers of subsequent blocks would be entirely different, based on the mechanism of the hash function.As a result, an attacker would be unable to tamper with the data without disrupting the entire chain.
The use of legacy systems in the healthcare sector only allows for sharing resources internally, creating incompatibility with external systems.However, research indicates that integration of these systems could lead to better and interconnected healthcare, prompting the need for interconnection among healthcare organizations [12].An essential challenge is the exchange of medical data between different organizations, such as healthcare providers, physicians, and research institutes.Blockchain technology is increasingly being used to address this issue through its adaptable, secure, and segmented approach to data processing and governance.As a result, blockchain technology is at the forefront of many healthcare developments.
The information age has transformed the way we store and manage data.The advent of digitalization and cloud storage has enabled us to transfer an enormous amount of information from paper to electronic devices [13].In the healthcare industry, it is common practice to convert patient information into digital format and store it in secure databases that can only be accessed by authorized individuals.This has revolutionized the way patient information is recorded, stored, and accessed, making it much more efficient and secure.
However, the digitization of patient information has also posed some challenges.One of the most significant challenges is the issue of patient mobility [14].When patients move from one hospital to another, their data may be dispersed among multiple hospitals, making it difficult for them to access their medical records.Although electronic medical reports are generated after patients' visits and recorded in electronic medical records, patients often lose access to their records when they move.This can lead to a fragmented medical history, making it challenging for doctors to make informed decisions about their patients' care.
The problem is worsened by the lack of interoperability among healthcare systems, leading to difficulties in accessing necessary information.This is evident when patients are unable to share comprehensive medical records with doctors at different hospitals, hampering effective healthcare delivery.This not only hinders the quality of care that patients receive but also puts their health and well-being at risk.To address these challenges, there is a need for a standardized system for data management and sharing across different healthcare systems [15].This will require collaboration among healthcare providers, policymakers, and technology experts to develop a system that ensures secure, efficient, and seamless data exchange.By doing so, we can unlock the full potential of digitalization and cloud storage, enabling us to provide better care to patients and improve health outcomes.
Advancements in electronic health data, data protection regulations, and cloud storage have enhanced health data management and patient accessibility [16].The integration of storage, transactions, and management is critical for data-driven healthcare organizations, with blockchain technology offering effective solutions [17].Agbo et al. conducted a comprehensive review on blockchain applications in healthcare, identifying potential in drug supply chains, biomedical research, and electronic healthcare records [18].They emphasized the necessity for a deeper understanding of blockchain technology and its suitability for healthcare challenges.Zhang et al. discussed the potential of blockchainbased smart contracts in tackling healthcare issues [19].
Several studies have explored the application of blockchain technology in healthcare, shedding light on its potential benefits and implications.Azaria et al. [20] conducted a comprehensive analysis of blockchain's potential in securing electronic health records, emphasizing its ability to provide a tamper-proof and auditable record of healthcare transactions.Yüksel et al. [21] proposed a blockchain-based solution for enhancing supply chain traceability in healthcare, addressing issues related to drug counterfeiting, tracking medical devices, and ensuring the integrity of the supply chain.
Wang et al. [22] presented a blockchain-enabled framework for the efficient and secure sharing of medical data.Their research highlighted the potential of blockchain technology in enabling interoperability among disparate healthcare systems while ensuring data privacy and security.By utilizing blockchain's decentralized architecture, Wang et al. demonstrated the feasibility of patient-centric control over health data and facilitated seamless data exchange between healthcare providers.Furthermore, Linn et al. [23] conducted an extensive review of blockchain applications in healthcare, emphasizing its potential to revolutionize medical research, clinical trials, and precision medicine.They discussed the role of blockchain in enabling secure and efficient data sharing, facilitating consent management, and enhancing the integrity and reproducibility of research findings.
The contributions of this research can be as follows: • Our contribution eliminates the need for a third-party authentication service, enhancing the structure and interaction of the proposed HMS system.

•
Our contribution involves the application of model-driven engineering to recover and modernize the architecture of the traditional HMS through the integration of blockchain technology.

•
Our contribution involved validating the functionality of our framework through test cases and evaluating its performance using key metrics.These metrics encompassed document uploading and access time, function execution cost, system event recording time in the blockchain, average block size, and average gas consumption.
Blockchain is a decentralized system where multiple parties can transact and maintain a ledger of those transactions.It is built on a distributed network of nodes that validate and record transactions in a secure and immutable way.The ledger is replicated across all nodes, and each transaction is verified by multiple nodes in the network before it is added to the blockchain.
On the other hand, traditional systems are typically centralized, where a single entity or organization controls the data and the transactions.These systems rely on a trusted third party, such as a bank, to facilitate transactions and maintain the ledger.This means that the third party has the authority to approve or reject transactions and can also alter or delete data on the ledger.
In summary, blockchain offers a decentralized, secure, and transparent way to transact and maintain a ledger, while traditional systems are centralized and rely on a trusted third party to facilitate transactions and maintain the ledger.
The paper is structured into four primary sections.The second section details the research materials and methods employed in conducting the study.The third section presents and analyzes the study's results.Lastly, the fourth section provides conclusions based on the findings and explores their implications.

Materials and Methods
The Materials and Methods section of this study provides a detailed account of the procedures and techniques employed to investigate the integration of blockchain technology in the healthcare system, specifically in transitioning from legacy to modern systems.This section outlines the materials used, the methodology adopted, and the experimental approach taken to analyze the process implementation of blockchain technology.By employing rigorous methods, this research aims to shed light on the potential benefits and challenges associated with the adoption of blockchain in healthcare, ultimately contributing to the advancement of this field.

Research Context and Methods
In this study, the research approach involves the design and development of a suggested solution.The approach consists of five processes, which are depicted in Figure 1.The first process is the assessment, which involves identifying the requirements and challenges of the proposed solution.The second process is the development of the solution design, which includes the creation of the system architecture and the definition of the system components.The third process is the execution, which involves the implementation of the solution design.The fourth and final process is validation, which includes the testing and evaluation of the proposed solution to ensure that it meets the requirements and objectives.This incremental approach ensures that each process builds upon the previous one, leading to a robust and effective solution.
research materials and methods employed in conducting the study.The third section pre sents and analyzes the study's results.Lastly, the fourth section provides conclusion based on the findings and explores their implications.

Materials and Methods
The Materials and Methods section of this study provides a detailed account of th procedures and techniques employed to investigate the integration of blockchain technol ogy in the healthcare system, specifically in transitioning from legacy to modern systems This section outlines the materials used, the methodology adopted, and the experimenta approach taken to analyze the process implementation of blockchain technology.By em ploying rigorous methods, this research aims to shed light on the potential benefits and challenges associated with the adoption of blockchain in healthcare, ultimately contrib uting to the advancement of this field.

Research Context and Methods
In this study, the research approach involves the design and development of a sug gested solution.The approach consists of five processes, which are depicted in Figure 1 The first process is the assessment, which involves identifying the requirements and chal lenges of the proposed solution.The second process is the development of the solution design, which includes the creation of the system architecture and the definition of th system components.The third process is the execution, which involves the implementa tion of the solution design.The fourth and final process is validation, which includes th testing and evaluation of the proposed solution to ensure that it meets the requirement and objectives.This incremental approach ensures that each process builds upon the pre vious one, leading to a robust and effective solution.In the initial phase of our investigation, an extensive examination of diverse literatur sources was performed.These sources encompassed peer-reviewed research articles, tech nical reports, and technological roadmaps.The primary objective was to identify existing solutions and their constraints.By conducting a methodical literature review, we meticu lously scrutinized the most pertinent and highly regarded papers.This approach facili tated the consolidation of necessary solutions and delineated the research scope through an analysis of existing research and development endeavors.By conducting a thorough  In the initial phase of our investigation, an extensive examination of diverse literature sources was performed.These sources encompassed peer-reviewed research articles, technical reports, and technological roadmaps.The primary objective was to identify existing solutions and their constraints.By conducting a methodical literature review, we meticulously scrutinized the most pertinent and highly regarded papers.This approach facilitated the consolidation of necessary solutions and delineated the research scope through an analysis of existing research and development endeavors.By conducting a thorough literature review, we were able to gain a better understanding of the current state of the field and identify the gaps and challenges that needed to be addressed (see Figure 1).
Algorithm implementation refers to executing a solution that involves computationally and storage-intensive phases.It involves breaking down the proposed solution into modular components that users can customize with specific inputs.The design executable standards are produced by algorithmic complexity and the underlying source code.In simpler terms, algorithm implementation involves taking the proposed solution and putting it into action through a series of complex steps, resulting in a set of executable codes that can be customized by users.The code produced through algorithm implementation follows a standard design that is determined by the complexity of the algorithm and the underlying code.
The last stage of the proposed solution entails the validation of the solution, which seeks to evaluate the effectiveness and caliber of the provided solution.This approach encompasses the utilization of a collection of established assessment metrics, enabling the evaluation of various aspects pertaining to system usability and efficiency.By conducting rigorous validation tests, we can ensure that the proposed solution meets the desired objectives and delivers the expected performance.The results of these tests provide valuable insights into areas for improvement and help to refine the solution further.
The initial two processes shown in Figure 1 are performed manually and need human intelligence and decision-making support.However, the remaining two phases require both human interaction and tool assistance to (semi)automate the development of the proposed solution.During these phases, algorithmic improvement may be required to enhance system efficiency or adjust system functionality as a result of the solution validation process.
In this research, a reverse engineering model was employed to extract classes from an existing Healthcare Management System (HMS) and migrate them to a decentralized platform.Among the different case studies that were analyzed, one HMS system was selected for this study, and the source code was obtained for further analysis.The extracted classes were then used to generate class diagrams, which provided an overview of the system's components and their interactions (see Figure 2).
field and identify the gaps and challenges that needed to be addressed (see Figure 1).
Algorithm implementation refers to executing a solution that involves computationally and storage-intensive phases.It involves breaking down the proposed solution into modular components that users can customize with specific inputs.The design executable standards are produced by algorithmic complexity and the underlying source code.In simpler terms, algorithm implementation involves taking the proposed solution and putting it into action through a series of complex steps, resulting in a set of executable codes that can be customized by users.The code produced through algorithm implementation follows a standard design that is determined by the complexity of the algorithm and the underlying code.
The last stage of the proposed solution entails the validation of the solution, which seeks to evaluate the effectiveness and caliber of the provided solution.This approach encompasses the utilization of a collection of established assessment metrics, enabling the evaluation of various aspects pertaining to system usability and efficiency.By conducting rigorous validation tests, we can ensure that the proposed solution meets the desired objectives and delivers the expected performance.The results of these tests provide valuable insights into areas for improvement and help to refine the solution further.
The initial two processes shown in Figure 1 are performed manually and need human intelligence and decision-making support.However, the remaining two phases require both human interaction and tool assistance to (semi)automate the development of the proposed solution.During these phases, algorithmic improvement may be required to enhance system efficiency or adjust system functionality as a result of the solution validation process.
In this research, a reverse engineering model was employed to extract classes from an existing Healthcare Management System (HMS) and migrate them to a decentralized platform.Among the different case studies that were analyzed, one HMS system was selected for this study, and the source code was obtained for further analysis.The extracted classes were then used to generate class diagrams, which provided an overview of the system's components and their interactions (see Figure 2).Once the class diagrams were created, the next step was to convert the XML source file into a smart contract.This smart contract is a code that is used by the blockchain system to execute transactions.The process of converting the XML source file into a smart contract involves transforming the class diagrams into executable code that can be deployed on a blockchain network.This is achieved using a compiler, which generates machine-readable code that can be executed by the blockchain system.Once the class diagrams were created, the next step was to convert the XML source file into a smart contract.This smart contract is a code that is used by the blockchain system to execute transactions.The process of converting the XML source file into a smart contract involves transforming the class diagrams into executable code that can be deployed on a blockchain network.This is achieved using a compiler, which generates machine-readable code that can be executed by the blockchain system.
The process of migrating the classes to a decentralized platform involves several challenges.One of the main challenges is ensuring that the migrated classes are compatible with the blockchain platform.This requires a deep understanding of the blockchain architecture, and the programming languages used to write smart contracts.Additionally, the migrated classes must be able to interact with other components of the blockchain network, such as other smart contracts and the blockchain ledger.
Another challenge in migrating classes to a decentralized platform is ensuring the security of the system.Since the blockchain network is decentralized and open, there is a risk of malicious attacks that could compromise the integrity of the system.Therefore, it is essential to ensure that the migrated classes are secure and can withstand potential attacks.By using reverse engineering and class diagrams, it is possible to extract the necessary components and migrate them to a blockchain platform.However, ensuring the compatibility and security of the migrated classes is essential to the success of the migration process.
The process of storing test reports, as depicted in Figure 3, stores the reports in the blockchain along with other necessary information.Furthermore, the blockchain's decentralized nature ensures that the reports are accessible from anywhere and cannot be lost or destroyed.Overall, this process of storing test reports provides a secure, efficient, and easily accessible solution for laboratory report management.
The process of migrating the classes to a decentralized platform involves several challenges.One of the main challenges is ensuring that the migrated classes are compatible with the blockchain platform.This requires a deep understanding of the blockchain architecture, and the programming languages used to write smart contracts.Additionally, the migrated classes must be able to interact with other components of the blockchain network, such as other smart contracts and the blockchain ledger.
Another challenge in migrating classes to a decentralized platform is ensuring the security of the system.Since the blockchain network is decentralized and open, there is a risk of malicious attacks that could compromise the integrity of the system.Therefore, it is essential to ensure that the migrated classes are secure and can withstand potential attacks.By using reverse engineering and class diagrams, it is possible to extract the necessary components and migrate them to a blockchain platform.However, ensuring the compatibility and security of the migrated classes is essential to the success of the migration process.
The process of storing test reports, as depicted in Figure 3, stores the reports in the blockchain along with other necessary information.Furthermore, the blockchain's decentralized nature ensures that the reports are accessible from anywhere and cannot be lost or destroyed.Overall, this process of storing test reports provides a secure, efficient, and easily accessible solution for laboratory report management.In the proposed system, doctors and patients can access their test reports by retrieving them from blockchain ledger.The process starts with the user requesting access to a specific test report by providing report number or patient's identity, which is stored in the blockchain (see Figure 4).The proposed process for accessing test reports ensures that only authorized users can access the reports, and that the reports are protected from unauthorized access.The registration process is an important initial step that allows the user to select a specific role such as a doctor, patient, or test report lab admin.Once the users have selected their roles, they can proceed to upload their respective data.For instance, a lab can upload test reports while doctors and patients can access them.This ensures that the data and their metadata are securely stored and can be accessed by authorized users (see Figure 5).In the proposed system, doctors and patients can access their test reports by retrieving them from blockchain ledger.The process starts with the user requesting access to a specific test report by providing report number or patient's identity, which is stored in the blockchain (see Figure 4).The proposed process for accessing test reports ensures that only authorized users can access the reports, and that the reports are protected from unauthorized access.
The process of migrating the classes to a decentralized platform involves several chal lenges.One of the main challenges is ensuring that the migrated classes are compatible with the blockchain platform.This requires a deep understanding of the blockchain archi tecture, and the programming languages used to write smart contracts.Additionally, the migrated classes must be able to interact with other components of the blockchain network, such as other smart contracts and the blockchain ledger.
Another challenge in migrating classes to a decentralized platform is ensuring the secu rity of the system.Since the blockchain network is decentralized and open, there is a risk of malicious attacks that could compromise the integrity of the system.Therefore, it is essentia to ensure that the migrated classes are secure and can withstand potential attacks.By using reverse engineering and class diagrams, it is possible to extract the necessary components and migrate them to a blockchain platform.However, ensuring the compatibility and security o the migrated classes is essential to the success of the migration process.
The process of storing test reports, as depicted in Figure 3, stores the reports in the blockchain along with other necessary information.Furthermore, the blockchain's decen tralized nature ensures that the reports are accessible from anywhere and cannot be los or destroyed.Overall, this process of storing test reports provides a secure, efficient, and easily accessible solution for laboratory report management.In the proposed system, doctors and patients can access their test reports by retrieving them from blockchain ledger.The process starts with the user requesting access to a specific test report by providing report number or patient's identity, which is stored in the blockchain (see Figure 4).The proposed process for accessing test reports ensures tha only authorized users can access the reports, and that the reports are protected from un authorized access.The registration process is an important initial step that allows the user to select a specific role such as a doctor, patient, or test report lab admin.Once the users have selected their roles they can proceed to upload their respective data.For instance, a lab can upload test reports while doctors and patients can access them.This ensures that the data and their metadata are securely stored and can be accessed by authorized users (see Figure 5).The registration process is an important initial step that allows the user to select a specific role such as a doctor, patient, or test report lab admin.Once the users have selected their roles, they can proceed to upload their respective data.For instance, a lab can upload test reports while doctors and patients can access them.This ensures that the data and their metadata are securely stored and can be accessed by authorized users (see Figure 5).The provided passage examines the incorporation of the "AddLipidTest" functio into a smart contract, employing the Solidity programming language.This particula function plays a vital role in storing data within the blockchain via smart contracts.T enhance the ease of data retrieval on the portal, the developers devised three mappin The provided passage examines the incorporation of the "AddLipidTest" function into a smart contract, employing the Solidity programming language.This particular function plays a vital role in storing data within the blockchain via smart contracts.To enhance the ease of data retrieval on the portal, the developers devised three mapping sets.The initial mapping set aids in obtaining a comprehensive list of all registered users.The second mapping set facilitates data retrieval based on the user's blockchain address.Lastly, the third mapping set allows for access to the data by the approved users, identified by their respective blockchain addresses.
To execute the "AddLipidTest" function, the necessary parameters are transmitted to the smart contract to store the data within the blockchain.This function is coded using the Solidity programming language, which is purpose-built for developing smart contracts on the Ethereum blockchain.The mapping sets are used to search the stored data on the portal.The first mapping set returns a list of all the registered users, which can be used to display the total number of registered users on the portal.The second mapping set help to find the data by the blockchain address of the user.This is useful when a user wants to retrieve his/her data from the portal.The third mapping set is used to access the data of the approved users by their blockchain address.

Results
This section presents the implementation specifics of the proposed system.The system in question is an Ethereum blockchain private network, which leverages Ethereum as an open-source, decentralized platform and utilizes the Solidity programming language for creating smart contracts.For the implementation, a web server was set up using Node.jsversion 15.3.0, while the Truffle version 5.3.0 and Ganache version 2.5.4 were employed.The networking for the decentralized application (DApp) was achieved using 802.11nWiFi.
Contract Creating: The function mentioned in the statement is a restricted function that is designed to be executed only by authorized personnel, such as a lab assistant, doctor, or patient.Its main purpose is to provide a secure and efficient method of uploading and storing medical data on a decentralized platform.Additionally, this function can be used to access previously stored medical data, enabling authorized personnel to retrieve and view patient information as needed.By limiting access to this function, the system can maintain data integrity and prevent unauthorized access to sensitive medical information.
Algorithm 1 presents a comprehensive explanation of the process for storing medical reports within the blockchain ledger.This algorithm utilizes a smart contract that incorporates a mapping of specific additional properties, ensuring secure and transparent storage of the reports.Medical reports encompass various types, such as blood tests and lipid test reports, with distinct parameters being stored in the blockchain ledger for each report category.The parameters required for lipid tests consist of the patient's user ID, prescription ID, cholesterol HDL, cholesterol LDL, triglycerides, total cholesterol LDL HDL ratio, and appointment ID.Likewise, for blood tests, the parameters encompass the patient's user ID, prescription ID, blood group, and appointment ID.The use of a smart contract ensures that the data are stored securely and are accessible only by authorized parties such as doctors, patients, and lab assistants.Additionally, the use of a mapping function allows for easy retrieval of the data based on specific parameters such as patient user ID, prescription ID, or appointment ID.
Storing medical reports in a blockchain ledger using a smart contract is a reliable method to secure sensitive medical data.The blockchain's decentralized nature and cryptographic security features make it difficult for anyone to alter or manipulate the data, ensuring its tamper-proof nature.By eliminating the need for intermediaries such as healthcare providers or insurance companies, it reduces the risk of data breaches or unauthorized access.Authorized parties, such as doctors or patients, can easily access the data in a transparent and efficient manner, leading to faster diagnosis and better patient outcomes.Moreover, the technology ensures that patient data are accurate, consistent, and up to date across different healthcare providers, enhancing the continuity of care.Overall, storing medical reports on a blockchain ledger using a smart contract provides a secure and transparent method to store sensitive medical data, ensuring that they are accessible only to authorized parties and leading to better patient outcomes.
Input(s): The process of submitting medical data to the blockchain ledger is described.The input parameters are converted to user ID and appointment ID, which are vital for identifying the user and their appointment.This ensures data integrity and accurate linkage between medical data and users.The medical data, including test type and results, is then submitted as a report to the blockchain ledger.To maintain data immutability, the user ID and appointment ID are securely stored within a smart contract, associated with the test report parameters.This ensures that the data are tamper-proof and easily accessible to authorized parties, such as doctors or patients, who can retrieve the information using the user ID or appointment ID as a reference.Overall, this process helps to improve the efficiency and accuracy of healthcare delivery and enables better patient outcomes.
Output: The mapped data, including user IDs, appointment IDs, and medical data reports, are stored in the blockchain ledger as the output of the algorithm.
Algorithm 2 is designed to validate the data-accessing capabilities in the proposed blockchain-based system.Once the data is stored in the blockchain ledger using a smart contract, it is essential to ensure that authorized parties can access the data securely and efficiently.The algorithm outlines the steps to retrieve data from the blockchain ledger and make them publicly accessible.The data access process involves different roles, such as users, doctors, and lab assistants.Each role has specific permissions to access data based on predefined parameters.For instance, users can access their medical reports based on their user ID and appointment ID mapping.On the other hand, doctors can access the medical report directly using the user appointment ID.To access the data from the blockchain ledger, the user must provide their authentication credentials, such as a private key or a digital signature.The blockchain network validates the credentials and grants access to the authorized party.The data are then retrieved from the blockchain ledger and displayed on the user interface.By implementing a blockchain-based system with data access controls, the proposed solution ensures the privacy and security of sensitive medical data.The system eliminates the need for intermediaries, such as healthcare providers or insurance companies, reducing the risk of data breaches and unauthorized access.Additionally, the system provides a transparent and auditable trail of medical data, which can improve the efficiency and quality of healthcare services.
Input(s): The algorithm's input is used to map the specific settings for accessing the data from the blockchain, which allows authorized parties to retrieve the data based on certain parameters such as user ID or appointment ID.
Processing: The blockchain provides different ways to access data, depending on the user's role and the parameters set.As an illustration, users can retrieve their medical data by mapping their user ID and appointment ID, whereas doctors can directly access medical reports using the appointment ID of the respective user.The parameters are mapped using algorithms to ensure secure and efficient data access.By providing various ways to access medical data, blockchain technology improves the transparency and accessibility of healthcare information, leading to better patient outcomes.
Output: The output of the algorithm is publicly accessible data that were mapped based on the input parameters.

Tools and Technologies for Algorithmic Implementation
The suggested solution incorporates a range of complementary tools and technologies to enable the implementation of the proposed system.The technology stack includes several components that are utilized to ensure the efficient functioning of the system.
We utilized the NodeJS platform to create a server-side application, leveraging the development tools available within it.Visual Studio Code (VSC), an integrated development environment, was employed to code and debug the application, offering helpful features such as code completion, syntax highlighting, and debugging tools.For the local blockchain environment, we employed the Ganache Truffle Suite package, allowing us to easily set up a personalized Ethereum blockchain for testing, command execution, and chain state observation.The Ganache Truffle Suite includes several useful tools, such as a development console, a graphical user interface, and a command-line interface, which simplify the management of the blockchain environment.
The mentioned interface is designed to display two distinct types of test reports: blood test reports and lipid test reports (see Figure 6).Each report type has its own specific set of required fields that must be included in order to properly record and track the relevant data.The purpose of this interface is to provide a user-friendly means for healthcare professionals to input this information accurately and efficiently.One notable feature of this system is that all of the data entered into the inte saved in a blockchain ledger.This means that the information is securely recor tamper-proof manner, ensuring that the data remain accurate and trustworthy. of blockchain technology also makes it easy to access and share data with other he One notable feature of this system is that all of the data entered into the interface are saved in a blockchain ledger.This means that the information is securely recorded in a tamper-proof manner, ensuring that the data remain accurate and trustworthy.The use of blockchain technology also makes it easy to access and share data with other healthcare professionals, as the ledger can be accessed from anywhere in the world with an internet connection.
This interface represents a significant step forward in the world of healthcare data management.By providing a streamlined and secure means for recording and accessing important medical data, this technology has the potential to improve patient outcomes and facilitate more effective communication among healthcare professionals.
The interface in question was designed to facilitate the retrieval of test reports from the blockchain ledger, using either the report ID or the patient ID as a reference point (see Figure 7).By inputting one of these two pieces of information, healthcare professionals are able to quickly and easily access the relevant test report data, which are securely stored in the blockchain ledger.One notable feature of this system is that all of the data entered into the inte saved in a blockchain ledger.This means that the information is securely reco tamper-proof manner, ensuring that the data remain accurate and trustworthy of blockchain technology also makes it easy to access and share data with other h professionals, as the ledger can be accessed from anywhere in the world with an connection.
This interface represents a significant step forward in the world of health management.By providing a streamlined and secure means for recording and important medical data, this technology has the potential to improve patient o and facilitate more effective communication among healthcare professionals.
The interface in question was designed to facilitate the retrieval of test rep the blockchain ledger, using either the report ID or the patient ID as a reference p Figure 7).By inputting one of these two pieces of information, healthcare prof are able to quickly and easily access the relevant test report data, which are secure in the blockchain ledger.The use of blockchain technology for storing medical data has several vantages, including the ability to ensure data integrity and security.Because the recorded in a decentralized and distributed fashion, they are effectively immun pering and hacking attempts.This means that healthcare professionals can be c in the accuracy and reliability of the data that they are accessing through this The ability to search for test reports by report ID or patient ID also provides si convenience and flexibility for healthcare professionals.They can easily pull up The use of blockchain technology for storing medical data has several key advantages, including the ability to ensure data integrity and security.Because the data are recorded in a decentralized and distributed fashion, they are effectively immune to tampering and hacking attempts.This means that healthcare professionals can be confident in the accuracy and reliability of the data that they are accessing through this interface.The ability to search for test reports by report ID or patient ID also provides significant convenience and flexibility for healthcare professionals.They can easily pull up the test reports they need, whether they are trying to track a particular patient's progress over time or simply need to quickly reference a specific report for diagnostic purposes.This streamlined approach to data management saves time and effort while also reducing the risk of errors or inaccuracies in the data.
In conclusion, the ability to search for test reports based on report ID or patient ID through this interface is an important and valuable feature.By leveraging the security and reliability of blockchain technology, healthcare professionals can be confident in the accuracy of the data they are accessing while also enjoying the convenience and flexibility of this streamlined approach to medical data management.

Evaluation Environment
The evaluation environment included hardware and software resources.Experiments were conducted on a Windows platform with an Intel Core i7 processor and 8 GB of RAM.NodeJS scripts in Visual Studio Code with ReactJS were used for automated execution evaluation.Existing libraries such as React and Web3 were utilized.A JavaScript performance library script analyzed CPU consumption for blockchain data storage and retrieval.Ganache and Metamask were used for the local Ethereum blockchain environment and browser-based distributed web connectivity.
The evaluation environment was carefully designed to ensure that the solution performance and execution were thoroughly assessed.The hardware and software resources utilized were well-suited for the task at hand.The use of existing libraries and performance analysis scripts further enhanced the evaluation process, enabling the team to identify and address any performance issues that arose.In addition, the use of the Ganache suite and Metamask extension provided a reliable and secure means of creating a local blockchain environment and linking it to the distributed web.As a result, the evaluation environment proved to be an essential component of the solution development process, enabling the team to thoroughly assess its performance and ensure that it meets the necessary requirements.

Upload and Energy Usage
Executing an Ethereum smart contract requires paying a fee known as fuel consumption, measured in the smallest unit of Ether called Gwei.In our proposed solution, we defined the cost of contract migration execution, as listed in Table 1.The cost is denoted in Ether, and the corresponding gas usage is recorded.Gas represents the ongoing computational expense in the system, and the gas price is dynamically adjusted by the network to reflect fluctuations in the value of Ether [24].To compare the fuel consumption during the original data transfer during the proposed data upload, we measured the gas consumption in Gwei.This enabled us to determine the cost of executing the smart contract.By tracking the Gwei, we were able to measure the exact amount of fuel used and ensure that the system was not wasting resources unnecessarily.Overall, our solution optimizes gas consumption by establishing a default gas limit and providing a low-cost migration process for efficient contract formation.
Experiments were performed to measure the average upload time for different sizes of medical data, as shown in Figure 8.For example, when uploading data of 450 bytes, the average gas consumption was approximately 555,062 Gas, while for data of 1000 bytes, the average gas consumption was around 1,409,568 Gas.These results indicate that fuel consumption increases with the size of the data being uploaded.This suggests that the system is efficient in terms of fuel consumption and can handle large volumes of medical data without significant delays or complications.It is essential to consider the time required for data uploading and accessing when evaluating the efficiency and performance of the proposed solution, and the results of the experiments demonstrate that the system is capable of handling data of different sizes efficiently.the average gas consumption was around 1,409,568 Gas.These results indicate that fuel consumption increases with the size of the data being uploaded.This suggests that the system is efficient in terms of fuel consumption and can handle large volumes of medical data without significant delays or complications.It is essential to consider the time required for data uploading and accessing when evaluating the efficiency and performance of the proposed solution, and the results of the experiments demonstrate that the system is capable of handling data of different sizes efficiently.The tools and technologies used in the solution are stacked, which means that they are arranged in a hierarchy based on their functionality and importance (see Figure 9).A server-side application is a crucial component of the suggested solution.It is built using the NodeJS platform, which is a popular JavaScript runtime that enables developers to create scalable network applications.The platform offers several tools that help  The tools and technologies used in the solution are stacked, which means that they are arranged in a hierarchy based on their functionality and importance (see Figure 9).A server-side application is a crucial component of the suggested solution.It is built using the NodeJS platform, which is a popular JavaScript runtime that enables developers to create scalable network applications.The platform offers several tools that help developers to develop and manage the server-side application effectively.These tools include Node Package Manager (npm), which is a package manager for NodeJS, and ExpressJS, which is a web application framework for NodeJS.

Evaluations of Query Response Time
The process of saving blood test reports' information in the blockchain requires data querying to retrieve and store the relevant data.To evaluate the efficiency of the solution in terms of data storage and retrieval from the blockchain, it is important to consider the query response time.To test the query response time for saving records with file hashes to the blockchain, the authors conducted two distinct tests.
The experimental findings demonstrate a notable disparity in query response time between the "Complete" and "Smart Contract" functions.The response time for the "Complete" function is notably faster, indicating its efficiency in handling queries.On the other hand, the delay observed in the "Smart Contract" function is attributed to the execution call of the smart contract, underscoring the significance of selecting the appropriate execution function to optimize query response time.These results highlight the need for careful consideration when designing and implementing execution functions to ensure optimal performance and minimize delays in data retrieval and processing (see Figure 10).

Evaluations of Query Response Time
The process of saving blood test reports' information in the blockchain requires data querying to retrieve and store the relevant data.To evaluate the efficiency of the solution in terms of data storage and retrieval from the blockchain, it is important to consider the query response time.To test the query response time for saving records with file hashes to the blockchain, the authors conducted two distinct tests.
The experimental findings demonstrate a notable disparity in query response time between the "Complete" and "Smart Contract" functions.The response time for the "Complete" function is notably faster, indicating its efficiency in handling queries.On the other hand, the delay observed in the "Smart Contract" function is attributed to the execution call of the smart contract, underscoring the significance of selecting the appropriate execution function to optimize query response time.These results highlight the need for careful consideration when designing and implementing execution functions to ensure optimal performance and minimize delays in data retrieval and processing (see Figure 10).
Overall, the authors demonstrated the significance of considering the query response time in evaluating the efficiency of blockchain-based solutions.The use of practical examples and real-world scenarios in this study highlights the relevance of such solutions in the medical domain, where secure and efficient data storage and retrieval are crucial.The results of the tests performed by the authors can provide valuable insights for developers and stakeholders looking to implement similar solutions in the future.Comparison of Traditional Healthcare Systems and Blockchain Decentralized Systems in Healthcare: A Research Perspective Traditional healthcare systems have long relied on centralized approaches for data management, patient records, and information exchange.However, the emergence of blockchain technology presents a novel decentralized paradigm that offers potential improvements in various aspects of healthcare.This research aims to compare traditional healthcare systems with blockchain decentralized systems, highlighting their contrasting features and potential advantages.

•
Data Security and Privacy: Traditional healthcare systems often face security and privacy concerns due to centralized data storage and reliance on trusted intermediaries.In contrast, blockchain decentralized systems offer inherent security through cryptographic algorithms, distributed consensus, and immutability.Patient data can be fragmented and securely stored across multiple nodes, providing enhanced data security and privacy.

•
Interoperability and Data Sharing: Interoperability among different healthcare systems and data sharing between providers remain significant challenges in traditional healthcare systems.Blockchain Overall, the authors demonstrated the significance of considering the query response time in evaluating the efficiency of blockchain-based solutions.The use of practical examples and real-world scenarios in this study highlights the relevance of such solutions in the medical domain, where secure and efficient data storage and retrieval are crucial.The results of the tests performed by the authors can provide valuable insights for developers and stakeholders looking to implement similar solutions in the future.
Comparison of Traditional Healthcare Systems and Blockchain Decentralized Systems in Healthcare: A Research Perspective Traditional healthcare systems have long relied on centralized approaches for data management, patient records, and information exchange.However, the emergence of blockchain technology presents a novel decentralized paradigm that offers potential improvements in various aspects of healthcare.This research aims to compare traditional healthcare systems with blockchain decentralized systems, highlighting their contrasting features and potential advantages.

•
Data Security and Privacy: Traditional healthcare systems often face security and privacy concerns due to centralized data storage and reliance on trusted intermediaries.In contrast, blockchain decentralized systems offer inherent security through cryptographic algorithms, distributed consensus, and immutability.Patient data can be fragmented and securely stored across multiple nodes, providing enhanced data security and privacy.Traditional healthcare systems often face scalability challenges, particularly with the increasing volume and complexity of patient data.Blockchain technology, with its distributed and decentralized architecture, allows for scalable storage, processing, and retrieval of healthcare data.Additionally, blockchain systems exhibit resilience to single points of failure, ensuring the continuity of healthcare services even during network disruptions or cyberattacks.
While blockchain decentralized systems offer promising advantages, there are challenges to overcome, including regulatory considerations, integration with existing healthcare infrastructure, and energy consumption.Further research and practical implementations are necessary to fully evaluate the potential of blockchain technology in healthcare and address these challenges.

Conclusions
In conclusion, our healthcare management system leverages smart contracts and blockchain technology to demonstrate the effectiveness and efficiency of decentralization in large-scale medical ecosystems.By incorporating smart contracts, we achieve auditability, interoperability, and accessibility while ensuring privacy, security, and granular control of access to electronic health record (EHR) data.This system enables secure data sharing and incentivizes medical researchers.We propose various applications of blockchain technology in health data management, aiming to streamline processes, improve patient outcomes, reduce costs, simplify procedures, and eliminate intermediaries.Through experimental implementations, we validate the efficiency and practicality of our solution, which establishes an iterative, scalable, secure, and decentralized healthcare ecosystem.By addressing challenges such as data siloing, legacy network incompatibility, unstructured data collection, high administrative costs, data security, and privacy concerns, our system empowers patients to exchange medical records freely and safely while maintaining full control over their privacy.
Future prospects: In the forthcoming endeavors, we will enhance our system to align it with cutting-edge research by incorporating a mobile-enabled smart application.Through subsequent case studies, our primary emphasis will lie in diversifying data evaluation, thereby augmenting the overall rigor of our assessments.

Figure 2 .
Figure 2. Reverse engineering model: extraction of classes and migration to decentralization.

Figure 2 .
Figure 2. Reverse engineering model: extraction of classes and migration to decentralization.

Figure 3 .
Figure 3.A process for saving data from medical reports.

Figure 3 .
Figure 3.A process for saving data from medical reports.

Figure 3 .
Figure 3.A process for saving data from medical reports.

Technologies 2023 ,Figure 6 .
Figure 6.Case study: interface for saving medical test report.

Figure 6 .
Figure 6.Case study: interface for saving medical test report.

Figure 6 .
Figure 6.Case study: interface for saving medical test report.

Figure 7 .
Figure 7. Case study: interface for accessing medical report data.

Figure 7 .
Figure 7. Case study: interface for accessing medical report data.

Figure 8 .
Figure 8. Gas is used based on block size and transaction count.

3. 2 . 3 .
Algorithmic Implementation Tools and Technologies Implementation of Technologies Eclipse IDE for source code and "Object Aid" library for converting the source to a UML class diagram.Database schema converted into XSD in SQL Server and XSD converted into XML using an online tool.Ganache Tool for creating a virtual Ethereum wallet and workspace for blockchain in a local environment.Visual Studio Code for creating HMS projects in a blockchain environment.Metamask extension for connecting Ganache blockchain with the application.Solidity language for the internal development of blockchain to write smart contracts.NodeJS for development and ReactJS for programming.MS SQL Server for external data storage (Login detail).APIs developed in C# for user authentication (Patient, Doctor, Lab Operator) Remix IDE for testing the purpose of Solidity development for smart contracts.

Figure 8 .
Figure 8. Gas is used based on block size and transaction count.

3. 2 . 3 .
Algorithmic Implementation Tools and Technologies Implementation of Technologies Eclipse IDE for source code and "Object Aid" library for converting the source to a UML class diagram.Database schema converted into XSD in SQL Server and XSD converted into XML using an online tool.Ganache Tool for creating a virtual Ethereum wallet and workspace for blockchain in a local environment.Visual Studio Code for creating HMS projects in a blockchain environment.Metamask extension for connecting Ganache blockchain with the application.Solidity language for the internal development of blockchain to write smart contracts.NodeJS for development and ReactJS for programming.MS SQL Server for external data storage (Login detail).APIs developed in C# for user authentication (Patient, Doctor, Lab Operator) Remix IDE for testing the purpose of Solidity development for smart contracts.

Technologies 2023 ,
11, x FOR PEER REVIEW 14 of 17developers to develop and manage the server-side application effectively.These tools include Node Package Manager (npm), which is a package manager for NodeJS, and Ex-pressJS, which is a web application framework for NodeJS.

Figure 9 .
Figure 9.A depiction of the tools and technologies required to implement the system.

Figure 9 .
Figure 9.A depiction of the tools and technologies required to implement the system.Technologies 2023, 11, x FOR PEER REVIEW 15 of 17

Figure 10 .
Figure 10.The time taken to compute the function execution and store the data in blockchain.

Figure 10 .
Figure 10.The time taken to compute the function execution and store the data in blockchain.

Table 1 .
Cost estimation with data storage.
• Interoperability and Data Sharing: Interoperability among different healthcare systems and data sharing between providers remain significant challenges in traditional healthcare systems.Blockchain technology facilitates interoperability by enabling seamless data exchange through standardized protocols and smart contracts.It offers a decentralized and secure environment for authorized entities to access and share patient data in a controlled manner, improving care coordination and continuity.• Transparency and Trust: Traditional healthcare systems often lack transparency, making it difficult for patients to have full visibility into their medical records and treatment history.Blockchain decentralized systems introduce transparency by providing an auditable and tamperproof ledger accessible to authorized parties.Patients can maintain control over their data, monitor access, and track any modifications, fostering trust between patients, providers, and other stakeholders.• Efficiency and Cost Optimization: In traditional healthcare systems, administrative inefficiencies, redundant processes, and fragmented data management contribute to increased costs.Blockchain decentralized systems offer streamlined processes, automated workflows, and real-time access to accurate data, reducing administrative burdens and improving overall efficiency.Smart contracts and automated transactions enable cost optimization by eliminating intermediaries and reducing transactional friction.