Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Table of Contents

...

Page Properties
idAPI_Specification

Link

https://ehealthmedicaleventsapi.docs.apiary.io/#reference/device-dispenses/stop-device-dispense/stop-device-dispense

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

Resource

/api/patients/{{patient_id}}/device_dispenses/{{device_dispense_id}}/actions/stop

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

Scope

device_dispense:stop

Scope для доступу

Components

Devices

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

Microservices

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

Protocol type

REST

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

Request type

PATCH

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

Sync/Async

Sync

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

Public/Private/Internal

Public

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

Logic

  1. Update Device dispense data in device_dispenses (MongoDB):

    1. set status  =  ‘stopped’

    2. updated_by = user_id

    3. updated_at = now()

  2. Send StatusChangeEvent to Event Manager

Input parameters

Input parameter

Values

Type

Description

Example

patient_id

String

Unique patient identifier

aff00bf6-68bf-4b49-b66d-f031d48922b3

Request structure

...

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 = 'device_dispense:stop')

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

Headers

API paragraph not foundContent-Type:application/json

Request data validation

Validate Legal entity

...

For more information look at https://e-health-ua.atlassian.net/wiki/spaces/EH/pages/17492805190 .

Processing

API paragraph not found

Response structure

See on Apiary

...

Expand
titleResponse example
Code Block
{
  "data": {
    "status": "pending",
    "eta": "2018-08-02T10:45:16.000Z",
    "links": [
      {
        "entity": "job",
        "href": "/Jobs/NBXk9EyErUZv1RhXgyvgg"
      }
    ]
  },
  "meta": {
    "code": 202,
    "url": "http://example.com/resource",
    "type": "object",
    "request_id": "req-adasdoijasdojsda"
  }
}

Post-processing processes

...

HTTP status codes

Page Properties
idAPI_HTTP status codes

HTTP status code

Message

What caused the error

 202

 

 

...