...
Purpose*
Необхідно зазначити призначення методу.
Наприклад: This method allows to receive active person declarations issued by the current legal entity (based on access_token)
Specification*
...
Link
...
Посилання на Apiary або Swagger
...
Resource
...
Наприклад: /api/persons/create
...
Scope
...
Зазначається потрібний scope
...
Components
...
Зазначається перелік бізнес компонентів, які використовують цей метод, наприклад: ePrescription
...
Microservices
...
Перелік мікросервісів, які використовує метод API. Наприклад: Auth, ABAC
...
Protocol type
...
Тип протоколу, який використовується запитом, наприклад: SOAP | REST
...
Request type
...
Тип HTTP методу, який використовується запитом, наприклад: POST | GET…
...
Sync/Async
...
Метод є синхронним чи асинхронним?
Logic*
Потрібно по пунктах описати логіку методу API або додати діаграму
Preconditions
Які передумови мають бути виконані системою/користувачем. Наприклад:
створений запис в MedicationRequest;
рецепт відпущений (COMPLETED)
Global and configuration parameters
Потрібно вказати глобальні та конфігураційні параметри.
Наприклад:
...
Variable
...
Values
...
Description
...
CARE_PLAN_<category>_ICD10_AM_CONDITIONS_ALLOWED
...
Values that matches with dictionaryeHealth/ICD10_AM/condition_codes
Example: “E10.32, E11.92”
...
Allowed diagnoses for specified care plan category. Diagnoses should match with eHealth/ICD10_AM/condition_codes
dictionary, <category> - is a value from dictionary eHealth/care_plan_categories
in uppercase
(Example: CARE_PLAN_CLASS_1_ICD10_AM_CONDITIONS_ALLOWED)
Input parameters
Потрібно вказати вхідні параметри, наприклад:
...
Input parameter
...
Values
...
Type
...
Description
...
Example
...
asyncJobId
...
String
...
Async Job Object ID
Filters
Потрібно вказати фільтри. Наприклад:
...
Filter
...
Values
...
Type
...
Description
...
Example
...
id
...
String
...
7f93-4fc2-b2ec-2d81b19a9b7b (string, required)
...
d290f1ee-6c54-4b01-90e6-d701748f0851
Request structure*
See on Apiary
Example:
...
...
Purpose
This WS allows to terminate contract request by legal entity.
Specification
Logic
This WS is designed to terminate contract request by contractor. Contract request can't be in status='SIGNED'
Input parameters
Input parameter | Values | Type | Description | Example |
---|
id | | String | | b075f148-7f93-4fc2-b2ec-2d81b19a9b7b
|
Request structure
See on Apiary
Example:
Expand |
---|
|
Code Block |
---|
{
"status_reason": "Неправильний період контракту"
} |
|
Authorize
Verify the validity of access token
in case of error return 401 ('Access denied')
Check user scope contract_request:termiante in order to perform this action
in case of error generate 401 response ('Invalid scopes')
Request to process the request using a token in the headers
Наприклад:
Content-Type:application/json
Authorization:Bearer c2778f3064753ea70de870a53795f5c9
Request data validation
Validate User
Extract party_id (associated with user_id) from token.
Check party_id=party.contractor_owner_id
in case of error return 403 "User is not allowed to perform this action"
Validate contract request status
Check contract_request.status<>SIGNED
Processing
Auto termination
Fetch all contract_request with start_date<now().
for REIMBURSEMENT contracts
for CAPITATION contracts
Set status and status reason for such contract request as below:
field | value |
---|
status | TERMINATED |
status_reason | $.auto_expired |
updated_at | now() |
updated_by | $.user_id |
Add status to event manager
After status was changed (status = TERMINATED) - add new status to event_manager
field | value |
---|
event_type
| StatusChangeEvent
|
entity_type
| Contract_request |
entity_id
| $.id |
properties.status.new_value
| $.status |
event_time
| $.update_at |
changed_by
| $.changed_by |
Response structure
See on Apiary
Example:
Expand |
---|
|
Code Block |
---|
{
"meta": {
"code": 201,
"url": "https://example.com/resource",
"type": "object",
"request_id": "req-adasdoijasdojsda"
},
"data": {
"id": "09106b70-18b0-4726-b0ed-6bda1369fd52",
"contract_type": "REIMBURSEMENT",
"contractor_legal_entity": {
"id": "df9f70ee-4b12-4740-b0f5-bb5aea116863",
"name": "Клініка Ноунейм",
"edrpou": "32323454",
"addresses": [
{
"type": "RESIDENCE",
"country": "UA",
"area": "Житомирська",
"region": "Бердичівський",
"settlement": "Київ",
"settlement_type": "CITY",
"settlement_id": "b075f148",
"street_type": "STREET",
"street": "вул. Ніжинська",
"building": "15",
"apartment": "23",
"zip": "02090"
}
]
},
"contractor_owner": {
"id": "b075f148-7f93-4fc2-b2ec-2d81b19a9b7b",
"party": {
"first_name": "Петро",
"last_name": "Іванов",
"second_name": "Миколайович"
}
},
"contractor_base": "на підставі закону про Медичне обслуговування населення",
"contractor_payment_details": {
"bank_name": "Банк номер 1",
"MFO": "351005",
"payer_account": "32009102701026"
},
"id_form": "RMB-1",
"nhs_signer": {
"id": "b075f148-7f93-4fc2-b2ec-2d81b19a9b7b",
"party": {
"first_name": "Петро",
"last_name": "Іванов",
"second_name": "Миколайович"
}
},
"nhs_legal_entity": {
"id": "df9f70ee-4b12-4740-b0f5-bb5aea116863",
"name": "Клініка Ноунейм",
"edrpou": "32323454",
"addresses": [
{
"type": "RESIDENCE",
"country": "UA",
"area": "Житомирська",
"region": "Бердичівський",
"settlement": "Київ",
"settlement_type": "CITY",
"settlement_id": "b075f148",
"street_type": "STREET",
"street": "вул. Ніжинська",
"building": "15",
"apartment": "23",
"zip": "02090"
}
]
},
"nhs_signer_base": "на підставі наказу",
"nhs_contract_price": 50000,
"nhs_payment_method": "BACKWARD",
"status": "NEW",
"status_reason": "Не відповідає попереднім домовленостям",
"issue_city": "Київ",
"contract_number": "0000-9EAX-XT7X-3115",
"contract_id": "df9f70ee-4b12-4740-b0f5-bb5aea116863",
"parent_contract_id": "22e416c4-5747-41cd-9f73-c3a85cdee885",
"start_date": "2017-04-20",
"end_date": "2017-04-20",
"printout_content": "Contract request content",
"previous_request_id": "df9f70ee-4b12-4740-b0f5-bb5aea116863",
"assignee_id": "22e416c4-5747-41cd-9f73-c3a85cdee885",
"medical_programs": [
"3914a240-63db-404e-b730-09222bfeb2d0"
]
}
} |
|
Expand |
---|
|
Code Block |
---|
{
"meta": {
"code": 201,
"url": "https://example.com/resource",
"type": "object",
"request_id": "req-adasdoijasdojsda"
},
"data": {
"id": "09106b70-18b0-4726-b0ed-6bda1369fd52",
"contract_type": "CAPITATION",
"contractor_legal_entity": {
"id": "df9f70ee-4b12-4740-b0f5-bb5aea116863",
"name": "Клініка Ноунейм",
"edrpou": "32323454",
"addresses": [
{
"type": "RESIDENCE",
"country": "UA",
"area": "Житомирська",
"region": "Бердичівський",
"settlement": "Київ",
"settlement_type": "CITY",
"settlement_id": "b075f148",
"street_type": "STREET",
"street": "вул. Ніжинська",
"building": "15",
"apartment": "23",
"zip": "02090"
}
]
},
"contractor_owner": {
"id": "b075f148-7f93-4fc2-b2ec-2d81b19a9b7b",
"party": {
"first_name": "Петро",
"last_name": "Іванов",
"second_name": "Миколайович"
}
},
"contractor_base": "на підставі закону про Медичне обслуговування населення",
"contractor_payment_details": {
"bank_name": "Банк номер 1",
"MFO": "351005",
"payer_account": "32009102701026"
},
"contractor_rmsp_amount": 50000,
"contractor_divisions": [
{
"id": "2922a240-63db-404e-b730-09222bfeb2dd",
"name": "Бориспільське відділення Клініки Ноунейм",
"addresses": [
{
"type": "RESIDENCE",
"country": "UA",
"area": "Житомирська",
"region": "Бердичівський",
"settlement": "Київ",
"settlement_type": "CITY",
"settlement_id": "b075f148",
"street_type": "STREET",
"street": "вул. Ніжинська",
"building": "15",
"apartment": "23",
"zip": "02090"
}
],
"phones": [
{
"type": "MOBILE",
"number": "+380503410870"
}
],
"email": "email@example.com",
"working_hours": {
"mon": [
[
"08.00",
"12.00"
],
[
"14.00",
"18.00"
]
],
"tue": [
[
"08.00",
"12.00"
]
],
"wed": [
[
"08.00",
"12.00"
]
],
"thu": [
|
|
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
],
"contractor_employee_divisions": [
|
|
...
...
...
...
...
b075f148-7f93-4fc2-b2ec-2d81b19a9b7b",
" |
|
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
"speciality_officio": true,
|
|
...
...
...
...
...
...
...
...
...
...
...
...
...
"attestation_date": "2017-02-28",
|
|
...
...
...
...
...
...
...
...
"declaration_limit": 2000,
|
|
...
...
...
...
...
...
...
...
"external_contractor_flag": |
|
...
...
...
...
...
...
...
b075f148-7f93-4fc2-b2ec-2d81b19a9b7b",
"name": "Клініка Ноунейм"
|
|
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
2922a240-63db-404e-b730-09222bfeb2dd",
" |
|
...
...
Бориспільське відділення Клініки Ноунейм",
|
|
...
"medical_service": "Послуга ПМД"
|
|
...
...
...
...
...
...
...
"PMD_1",
"nhs_signer": {
" |
|
...
...
b075f148-7f93-4fc2-b2ec-2d81b19a9b7b",
" |
|
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
df9f70ee-4b12-4740-b0f5-bb5aea116863",
|
|
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
"region": "Бердичівський",
|
|
...
...
...
...
...
...
...
Authorize*
Вимоги до авторизації: яким чином надається доступ до використання методу
Request to process the request using a token in the headers
Наприклад:
Content-Type:application/json
Authorization:Bearer c2778f3064753ea70de870a53795f5c9
api-key:uXhEczJ56adsfh3Ri9SUkc4en
Validate request*
Наприклад:
Validate request using JSON schema
In case validation failed - generate 422 error
Expand |
---|
|
Code Block |
---|
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"verification_code": {
"type": "string"
}
},
"required": [
"verification_code"
],
"additionalProperties": false
}
|
|
Request data validation*
Валідація даних
Parameters that are used when processing the request
Configuration parameters
Наприклад: Доступ до методу визначається скоупом covid_certificate:get . Дозвіл на даний скоуп визначається адміністратором Системи шляхом конфігурування скоупів в контексті клієнтів і ролей.
Dictionaries
Потрібно вказати довідники, які використовує метод API
Processing*
Потрібно описати процеси, які відбуваються з даними
1. Using global parameters
Потрібно викликати глобальні параметри (Global parameters), щоб отримати наведені нижче параметри
Response structure*
See on Apiary
Example:
...
...
"settlement_id": "b075f148",
"street_type": "STREET",
"street": "вул. Ніжинська",
"building": "15",
"apartment": "23",
"zip": "02090"
}
]
},
"nhs_signer_base": "на підставі наказу",
"nhs_contract_price": 50000,
"nhs_payment_method": "BACKWARD",
"status": "NEW",
"status_reason": "Не відповідає попереднім домовленостям",
"issue_city": "Київ",
"contract_number": "0000-9EAX-XT7X-3115",
"contract_id": "df9f70ee-4b12-4740-b0f5-bb5aea116863",
" |
|
...
...
22e416c4-5747-41cd-9f73-c3a85cdee885",
" |
|
...
...
...
...
...
printout_content": "Contract request content",
" |
|
...
...
...
...
...
...
...
...
22e416c4-5747-41cd-9f73-c3a85cdee885"
}
}
|
|
Request mapping
field | value |
---|
status | TERMINATED |
status_reason | $.status_reason |
updated_at | now() |
updated_by | $.user_id |
Post-processing processes
...
API paragraph not found
HTTP status codes
HTTP status code | Message | What caused the error |
---|
200 | | |
| | |
Backward compatibility
...