Validate request
- Validate mandatory query params
- first_name
- last_name
- birth_date
- Validate optional query params
- second_name
- tax_id
- birth_certificate
- phone_number
- Validate mandatory query params
Calculate age
Code Block |
---|
age = MONTHS_BETWEEN (now(), $.birth_date) / 12 |
Search existing MPI entity
Search only active persons - MPI.persons.is_active=true
- if tax_id is not null and age>=1614
- search
- fields: tax_id
first_name
+last_name
...
- , birth_date
- additional fields: second_name, phone_number
- if tax_id is null and age>=1614
- search
- fields: first_name
- , last_name
- , birth_date
...
- if age<16
- search via
birth_certificate
+birth_date
- search via
...
- additional fields: tax_id, second_name, phone_number
- if age<14
- search fields: birth_certificate, birth_date
- additional fields: first_name, last_name, second_name
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
For example:
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
http://ehealth.nebo15edenlabllc.com/api/persons?first_name=%D0%9F%D0%B5%D1%82%D1%80%D0%BE&last_name=%D0%86%D0%B2%D0%B0%D0%BD%D0%BE%D0%B2&birth_date=1991-08-19T00%3A00%3A00.000Z |
...