Purpose
This WS allows to get Specimen without patient context by its accession identifier.
Key points
Returns a single Specimen that has a specified accession_identifier
ABAC isn’t used here
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 = 'specimen:read')
Return (403, 'Your scope does not allow to access this resource. Missing allowances: specimen:read') in case of invalid scope(s)
Service logic
Service returns a single Specimen that has a specified accession_identifier:
Get Specimen by ID from specimens collection (MongoDB)
Enrich
identity
object in the response with person’s age and gender, but w/o patient’s nameRender a response according to specification.