Document Index
Last updated
Last updated
Using a smart contract as a document and data index repository provides high availability, fault tolerance, immutability.
user_id - unique identifier
user key pair - public key + private key, generated according to the Curve25519 elliptic curve-based cryptosystem
Is a data structure described in the openEHR standard
ehr_id
includes the documents: EHR_STATUS, COMPOSITION, DIRECTORY, CONTRIBUTION
Each patient can have only one EHR.
Sets the relationship between ehr_id
from a specified user_id
Sets the relationship betweendoc_storage_id
and ehr_id
Sets the relationship between ehr_id
and subject_id
, subject_namespace
Allows to find an encrypted doc_key
for the specified doc_storage_id
and user_id
Allows to find the doc_storage_id
of documents that contain data with the specified values
access_group
- access group, within which encrypted data is searched
An EHR document is created as a json file
Generation of a new doc_key
The document is encrypted using the doc_key
Document is saved in the document storage, doc_storage_id
is returned
An entry is added to the EHR Index to link the patient and their EHR:
An entry is added to the Document Index to allow the document in the repository to be linked to the EHR
An entry is added to the EHRsubject Index to search for ehr_id
by its subject
An entry is added to the AccessStore index to find the encrypted doc_key
from the document
Get ehr_id
using user_id
in EHR Index
Get doc_storage_id
of a document with DocType = EHR
Get the encrypted doc_key
from the AccessStore index
Decrypt doc_key
with user's priv_key
Download document with doc_storage_id
from storage
Decrypt the document using the decrypted doc_key
in step 5
The document is created as a json file
The document is encrypted with the unique key doc_key
The document is saved in the document storage, doc_storage_id
is returned
An entry is added to the document index, allowing you to link the document in the repository with the EHR
Path construction for all field values within the document
Determining the access_group
for searching the values in the dataSearch index
Records containing paths, values encrypted with access_group_key
and encrypted doc_storage_id
to associate records with documents in the repository and access_group_id
are added to the dataSearch Index for all values
Paths to the values of interest and conditions are generated from the query
Search for records in dataSearch index, which satisfy the specified conditions, the encrypted doc_storage_id
of documents containing these values is returned, or the encrypted values
Search for an access_group_key
in the dataAccess index
Decrypting access_group_key
with user_priv_key
Decrypting field values with access_group_key
Decrypting doc_storage_id
with user_priv_key
Search for doc_keys
encrypted documents in the docAccess index by doc_storage_id
Decrypting doc_keys
Downloading found documents from the storage
Documents are decrypted using doc_keys