Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

...

...

...

Table of Contents
Introduction

There are several types of access to patient medical data in eHealth, such as:

...

Active doctors declarations are selected by the algorithm below during the first request  and then caсhed to the Redis:

Search for declarations using

...

user_id and client_id

  1. Select party_id from PRM.Party_users where 
    1. PRM.Party_users.user_id =
    token.user_id Select id from
    1. user_id
  2. Select IDs from PRM.Employees where
    1. PRM.Employees.party_id = Select 1.
    2. PRM.Employees.legal_entitty_id= client_id
  3. Select person_id from OPS.Declarations where  
    1. OPS.Declarations.employee_id IN Select 2.
    2. OPS.Declarations.status IN (active, pending_verification)
  4. Select user_id from PRM.Party_users where
    1. PRM.Party_users.party_id = Select 1.
  5. Write all selected records into Redis in the structure:
    user_id | client_id | | [{person_id}|

Search for declarations using party_id and legal_entity_id

  1. Select user_id from PRM.Party_users where
    1. PRM.Party_users.party_id = party_id
  2. Select IDs from PRM.Employee where
    1. PRM.Employee.party_id = Select 1.
    2. PRM.Employee.legal_entitty_id= token.client legal_entity_id
  3. Select patientperson_id from OPS.Declarations where  
    1. OPS.Declarations.employee_id = Select 2.
    2. OPS.Declarations.status = active
  4. Write all selected records into Redis in the structure:
    user_id | client_id | employee_id | [{patient_id}|


The data in the Redis expires after N minutes or when declared event happens:

...