/wiki/spaces/EN/pages/17591304241 (remove the link block before publishing the document)
Properties of a REST API method document
Purpose
This WS allows to update end_date for contracts in case legal entity was merged and can't sign new contract.
Logic
This WS allows to update end_date for contracts in case legal entity was merged and can't sign new contract. Contract must be in status 'VERIFIED'
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 | id |
| String |
|
|
2 |
Request structure
See on API-specification (посилання на сторінку з API-специфікацією)
Description of the REST API request structure, example
Headers
Key | Value | Mandatory | Description | Example | |
---|---|---|---|---|---|
1 | Content-Type | application/json | M | Тип контенту | Content-Type:application/json |
2 | Authorization | Bearer c2778f3064753ea70de870a53795f5c9 | M | Перевірка користувача | Authorization:Bearer c2778f3064753ea70de870a53795f5c9 |
3 |
Request data validation
Validate User
Extract legal_entity_id (client_id) from token.
Check client_id=nhs_legal_entity_id
in case of error return 403 "User is not allowed to perform this action"
Validate contract ID
Check contract.id exists
in case error return 404 - "Contract is not found"
Validate contract status
Check contract.status='VERIFIED'
in case error return 409 - "Incorrect contract status to modify it"
Validate contractor_legal_entity_id
Check there is a record contract.contractor_legal_entity_id=prm.related_legaLentities.merged_from_id and is_active=true
in case error return 422 - "Contract for this legal entity must be resign with standard procedure"
Check contractor_legal_entity status = 'active'
in case of error return 422 error 'Legal entity is not active'
Validate end_date
Check end_date>contract.end_date and end_date>now()
in case error return 422 - "Invalid end_date"
Processing
WS sets data at DB from reuest
field | value |
---|---|
end_date | $end_date |
updated_at | now() |
updated_by | $.user_id |
Response structure examples
See on API-specification (посилання на сторінку з API-специфікацією)
Description of the REST API response structure, example
HTTP status codes
Response code | HTTP Status code | Message | Internal name | Description | |
---|---|---|---|---|---|
1 | Базові | ||||
2 | 1000 | 404 | Composition not found | COMPOSITION_NOT_FOUND_404 | Не знайдено медичний висновок |
3 | 200 | ||||
4 | 401 | Unauthorized | Помилка підтвердження | ||
5 | Специфічні | ||||
6 | 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