Table of Contents | ||||
---|---|---|---|---|
|
Purpose
...
This web service is designed to close an episode.
Specification
...
Page Properties | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Logic
...
API paragraph not found
Input parameters
Input parameter | Values | Type | Description | Example |
---|---|---|---|---|
patient_id | String | Patient identifier |
| |
episode_id | String | Episode identifier |
|
Request structure
...
See on Apiary
Example:
Expand | ||
---|---|---|
| ||
|
Authorize
...
Request to process the request using a token in the headers
Headers
...
Наприклад:
Content-Type:application/json
Authorization:Bearer mF_9.B5f-4.1JqM
Request data validation
...
Validate token
Verify the validity of access token
Return 401 in case validation fails
Verify token is not expired
in case of error return 401
check value of ALLOWof ALLOW_OTHER_LE_EMPLOYEES_TO_MANAGE_EPISODE variable 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 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_cancellation_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
...
See on Apiary
Example:
Expand | ||
---|---|---|
| ||
|
Expand | ||
---|---|---|
| ||
|
Post-processing processes
...
API paragraph not found
HTTP status codes
...
HTTP status code | Message | What caused the error |
---|---|---|
202 |
|
|
404 |
|
|
...