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

Get Merged persons

Purpose

This method allows to find all persons, which were merged with this person. Also this endpoint shows all the persons who enter the whole chain of merges to this person.

For example, Person 3 was merged with Person 2(master). Then Person 2 was merged with Person 1(master). So then get Person 1 by id, response shows information about Person 2 and Person 3

 

Specification

Link

https://ehealthmisapi1.docs.apiary.io/#reference/public.-medical-service-provider-integration-layer/persons/search-person's-merged-persons

Посилання на Apiary або Swagger

Resource

/api/persons/{{id}}/merged_persons

Посилання на ресурс, наприклад: /api/persons/create

Scope

 

Scope для доступу

Components

 

Зазначається перелік бізнес компонентів, які використовують цей метод, наприклад: ePrescription

Microservices

 

Перелік мікросервісів, які використовує метод API, наприклад: Auth, ABAC

Protocol type

 

Тип протоколу, який використовується запитом, наприклад: SOAP | REST

Request type

GET

Тип запиту API, наприклад: GET, POST, PATCH…

Sync/Async

 

Метод є синхронним чи асинхронним?

Public/Private/Internal

 

Потрібно зазначити тип методу за ступенем доступності

 

Logic

API Paragraph not found

 

Input parameters

Input parameter

Values

Type

Description

Example

Input parameter

Values

Type

Description

Example

id

 

String

 

b075f148-7f93-4fc2-b2ec-2d81b19a9b7b

 

Request structure

See on Apiary

 

Authorize

  • Verify the validity of access token

  • Check user scope person:read in order to perform this action

 

Headers

  • Content-Type:application/json

  • Authorization:Bearer c2778f3064753ea70de870a53795f5c9

  • api-key:uXhEczJ56adsfh3Ri9SUkc4en

 

Request data validation

Validate request

Validateperson_id in request:

  • search person by person.id in MPI

    • in case error return 200 with empty array

 

Processing

Search persons in mpi.merged_pairs, where master_person_id = $.person_id. Then take all merge_person_id and search pairs by this ids as master_person_id.

Search until all persons are found from the merge chain.

 

Response structure

See on Apiary

Example:

{ "meta": { "code": 200, "url": "https://example.com/resource", "type": "object", "request_id": "6617aeec-15e2-4d6f-b9bd-53559c358f97#17810" }, "data": [ { "id": "57e30ea3-16f1-4f8e-adcd-1a05e99e2d22", "inserted_at": "2019-05-08T15:34:00Z", "merge_person_id": "bdadc2a7-7283-4f24-bc99-8d8d9808af80", "master_person_id": "b075f148-7f93-4fc2-b2ec-2d81b19a9b7b", "updated_at": "2019-05-08T15:34:00Z" }, { "id": "a4181621-681f-4e46-b0ba-7fa4e59859ef", "inserted_at": "2019-01-08T15:34:00Z", "merge_person_id": "1a356e56-a991-4ceb-a475-3edfd9930265", "master_person_id": "bdadc2a7-7283-4f24-bc99-8d8d9808af80", "updated_at": "2019-01-08T15:34:00Z" } ] }

 

{ "meta": { "code": 404, "url": "https://example.com/resource", "type": "object", "request_id": "6617aeec-15e2-4d6f-b9bd-53559c358f97#17810" }, "error": { "type": "forbidden", "message": "Such person not found" } }

 

Post-processing processes

API Paragraph not found

 

HTTP status codes

HTTP status code

Message

What caused the error

HTTP status code

Message

What caused the error

 200

 

 

 404

 

 



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