Purpose
This method allows to view Person's (MPI) details.
Specification
Logic
This is a graphQl query method used in Administration panel only to get person’s data . Only authenticated and authorized NHS employee with appropriate scope can get person’s data.
Request structure
Example:
Authorize
Request to process the request using a token in the headers.
Verify the validity of access token
Return
401
in case validation fails
Verify that token is not expired
in case of error - return (
401
, 'Invalid access token')
Check user scopes
person:read
in order to search personReturn
403
in case invalid scope(s) "Your scope does not allow to access this resource. Missing allowances: person:read“
Request data validation
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')
Validate request
Validate $.personId
Check $.personId
is ID from MPI.person.id
search person
$.personId
inMPI.person.(id = $.personId)
andMPI.person.(id = $.personId).is_active = true then ok
in case of error, return "Person not found"
Processing
Get data from mpi DB:
persons by id
Render a response according to specification.
Response structure
Example: