ЕСОЗ - публічна документація

RC_(CSI-1323)_Get Confidant Person relationships

Purpose

This method allows to view list of active person's confidants with masked personal data and relationship verification details.

Specification

Apiary

Authorization

  • Verify the validity of access token

    • Return (401, 'Invalid access token') in case of validation fails

  • Verify that token is not expired

    • in case of error - return (401, 'Invalid access token')

  • Check user scopes in order to perform this action (scope = confidant_person_relationship:read)

    • Return (403, 'Your scope does not allow to access this resource. Missing allowances: confidant_person_relationship:read') in case of invalid scope(s)

Validate person

  • Get person_id from URL

  • Validate person status is active (status = ‘active' & is_active = 'true’)

    • in case of error - return 404 ('Person not found')

Service logic

  1. Get relationships list from https://e-health-ua.atlassian.net/wiki/spaces/CSI/pages/17613488166/MPI#confidant_person_relationships table where:

    • person_id is equal to $.person_id

    • AND active_to > now() or null

    • AND is_active=true

  2. For each relationship from previous step:

    1. Get details of confidant person from https://e-health-ua.atlassian.net/wiki/spaces/CSI/pages/17613488166/MPI#persons table where id is equal to confidant_person_id.

    2. Get documents of confidant person from https://e-health-ua.atlassian.net/wiki/spaces/CSI/pages/17613488166/MPI#person_documents table where person_id is equal to confidant_person_id.

    3. Get documents of relationship from https://e-health-ua.atlassian.net/wiki/spaces/CSI/pages/17613488166/MPI#confidant_person_relationship_documents table where confidant_person_relationship_id equal to relationship id.

    4. Mask personal information:

      • For name use combination: “{last_name} {first letter from first_name} {first letter from second_name}”

      • For phone number use already accepted masking: as example - "+38093*****85"

      • For other fields (tax_id, unzr, documents_person.number) show two last symbols only

    5. Cast relationship active_to to date format.

  3. Render a response according to specification.

ЕСОЗ - публічна документація