ЕСОЗ - публічна документація
Private. Search for a person, new v.2 (Deprecated)
Purpose
This WS is designed to change person search in order to optimize searching process on create declaration.
Overview
- The priority search is a search by tax_id. In case tax_id exists search will always be done with tax_id and birth_date.
- New flag "no_tax_id" is added. It signifies whether person declined the tax id according to Ukrainian law process. In case the flag is true the scan copy of special sign in person's passport should be added to declaration request. Logic is organized on Create declaration request
- In case flag "no_tax_id" is true, and document will be added to request, person search for a person will be done by document number.
- Search for persons, with the age less than 14 years old, only by numbers in birth certificate and last_name, birth_date.
Business logic
Search person
Calculate patient age
age = MONTHS_BETWEEN (now(), $.declaration_request.person.birth_date) / 12 |
1. if person age < 14
- check if tax_id exists
- check if "no_tax_id" = false, in case error return error 422 "Persons who refused the tax_id should be without tax_id"
- Search by tax_id+birth_date
- if tax_id does not exists or person was nor found by previous step
- if tax_id does not exist do not check "no_tax_id" flag
- find all numbers in persons birth_certificate
- last_name on search should be case insensitive, without extra spaces
- Search person by numbers in birth_certificate + last_name + birth_date
2. If person age >= 14
- check if tax_id exists
- check if "no_tax_id" = false, in case error return error 422 "Persons who refused the tax_id should be without tax_id"
- Search by tax_id+birth_date
- if tax_id does not exists
- check if "no_tax_id" = true, in case error return error 422 "Only persons who refused the tax_id could be without tax_id"
- document number on search should be case insensitive, without extra spaces
- Search person by document number
Response
Return empty array if no data found
Return only requested params, id, first_name, second_name, last_name, birth_place and merged_ids if data found
ЕСОЗ - публічна документація