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

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Version History

Version 1 Current »

Purpose

This WS is designed to return details of Device definition using its identifier.

Used to return device definition with the old structure only.

Will be deprecated

Specification

Link

https://uaehealthapi.docs.apiary.io/#reference/public.-devices/get-device-definition-details/get-device-definition-details

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

Resource

/api/device_definitions/id

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

Scope

device_definitions:read

Scope для доступу

Components

Public. Devices

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

Microservices

Devices

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

Protocol type

REST

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

Request type

GET

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

Sync/Async

Sync

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

Public/Private/Internal

Public

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

Filters

Filter

Values

Type

Description

Example

id

String

Device definition identifier

88ecde40-c97f-4b36-bffd-0da9c60d697c

Logic

Service returns device_definitions filtered by ID:

  1. Get all device_definitions (PRM database) where device_definitions.classification_type is not empty.

  2. Get data from program_devices (PRM database) with following params:

    1. device_definition_id = id from URL

    2. is_active = true

    3. start_date <= current date()

    4. end_date >= current_date(), if not null

  3. Render a response according to specification

Authorize

  • Verify the validity of access token

    • Return (401, 'Invalid access token') in case of validation fails

  • Verify that token is not expired

    • in case of error - return (401, 'Invalid access token')

  • Check user scopes in order to perform this action (scope = 'device_definitions:read')

    • Return (403, 'Your scope does not allow to access this resource. Missing allowances: device_definitions:read') in case of invalid scope(s)

Validate device definition

  • Check that device definition with such ID exists in the system

    • in case of error - return 404 ('Device definition is not found')

  • Check device_definitions.classification_type field is not empty.

    • in case of error - return 409 ('Use v2 route for this device definition')

Headers

Content-Type:application/json

Authorization:Bearer c2778f3064753ea70de870a53795f5c9

api-key:uXhEczJ56adsfh3Ri9SUkc4en

Response structure

See on Apiary

 Request example
{
  "meta": {
    "code": 200,
    "url": "https://example.com/resource",
    "type": "object",
    "request_id": "6617aeec-15e2-4d6f-b9bd-53559c358f97#17810"
  },
  "data": [
    {
      "id": "3e34da3d-9b8c-4aaf-be8e-24a161279b6a",
      "external_id": "0012351",
      "device_names": [
        {
          "name": "Тест-смужки Accu-Chek Active для глюкометра",
          "type": "user_friendly"
        }
      ],
      "classification_type": "30221",
      "description": "Для визначення рівня глюкози в крові за допомогою глюкоментра Accu-Chek Active",
      "manufacturer": {
        "name": "ПАТ \"Київський вітамінний завод\"",
        "country": "UA"
      },
      "model_number": "M23N76",
      "part_number": "P00234",
      "note": "Для визначення рівня глюкози в крові за допомогою глюкоментра Accu-Chek Active",
      "packaging": {
        "packaging_type": "undefined",
        "packaging_count": 50,
        "packaging_unit": "pcs"
      },
      "program_devices": [
        {
          "id": "e477a845-972b-47a1-8ca3-1c71e4fd00c2",
          "start_date": "2019-01-01",
          "end_date": "2025-06-30",
          "device_request_allowed": false,
          "registry_number": "REG-1111",
          "max_daily_count": 200
        }
      ],
      "is_active": true,
      "inserted_at": "2017-04-20T19:14:13Z",
      "inserted_by": "e1453f4c-1077-4e85-8c98-c13ffca0063e",
      "updated_at": "2017-04-20T19:14:13Z",
      "updated_by": "2922a240-63db-404e-b730-09222bfeb2dd"
    }
  ],
  "paging": {
    "page_number": 2,
    "page_size": 50,
    "total_entries": 1000,
    "total_pages": 23
  }
}

HTTP status codes

HTTP status code

Message

What caused the error

 200

 

 

  • No labels