ЕСОЗ - публічна документація
(GraphQL, NHS) Get Person Details
Purpose
This method allows to view Person's (MPI) details.
Specification
Link | - | Посилання на Apiary або Swagger |
Resource | /graphql | Посилання на ресурс, наприклад: /api/persons/create |
Scope | person:read | Scope для доступу |
Components | Patient registry | Зазначається перелік бізнес компонентів, які використовують цей метод, наприклад: ePrescription |
Microservices | mpi/api il/api (rpc) fe/admin-web | Перелік мікросервісів, які використовує метод API, наприклад: Auth, ABAC |
Protocol type | GraphQL | Тип протоколу, який використовується запитом, наприклад: SOAP | REST |
Request type | POST | Тип запиту API, наприклад: GET, POST, PATCH… |
Sync/Async | Sync | Метод є синхронним чи асинхронним? |
Public/Private/Internal | Private | Потрібно зазначити тип методу за ступенем доступності |
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
('Invalid access token') in case 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 = 'person:read')
Return
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
404
, "Such person doesn't exist"
Processing
Get data from mpi DB:
persons by id
Render a response according to specification.
Response structure
Example:
HTTP status codes
HTTP status code | Message | What caused the error |
---|---|---|
200 | Response |
|
401 | Invalid access token | Invalid token |
403 | Your scope does not allow to access this resource. Missing allowances: {{scope}} | Scope is missing |
409 | client_id refers to legal entity that is not active | Legal entity is not active |
Related content
ЕСОЗ - публічна документація