Purpose
This WS is designed to return list of all active device definitions. It is also allow to search for some device definitions by search criteria
Method to get or search all active device definitions in the system
Specification
Filters
Filter | Values | Type | Description | Example |
---|---|---|---|---|
classification_type | String | Classification type. Dictionary |
| |
model_number | String | Model number for the device |
| |
name | String | Device name |
| |
name_type | Enum | Device name type. Dictionary |
| |
medical_program_id | String | medical program id |
| |
is_active | Boolean | device definition status |
| |
page | Number | Page number |
| |
page_size | Number | A limit on the number of objects to be returned, between 1 and 300. Default: 50 |
|
Logic
Service returns all device_definitions filtered by passed parameters:
Get all device_definitions (PRM database)
Filter list by passed search parameters (according to spec.)
Search using like operation. Case insensitive
if
medical_program_id
is passed than get device definitions related to this program in program_devices tableis_active = true
start_date <= current date()
end_date >= current_date(), if not null
Render a response according to specification
Authorize
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 = 'device_definitions:read')
Return (403, 'Your scope does not allow to access this resource. Missing allowances: device_definitions:read') in case of invalid scope(s)
Headers
Content-Type:application/json
Authorization:Bearer c2778f3064753ea70de870a53795f5c9
api-key:uXhEczJ56adsfh3Ri9SUkc4en
Response structure
See on Apiary