ЕСОЗ - публічна документація
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
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
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
For each relationship from previous step:
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.
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.
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.
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
Cast relationship active_to to date format.
Render a response according to specification.
ЕСОЗ - публічна документація