Versions Compared

Key

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

...

Specification

Page Properties

Link

https://uaehealthapiehealthmisapi1.docs.apiary.io/#reference/public.-reimbursement/medication-dispense/get-medication-dispense-details

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

Resource

/api/medication_dispenses/{{id}}

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

Scope

medication_dispense:read

Scope для доступу

Components

ePrescription, Reimbursement

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

Microservices

API paragraph not found

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

Protocol type

REST

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

Request type

GET

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

Sync/Async

Sync

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

Logic

Status Charts (reimbursement)Service returns specified Medication dispense related to the legal entity from token:

  • Get Medication dispense by ID from medication_dispenses DB (OPS).

  • Validate data consistency:

    • Ensure that requested Medication dispense relates to requested legal entity

      • Return 404 ('not_found') in case of error.

  • Render a response according to specification.

Preconditions

No

Global and configurable parameters

...

Input parameter

Values

Type

Description

Example

id

String

Medication Dispense Response Identifier. Required.

a89f6a26-4221-4597-a1d2-542d5e40b565

Filters

See on ApiaryNo

Request structure

API paragraph not foundSee on Apiary

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 = 'medication_dispense:read')

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

Headers

Content-Type:application/json

Authorization:Bearer c2778f3064753ea70de870a53795f5c9

Validate request

Get legal entity from token

Extract legal_entity_id (client_id) from token

API paragraph not found

Request data validation

Validate

...

Return response to user limited by context from user's token

...

Token type

...

Limitation

...

TOKENS_TYPES_PERSONAL

...

Limited by Legal Entity (ID)

...

Medication dispense

  • Get Medication dispense identifier from the URL

    • Check Medication dispense exists in DB (OPS)

      • Return 404 ('not_found') in case of error.

    • Check Medication dispense belongs to legal entity

      • Return 404 ('not_found') in case of error.

Validate User

  • Extract client_id (legal_entity_id

...

TOKENS_TYPES_ADMIN

...

  • ) from token

...

Limited by approval on care plan from medication request

...

Extract care_plan_id from medication request

    • Return 404 ('not_found') in case employee has no access to medication dispense.

Parameters that are used when processing the request

...

API paragraph not found

Processing

  1. Get certain record from medication_dispenses filtered by:

    1. record should be active: is_active = true

    2. context: user context

    3. id: Query param: id

API paragraph not found

Response structure

See on Apiary

...

HTTP status code

Message

What caused the error

200

Response

 

401

Invalid access token

 

403Invalid

scopeYour scope does not allow to access this resource. Missing allowances: medication_dispense:read

404

Not found

  • Ensure that requested Medication dispense relates to requested legal entity.

  • Medication dispense exists in DB (OPS) check failed.

  • Medication dispense belongs to legal entity check failed.

  • In case employee has no access to medication dispense.

Backward compatibility

API paragraph not found