Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Info

REST API method / Метод REST API (настанова) (remove the link block before publishing the document)

...

Page Properties
idpage_properties_method_REST API

Document type

Метод REST API

Document title

[Document status] REST API [Назва методу] [ID методу]

Guideline ID

GUI-0011

Author

@

Document version

1

Document status

DRAFT

Date of creation

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

Date of update

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

Method API ID

API-005-004-002-0073

Microservices (namespace)

IL

Component

Declarations

Component ID

COM-005-004

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

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

Resource

{{host}}/api/v3/declaration_requests

Scope

declaration_request:write

Protocol type

REST

Request type

POST

Sync/Async

Sync

Public/Private

Public

...

  1. This method method allows to create a declaration only for an existing person.

  2. To create declaration request based on active declaration in reorganized legal entity, parent_declaration_id must be passed in request.

Logic

Description of the working algorithm of the API method and the interaction of services with each other add Service logic (if necessary)

Configuration parameters

Description of the configuration parameters that are used when processing a request in the system

Dictionaries

Provides a list of links to dictionaries that are available in Confluence

Input parameters

Description of input parameters

Input parameter

Mandatory

Type

Description

Example

1

composition_id

 M

String ($uuid) (path)

Composition object ID

 89678f60-4cdc-4fe3-ae83-e8b3ebd35c59

2

Request structure

See on API-specification (посилання на сторінку з API-специфікацією)

Description of the REST API request structure, example

Expand
titleExample
Code Block

...

Key

Value

Mandatory

Description

Example

1

Content-Type

application/json

M

Тип контенту

Content-Type:application/json

2

Authorization

Bearer c2778f3064753ea70de870a53795f5c9

M

Перевірка користувача

Authorization:Bearer c2778f3064753ea70de870a53795f5c9

3

Request data validation

Validate request using JSON schema

...

where IL.Declaration_request.mpi_id = :($.person.id) and status in ('NEW' or 'APPROVED)
Cancel declaration requests

Change status and status reason of all found declaration requests:

  • status: CANCELED

  • status_reason: request_cancelled

Code Block
SET   IL_DB.declaration_requests.status = 'CANCELED'
WHERE IL_DB.declaration_requests.id IN (:LIST)

...

  1. Insert record to IL.declaration_request:

    1. status 'NEW'

    2. is_shareable: false

Generate upload URL

If auth_method_requests.auth_method_current = OFFLINE

...

Response structure examples

See on API-specification (посилання на сторінку з API-специфікацією)

Description of the REST API response structure, example

Expand
titleExample
Code Block

...

Response code

HTTP Status code

Message

Internal name

Description

1

Базові

2

201

Response

 

3

401

 

Access token validation failed

4

403

Access denied. Party is not verified

5

403

Access denied. Party is deceased

6

403

 

Invalid scopes

7

403

forbidden

8

404

Active parent declaration was not found

9

1000

404

Composition not found

COMPOSITION_NOT_FOUND_404

Не знайдено медичний висновок

10

404

 

Validation error

11

404

Such person doesn't exist

12

409

 

Validation error

13

409

Employee of parent declaration and current employee are not the same

14

409

Legal entities of parent declaration and current are not in reorganization process

15

409

Parent declaration does not belong to this person

16

422

 

Validation error

17

401

Unauthorized

Помилка підтвердження

18

409

Patient is not verified

19

422

Сannot be confirmed by a method with type= NA. Use a different method.

20

422

Person must have authentication method

21

422

such authentication method doesn't exist

22

422

such authentication method does not belong to this person

23

Специфічні

24

422

Only for active MPI record can be created medication request!

Post-processing processes

Description of actions performed on data after processing

Technical modules where the method is used

List of pages describing technical modules where the method is used

Page Properties Report
headingsID ТМ, Статус
cqllabel = "tr-mis"

...