Table of Contents |
---|
...
if not exists - proceed to Create person request process
if exists - process to Update person request process
Create person request
...
A block with information about confidant person must be transferred when the person is created.
New endpoints RC_(CSI-1323)_Confidant Persons technical specification https://e-health-ua.atlassian.net/wiki/spaces/EH/pages/18000249910 must be used to manage list of persons confidants.
...
Validate block confidant person. If
$.person.confidant_person
is not null:Generate URLs with type
confidant_person.{confidant_person.person_id}.documents_relationship.[:].{type}
Validate block of person documents. If one of the documents has document.type = BIRTH_CERTIFICATE_FOREIGN and there is no same document in {$.person_request.person.confidant_person.[:].documents_relationship.[:]}
and persons age < no_self_auth_age global parameter then
Generate URL with type
person.BIRTH_CERTIFICATE_FOREIGN
Validate block of person documents. If one of the documents has document.type = PERMANENT_RESIDENCE_PERMIT and persons age >= no_self_auth_age global parameter then
Generate URL with type
person.PERMANENT_RESIDENCE_PERMIT
Validate block of authentication methods. If authentication method type = OFFLINE
Generate URLs with type
person.{$.person.documents.[:].type}
for each persons document
Validate persons unzr. If$.person.unzr
is not emptyandfirst 8 digits of$.person.unzr != $.person.birth_date
Generate URL with typeperson.unzr
Invoke Media Content Storage to generate upload URL for each document obtained by executing logic above and save documents to DB.
...
Validate client
Validate as on Create person request process
Validate tax id
If updated persons tax_id is not null - check that
$.person.tax_id
equals to updated persons tax_idin case of error - return 422 ('tax_id can't be updated')
Validate as on Create person request process
Validate no_tax_id flag
Validate as on Create person request process
Validate patient_signed flag
Validate as on Create person request process
Validate process_disclosure_data_consent flag
Validate as on Create person request process
Validate person addresses
Validate as on Create person request process
Validate person documents
...
Check that
$.authorize_with
with auth_method.type = 'THIRD_PERSON' is submitted for person that must be authorized by confidant person using following logic:persons age < no_self_registration_age global parameter;
persons age between no_self_registration_age and person_full_legal_capacity_age global parameters and person does not have document with type from PERSON_LEGAL_CAPACITY_DOCUMENT_TYPES config parameter;
persons age > person_full_legal_capacity_age global parameter and exists at least one active and approved confidant person relationship for person (using following process /wiki/spaces/CSI/pages/17667883028 Check confidant person relationship with
person_id
= person from request - expected:ok, :approved
response)in case of error - return 422 ('Authentication method with type THIRD_PERSON must be submitted for this person')
Check that
$.authorize_with
is a valid uuidin case error - return 422 ('string does not match pattern') with uuid regexp
Check that auth method exists in MPI database,
person_authentication_methods
table, belongs to person from request, stored in$.person.id
, is active (ended_at > now() or ended_at is null and is_active = true), and type != NA, additionally for auth method with type = ‘THIRD_PERSON’ - check that person from value is an approved confidant for a$.person.id
from request – exists active and approved confidant person relationship between person from request and person_id from authentication method value (using following logic: /wiki/spaces/CSI/pages/17667883028 Check confidant person relationship withperson_id
= person from request andconfidant_person_id
= value from auth method - expected:ok, :approved
response)in case error - return 409 ('Authentication method doesn't belong to person.')
...
If person request doesn't have this field, then choose that method which is returned from mpi as using following process Determination of a default authentication method and return person's active auth_methods .
Determine authentication method current for request
If
$.authorize_with
is not null - set its value as authentication method current for requestIf
$.authorize_with
is null -set default auth method as authentication method current for request - use function in mpi that return default auth methodCheck that persons default auth method != NA
in case of error - return 409 ('Person does not have active auth methods.')
...