Info |
---|
REST API method / Метод REST API (настанова) (remove the link block before publishing the document) |
...
Page Properties | ||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||||||||||||||||||||||
|
Purpose
Describe the purpose of the API method, add Key points (if necessary)
Logic
...
|
Purpose
This web service is designed to close an episode.
Logic
This web service is designed to close an episode of care.
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 | compositionpatient_id | M | String ($uuid) (path) | Composition object ID | 89678f60-4cdc-4fe3-ae83-e8b3ebd35c59 | 2 | Patient identifier |
| |
2 | episode_id |
| String | Episode identifier |
|
Request structure
See on Apiary
See on API-specification (посилання на сторінку з API-специфікацією)
Description of the REST API request structure, example
Expand | ||
---|---|---|
| ||
|
Headers
Key | Value | Mandatory | Description | Example | ||||
---|---|---|---|---|---|---|---|---|
1 | Content-Type | application/json | M | Тип контенту | Content-Type:application/json | |||
2 | Authorization | Bearer c2778f3064753ea70de870a53795f5c9 | M | Перевірка користувача{{access_token}} | Authorization:Bearer c2778f3064753ea70de870a53795f5c9 | 3 |
Request data validation
Describe the process of checking the input data transmitted in the request for compliance with the given rules and restrictions set in the API
Processing
A list of processes related to receiving, changing or transmitting data according to the logic defined in the REST API
Response structure examples
Description of the REST API response structure, example
...
title | Example |
---|
...
{{access_token}} | |||||
3 | API-key | {{secret}} | API-key:{{secret}} |
Request data validation
Validate token
check value of ALLOW_OTHER_LE_EMPLOYEES_TO_MANAGE_EPISODE variable in charts configuration
if its value is equal to false, verify that user’s employees from care_manager belongs to one of the user_id from token
in case of error - return 422 ('User is not allowed to perform this action')
otherwise, verify that user’s employees from care_manager belongs to the same Legal Entity as author of the episode
in case of error - return 422 ('User is not allowed to perfom this action')
Validate legal entity
Validate episode belongs to the legal entity where the current user works
ME.episode.managing_organization==token.client_id
in case of error return 422 "Managing_organization does not correspond to user`s legal_entity"
Validate request
Validate episode.status!= "entered_in_error" or "closed"
in case of error "Episode in {episode_status} can not be closed"
Validate that "closing_reason" is a valid value from the corresponding dictionary
$.closing_reason.coding[*].system == "eHealth/episode_closing_reasons"
Validate period as Period (consider period.start_date from the episode)
Processing
Set the status of the episode in "closed"
Set closing_reason in status_reason
Set closing_summary
Set period.end
Create a record in episode.status_history
Response structure examples
See on Apiary
See on API-specification (посилання на сторінку з API-специфікацією)
Expand | ||
---|---|---|
| ||
|
Expand | ||
---|---|---|
| ||
|
HTTP status codes
Response code | HTTP Status code | Message | Internal name | Description | |||||
---|---|---|---|---|---|---|---|---|---|
1 | Базові | ||||||||
2 | 202 |
|
| ||||||
3 | 401 |
| Access token validation failed | ||||||
4 | 401 | Unauthorized | Помилка підтвердження | ||||||
5 | 403 |
| Invalid scope | ||||||
6 | 1000 | 404 | Composition not found | COMPOSITION_NOT_FOUND_404 | Не знайдено медичний висновок | 3 | 401 | Unauthorized | Помилка підтвердження |
4 | Специфічні | ||||||||
7 | 404 | Patient not found |
| ||||||
8 | 422 | Managing_organization does not correspond to user`s legal_entity | |||||||
9 | 422 |
| Validation failed | ||||||
10 | 422 | User is not allowed to perform this action | |||||||
11 | Специфічні | ||||||||
12 | 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 | ||||
---|---|---|---|---|
|
...