1 Introduction

Technology breakthroughs have significantly changed the healthcare sector in recent years. The incorporation of blockchain technology-telemedicine [1] and secure data interchange [2] is essential to this development and has the potential to completely transform patient-centred care. These developments are meant to tackle persistent issues in the medical field, like patient involvement, data security [3], and doctor’s trust [4]. The move to patient-centric models puts the patient first, allowing them to take charge of their health and medical records, improving patient outcomes and overall care quality.

Healthcare has long faced problems with data security, interoperability, and trust. With its intrinsic qualities of decentralisation, immutability [5], and transparency [6], Blockchain technology offers promising answers to these issues. However, telemedicine fills the gap between patients and medical professionals by enabling remote consultations and ongoing care, which is especially important given the state of world health today [7, 8]. Combining these technologies offers a never-before-seen chance to build a more reliable patient-focused EMR system that incorporates mechanisms for ongoing trust assessment and feedback and ensures safe and effective data management.

Developing a comprehensive patient-centric EMR system is made possible by the unique opportunity these technologies’ convergence offers. In addition to guaranteeing safe and effective data management, this system includes features for ongoing feedback and trust assessment. Patients are empowered to offer real-time feedback on their healthcare experiences by integrating a trust-based feedback system into the EMR model. This fosters an accountable and transparent healthcare ecosystem and influences the quality of care provided. Patient engagement data integrity and trustworthy interactions must be prioritised in the design and implementation of models as the healthcare sector attempts to adjust to these technological advancements. To meet the essential requirements of contemporary healthcare, this research attempts to investigate how blockchain and telemedicine can be integrated into a trust-based EMR model. This study establishes the foundation for upcoming advancements in patient-centric healthcare solutions by emphasising improving patient autonomy, guaranteeing secure data exchange, and fostering trust within the healthcare ecosystem.

2 Literature review

Blockchain is a relatively new and emerging technology with creative uses in its successful application to the healthcare industry. It provides the healthcare sector significant and outstanding opportunities ranging from science and logistics to inter-industry relationships, physicians and patients. Table 1 discusses the significant research work done in healthcare using blockchain.

Table 1 Literature review on various EMR models

3 System architecture for the proposed framework

The proposed TPC-EMR framework, illustrated in Fig. 1, showcases the various functional components of the system. For the many stakeholders in the healthcare system, this architecture creates a single platform for data sharing. Each participant’s health information is stored in a blockchain ledger throughout the network.

Fig. 1
figure 1

Trust-based patient-centric architecture for an EMR model

Each functional component includes an application programming interface (API) for blockchain apps, which facilitates user communication and handles transactions that update the ledgers to preserve the blockchain’s state.

There are five modules in the architecture, which are further described in Figs. 2, 3, 4, 5. Creating safe, decentralised, and unchangeable electronic medical records (EMRs) is the main goal of the first module. The subsequent module handles the consistency of EMRs among participating hospitals and allows patients to share their EMR data with their consent.

Fig. 2
figure 2

Patient’s dashboard components

Fig. 3
figure 3

Various assets within the model

Fig. 4
figure 4

Appointment module

Fig. 5
figure 5

Pharmacist and Medical representative interaction

3.1 System architecture

The TPC-EMR system architecture integrates blockchain technology to revolutionise healthcare delivery, ensuring patient empowerment, data security, and collaborative care. Central to this architecture is a blockchain infrastructure that guarantees the integrity and privacy of patient data, enabling decentralised storage and access control. Patients interact through a user-friendly portal, managing their medical records, appointments, and health metrics. Telemedicine capabilities facilitate virtual consultations with doctors, while smart contracts govern consent and data-sharing agreements to ensure compliance and transparency [10]. Additionally, the system includes a feature for medical representatives to arrange medicines unavailable at the pharmacy, enhancing accessibility and patient care. The architecture fosters patient involvement, quality care, and mutual trust among stakeholders through incentivised patient engagement and a trust-based feedback system.

3.2 Proposed participants, their roles and their control panels

The Ethereum blockchain is the foundation for the proposed patient-centric healthcare model, providing a secure and flexible platform for developing sophisticated blockchain-based applications [15]. In this network, key entities include participants, assets, transactions, and smart contracts, establishing a cohesive ecosystem for effective healthcare delivery.

3.2.1 Participants

Participants include individual patients, doctors, pharmacists, and medical representatives. These participants can create, manage, and exchange health data assets with one another, facilitating efficient collaboration within the healthcare system using the EMR patient’s dashboard, as shown in Fig. 2.

3.2.2 Assets

Assets encompass tangible and intangible entities such as medical records, prescriptions, and health data. For example, a prescription is an intangible asset, while a receipt for a purchase is a tangible asset. Assets can be managed and modified through transactions on the Ethereum blockchain, ensuring data integrity and security. The list of assets used in our model is shown in Fig. 3.

3.2.3 Transactions

Transactions involve scheduling appointments, exchanging data, and issuing indents for medical supplies. A transaction is carried out to verify the appointment if a doctor is available when a patient makes one. Similarly, when a patient buys medications from a pharmacy, a transaction is made to provide a receipt. Additionally, pharmacists can issue indents to medical representatives to request medicines that are not currently available, ensuring timely patient care. These transactions are validated and processed through the Ethereum network using smart contracts, ensuring data integrity and patient consent.

4 Interaction among participants

4.1 Doctor and patient

The system uses blockchain to store patient and doctor IDs securely. PIDi, i is an integer within the range of registered patients P. DIDj, where j is an integer within the range of available doctors D. AIDij is the appointment ID between patient i and doctor j. di is the specific disease or condition i from the set of diseases d. SPik indicates whether patient i is suffering from disease k. SDjl indicates whether doctor j has a speciality l from the set of specialisations S. The objective functions in the model are outlined as follows:

$${\text{X}} = {\text{P}} + {\text{Q}} + {\text{R}}$$
(1)
$$P = \left\{ {\begin{array}{*{20}c} {1,\,if\,SP_{ik} = d_{i} } \\ {0,\,otherwise} \\ \end{array} } \right.$$
(2)
$$Q = \left\{ {\begin{array}{*{20}c} {1,\,if\,AD_{ij} = A} \\ {0,\,otherwise} \\ \end{array} } \right.$$
(3)
$$R = \left\{ {\begin{array}{*{20}c} {1,\,if\,SD_{jl} = SP_{jk} } \\ {0,\,otherwise} \\ \end{array} } \right.$$
(4)

4.2 Pharmacist and patient

The model utilises blockchain to maintain secure records of PIDs and pharmacist IDs (PhID) and details about medications and prescriptions. PhIDj, where j is an integer within the range of available pharmacists Ph. MIDk is the medication ID for a specific medication k within the set of available medications M. RIDij is the request ID for a prescription request from patient i to pharmacist j, and Ci is the completed medication order for a patient i. Objective functions in the model are outlined as follows:

$${\text{T}} = {\text{U}} + {\text{V}} + {\text{W}}$$
(5)
$$U = \left\{ {\begin{array}{*{20}c} {1,\,if\,RID_{ij} = R} \\ {0,\,otherwise} \\ \end{array} } \right.$$
(6)
$$V = \left\{ {\begin{array}{l} {1,\,if\,M\,available} \\ {0,\,otherwise} \\ \end{array} } \right.$$
(7)
$$W = \left\{ {\begin{array}{l} {1,\,if\,C_{i} = C} \\ {0, \,otherwise} \\ \end{array} } \right.$$
(8)

4.3 Medical representative and pharmacist

The interaction between medical representatives and pharmacists involves securely exchanging medication information, supply orders, and product details.

MRIDj, where j is an integer within the range of available medical representatives MR. MIDk is the medication or medical supply ID for a specific product k within the set of available medications and supplies M. OIDij is the order ID for a supply order from pharmacist i to medical representative j. Ci is the completed supply order for pharmacist i. Objective functions in the model are outlined as follows:

$${\text{E}} = {\text{U}} + {\text{V}} + {\text{W}}$$
(9)
$$U = \left\{ {\begin{array}{*{20}c} {1,\,if\,OID_{ik} = O} \\ {0,\,otherwise} \\ \end{array} } \right.$$
(10)
$$V = \left\{ {\begin{array}{*{20}c} {1,\,if\,m available} \\ {0, \,otherwise} \\ \end{array} } \right.$$
(11)
$$W = \left\{ {\begin{array}{*{20}c} {1,\,if\,C_{i} = CO} \\ {0, \,otherwise} \\ \end{array} } \right.$$
(12)

5 Feedback-based trust model

The feedback-based trust model for the patient-centric healthcare framework involves collecting and analysing feedback from patients about doctors, as well as from pharmacists about medical representatives. Patients provide feedback on doctors based on their experience during appointments, treatment, and communication. The doctor’s expertise, professionalism, bedside manner, communication skills, and overall patient satisfaction are key aspects. Pharmacists provide feedback on medical representatives based on their interactions. Key aspects include the quality and availability of medication supplies, timeliness of deliveries, knowledge of products, and overall professionalism. This feedback generates a trust factor that indicates the reliability and quality of service these doctors provide. The trust factor can enhance decision-making, improve patient care, and guide professional development.

fij is the feedback data from patient i on doctor j and gkj is the data from the pharmacist k on medical representative j.

For each doctor j, the average feedback score will be

$$\overline{f}_{j} = \frac{1}{{N_{j} }}\mathop \sum \limits_{i = 1}^{{N_{j} }} f_{ij}$$
(13)

where Nj is the number of feedback submissions for doctor j.

For each medical representative j, the average feedback score will be

$$\overline{g}_{j} = \frac{1}{{M_{j} }}\mathop \sum \limits_{k = 1}^{{M_{j} }} g_{kj}$$
(14)

where Mj is the number of feedback submissions for medical representative j.

We use the weighted feback to calculate the trust factor Tj for each doctor j:

$$T_{j} = w_{f} X \overline{f}_{j} .$$
(15)

Similarly, calculate the trust factor Uj for each medical representative j:

$$U_{j} = w_{g} X \overline{g}_{j}$$
(16)

where \(w_{f}\) and \(w_{g}\) are weights assigned to patient and pharmacist feedback, respectively.

For continuous monitoring, new feedback data \(f_{ij}\) from patients about doctors and \(g_{kj}\) from pharmacists about medical representatives will be collected. For each doctor j, the new exponential moving average (EMA) of the trust factor Tj using new feedback data \(f_{ij}\):

$$EMA_{{T_{j} }} = \alpha f_{ij} + \left( {1 - \alpha } \right)EMA_{{T_{j} }}^{previous}$$
(17)

where α is the smoothing factor (e.g., 0.1) that controls the weight given to new feedback data and \(EMA_{{T_{j} }}^{previous}\) is the previous exponential moving average of the trust factor for doctor j.

So, the updated trust factor for doctor j will be

$$T_{j} = EMA_{{T_{j} }}$$
(18)

Similarly, the updated trust factor will be calculated for medical representative j.

6 Reward system

The reward system in the healthcare framework provides patients with incentives for engaging in healthy behaviours, achieving health goals, and participating in healthcare-related activities. The system promotes patient involvement in their healthcare journey by offering tangible benefits such as discounts and vouchers. Patients can earn them by achieving specific health goals such as meeting exercise targets, maintaining healthy diet habits, or reaching weight loss milestones. The system encourages patients to actively participate in their healthcare journey and take proactive steps toward better health. Rewards help patients save on healthcare costs, making healthcare more affordable and accessible. The system can improve patient health outcomes by incentivising healthy behaviours and regular health checkups.

7 Implementation

This paper’s implementation section focuses on the real-world application of the Ethereum blockchain’s trust-based, patient-centric electronic medical records (EMR) paradigm. This section details every action made to put the suggested solution into practice. These actions include setting up the blockchain network, creating and implementing smart contracts for EMR administration, and smoothly integrating key parts. We aim to provide a thorough knowledge of the technical nuances involved and insightful information about the EMR model’s practical applicability through this comprehensive explanation of the deployment process.

The proposed architectural framework was designed using Ethereum’s blockchain. The following stages make up the suggested architectural framework:

  1. 1.

    In the initial phase of network implementation, the focus lies on designing the participants and assets essential for the TPC-EMR model on the Ethereum blockchain. Following the application coding, we compile the code into a.sol file (Solidity file). Ethereum’s test environment, Ganache, deploys and tests the smart contracts.

  2. 2.

    In the second phase, various functionalities, such as trust score calculation, appointment scheduling, and medication procurement, were thoroughly tested within the framework.

  3. 3.

    In the third phase, modules for patients and pharmacists giving feedback to doctors and medical representatives based on interaction satisfaction are developed within the framework, as shown in Fig. 6. Testing commences by calculating the doctor’s trust score based on the patient’s feedback after the interaction, as shown in Fig. 7. Subsequently, another test commences by setting patients’ health goals and rewarding them with points on goal completion. Another test is commenced on raising indent transactions by the pharmacist for the medicine to the medical representative, as shown in Fig. 8.

Fig. 6
figure 6

Patient’s feedback portal

Fig. 7
figure 7

Representing doctor’s trust score

Fig. 8
figure 8

Indent transaction raised by pharmacist

Algorithm 1
figure a

Trust Score Calculation

8 Analysis and discussion

8.1 Comparative analysis

We conduct a comparative analysis of our model with other well-known models. Comparing the models uses the following criteria: reward system medicine supply chain trust calculation accountability, real-time feedback, and health metrics. Table 2 displays the inclusion status of the parameter in our model (yes) and the corresponding models (no).

Table 2 Comparison among various existing EMR models with TPC-EMR model

Since it considers every pertinent factor, our Blockchain-Enabled TPC-EMR model is more thorough and patient-centric than other research approaches. While focusing on specific areas like data exchange and responsibility, the other models do not encompass our model’s full range of capabilities.

8.2 System analysis

8.2.1 Patient feedback submission analysis

Patients and pharmacists access the EMR system’s user-friendly interface to give doctors and medical representatives feedback. Patients provide feedback on recent healthcare interactions, appointment satisfaction, treatment satisfaction and communication quality, and pharmacists provide feedback on interaction satisfaction, medication availability, delivery timeliness and professionalism. The feedback submission form includes client-side validation using JavaScript to ensure completeness and accuracy. Server-side validation through Express.js further validates data integrity and prevents injection attacks. The feedback data is securely encrypted and stored within the EMR system’s database upon submission. Data storage mechanisms, including encryption-at-rest and access controls, ensure the confidentiality, integrity, and availability of feedback data. Compliance measures are in place to adhere to privacy regulations such as HIPAA, safeguarding patient confidentiality and data security.

8.2.2 Data validation and authentication analysis

The EMR system employs robust validation and authentication mechanisms to verify the authenticity and integrity of feedback data. Authentication processes validate that feedback originates from authorised patients and pharmacists, preventing unauthorised access or tampering. Hash functions like SHA-256 are used to compute checksums of feedback data before and after transmission or storage.

8.2.3 Trust calculation model integration analysis

A weighted aggregation method is utilised for trust calculation, where each feedback rating is multiplied by a weight based on the time of submission. Based on analysed feedback data, the trust calculation model computes real-time dynamic trust scores for each doctor and medical representative. Trust scores reflect the perceived quality of care, communication effectiveness, and overall satisfaction. These scores empower patients and pharmacists to make informed decisions about their doctors and medical representatives. Calculated trust scores are continuously updated within the EMR system’s database, reflecting the latest feedback data and patient and pharmacist perceptions.

8.2.4 Trust score updation analysis

Real-time updates ensure that trust scores remain accurate and relevant, enabling stakeholders to monitor changes in doctors’ trustworthiness over time. Updated trust scores serve as dynamic indicators of doctors’ and medical representatives’ performance and reputation, driving continuous improvement initiatives within the healthcare organisation. Trust scores seamlessly synchronise with doctors’ profiles within the EMR system’s intuitive interface. Patients and pharmacists can easily access updated trust scores when browsing doctor profiles, facilitating informed decision-making and enhancing their empowerment. Stakeholders, including patients, doctors, pharmacists and medical representatives, access trust score data, promoting transparency and accountability in healthcare service delivery.

8.3 Reward analysis

The reward management module is implemented on the Ethereum blockchain. This module, named RewardSystem, serves as the core component responsible for managing reward points and facilitating reward-related interactions. It maintains a rewardPoints mapping, which associates each patient’s Ethereum address with their corresponding reward balance. This mapping allows tracking of the reward points earned by each patient. The earnRewards function calculates and assigns patients reward points based on their interactions with the EMR system. For example, the function takes a parameter step, representing the number of steps the patient walks, and calculates the reward points earned. The redeemRewards function enables patients to redeem their earned reward points for tangible benefits, such as discounts or vouchers. This function implements the logic for verifying the patient’s redemption eligibility and deducting the appropriate reward points from their balance. Upon successful redemption, the function issues discount codes or vouchers to the patient. The reward management module undergoes thorough testing locally using development tools like Remix IDE or Truffle framework to ensure its functionality and integrity. Once tested, the module is deployed to the network using deployment tools like Remix or Truffle. Upon deployment, the module is integrated with the patient-centric EMR system, allowing patients to interact with the module through the EMR system’s user interface. Patients can earn, track, and redeem rewards seamlessly within the EMR system, enhancing their engagement and motivation in their healthcare journey.

8.3.1 Earn reward

  1. a)

    Patient engagement assessment: the EMR system monitors patient engagement and participation in healthcare-related activities, including adherence to treatment plans, completion of health assessments, and achievement of health goals. Patient interactions with the EMR system are tracked and recorded, capturing relevant data points such as appointment attendance, medication adherence, and lifestyle modifications.

  2. b)

    Identification of rewardable behaviors: the EMR system identifies specific health behaviours or milestones eligible for reward points based on predefined criteria and program rules. These behaviours include:

  3. c)

    Regularly attending scheduled appointments with doctors.

  4. d)

    Adhering to prescribed medication regimens and treatment plans.

  5. e)

    Achieving predefined health goals such as weight loss, blood pressure control, or smoking cessation.

  6. f)

    Completing health assessments, surveys, or educational modules within the EMR platform.

  7. g)

    Reward point calculation: each eligible behaviour or milestone is assigned a corresponding number of reward points based on its significance and impact on patient health outcomes. The Reward system module calculates the number of reward points the patient earns for each completed activity or behaviour in real-time. Reward points may be weighted differently depending on the complexity or importance of the behaviour, with more challenging tasks earning higher point values.

  8. h)

    Reward point accumulation: accumulated reward points are stored securely within the patient’s account in the EMR system, leveraging blockchain technology to ensure immutability and transparency. Patients can view their current reward balance and track their progress towards earning rewards through the EMR user interface.

8.3.2 Reward redemption

The redeemRewards function enables patients to redeem their earned reward points for tangible benefits, such as discounts or vouchers. This function implements the logic for verifying the patient’s redemption eligibility and deducting the appropriate reward points from their balance. Upon successful redemption, the function issues discount codes or vouchers to the patient.

  1. a)

    Preconditions verification: before initiating the reward redemption process, the patient initiates a request through the EMR system’s user interface, indicating their intent to redeem accrued reward points for tangible benefits. The EMR system verifies the patient’s eligibility for reward redemption based on predefined criteria, including:

  2. b)

    Sufficient reward balance

  3. c)

    The patient’s account is in good standing and not subject to administrative restrictions or sanctions.

  4. d)

    Invocation of redemption function: upon successful precondition verification, the EMR system invokes the redeem rewards function within the reward management module deployed on the Ethereum blockchain. The function call includes parameters such as the patient’s Ethereum address and the quantity of reward points to be redeemed.

  5. e)

    Validation and deduction: within the redeemRewards function, the smart contract validates the patient’s eligibility for reward redemption based on the provided parameters. If the patient meets the redemption criteria, the contract deducts the specified number of reward points from the patient’s balance. The deduction process is atomic and immutable, ensuring the integrity and consistency of reward point transactions on the blockchain.

  6. f)

    Reward issuance: following the successful deduction of reward points, the smart contract triggers the issuance of tangible rewards or benefits to the patient. Depending on the nature of the reward program, rewards may manifest as:

  7. g)

    Digital tokens or cryptocurrency deposited into the patient’s Ethereum wallet.

  8. h)

    Discount vouchers or coupons the EMR system generates for use in healthcare services or wellness products.

  9. i)

    Access privileges or premium features unlocked within the EMR platform, such as priority appointment scheduling or personalised health content.

  10. j)

    Transaction confirmation: upon completion of the reward redemption process, the smart contract emits an event or transaction receipt confirming the successful execution of the redemption transaction. This confirmation is cryptographic proof of the transaction’s validity and immutability, assuring the patient and the EMR system.

  11. k)

    User notification: the EMR system notifies the patient of the successful redemption, conveying details of the redeemed rewards and any associated instructions or redemption codes. This notification enhances user engagement and satisfaction, fostering a positive user experience within the TPC- EMR model.

The module also includes additional functions to enhance reward management, such as checking reward balances (checkRewardBalance) and retrieving reward transaction history. These functions give patients visibility into their reward status and transaction records, promoting transparency and accountability.

  • Reward balance inquiry: patients can query their current reward balance using the checkRewardBalance function, which provides real-time visibility into their accumulated reward points.

  • Transaction history: the contract may maintain a transaction log to record all reward-related interactions initiated by patients, including the earning, redemption, and transfer of reward points. This transaction history serves as an audit trail, enabling patients to review their past activities and monitor the progression of their reward journey over time.

8.4 Pharmacist and medical representative collaboration

  1. a)

    Patient requests medicine refill: the patient initiates a transaction on the blockchain network through the EMR system, creating a refill request transaction. The pharmacist retrieves the refill request transaction stored on the blockchain using a private key, securely accessing the patient’s prescription. The pharmacist’s access is authenticated through cryptographic signatures, ensuring data privacy and integrity.

  2. b)

    Pharmacist checks medicine availability: after accessing the prescription, the pharmacist queries the pharmacy’s inventory stored on the blockchain to verify the availability of the prescribed medication. This information is directly retrieved from a single inventory smart contract deployed on the blockchain. If the prescribed medication is unavailable in the pharmacy’s inventory, the pharmacist initiates the procurement process by sending a transaction to the medical representative.

  3. c)

    Medical representative checks company stock: the assigned medical representative accesses the pharmaceutical company’s inventory stored on the blockchain to check the availability of the requested medication. This data is retrieved from the company inventory smart contract deployed on the blockchain.

  4. d)

    Indent generation and restocking: upon confirming the availability of the medication, the pharmacist generates an indent (purchase requisition) transaction. This transaction includes details of the medication, quantity required and delivery preferences.

  5. e)

    Medicine unavailable in company stock: if the medication is unavailable in the company’s stock, the medical representative explores alternative sourcing options, such as contacting suppliers or distributors. The medical representative collaborates with peers within the medical supply chain to source the required medication if necessary.

  6. f)

    Restocking medicine in pharmacy stock: upon successfully procuring the medication, the medical representative updates the pharmacy’s inventory directly through a transaction. This transaction records the details and the quantity of medication restocked.

9 Conclusion

This study assessed the architecture, essential elements of electronic medical record (EMR) systems and the methodology used to determine trust scores. We have also investigated how our model might affect patient outcomes and healthcare provision, finding potential advantages like better patient satisfaction, better care coordination, and improved patient engagement. Our research underscores the transformative potential of the blockchain-enabled TPC-EMR model, highlighting the importance of technological innovation in driving positive change in healthcare delivery. We can strive toward a future where patients actively participate in their care and healthcare systems are truly patient-centred by embracing patient empowerment interoperability and mechanisms that foster trust. For future scope, Artificial intelligence and machine learning can be incorporated to analyse patient data and provide predictive insights for better healthcare outcome.