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

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 Page History

Version 1 Current »

Purpose

This WS is designed to return list of all active device definitions. It is also allow to search for some device definitions by search criteria

Method to get or search all active device definitions in the system

Specification

Link

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

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

Resource

/api/device_definitions

Посилання на ресурс, наприклад: /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

classification_type

String

Classification type. Dictionary device_definition_classification_type

30221

model_number

String

Model number for the device

H00P53

name

String

Device name

Some name

name_type

Enum

Device name type. Dictionary device_name_type

registered

medical_program_id

String

medical program id

d290f1ee-6c54-4b01-90e6-d701748f0851

is_active

Boolean

device definition status

true

page

Number

Page number

2

page_size

Number

A limit on the number of objects to be returned, between 1 and 300. Default: 50

50

Logic

Service returns all device_definitions filtered by passed parameters:

  1. Get all device_definitions (PRM database)

  2. Filter list by passed search parameters (according to spec.)

    1. Search using like operation. Case insensitive

    2. if medical_program_id is passed than get device definitions related to this program in program_devices table

      1. is_active = true

      2. start_date <= current date()

      3. 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)

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