ЕСОЗ - публічна документація
Create Group of Diagnoses (NHS Admin)
Purpose
This WS allows to create a Group of Diagnoses from the Admin panel.
The Group of Diagnoses will be used by Doctor to receive Approval on all Episodes of Care which consist of Diagnoses from the Group.
Key points
This is a graphQl method used in the Administration panel only.
Only authenticated and authorized NHS employee with an appropriate scope can create a Group of Diagnoses.
The dictionary codes from eHealth/ICD10_AM/condition_codes and eHealth/ICPC2/condition_codes can be added to the Group of Diagnoses.
Added diagnoses codes should be unique within one Group of Diagnoses (check uniqueness for active items).
User can not create a Group of Diagnoses with an empty list of dictionary codes.
Specification
Link | graphQl method | Посилання на Apiary або Swagger |
Resource | graphQl method | Посилання на ресурс, наприклад: /api/persons/create |
Scope | diagnoses_group:write | Scope для доступу |
Components | Medical events | Зазначається перелік бізнес компонентів, які використовують цей метод, наприклад: 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
Save Group of Diagnoses to diagnoses_groups table (PRM DB) according to Group of Diagnoses data model
For each element in the
diagnoses_codes
array save data to diagnoses_group_codes table:set diagnoses_group_id = $.diagnoses_group_id
set system = $.system
set code = $.code
Authorize
Verify the validity of access token
in case of error - 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 = 'diagnoses_group:write')
return 403 (“Your scope does not allow to access this resource. Missing allowances: diagnoses_group:write”) in case of invalid scope(s)
Request data validation
Validate legal entity
Extract client_id from token.
Check client scopes in order to perform this action (scope = 'diagnoses_group:write')
in case of error - return 403 (“Your scope does not allow to access this resource. Missing allowances: diagnoses_group:write”)
Check client_type = NHS
in case of error - return 403 ('You don’t have permission to access this resource')
Check legal entity status (status = ACTIVE)
In case of error - return 409 ('client_id refers to legal entity that is not active')
Validate request
Check if
name
is submitted
in case of error - return 422 ('required property name was not present')
Check if
code
is submitted
Check if
code
value is in dictionary:DIAGNOSES_GROUP_CODES
in case of error - return 422 ('not allowed in enum')
Check if the
diagnoses_codes
array is submitted and contains at least one item
in case of error - return 422 ('required property diagnoses_codes was not present')
For each item in the
diagnoses_codes
array:
Check if
system
is submittedin case of error - return 422 ('required property system was not present')
Check if
system
value is following dictionary name:eHealth/ICD10_AM/condition_codes
,eHealth/ICPC2/condition_codes
in case of error - return 422 ('not allowed in enum')
Check if
code
is submittedin case not submitted - return 422 ('required property code was not present')
Check if
code
value is within dictionary specified insystem
propertyin case of error - return 422 ('value is not allowed in enum')
Check if
code
is unique withinsystem
in the requestin case of error - return 422 ('Code <code> of <system> dictionary is duplicated in the request')
HTTP status codes
HTTP status code | Message | What caused the error |
---|---|---|
401 | Invalid access token |
|
403 |
|
|
409 |
|
|
422 |
|
|
ЕСОЗ - публічна документація