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

[DRAFT] Search parties [API-005-007-003-0117]

Сторінка знаходиться в процесі розробки. Інформація на ній може бути застарілою.

https://e-health-ua.atlassian.net/wiki/spaces/EN/pages/17591304241 (remove the link block before publishing the document)

Properties of a REST API method document

Document type

Метод REST API

Document title

[DRAFT] Search parties [API-005-007-003-0117]

Guideline ID

GUI-0011

Author

@

Document version

1

Document status

DRAFT

Date of creation

ХХ.ХХ.ХХХХ (дата фінальної версії документа – RC або PROD)

Date of update

ХХ.ХХ.ХХХХ (дата зміни версії)

Method API ID

API-005-007-003-0117

Microservices (namespace)

IL

Component

Employees

Component ID

COM-005-007

Link на API-специфікацію

https://ehealthmisapi1.docs.apiary.io/#reference/public.-portal-and-reports/parties/search-parties

Resource

{{host}}/api/stats/parties

Scope

відсутній за замовченням

Protocol type

REST

Request type

GET

Sync/Async

Sync

Public/Private

Public

Purpose

This API is designed to search parties (doctors) on public portal and patient cabinet

Key features:

  • Returns only parties who have at least one employee with type DOCTOR, SPECIALIST or ASSISTANT

Logic

N/A

Configuration parameters

N/A

Dictionaries

  • EMPLOYEE_TYPE

  • COUNTRY

  • EDUCATION_DEGREE

  • SPEC_QUALIFICATION_TYPE

  • SPECIALITY_TYPE

  • SPECIALITY_LEVEL

  • SPEC_QUALIFICATION_TYPE

  • PROVIDING_CONDITION

  • +DIVISION_TYPE

  • +ADDRESS_TYPE

  • SETTLEMENT_TYPE

  • STREET_TYPE

  • LEGAL_ENTITY_TYPE_V2

  • OWNER_PROPERTY_TYPE

  • LEGAL_FORM

  • PHONE_TYPE

Input parameters

Input parameter

Mandatory

Type

Description

Example

Input parameter

Mandatory

Type

Description

Example

1

 

 

 

 

 

2

 

 

 

 

 

Request structure

See on API-specification

Headers

Headers

Request data validation

Authorize

Request to process the request using a token in the headers

Validate query params

  1. Validate location - must be provided none of them or all four (location_north, location_south, location_west, location_east)

    1. In case of error - generate 422 error

Prepare response

  1. Get parties who has at least one employee with type DOCTOR, SPECIALIST or ASSISTANT

  2. Outer join employee roles, healthcare services and divisions on (employees.id = employee_roles.employee_id and employee_roles.healthcare_service_id = healthcare_service.id and healthcare_service.division_id = divisions.id)

  3. Filter result by query params

Query param

Source

Query param

Source

employee_type

employees.employee_type

full_name

parties.first_name + parties.second_name + parties.last_name

(The same way as it works on search employees)

speciality

healthcare_services.speciality_type

division_id

healthcare_services.division_id

division_name

divisions.name

area

division_addresses

region

division_addresses

settlement

division_addresses

location_*

divisions.location

Must be within the given coordinates

 

Processing

N/A

Response structure examples

See on API-specification

{ "meta": { "code": 200, "url": "https://example.com/resource", "type": "object", "request_id": "6617aeec-15e2-4d6f-b9bd-53559c358f97#17810" }, "data": [ { "id": "7d23bebb-1cf3-4221-bf21-18aada444756", "first_name": "Петро", "second_name": "Миколайович", "last_name": "Іванов", "educations": [ { "country": "UA", "city": "Київ", "institution_name": "Академія Богомольця", "issued_date": "2017-02-28", "diploma_number": "DD123543", "degree": "MASTER", "speciality": "Педіатр" } ], "qualifications": [ { "type": "SPECIALIZATION", "institution_name": "Академія Богомольця", "speciality": "Педіатр", "issued_date": "2017", "certificate_number": "2017", "valid_to": "2017", "additional_info": "додаткова інофрмація" } ], "specialities": [ { "speciality": "THERAPIST", "speciality_officio": true, "level": "FIRST", "qualification_type": "AWARDING", "attestation_name": "Академія Богомольця", "attestation_date": "2017-02-28", "valid_to_date": "2020-02-28", "certificate_number": "AB/21331" } ], "is_available": true, "science_degree": { "country": "UA", "city": "Київ", "degree": "", "institution_name": "Академія Богомольця", "diploma_number": "DD123543", "speciality": "Педіатр", "issued_date": "2017" }, "working_experience": 10, "about_myself": "Закінчив всі можливі курси", "employees": [ { "id": "7d23bebb-1cf3-4221-bf21-18aada444756", "position": "P1", "employee_type": "DOCTOR", "healthcare_services": [ { "id": "7c3da506-804d-4550-8993-bf17f9ee0402", "division": { "id": "asSbcy12sYs8c", "name": "Aдоніс", "type": "CLINIC", "addresses": { "type": "RESIDENCE", "country": "UA", "area": "Житомирська", "region": "Бердичівський", "settlement": "Київ", "settlement_type": "CITY", "settlement_id": "b075f148", "street_type": "STREET", "street": "вул. Ніжинська", "building": "15", "apartment": "23", "zip": "02090" }, "contacts": { "email": "email@example.com", "phones": [ { "type": "MOBILE", "number": "+380503410870" } ] }, "coordinates": { "latitude": 30.1233, "longitude": 50.32423 }, "legal_entity": { "name": "Заклад Ноунейм", "short_name": "Ноунейм", "public_name": "Ноунейм", "type": "PRIMARY_CARE", "owner_property_type": "STATE", "legal_form": "140", "edrpou": "5432345432", "kveds": "[\"86.10\", \"47.73\"]", "addresses": [ { "type": "RESIDENCE", "country": "UA", "area": "Житомирська", "region": "Бердичівський", "settlement": "Київ", "settlement_type": "CITY", "settlement_id": "b075f148", "street_type": "STREET", "street": "вул. Ніжинська", "building": "15", "apartment": "23", "zip": "02090" } ], "phones": [ { "type": "MOBILE", "number": "+380503410870" } ], "email": "email@example.com", "nhs_verified": "false", "owner": { "id": "7d23bebb-1cf3-4221-bf21-18aada444756", "position": "P1", "employee_type": "OWNER", "party": { "id": "7d23bebb-1cf3-4221-bf21-18aada444756", "first_name": "Петро", "second_name": "Миколайович", "last_name": "Іванов" } } } }, "speciality_type": "FAMILY_DOCTOR", "providing_condition": "OUTPATIENT", "category": [ "0742d949-1492-4864-9494-60fd7102abfd" ], "type": [ "2c0110a9-0bea-4b16-af8e-6e2e149a5bfc" ], "status": "ACTIVE", "comment": "Заведено помилково", "coverage_area": [ "2c0110a9-0bea-4b16-af8e-6e2e149a5bfc" ], "available_time": [ { "days_of_week": [ "mon" ], "all_day": true, "available_start_time": "08:30:00", "available_end_time": "19:00:00" } ], "not_available": [ { "description": "Санітарний день", "during": { "start": "2018-08-02T10:45:16.000Z", "end": "2018-08-02T11:00:00.000Z" } } ] } ] } ] } ], "paging": { "page_number": 2, "page_size": 50, "total_entries": 1000, "total_pages": 23 } }

HTTP status codes

Response code

HTTP Status code

Message

Internal name

Description

Response code

HTTP Status code

Message

Internal name

Description

1

Базові

2

 

200

 Response

 

 

3

 

422

 

Validation failed

 

4

Специфічні

5

 

 

 

 

 

Post-processing processes

N/A

Technical modules where the method is used

 

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