ЕСОЗ - публічна документація
Get merge request by ID
Purpose
Method returns merge request details by it's ID.
Specification
Link | Посилання на Apiary або Swagger | |
Resource | /api/merge_requests/{{id}} | Посилання на ресурс, наприклад: /api/persons/create |
Scope | merge_request:read | Scope для доступу |
Components | Patient registry | Зазначається перелік бізнес компонентів, які використовують цей метод, наприклад: ePrescription |
Microservices | il/api mpi/api fe/admin-web | Перелік мікросервісів, які використовує метод API, наприклад: Auth, ABAC |
Protocol type | REST | Тип протоколу, який використовується запитом, наприклад: SOAP | REST |
Request type | GET | Тип запиту API, наприклад: GET, POST, PATCH… |
Sync/Async | Sync | Метод є синхронним чи асинхронним? |
Public/Private/Internal | Public | Потрібно зазначити тип методу за ступенем доступності |
Logic
Only authenticated and authorized SPECIALIST, ASSISTANT or RECEPTIONIST employees can use this WS.
Usage of this WS allowed in EMERGENCY or OUTPATIENT legal entities.
Service returns only merge request related to the same legal entity as the user.
Depending on merge request status different data should returned in response:
if status is NEW, REJECTED or EXPIRED - short data returns, data_to_be_signed field that contains details about person and preperson will be empty (null).
If status is APPROVED or SIGNED - data_to_be_signed field returns. It contains detailed information about person and preperson, printout form e.t.c that will be needed for sign merge request. Data in this field of SIGNED merge request will be avaliable limited period of time which depends on Auto cleaning of person data from merge requests process.
Input parameters
Input parameter | Values | Type | Description | Example |
---|---|---|---|---|
id |
| String | Identifier of the merge request. Required. | 7c3da506-804d-4550-8993-bf17f9ee0404 |
Dictionaries
GENDER
DOCUMENT_TYPE
ADDRESS_TYPE
COUNTRY
SETTLEMENT_TYPE
STREET_TYPE
PHONE_TYPE
CONFIDANT_PERSON_TYPE
PREFERRED_WAY_COMMUNICATION
DOCUMENT_RELATIONSHIP_TYPE
AUTHENTICATION_METHOD
Request structure
See on Apiary
Authorize
Verify the validity of access token
Return 401 in case validation fails
Check scopes in order to perform this action (scope = 'merge_request:read')
Return 403 in case invalid scope(s)
Headers
Content-Type:application/json
Authorization:Bearer {{access_token}}
Api-key:{{secret}}
Request data validation
Validate ID
Check ID exists in merge_requests table
Return 404 in case validation fails
Extract client_id from token and compare it with merge_requests.legal_entity_id
Return 403 in case not match (Client is not allowed to get merge_request)
Processing
Prepare response
Service returns only merge request related to the same legal entity as the user
Return entry with ID from merge_requests table. Use data field to render data_to_be_signed section in response according to next logic:
if status is NEW, REJECTED or EXPIRED - short data returns. Field data_to_be_signed is empty (null).
If status is APPROVED or SIGNED - data_to_be_signed field returns and contains detailed information about person and preperson, printout form etc.
Response structure
See on Apiary
Example:
HTTP status codes
HTTP status code | Message | What caused the error |
---|---|---|
200 | Response |
|
401 | Access token validation failed | Validation failed |
403 | Client is not allowed to get merge_request | Invalid scope |
404 |
| Check that ID exists in merge_requests table failed |
ЕСОЗ - публічна документація