Electronic medical record secure storage and controllable sharing system, method, device and medium

By leveraging blockchain networks and on-chain/off-chain storage architecture, combined with smart contracts and encryption technology, the issues of data silos and security/privacy in electronic medical record systems have been resolved. This enables trusted sharing and transparent management across institutions, thereby improving the security and efficiency of electronic medical records.

CN121191673APending Publication Date: 2025-12-23SICHUAN CHANGHONG SMART HEALTH TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511362100.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-23
Publication Date
2025-12-23

AI Technical Summary

Technical Problem

Existing electronic medical record systems suffer from data silos and risks of data security and privacy breaches. Centralized architectures make it difficult to achieve seamless and reliable data sharing and effective access control.

Method used

It adopts an architecture that combines blockchain network with on-chain and off-chain storage, manages the metadata and encrypted data of electronic medical records through smart contracts, realizes trusted sharing across institutions, and allows patients to control and authorize the data. It also uses asymmetric and symmetric encryption algorithms to protect sensitive information.

Benefits of technology

It enables secure and efficient sharing of electronic medical records across institutions, protects patient data sovereignty, enhances system transparency and security, reduces the risk of data leakage, and improves diagnostic and treatment efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121191673A_ABST
    Figure CN121191673A_ABST
Patent Text Reader

Abstract

The invention discloses a secure storage and controllable sharing system, method and device for electronic medical records and a medium. The system comprises a user terminal, a medical institution terminal, an application service layer and a block chain network. The user terminal is used for providing services for patients and third-party visitors; the medical institution end is used for providing services for medical staff; the application service layer is used for receiving original electronic medical record data from a medical institution end and encrypting sensitive fields or a whole file in an electronic medical record by using an asymmetric encryption algorithm or a symmetric encryption algorithm; calculating a unique hash value, namely an abstract, for the encrypted electronic medical record file by using a secure hash algorithm; and packaging metadata of the electronic medical record and the calculated hash value into a transaction by calling a function of the smart contract, and sending the transaction to a block chain network for recording. The diagnosis and treatment efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of medical information technology, and in particular to a secure storage and controllable sharing system, method, device and medium for electronic medical records. Background Technology

[0002] Currently, electronic medical records (EMRs) have become a core component of the modern healthcare system. However, traditional centralized EMR systems generally face two major challenges: 1) Data silos: EMR systems in different healthcare institutions are typically independent and heterogeneous, forming information silos. When patients visit different hospitals, their EMR data cannot be seamlessly and reliably transferred and shared, leading to duplicate examinations, inefficient diagnosis, and potentially affecting the accuracy of treatment decisions. 2) Data security and privacy risks: The centralized database storage model makes it a prime target for hackers. Once a server is compromised, a large amount of highly sensitive patient privacy data may be stolen or tampered with. Furthermore, ensuring that data is only accessed by authorized parties within the authorized scope and effectively tracing access behavior during data sharing are pain points that existing technologies struggle to perfectly address.

[0003] While existing solutions have attempted to address data sharing issues by establishing regional healthcare information platforms, these platforms often still employ a centralized architecture, failing to fundamentally resolve trust and security problems. Summary of the Invention

[0004] To address issues such as data silos, security and privacy risks, and difficulties in sharing, this application provides a secure storage and controllable sharing system, method, device, and medium for electronic medical records, which can achieve efficient, reliable, and controllable sharing of electronic medical records while ensuring data sovereignty and privacy security.

[0005] This application discloses a secure storage and controllable sharing system for electronic medical records, which includes a user terminal, a medical institution terminal, an application service layer, and a blockchain network. The user terminal is used to provide services to patients and third-party visitors. Patients are the ultimate owners of their electronic medical records. They can view their entire electronic medical record index through the user terminal and set or revoke access authorization for any electronic medical record to others. When granting authorization, authorization information is set. After obtaining authorization from the patient, third-party visitors can initiate an access request through the user terminal. After system verification, they can view the authorized electronic medical record content. The medical institution side is used to provide services to medical staff; medical staff enter and generate patients' electronic medical records on the medical institution side. When an electronic medical record is generated or updated, the system calls the interface of the application service layer to start the subsequent encryption and on-chain process. The application service layer receives raw electronic medical record data from medical institutions and encrypts sensitive fields or the entire file using asymmetric or symmetric encryption algorithms. It then uses a secure hash algorithm to calculate a unique hash value (digest) for the encrypted electronic medical record file. The layer packages the electronic medical record metadata and the calculated hash value into a transaction and sends it to the blockchain network for recording by calling a function in a smart contract. Finally, it processes access requests from user terminals, verifies the accessor's permissions by querying authorization records on the blockchain network, and after successful verification, retrieves the corresponding encrypted electronic medical record from the off-chain database, decrypts it using a key, and securely transmits it to the requester. Blockchain networks primarily use smart contracts to record immutable information; this immutable information includes electronic medical record metadata, authorization records, and operation logs.

[0006] Furthermore, it also includes off-chain encrypted medical record databases; an off-chain encrypted medical record database is one or more distributed databases or file systems managed by each medical institution itself, responsible for storing complete, encrypted electronic medical records by storing actual sensitive data off-chain.

[0007] Furthermore, the blockchain network adopts the form of a consortium blockchain, with nodes including various medical institutions and health regulatory departments.

[0008] Furthermore, the authorization information includes the authorizer, the authorized person, the authorized content, the authorization period, and the number of accesses; third-party visitors include doctors from other hospitals, patients' families, and insurance companies; medical institution-side information includes doctors' workstations and HIS / EMR systems within the hospital; and metadata includes patient ID, medical institution ID, and timestamp.

[0009] Furthermore, the metadata of electronic medical records includes a unique identifier for each electronic medical record, a medical record summary, an off-chain storage address, a creation time, and operator information; authorization records include the specific content, time limit, and status of the authorization; the status includes valid and revoked; operation logs: log records of all key operations, used for auditing and traceability; key operations include electronic medical record generation, authorization, and access.

[0010] Furthermore, smart contracts include four core functions: metadata registration, authorization management, access control, and logging.

[0011] This application also discloses a method for secure storage and controllable sharing of electronic medical records, applicable to the above-described method for secure storage and controllable sharing of electronic medical records, comprising: When a patient needs to receive treatment at one hospital and wants a doctor at that hospital to access their electronic medical records from another hospital, the process is as follows: Access request initiation: The patient, through their own user terminal at the hospital, locates the electronic medical record or the entire electronic medical record folder that needs authorization and selects the doctor to be authorized; Patient authorization: The patient sets the authorization policy, and after confirmation, the authorization request is sent to the application service layer; Authorization information is uploaded to the blockchain: The application service layer packages the authorization information into a transaction, calls the smart contract to write it to the blockchain network; the authorization record on the blockchain network is updated. Access permission verification and data acquisition: Doctors at the patient's hospital initiate access requests to the patient's electronic medical records through their workstations; upon receiving the request, the application service layer queries the smart contract on the blockchain network to verify the doctor's identity and whether there is valid authorization. The smart contract automatically checks whether the current time is within the authorization period and whether the number of accesses has exceeded the limit. Data Decryption and Presentation: If the authorization verification is successful, the blockchain network returns electronic medical record metadata to the application service layer. The application service layer uses the address in the metadata to retrieve the encrypted electronic medical record from the off-chain encrypted medical record database of another hospital. The off-chain encrypted medical record database returns the encrypted electronic medical record data to the application service layer. The application service layer uses a secure key exchange mechanism to obtain the decryption key, decrypts the received encrypted electronic medical record, and securely presents the decrypted plaintext data, i.e., the medical record content, on the doctor's workstation interface. At the same time, this access behavior is recorded on the blockchain network.

[0012] Furthermore, the electronic medical record generation and blockchain process includes: When a doctor completes a consultation for a patient and generates a new electronic medical record at a medical institution, the system will execute the following process: Electronic medical record data entry and transmission: Doctors complete electronic medical record entry at the workstation; when the data is transmitted to the application service layer, a security protocol is used to ensure the security of the transmission channel; Sensitive information encryption: After receiving electronic medical record data, the application service layer identifies and encrypts highly sensitive fields or the entire electronic medical record file. The encryption key is securely managed by a dedicated key management system. Highly sensitive fields include ID card number and contact information. Off-chain storage and digest computation: The encrypted electronic medical record file is stored in the designated off-chain encrypted medical record database and obtains a unique storage address or file ID; Metadata on-chain: The application service layer packages the metadata of the electronic medical record, the off-chain storage address, and the hash value of the electronic medical record calculated in the previous step into a transaction, and calls the smart contract on the blockchain network to register. Generate a unique identifier and confirm the transaction: The blockchain network executes the transaction, permanently writes the transaction record into the distributed ledger, and generates a unique and tamper-proof identifier for the electronic medical record; once the transaction is confirmed, the electronic medical record storage process is completed.

[0013] After the transaction is confirmed, it is written into a block in the blockchain network and the confirmation information is returned to the application service layer. After receiving the confirmation information, the application service layer sends a message to the doctor's workstation that the operation was successful.

[0014] This application also discloses an electronic device, including a memory and a processor, wherein the memory stores a computer program that, when executed by the processor, implements the method described above.

[0015] This application also discloses a computer-readable storage medium comprising a computer program or instructions that, when executed on a computer, cause the computer to perform the methods described above.

[0016] Due to the adoption of the above technical solution, this application has the following advantages: 1. Breaking down data silos: A cross-institutional, trusted data sharing network has been built, enabling patients' electronic medical records to flow securely and efficiently between different medical institutions.

[0017] 2. Enhance data security and privacy protection: By using encryption technology and separating on-chain and off-chain storage, patient privacy information is protected to the greatest extent.

[0018] 3. Empower patients with data sovereignty: Patients can independently and precisely control the scope and method of sharing their personal electronic medical records, truly realizing "I control my data".

[0019] 4. Achieve complete traceability: All operations on electronic medical records (generation, modification, authorization, access) will leave an immutable trace on the blockchain network, greatly enhancing the system's transparency and auditability.

[0020] 5. By leveraging the decentralized, tamper-proof, and traceable characteristics of the blockchain network, combined with off-chain storage and encryption technology, the security and privacy of medical record data are guaranteed, and a secure, transparent, and efficient electronic medical record management and sharing ecosystem is built.

[0021] 6. Patients can safely and conveniently authorize doctors to access data without losing their data management rights, participating in a trusted shared network, breaking down information silos, improving diagnostic and treatment efficiency, and greatly reducing the risk of data leakage and non-compliance. Attached Figure Description

[0022] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments recorded in the embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings.

[0023] Figure 1 This is a schematic diagram of the overall architecture of a secure storage and controllable sharing system for electronic medical records provided in an embodiment of the present invention.

[0024] Figure 2 This is a flowchart illustrating a method for secure storage and controllable sharing of electronic medical records provided in an embodiment of the present invention.

[0025] Figure 3 This is a schematic diagram of the electronic medical record generation and blockchain process provided in an embodiment of the present invention. Detailed Implementation

[0026] The present application will be further described in conjunction with the accompanying drawings and embodiments. The described embodiments are only some, not all, of the embodiments of the present application. All other embodiments obtained by those skilled in the art should fall within the protection scope of the embodiments of the present application.

[0027] See Figure 1 This application provides an embodiment of a secure storage and controllable sharing system for electronic medical records, which includes a user terminal, a medical institution terminal, an application service layer, and a blockchain network; The user terminal is used to provide services to patients and third-party visitors. Patients are the ultimate owners of their electronic medical records. They can view their entire electronic medical record index through the user terminal and set or revoke access authorization for any electronic medical record to others, setting authorization information when granting authorization. After obtaining authorization from the patient, third-party visitors can initiate an access request through the user terminal. After system verification, they can view the authorized electronic medical record content. The user terminal can be in the form of a smartphone app, web portal, etc. The medical institution side is used to provide services to medical staff; medical staff enter and generate patients' electronic medical records on the medical institution side. When an electronic medical record is generated or updated, the system calls the interface of the application service layer to start the subsequent encryption and on-chain process. The application service layer receives raw electronic medical record data from medical institutions and encrypts sensitive fields or the entire file using asymmetric encryption algorithms (such as RSA) or symmetric encryption algorithms (such as AES). It then uses a secure hash algorithm (such as SHA-256) to calculate a unique hash value, or digest, for the encrypted electronic medical record file. The layer packages the electronic medical record metadata and the calculated hash value into a transaction and sends it to the blockchain network for recording by calling a function in a smart contract. Finally, it processes access requests from user terminals, verifies the accessor's permissions by querying authorization records on the blockchain network, and after successful verification, retrieves the corresponding encrypted electronic medical record from the off-chain database, decrypts it using a key, and securely transmits it to the requester. Blockchain networks primarily use smart contracts to record immutable information; this immutable information includes electronic medical record metadata, authorization records, and operation logs.

[0028] This application employs a collaborative on-chain and off-chain storage approach: the encrypted, complete electronic medical records are stored in an off-chain database controlled by the medical institution, while metadata such as the hash value (summary), ownership, and timestamps of the medical records, as well as access authorization records, are stored on the blockchain network. This design leverages the immutability of the blockchain network to ensure the integrity and trustworthiness of medical records, while avoiding the privacy risks and performance bottlenecks associated with directly storing large amounts of sensitive data on the blockchain.

[0029] This application utilizes smart contracts for refined authorization management: patients, as the sole owners of their medical record data, can easily create, modify, or revoke access authorizations for other users (such as doctors at other hospitals or family members) through user terminals (e.g., mobile apps). Authorization policies can be finely defined, such as restricting access to specific medical record entries, valid periods, and the number of accesses. All authorization actions are recorded on the blockchain network via smart contracts, ensuring transparency and non-repudiation.

[0030] The secure and controllable access process outlined in this application is as follows: When an authorized party needs to access medical records, the system first verifies their identity and permissions by querying smart contracts on the blockchain network. Only after successful permission verification will the system retrieve encrypted medical record data from the off-chain database and decrypt it using the corresponding key, ensuring that the data is only visible to legitimate users.

[0031] Optionally, it also includes an off-chain encrypted medical record database; the off-chain encrypted medical record database is one or more distributed databases or file systems managed by each medical institution itself, responsible for storing complete, encrypted electronic medical records. By storing actual sensitive data off-chain, data security and privacy are guaranteed, and the blockchain network is prevented from becoming bloated due to storing large amounts of data, thus improving the overall system efficiency.

[0032] Optionally, the blockchain network takes the form of a consortium blockchain, with nodes including various medical institutions and health regulatory departments.

[0033] Optionally, the authorization information includes the authorizer, the authorized person, the authorized content (e.g., only a certain outpatient record), the authorization period (e.g., valid for 24 hours), and the number of accesses; third-party visitors include doctors from other hospitals, patients' families, and insurance companies; the medical institution side includes the hospital's internal doctor workstations and HIS / EMR systems; metadata includes patient ID (number), medical institution ID, and timestamp.

[0034] Optionally, the electronic medical record metadata includes a unique identifier for each electronic medical record, a medical record summary (hash), an off-chain storage address, a creation time (timestamp), and operator information; the authorization record includes the specific content, time limit, and status of the authorization; the status includes valid and revoked; the operation log: a log record of all key operations, used for auditing and traceability; key operations include electronic medical record generation, authorization, and access. Optionally, the smart contract includes four core functions: metadata registration, authorization management, access control, and logging.

[0035] Optionally, the application service layer, as the "brain" of the system, serves as a bridge connecting front-end users, back-end storage, and the blockchain network.

[0036] See Figure 2 This application also provides an embodiment of a method for secure storage and controllable sharing of electronic medical records, applicable to the secure storage and controllable sharing method for electronic medical records described in the above embodiment, comprising: When a patient needs to see a doctor at one hospital (e.g., Hospital B) and wants the doctor at Hospital B to access their electronic medical records at another hospital (Hospital A), the process is as follows: Access request initiation: At Hospital B, the patient uses their user terminal (mobile app) to locate the electronic medical record or the entire electronic medical record folder that needs authorization, and selects the doctor to be authorized; Patient authorization: The patient sets an authorization policy, for example, authorizing Dr. Zhang from Hospital B to access their hospitalization record at Hospital A once within the next 2 hours. After confirmation, the authorization request is sent to the application service layer; Authorization information is uploaded to the blockchain: The application service layer packages the authorization information into a transaction, calls the smart contract to write it to the blockchain network; the authorization record on the blockchain network is updated. Access permission verification and data acquisition: Dr. Zhang from Hospital B initiates an access request to the patient's electronic medical record through his workstation; after receiving the request, the application service layer queries the smart contract on the blockchain network to verify Dr. Zhang's identity and whether there is valid authorization. The smart contract automatically checks whether the current time is within the authorization period and whether the number of accesses has exceeded the limit. Data Decryption and Presentation: If the authorization verification is successful, the blockchain network returns electronic medical record metadata to the application service layer. The application service layer uses the address in the metadata to retrieve the encrypted electronic medical record from Hospital A's off-chain encrypted medical record database. The off-chain encrypted medical record database returns the encrypted electronic medical record data to the application service layer. The application service layer uses a secure key exchange mechanism to obtain the decryption key, decrypts the received encrypted electronic medical record, and securely presents the decrypted plaintext data, i.e., the medical record content, on the doctor's workstation interface. At the same time, this access behavior is recorded on the blockchain network, completing a closed-loop, secure, and traceable data sharing process.

[0037] This application encrypts highly sensitive, large-capacity medical record files and stores them off-chain, while recording "evidence information" such as medical record metadata, hash values, and authorization records on-chain. This is a mature design that balances the immutability of the blockchain network with system performance and privacy protection. It details the entire closed-loop process from medical record generation, encryption, and on-chain evidence storage to patient authorization, third-party access verification, and data decryption, with clear logic and strong operability.

[0038] Optionally, see Figure 3 The electronic medical record generation and blockchain process includes: When a doctor completes a consultation for a patient and generates a new electronic medical record at a medical institution, the system will execute the following process: Electronic medical record data entry and transmission: Doctors complete electronic medical record entry at the workstation; when the data is transmitted to the application service layer, a security protocol is used to ensure the security of the transmission channel; Sensitive information encryption: After receiving electronic medical record data, the application service layer identifies and encrypts highly sensitive fields or the entire electronic medical record file. The encryption key is securely managed by a dedicated key management system. Highly sensitive fields include ID card number and contact information. Off-chain storage and digest computation: The encrypted electronic medical record file is stored in the designated off-chain encrypted medical record database and obtains a unique storage address or file ID; Metadata upload to the blockchain: The application service layer packages the metadata of the electronic medical record, the off-chain storage address, and the electronic medical record hash value calculated in the previous step into a transaction, and calls the smart contract on the blockchain network for registration. For example, an on-chain transaction may include the following information: `{ “patientId”: “Patient_XYZ”,“timestamp”:“2023-10-27T10:30:00Z”,“hospitalId”: “Hospital_A”,“recordHash”:“0xabc…def”,“storagePointer”: “ / db / record / 12345”}`.

[0039] Generate a unique identifier and confirm the transaction: The blockchain network executes the transaction, permanently writes the transaction record into the distributed ledger, and generates a unique and tamper-proof identifier for the electronic medical record; once the transaction is confirmed, the electronic medical record storage process is completed.

[0040] Through the above implementation methods, this application constructs a patient-centered, secure, transparent, and controllable electronic medical record sharing system, effectively addressing the pain points of existing technical solutions.

[0041] This application also provides an embodiment of an electronic device, including a memory and a processor, wherein the memory stores a computer program that, when executed by the processor, implements the methods described in the above embodiments.

[0042] This application also provides an embodiment of a computer-readable storage medium, the computer-readable storage medium including a computer program or instructions that, when executed on a computer, cause the computer to perform the methods described in the above embodiments.

[0043] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application and not to limit them. Although this application has been described in detail with reference to the above embodiments, those skilled in the art should understand that modifications or equivalent substitutions can still be made to the specific implementation of this application. Any modifications or equivalent substitutions that do not depart from the spirit and scope of this application should be covered within the protection scope of the claims of this application.

Claims

1. A secure storage and controllable sharing system for electronic medical records, characterized in that, This includes user terminals, medical institution terminals, application service layers, and blockchain networks; The user terminal is used to provide services to patients and third-party visitors; the patient is the ultimate owner of their electronic medical record, and can view their entire electronic medical record index through the user terminal, and set or revoke access authorization for any electronic medical record to others, and set authorization information when authorizing. After obtaining authorization from the patient, a third-party visitor initiates an access request through the user terminal. After system verification, the visitor can view the authorized electronic medical record content. The medical institution side is used to provide services to medical staff; Medical staff enter and generate patients' electronic medical records at the medical institution. When an electronic medical record is generated or updated, the system calls the application service layer interface to start the subsequent encryption and blockchain process. The application service layer receives raw electronic medical record data from medical institutions and encrypts sensitive fields or the entire file using asymmetric or symmetric encryption algorithms. It then uses a secure hash algorithm to calculate a unique hash value (digest) for the encrypted electronic medical record file. The layer packages the electronic medical record metadata and the calculated hash value into a transaction and sends it to the blockchain network for recording by calling a function in a smart contract. Finally, it processes access requests from user terminals, verifies the accessor's permissions by querying authorization records on the blockchain network, and after successful verification, retrieves the corresponding encrypted electronic medical record from the off-chain database, decrypts it using a key, and securely transmits it to the requester. Blockchain networks primarily use smart contracts to record immutable information; this immutable information includes electronic medical record metadata, authorization records, and operation logs.

2. The secure storage and controllable sharing system for electronic medical records according to claim 1, characterized in that, It also includes off-chain encrypted medical record databases; an off-chain encrypted medical record database is one or more distributed databases or file systems managed by each medical institution itself, responsible for storing complete, encrypted electronic medical records by storing actual sensitive data off-chain.

3. The secure storage and controllable sharing system for electronic medical records according to claim 1, characterized in that, The blockchain network adopts the form of a consortium blockchain, and its nodes include various medical institutions and health regulatory departments.

4. The secure storage and controllable sharing system for electronic medical records according to claim 1, characterized in that, The authorization information includes the authorizer, the authorized person, the authorized content, the authorization period, and the number of accesses; third-party visitors include doctors from other hospitals, patients' families, and insurance companies; medical institution-side information includes doctors' workstations and HIS / EMR systems within the hospital. Metadata includes patient ID, medical institution ID, and timestamp.

5. The secure storage and controllable sharing system for electronic medical records according to claim 1, characterized in that, Electronic medical record metadata includes a unique identifier for each electronic medical record, a medical record summary, an off-chain storage address, a creation time, and operator information; authorization records include the specific content, time limit, and status of the authorization; status includes valid and revoked; operation logs: log records of all critical operations, used for auditing and traceability; critical operations include electronic medical record generation, authorization, and access.

6. The secure storage and controllable sharing system for electronic medical records according to claim 1, characterized in that, Smart contracts consist of four core functions: metadata registration, authorization management, access control, and logging.

7. A method for secure storage and controllable sharing of electronic medical records, applicable to the method for secure storage and controllable sharing of electronic medical records as described in any one of claims 1-6, characterized in that, include: When a patient needs to receive treatment at one hospital and wants a doctor at that hospital to access their electronic medical records from another hospital, the process is as follows: Access request initiation: The patient, through their own user terminal at the hospital, locates the electronic medical record or the entire electronic medical record folder that needs authorization and selects the doctor to be authorized; Patient authorization: The patient sets the authorization policy, and after confirmation, the authorization request is sent to the application service layer; Authorization information is uploaded to the blockchain: The application service layer packages the authorization information into a transaction, calls the smart contract to write it to the blockchain network; the authorization record on the blockchain network is updated. Access permission verification and data acquisition: Doctors at the patient's hospital initiate access requests to the patient's electronic medical records through their workstations; upon receiving the request, the application service layer queries the smart contract on the blockchain network to verify the doctor's identity and whether there is valid authorization. The smart contract automatically checks whether the current time is within the authorization period and whether the number of accesses has exceeded the limit. Data Decryption and Presentation: If the authorization verification is successful, the blockchain network returns electronic medical record metadata to the application service layer. The application service layer uses the address in the metadata to retrieve the encrypted electronic medical record from the off-chain encrypted medical record database of another hospital. The off-chain encrypted medical record database returns the encrypted electronic medical record data to the application service layer. The application service layer uses a secure key exchange mechanism to obtain the decryption key, decrypts the received encrypted electronic medical record, and securely presents the decrypted plaintext data, i.e., the medical record content, on the doctor's workstation interface. At the same time, this access behavior is recorded on the blockchain network.

8. The method for secure storage and controllable sharing of electronic medical records according to claim 7, characterized in that, The process of generating and uploading electronic medical records to the blockchain includes: When a doctor completes a consultation for a patient and generates a new electronic medical record at a medical institution, the system will execute the following process: Electronic medical record data entry and transmission: Doctors complete electronic medical record entry at the workstation; when the data is transmitted to the application service layer, a security protocol is used to ensure the security of the transmission channel; Sensitive information encryption: After receiving electronic medical record data, the application service layer identifies and encrypts highly sensitive fields or the entire electronic medical record file. The encryption key is securely managed by a dedicated key management system. Highly sensitive fields include ID card number and contact information. Off-chain storage and digest computation: The encrypted electronic medical record file is stored in the designated off-chain encrypted medical record database and obtains a unique storage address or file ID; Metadata on-chain: The application service layer packages the metadata of the electronic medical record, the off-chain storage address, and the hash value of the electronic medical record calculated in the previous step into a transaction, and calls the smart contract on the blockchain network to register and record the metadata; Generate a unique identifier and confirm the transaction: The blockchain network executes the transaction, permanently writes the transaction record into the distributed ledger, and generates a unique and tamper-proof identifier for the electronic medical record across the entire network; once the transaction is confirmed, the electronic medical record storage process is completed.

9. An electronic device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the computer program is executed by the processor, it implements the method of claim 7 or 8.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a computer program or instructions that, when executed on a computer, cause the computer to perform the method of claim 7 or 8.