ЕСОЗ - публічна документація
RС_[NEW] (GraphQl) Get Program device by ID_EN
Purpose
This WS allows to get details of a participant of medication program with device type.
Key points
This is a graphQl method used in Administration panel only.
Only authenticated and authorized NHS employee with appropriate scope can get details of a Program device.
Specification
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 = 'program_device:read')
Return (403, 'Your scope does not allow to access this resource. Missing allowances: program_device:read') in case of invalid scope(s)
Validate legal entity
Extract client_id from token.
Check legal entity status (status = ACTIVE)
In case of error - return 409 ('client_id refers to legal entity that is not active')
Check client type (type = NHS)
In case of error - return 403 ('You don't have permission to access this resource')
Validate program device
Check that program device with id from request exists in program_devices table, PRM DB
in case of error - return 404 ('Program device not found')
Service logic
Get program device by id from program_devices table, PRM DB
Preload medical program details by medical_program_id from medical_programs table in PRM DB
Preload device definition details by device_definition_id from device_definitions table in PRM DB
Render a response according to specification
ЕСОЗ - публічна документація