Versions Compared

Key

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

...

  1. Authorization
    1. Authorize user using standard flow (Auth)
  2. Search for declarations declarations using token 
    1. Select party_id from PRM.Party_users where  user_id = token.user_id 
    2. Select id from PRM.Employee where
      1. party_id = a.
      2. client_id
    3. Select declarations.patient_id from OPS where where  
      1. employee = user_idb.
      2. status = active
    4. Write selected declarations.id into Redis 
  3. Refresh declarations record in Redis
    1. Delete information record from Redis after N minutes (N = 15 by default)  
    2. If new declaration was signed with the Doctor, delete information the record from Redis where key = declarations.employee_id
  4. Declarations validation
    1. Search for declarations a record in Redis where the key = token.user_id 
      1. If
      Redis.? is null, search for declarations (2)If Redis.? is not null
      1. there is no record, perform point 2 - Search for declarations using token 
      2. If there is a record, search for patient_id in array
        1. If there are no
        row
        1. records with such patient_id return error -"Access denied - you have no active declaration with the patient"
        2. If there is a
        row
        1. record -
        allow
        1. grand access

Secondary care doctor

Will be implemented in next phases

...