Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Table of Contents

...

This WS allows linking medical data of an unidentified person to a person in eHealth. Thus it helps a person who was unidentified during some period to store all its medical history.

Specification

Page Properties
idAPI_Specification
API paragraph not found

Link

https://ehealthmisapi1.docs.apiary.io/#reference/public.-medical-service-provider-integration-layer/merge-request/create-merge-request

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

Resource

/api/merge_requests

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

Scope

merge_request:write

Scope для доступу

Components

Patient registry

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

Microservices

il/api

mpi/api

fe/admin-web

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

Protocol type

REST

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

Request type

POST

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

Sync/Async

Sync

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

Public/Private/Internal

Public

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

Logic

  1. Only authenticated and authorized SPECIALIST, ASSISTANT or RECEPTIONIST employees can merge prepersons with prepersons.

  2. Prepersons can be merged in EMERGENCY or OUTPATIENT legal entities.

  3. Employee can merge any active preperson to any active person.

  4. To merge person with preperson only their MPI ids needed.

  5. Change status should be logged in the Event manager.

Dictionaries

  • AUTHENTICATION_METHOD

  • DOCUMENT_TYPE

Request structure

Example:

...

  1. Verify the validity of access token

    1. Return 401 in case validation fails

  2. Check user scopes in order to perform this action (scope = 'merge_request:write')

    1. Return 403 in case invalid scope(s)

Headers

Наприклад:

Content-Type:application/json

Authorization:Bearer c2778f3064753ea70de870a53795f5c9api{{access_token}}

Api-key:uXhEczJ56adsfh3Ri9SUkc4en{{secret}}

Request data validation

Validate request

...

In case no auth methods found (null) - return error with code 409 (Person has no auth methods)

Processing

Save object to DB

il.merge_requeststable

Parameter

Source

Description

id

uuid

Autogenerated

data

jsonb

Contains data for signed_content in json format. At this step is null. Optional field

master_person_id

Request: master_person_id

Person identifier in MPI (mpi.persons.id). Required

merge_person_id

Request: merge_person_id

Preperson identifier that corresponds to MPI.prepersons.id (returned on create preperson). Required

status

string

Status of the request, required. Set NEW

merged_pair_id

uuid

Reference to mpi.merged_pairs table when person becomes merged with preperson (on sign). By default is null.

printout_form

text

Printout form of preperson merge request in html format. By default is null at this step

legal_entity_id

Request: client_id

Legal entity where request was created. Client_id extracted from token. Required

documents

jsonb

urls of the person`s documents if chosen authentication method is OFFLINE

authentication_method_current

jsonb

Person current authentication method.

is_active

bool

Technical flag. By default is true

inserted_by

uuid

Extract user from token

inserted_at

timestamp

Get current date-time

updated_by

uuid

Extract user from token

updated_at

timestamp

Get current date-time

...

Page Properties
idAPI_HTTP status codes

HTTP status code

Message

What caused the error

201

 Response

 

401

 

Access token validation failed

403

Invalid scope

404

Person not found

Preperson not found

Validation failed

409

Legal entity must be ACTIVE

Person is not active

Preperson is not active

Preperson has no episodes

Person has no auth methods

Validation failed

422

Validation failed