Versions Compared

Key

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

...

Page Properties
idAPI_Specification

Link

https://ehealthmisapi1.docs.apiary.io/#reference/public.-contracts/contract-request/private.-create-contract-request-by-nhs

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

Resource

/api/contract_requests/{{contract_type}}/{{id}}

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

Scope

contract_request:create

Scope для доступу

Components

Contracts

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

Microservices

API paragraph not found

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

Protocol type

REST

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

Request type

POST

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

Sync/Async

API paragraph not found

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

Public/Private/Internal

Private

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

Preconditions

Contract should be created on MSP/Pharmacy side

...

  1. Verify the validity of access token

    1. in case of error return 401 ('Access denied')

  2. Check user scope contract_request:create in order to perform this action

    1. in case of error generate 401 response ('Invalid scopes')

Headers

Наприклад:

Content-Type:application/json

...

  1. contract request number structure XXXX-1234-5678-C , where:

    1. XXXX - series: numbers + only some letters (A, E, H, K, M, P, T, X)

    2. 1234-5678 - randomly generated numbers and letters A, E, H, K, M, P, T, X. 

  2. contract_number is in request

    1. in case error return 409, "Contract number should be in payload"

  3. check there is a contract with such contract_number 

    1. in case of error return 422 error ('Contract with such contract number does not exist')

  4. contrat status = VARIFIED

    1. in case of error return 409 error ('Can not update terminated contract')

  5. Contract.is_suspended = false

    1. in case error 409, "suspended contract should be updated by contractor_owner"

  6. Check only next fields are different from contract

    1. nhs_signer_id

    2. nhs_signer_base

    3. nhs_contract_price (for capitation contracts only)

    4. nhs_payment_method

    5. issue_city

    6. Misc

    7. assignee_id

      1. in case error return 422, "Not allowed to change field $.field"

  7. Validate end_date:

    1. if $contract_number and $end_date is passed in request:

      1. the year of $end_date must be greater or equal then the $start_date

        1. in case of error return 422 ('The year of end_date should be one year greater or equal to start_date')

      2. the $end_date should be less than $end_date from the previous contract equal or greater than today and less than or equal to three month from $end_date the previous contract

        1. in case of error return 422 ('The end_date should may be equal or greater than of the previous contract today and less than or equal to three monthsmonth from end_date the previous contract')

    2. if $contract_number w/o $end_date is passed in request:

      1. $end_date is taken from the previous contract.

Processing

Search pending contract requests

...

  1. Get url for contract request upload.

    Parameter
    Source
    action'GET'
    bucket'CONTRACT_REQUEST'
    resource_id: CONTRACT_REQUEST_ID
    resource_name: CONTRACT_REQUEST_APPROVED
    timestamp:TIMESTAMP

  2. Upload signed contract request to media storage

...