Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Table of Contents

Specification

Apiary

Authorize user

  1. Verify the validity of access token

    1. Return 401 in case validation fails

  2. Check scopes in order to perform this action (scope = 'append_auth_method:write')

    1. Return 403 in case invalid scope(s)

...

Logic

  • If IL_DB.authentication_method_request.status = NEW:

  1. Verificate

...

  1. sms - from third_person. Invoke verification module to verify OTP (OTP Verification)

  2. Invoke Initialize OTP to generate one time password and

...

  1. send it to person number. At this stage, the patients receive an SMS message.

  2. Update authentication method request

    1. Change entity status in IL_DB.authentication_method_request to APPROVED

    2. Set updated_at - now() (Get current date-time)

    3. Set updated_by - user_id (Extract user from token)

  • If IL_DB.authentication_method_request.status = APPROVED:

  1. Verificate sms - from person. Invoke verification module to verify OTP

...

  1. (OTP Verification)

  2. Update mpi

    1. Add to table person_auth_methods row with type = third_person, value = id (confidant_person_id), alias (from payload), is_primary = False

    2. Start date: start_date = Current_date()

    3. End date:

...

    1. if

...

    1. (person.age

...

    1. <

...

    1. 18)

...

    1. {  end_date

...

    1. =

...

    1. min(birth_date

...

    1. +

...

    1. 18y

...

    1. -

...

    1. 1d,

...

    1. start_date

...

    1. +

...

    1. third_person_term);}

...

    1. else

...

    1. {  end_date

...

    1. =

...

    1. start_date

...

    1. +

...

    1. third_person_term;}