ЕСОЗ - публічна документація
Deactivate INNM_WP
Purpose
This WS allows to deactivate INNM by NHS employee.
Key points
This is a graphQl mutation used in Administration panel only.
Only authenticated and authorized NHS employee with appropriate scope can deactivate INNM.
Before deactivation of INNM should be deactivated related Innm Dosage, Medications and Program medication of the Medical program.
Specification
Link | graphQl mutation | Посилання на Apiary або Swagger |
Resource | graphQl mutation | Посилання на ресурс, наприклад: /api/persons/create |
Scope | innm:deactivate | Scope для доступу |
Components | Drugs and Program medications | Зазначається перелік бізнес компонентів, які використовують цей метод, наприклад: ePrescription |
Microservices | API paragraph not found | Перелік мікросервісів, які використовує метод API, наприклад: Auth, ABAC |
Protocol type | API paragraph not found | Тип протоколу, який використовується запитом, наприклад: SOAP | REST |
Request type | API paragraph not found | Тип запиту API, наприклад: GET, POST, PATCH… |
Sync/Async | API paragraph not found | Метод є синхронним чи асинхронним? |
Public/Private/Internal | Internal | Потрібно зазначити тип методу за ступенем доступності |
Logic
Update innms record by $.id set values:
Source |
|
---|---|
is_active | FALSE |
updated_at | user_id |
updated_by | timestamp |
Authorization
Verify the validity of access token
Return (401, 'Invalid access token') in case of validation fails
Verify that token is not expired
in case of error - return (401, 'Invalid access token')
Check user scopes in order to perform this action (scope = 'innm:deactivate')
Return (403, 'You don't have permission to access this resource: innm:deactivate') in case of invalid scope(s)
Request data validation
Validate client
Extract client_id from token.
Check client scopes has innm:deactivate
in case of error - return 403 (“You don’t have permission to access this resource: innm:deactivate”)
Check legal entity type (type = NHS)
In case of error - return 403 ('You don’t have permission to access this resource')
Validate innm
Check there is an UUID value that:
Check that innm exists
in case error - return 404 ('Innm is not found!')
Check that innm is active (is_active = 'true')
in case error - return 409 ('Innm should be active')
Validate linked innm_dosage
Get all active linked medications (with type = innm_dosage):
In case of error - return 409 ('All linked innm_dosage should be inactive')
HTTP status codes
HTTP status code | Message | What caused the error |
---|---|---|
401 | Invalid access token |
|
403 |
|
|
404 | Innm is not found! |
|
409 |
|
|
ЕСОЗ - публічна документація