Info |
---|
REST API method / Метод REST API (настанова) (remove the link block before publishing the document) |
Table of Contents |
---|
Properties of a REST API method document
Page Properties | ||
---|---|---|
| ||
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-004-002-0073 | |
Microservices (namespace) | IL | |
Component | Declarations | |
Component ID | COM-005-004 | |
Link на API-специфікацію | Resource | {{host}}|
Info | ||
REST API method / Метод REST API (настанова) (remove the link block before publishing the document) |
Table of Contents |
---|
Properties of a REST API method document
Page Properties | ||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||||||||||||||||||||||
|
...
This method method allows to create a declaration only for an existing person.
To create declaration request based on active declaration in reorganized legal entity,
parent_declaration_id
must be passed in request.
Logic
Description of the working algorithm of the API method and the interaction of services with each other add Service logic (if necessary)
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 | composition_id | M | String ($uuid) (path) | Composition object ID | 89678f60-4cdc-4fe3-ae83-e8b3ebd35c59||||||
2 |
Request structure
See on API-specification (посилання на сторінку з API-специфікацією)
...
See on API-specification
Expand | ||
---|---|---|
| ||
|
...
Key | Value | Mandatory | Description | Example | |
---|---|---|---|---|---|
1 | Content-Type | application/json | M | Тип контенту | Content-Type:application/json |
2 | Authorization | Bearer c2778f3064753ea70de870a53795f5c9 | M | Перевірка користувача | Authorization:Bearer c2778f3064753ea70de870a53795f5c9 | 3 |
...
2 | |||||
3 |
Request data validation
Authorize
Verify the validity of access token
in case error - return 401
Check users scopes ('declaration_request:write') to perform this action
in case error return 403 - forbidden
If BLOCK_UNVERIFIED_PARTY_USERS is true, then check party's data match following condition: verification_status != NOT_VERIFIED or (verification_status = NOT_VERIFIED and updated_at > current_date - UNVERIFIED_PARTY_PERIOD_DAYS_ALLOWED):
in case not match - return 403 ("Access denied. Party is not verified")
If BLOCK_DECEASED_PARTY_USERS is true, check that party is not deceased (party_verification record does not equal to: dracs_death_verification_status = VERIFIED and dracs_death_verification_reason = MANUAL_CONFIRMED):
in case of error - return 403 ("Access denied. Party is deceased")
Validate request using JSON schema
...
where IL.Declaration_request.mpi_id = :($.person.id) and status in ('NEW' or 'APPROVED)
Cancel declaration requests
Change status and status reason of all found declaration requests:
status: CANCELED
status_reason: request_cancelled
|
...
Insert record to IL.declaration_request:
status 'NEW'
is_shareable: false
Generate upload URL
If auth_method_requests.auth_method_current = OFFLINE
...
Response structure examples
See on API-specification (посилання на сторінку з API-специфікацією)
...
See on API-specification
Expand | ||
---|---|---|
| ||
|
...
Response code | HTTP Status code | Message | Internal name | Description | |||||||
---|---|---|---|---|---|---|---|---|---|---|---|
1 | Базові | ||||||||||
2 | 201 | Response |
| ||||||||
3 | 401 |
| Access token validation failed | ||||||||
4 | 403 | Access denied. Party is not verified | |||||||||
5 | 403 | Access denied. Party is deceased | |||||||||
6 | 403 |
| Invalid scopes | ||||||||
7 | 403 | forbidden | |||||||||
8 | 404 | Active parent declaration was not found | |||||||||
9 | 1000 | 404 | Composition not found | COMPOSITION_NOT_FOUND_404 | Не знайдено медичний висновок | 10 | 404 |
| Validation error | ||
1110 | 404 | Such person doesn't exist | |||||||||
1211 | 409 |
| Validation error | ||||||||
1312 | 409 | Employee of parent declaration and current employee are not the same | |||||||||
1413 | 409 | Legal entities of parent declaration and current are not in reorganization process | |||||||||
1514 | 409 | Parent declaration does not belong to this person | |||||||||
1615 | 422 |
| Validation error | ||||||||
1716 | 401 | Unauthorized | Помилка підтвердження | ||||||||
1817 | 409 | Patient is not verified | |||||||||
1918 | 422 | Сannot be confirmed by a method with type= NA. Use a different method. | |||||||||
2019 | 422 | Person must have authentication method | |||||||||
2120 | 422 | such authentication method doesn't exist | |||||||||
2221 | 422 | such authentication method does not belong to this person | |||||||||
2322 | Специфічні | ||||||||||
2423 | 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 | ||||
---|---|---|---|---|
|
...