Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
REST API method / Метод REST API (настанова)
Info
Note

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

Info

/wiki/spaces/EN/pages/17591304241 (remove the link block before publishing the document)

Table of Contents

Properties of a REST API method document

Page Properties
idpage_properties_method_REST API

Document type

Метод REST API

Document title

[Document status] REST API [Назва методу] [ID методуDRAFT] Get Declaration Requests List V3 [API-005-004-002-0082]

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-0082

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/get-declaration-requests-list-v3

Resource

{{host}}/api/v3/declaration_requests

Scope

declaration_request:read

Protocol type

REST

Request type

GET

Sync/Async

Sync

Public/Private

Public

Purpose

This WS is designed to get declaration requests list.

Key features

  1. Only authenticated and authorized employee with appropriate scope can get declaration requests list.

  2. The service returns only a declaration requests that were created in the same legal entity as the user

  3. Method returns shortened declaration request details, to obtain full information - use Get Declaration request by ID method.

Logic

  1. Extract client_id from token. Filter declaration requests by client_id (legal_entity_id)

  2. Filter declaration requests to show only originated by legal entity or shared with legal entity (channel == MIS OR is_shareable == True)

  3. Filter declaration requests by search params (If legal_entity_id is differ from client_id in token - empty list must be returned)

  4. Render found declaration requests with shortened details according to specification

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 N/A

Dictionaries

N/A

Input parameters

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

Input parameter

Mandatory

Type

Description

Example

1

composition_id

 M

String ($uuid) (path)

Composition object ID

2

Request structure

See on API-specification (посилання на сторінку з API-специфікацією)Description of the REST API request structure, example

Expand
titleExample
Code Block

Headers

...

Headers

...

Request data validation

...

Mandatory

...

Description

...

Example

...

Content-Type

...

application/json

...

M

...

Тип контенту

...

Content-Type:application/json

...

Authorization

...

Bearer {{access_token}}

...

M

...

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

...

Authorization:Bearer {{access_token}}

...

X-Custom-PSK

...

{{secret}}

...

X-Custom-PSK:{{secret}}

Request data validation

Describe the process of checking the input data transmitted in the request for compliance with the given rules and restrictions set in the API

Processing

...

Authorize

  1. Verify the validity of access token

    • in case of error - return 401 (“Invalid access token”) in case of validation fails

  2. Verify that token is not expired

    • in case of error - return 401 (“Invalid access token”)

  3. Check user scopes in order to perform this action (scope = 'declaration_request:read')

    • return 403 (“Your scope does not allow to access this resource. Missing allowances: declaration_request:read”) in case of invalid scope(s)

Processing

N/A

Response structure examples

See on API-specification (посилання на сторінку з API-специфікацією)Description of the REST API response structure, example

Expand
titleExample
Code Block
languagejson
{
  "meta": {
    "code": 200,
    "url": "https://example.com/resource",
    "type": "object",
    "request_id": "6617aeec-15e2-4d6f-b9bd-53559c358f97#17810"
  },
  "data": [
    {
      "id": "b075f148-7f93-4fc2-b2ec-2d81b19a9b7b",
      "start_date": "2017-03-02",
      "end_date": "2025-03-02",
      "status": "NEW",
      "status_reason": "not relevant",
      "channel": "MIS",
      "person_id": "4fa9cac7-8950-44db-9294-0daba56eed58",
      "employee_id": "60a797bb-43c5-463d-86ee-68e354cb626b",
      "division_id": "4c9c9c6e-5230-444d-8b65-7678da1c1ab3",
      "legal_entity_id": "56b8bcd7-78b8-4ff7-8a60-a48e54a6ef57",
      "authorize_with": "cc949559-5dfe-420f-ac05-065e443b2cc6",
      "parent_declaration_id": "8c7753fc-a647-435f-8e43-4ff4546431f6",
      "system_declaration_limit": 900,
      "current_declaration_count": 675
    }
  ],
  "paging": {
    "page_number": 2,
    "page_size": 50,
    "total_entries": 1000,
    "total_pages": 23
  }
}

HTTP status codes

Only for active MPI record can be created medication request!

Response code

HTTP Status code

Message

Internal name

Description

1

Базові

2

200

 Response

 

3

401

 Access token validation failed

4

401

Invalid access token

5

401

Unauthorized

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

6

403

 Invalid scope

76

403

Your scope does not allow to access this resource. Missing allowances: declaration_request:read

8

1000

404

Composition not found

COMPOSITION_NOT_FOUND_404

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

9

10
11

Специфічні

12

422

7

Специфічні

8

Post-processing processes

Description of actions performed on data after processing

Technical modules where the method is used

List of pages describing technical N/A

Technical modules where the method is used

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

...