Versions Compared

Key

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

...

Page Properties

Link

https://ehealthmisapi1.docs.apiary.io/#reference/public.-contracts/medical-program-provision/deactivate-medical-program-provision

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

Resource

/api/medical_program_provision/{{id}}/actions/deactivate

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

Scope

medical_program_provision:write

Scope для доступу

Components

Medical program provision

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

Microservices

API paragraph not found

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

Protocol type

REST

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

Request type

PATCH

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

Sync/Async

Sync

API paragraph not foundМетод є синхронним чи асинхронним?

Logic

API paragraph not found

...

Input parameter

Values

Type

Description

Example

id

String

Medical program provision identifier. Required

2060b523-b469-4fc5-89af-ddb5899d8efe

Authorize

...

Verify the validity of access token

  • in case of error - 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 = 'medical_program_provision:write')

...

API paragraph not found

Headers

Content-Type:application/json

...

api-key:aDGFDFGT46S5gFGD

Request data validation

Validate legal entity

  • Extract client_id from token.

  • Check client scopes in order to perform this action (scope = 'medical_program_provision:write')

    • in case of error - return 403 (“Your scope does not allow to access this resource. Missing allowances: medical_program:write”).

Validate medical program ID

  1. Check id exists in DB

    1. in case of error - return 404 ('not_found').

Validate related program medications

For each related program medication:

  1. Check it has is_active=true

    1. in case of error - return 409 ('This program has active participants. Only medical programs without participants can be deactivated').

API paragraph not found

Processing

API paragraph not found

...

Page Properties

HTTP status code

Message

What caused the error

200

Response

401

 Invalid access token

 

403

  • Your scope does not allow to access this resource. Missing allowances: medical_program_provision:write

 

404

not_found

Check id exists in DB failed

409

This program has active participants. Only medical programs without participants can be deactivated

Backward compatibility

API paragraph not found