ЕСОЗ - публічна документація
RC [WP] Create Group of Diagnoses_EN
Purpose
This WS allows to create a Group of Diagnoses from 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 Administration panel only.
Only authenticated and authorized NHS employee with appropriate scope can create a Group of Diagnoses.
The dictionary codes from
eHealth/ICD10_AM/condition_codes
andeHealth/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 empty list of dictionary codes.
Specification
Authorization
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)
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
1. Check if name
is submitted
in case of error - return 422 ('required property name was not present')
2. 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')
3. 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')
4. 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')
Service logic
Save Group of Diagnoses to diagnoses_groups table (PRM DB) according to RC [WP] 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
ЕСОЗ - публічна документація