Purpose
This method intended to get all Device dispenses by legal entity from token.
Specification
Logic
Service returns specified Device dispenses related to the legal entity from token:
Get Device dispenses from device_dispenses (MongoDB)
Filter list above by submitted search parameters
Render a response according to specification.
Filters
Filter | Values | Type | Description | Example |
---|---|---|---|---|
based_on | String |
| ||
performer_legal_entity | String |
| ||
location | String |
| ||
performer | String |
| ||
status | String |
| ||
when_handed_over_from | String | date of dispense |
| |
when_handed_over_to | String | date of dispense |
| |
page | Number | Page number |
| |
page_size | Number | A limit on the number of objects to be returned, between 1 and 300. Default: 50 |
|
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_dispense:read')
Return (403, 'Your scope does not allow to access this resource. Missing allowances: device_dispense:read') in case of invalid scope(s)
Headers
Content-Type:application/json
Authorization:Bearer mF_9.B5f-4.1JqM
api-key:aFBLVTZ6Z2dON1V
Request data validation
Validate User
Extract client_id (performer_legal_entity) from token.
Return empty array in case employee has no access to medication dispense.
Response structure
See on Apiary