Disclosure of Invention
Based on this, the main objective of the present invention is to provide a block chain based resident health file management system to solve the above problems.
A method and a device for building a resident health record management system based on a block chain are characterized by comprising the following steps: the system comprises a client, a CA node, an access gateway, an accounting node and a distributed storage node.
Wherein the user intervenes in the blockchain network through the client.
The users include residents and medical facility staff.
The medical institutions include hospitals, physical examination companies and private clinics.
The client comprises a desktop client, a browser client and a mobile client.
And the CA node is used for issuing the digital certificate.
The purpose of the access gateway is security control, including member registration, identity authentication and authorization management.
The accounting node is a point-to-point network framework.
The accounting node comprises block chain management, digital signature management and cryptographic algorithm management.
And the distributed storage nodes are used for distributed storage of the resident health record block chain.
The block chain management comprises block generation, block query, block verification and block linking.
The block comprises a block chain head, a data part and metadata.
The block header comprises a block chain number, a parent block data Hash (Hash) value and the Hash (Hash) value of the block data.
The data part comprises a block number, a block type, an information adding time stamp, an information adder ID and block content information.
The metadata comprises block information adding times, hash values of each time, basic information and additional information.
The basic information comprises names of residents and gender of the residents.
The additional information comprises the resident address and the resident contact telephone.
A residential health record building method based on a block chain comprises the following steps:
the user registers the member and uploads the corresponding certificate file through the client and the access gateway, and then the user passes identity authentication and obtains the corresponding authority.
And the user passing the identity authentication obtains the CA certificate through the CA node.
When a resident user goes to a medical institution for medical treatment, the resident user provides corresponding identity authentication information, and the identity authentication can be in various modes including an identity card, a fingerprint and a human face.
The medical institution staff user is connected to the accounting node through the client and the access gateway, and inputs resident user information.
Furthermore, after verifying the legality of the resident user and the medical institution user, the accounting node queries the block chain to which the resident belongs through the distributed storage node, and displays the block chain information to which the resident belongs through the client, so that medical institution staff can look up the previous diagnosis and treatment information of the resident to know the previous diagnosis and treatment condition of the user, and the method is particularly suitable for diagnosis and treatment of referral residents.
Medical institution staff are connected to the accounting node through the client and the access gateway, and input diagnosis and treatment information of residents. Before adding blocks, the accounting node needs to confirm the validity and validity of several information: the first is that the hash value calculated from the data portion of the previous block is to be consistent with the hash value of the previous block; secondly, the hash value calculated by the data part of the previous block is consistent with the hash value added by the last data in the metadata of the previous block; third, the digital signature of the information-adding person who newly adds the data of the block is legal. Only if these three conditions are met, the block information can be successfully added to the block chain.
Further, linking of tiles, comprising the steps of:
and step A, generating a data part of the block according to the resident diagnosis and treatment information input by the medical institution staff.
And step B, calculating the hash value of the block according to the data part of the block.
And step C, generating a block header according to the block chain ID in the resident information, the last block hash value and the block hash value.
And D, adding the sequence number and the hash value of the block.
And E, generating metadata according to the D, the basic information and the additional information.
And F, summarizing the steps A, C and E to generate a new block, and linking the block into a block chain through the Hash pointer.
Furthermore, the accounting node adds the block adding information into the block chain of the resident, and completes the block adding storage of the block chain through distributed storage.
Furthermore, the accounting node sends the resident block adding information to other accounting nodes through the peer-to-peer network, and the other accounting nodes complete the block adding process of the block chain in the same way.
Further, the other accounting nodes add the block adding information into the block chain of the residents, and complete the block adding storage of the block chain through distributed storage.
The invention has the beneficial effects that: and storing the resident electronic health file by adopting a decentralized distributed system. The medical record management system solves the problems that the traditional medical record is dispersedly stored in each medical institution and the information is segmented. Because the same block chain exists in each resident information, the problem of repeated examination during patient referral is avoided, the medical cost of residents can be reduced, and the diagnosis and treatment efficiency is improved. The block chain prevents the medical records of residents from being tampered through encryption and distributed storage, and the safety of the health files is improved. The problem that medical records are falsified in medical accidents is also avoided. Through the management to the block chain authority, the disclosure of the health privacy of residents is prevented, and the individual privacy is effectively protected. As each block chain can be tracked to the parent block chain, the method can effectively and closely track some family diseases. Because each person only has one block chain, no matter where the residential area is, the generated block information is only accessed to the same block chain, and the problem that the mobile personnel are difficult to establish the health record is solved.
Example 1
In this embodiment, as shown in fig. 2, a method for linking a blockchain is provided, which includes the following steps:
firstly, the generation of the residential creature block. The creation time of the creation block of the resident is generated when the mother of the resident gets to the community hospital to build a small card after pregnancy, and in the creation block, the serial number of the block chain can be formed by the serial number of +8 dates, namely 20200131 xxxxxxxx. And therefore will not be repeated and facilitate retrieval of the blockchain. Each resident has one and only one block chain. The block 1 content of the data part is the checked result content when the small card is built at this time, the hash value of the father block is the hash value of the block 1 corresponding to the mother of the resident when the small card is built, and the hash value of the block is generated by the block data part by using the SHA-256 algorithm. At this time, the number of times of adding information to the metadata is 1, and the corresponding hash value is the hash value of the block.
After the creation of the created blocks, the following block adding process is as follows: first, block 2 is added, and the block header in block 2 contains information, such as the block chain ID, which is consistent with the block chain ID of the previous block. The last block hash value, the block hash value, and the block data part of the block hash value are calculated by SHA-256. The data portion contains information such as: block number, block type, timestamp of information addition, information adder ID, block content information, adder information signature. And meanwhile, adding times of block information in the metadata, and increasing the hash values of the data 2 and the block. The talent base information in the metadata is unchanged. This completes a process of adding block 2. The adding process of the rest blocks is as above.
The blockchain IDs in block 2 and block 3 are identical, but not identical to the blockchain ID in block 1, because block 1 belongs to a block in the blockchain of mothers of inhabitant a, the ID of each person's blockchain is not identical.