/
RC_[NEW] Get Device definition details V2

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

RC_[NEW] Get Device definition details V2

Purpose

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

 

 

Specification

Link

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

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

Resource

api/v2/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

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 data from device_definitions, related to it device_definition_names and device_definition_classification_types (PRM database)

  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

{ "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" } ], "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" }, "parent_id": "3bc7a920-53a5-46a6-a88e-b5f298c7b898", "program_devices": [ { "id": "e477a845-972b-47a1-8ca3-1c71e4fd00c2", "start_date": "2019-01-01", "end_date": "2025-06-30", "device_request_allowed": false, "care_plan_activity_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", "classification_types": [ { "system": "device_definition_classification_type", "code": "30221" } ], "properties": [ { "type": { "system": "device_properties", "code": "default" }, "value_integer": 10 } ] } }

 

HTTP status codes

HTTP status code

Message

What caused the error

HTTP status code

Message

What caused the error

 200

 

 

Related content

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