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