Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Info

REST API method / Метод REST API (настанова) (remove the link block before publishing the document)

...

Page Properties
idpage_properties_method_REST API

Document type

Метод REST API

Document title

[Document status] REST API [Назва методу] [ID методу]

Guideline ID

GUI-0011

Author

@

Document version

1

Document status

DRAFT

Date of creation

ХХ.ХХ.ХХХХ (дата фінальної версії документа – RC або PROD)

Date of update

ХХ.ХХ.ХХХХ (дата зміни версії)

Method API ID

API-005-002-002-0043

Microservices (namespace)

IL

Component

Contracts

Component ID

COM-005-002

Link на API-специфікацію

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

Resource

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

Scope

contract_request:create

Protocol type

REST

Request type

POST

Sync/Async

Sync

Public/Private

Private

...

Request has a similar structure as in Public. Create Contract Request. For Create contract request by NHS, the contract_number in the request is required, it is used to change the existing contract by the NHS.

Configuration parameters

Description of the configuration parameters that are used when processing a request in the system

Dictionaries

Provides a list of links to dictionaries that are available in Confluence

Input parameters

Description of input parameters

Input parameter

Mandatory

Type

Description

Example

1

contract_type

CAPITATION

REIMBURSEMENT

String

Required

 

2

id

 

String

Contract_request ID. Required

09106b70-18b0-4726-b0ed-6bda1369fd52

Request structure

See on API-specification (посилання на сторінку з API-специфікацією)

Description of the REST API request structure, example

Expand
titleExample
Code Block
{
  "signed_content": "ew0KICAiY29udHJhY3Rvcl9vd25lcl9pZCI6ICJkZjlmNzBlZS00YjEyLTQ3NDAtYjBmNS1iYjVhZWExMTY4NjMiLA0KICAiY29udHJhY3Rvcl9iYXNlIjogItC90LAg0L/RltC00YHRgtCw0LLRliDQt9Cw0LrQvtC90YMg0L/RgNC+INCc0LXQtNC40YfQvdC1INC+0LHRgdC70YPQs9C+0LLRg9Cy0LDQvdC90Y8g0L3QsNGB0LXQu9C10L3QvdGPIiwNCiAgImNvbnRyYWN0b3JfcGF5bWVudF9kZXRha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lIjogItCf0L7RgdC70YPQs9CwINCf0JzQlCINCiAgICAgIH0NCiAgICBdDQogIH0sDQogICJzdGFydF9kYXRlIjogIjIwMTctMDQtMjAiLA0KICAiZW5kX2RhdGUiOiAiMjAxNy0wNC0yMCIsDQogICJpZF9mb3JtIjogIjUiLA0KICAiY29udHJhY3RfbnVtYmVyIjogIjAwMDAtOUVBWC1YVDdYLTMxMTUiLA0KICAic3RhdHV0ZSI6ImJhc2U2NF9kb2N1bWVudCINCiAgImVxdWlwbWVudF9hZ3JlZW1lbnQiOiJiYXNlNjRfZG9jdW1lbnQiDQp9",
  "signed_content_encoding": "base64"
}

...

  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 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 may be equal or greater than today and less than or equal to three month 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

...

Response structure examples

See on API-specification (посилання на сторінку з API-специфікацією)

Description of the REST API response structure, example

...

Response code

HTTP Status code

Message

Internal name

Description

1

Базові

2

201

 Response

 

3

 401

Access denied

 

4

401

Invalid scopes

5

401

Unauthorized

Помилка підтвердження

6

403

Client is blocked

7

403

Client is not active

8

403

Error

9

403

forbidden

10

1000

404

Composition not found

COMPOSITION_NOT_FOUND_404

Не знайдено медичний висновок

11

409

 

Validation failed

12

422

 

Validation failed

13

422

Invalid EDRPOU in DS

14

422

Not allowed to change field $.field

15

422

The year of end_date should be one year greater or equal to start_date

16

422

The end_date may be equal or greater than today and less than or equal to three month from end_date the previous contract

17

Специфічні

18

422

Only for active MPI record can be created medication request!

Post-processing processes

Description of actions performed on data after processing

Technical modules where the method is used

List of pages describing technical modules where the method is used

Page Properties Report
headingsID ТМ, Статус
cqllabel = "tr-mis"

...