ЕСОЗ - публічна документація
(GraphQl) Search Program devices_EN
Purpose
This WS allows to search for a participant of medical 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 search for a Program devices.
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')
Service logic
Get all records from program_devices table in PRM database
Apply additional search parameters (connected by logical AND):
databaseId - search by program_devices.id (using exact match with
=
operator)medicalProgram - apply medical program filter, then search by program_devices.medical_program_id (using exact match with
=
operator)isActive - search by program_devices.is_active (using exact match with
=
operator)deviceRequestAllowed - search by program_devices.device_request_allowed (using exact match with
=
operator)deviceDefinition - apply device definition filter, then search by program_devices.device_definition_id (using exact match with
=
operator)registryNumber - search by program_devices.registry_number (using
like
match, case insensitive)reimbursementType - search by program_devices.reimbursement_type (using exact match with
=
operator)startDate - search by program_devices.start_date (using exact match with
between
operator)endDate - search by program_devices.end_date (using exact match with
between
operator)
Apply optional ordering
if no
$.orderBy
is passed - order records byinserted_at
field in descending order.
Render a response according to specification
ЕСОЗ - публічна документація