Note |
---|
Сторінка знаходиться в процесі розробки. Інформація на ній може бути застарілою. |
Page Properties | ||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||||||||||||||||||||||
|
Purpose
This process is designed to deactivate declaration manually (for NHS admin or patient authorized via Cabinet).
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-специфікацією)
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 | |||||
3 |
|
|
|
|
|
Request data validation
Validate request
One of parameter person_id or employee_id
must be set. Also can be added the description field: reason_description.
Patient via cabinet can terminate only his own active declaration.
Validate person
For NHS admin
Search person by $.id
in case error return 404
Search declaration by $.person_id
in case error return 404
Check declaration status = active
in case error return 422. Message:"declaration status is not active".
For authorized patient:
extract person_id from.
Validate employee
Search employee by $.id
in case error return 404.
Check if employee is an active doctor (employee_type=DOCTOR and is_active=true)
in case error return 422. Message: "Employee is not an active doctor".
Select all active declarations by $.employee_id
in case error return 422. Message: "Employee does not have active declarations".
Processing
Terminate declaration
Change declaration status to `terminated`
If in payload
employee_id
was set then change reason to `manual_employee`If in payload
person_id
was set then change reason to `manual_person`.
Response structure examples
See on API-specification (посилання на сторінку з API-специфікацією)
Description of the REST API response structure, example
Expand | ||
---|---|---|
| ||
|
HTTP status codes
Response code | HTTP Status code | Message | Internal name | Description | |
---|---|---|---|---|---|
1 | Базові | ||||
2 | 200 | Response |
| ||
3 | 401 |
|
| ||
4 | 401 | Unauthorized |
| Помилка підтвердження | |
5 | 1000 | 404 | Composition not found | COMPOSITION_NOT_FOUND_404 | Не знайдено медичний висновок |
6 | 404 | Error | Search employee by $.id failed | ||
7 | 404 | Error | Search person by $.id failed | ||
8 | 404 | Error | Search declaration by $.person_id | ||
9 | 422 | Error | Declaration status is not active | ||
10 |
| 422 | Error | Employee does not have active declarations | |
11 | 422 | Error | Employee is not an active doctor | ||
12 | Специфічні | ||||
13 |
| 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