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

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this content. View the current version.

Compare with Current View Version History

« Previous Version 2 Next »

Purpose

This method allows deactivation of a division that provides a medical program within user's legal entity

Specification

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 parameters

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')

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

Headers

Content-Type:application/json

Authorization:Bearer F3GF124Df565FDS234SDF34

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

Processing

API paragraph not found

Response structure

Example:

 Response 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",
    "contract_number": "0000-PAP5-M000",
    "msp_legal_entity_id": "15d5ea65-d6e7-44f8-9eef-f0d3c1121d3a",
    "medical_program_id": "04d5ea65-d6e7-44f8-9eef-f0d3c1121d2b",
    "division_id": "15caea3f-cac3-483c-a3da-5875eba96430",
    "is_active": false,
    "deactivate_reason": "MANUAL_DEACTIVATION",
    "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"
  }
}

Post-processing processes

API paragraph not found

HTTP status codes

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

  • No labels