ЕСОЗ - публічна документація
REST API PRIVATE SPACE [AR] Private. Get Medication request by ID [API-005-008-002-0159]
- 1 Properties of a REST API method document
- 2 Purpose
- 3 Logic
- 4 Configuration parameters
- 5 Dictionaries
- 6 Input parameters
- 7 Request structure
- 8 Request data validation
- 8.1 Search Medication Request
- 8.1.1 Validate FK
- 8.1 Search Medication Request
- 9 Processing
- 10 Response structure examples
- 11 HTTP status codes
- 12 Post-processing processes
- 13 Technical modules where the method is used
Properties of a REST API method document
Document type | Метод REST API |
---|---|
Guideline ID | GUI-0011 |
Author | @Iryna Lishtaba (SoE eHealth) |
Document version | 1 |
Document status | DRAFT |
Date of creation | ХХ.ХХ.ХХХХ (дата фінальної версії документа – RC або PROD) |
Date of update | ХХ.ХХ.ХХХХ (дата зміни версії) |
Method API ID | API-005-008-002-0159 |
Microservices (namespace) | IL |
Component | ePrescription |
Component ID | COM-005-008 |
Link на API-специфікацію | |
Resource | /api/admin/ medication_request/{{id}} |
Scope | medication_request_admin:details |
Protocol type | REST |
Request type | GET |
Sync/Async | Sync |
Public/Private | Private |
Purpose
This WS is designed to return Medication request detail for NHS_ADMIN. In the response of these endpoint person_id is return in hashed form.
Search Medication Request is possible in 2 options: by `medication_request.id` OR `medication_request.request_number`.
According to requirements user of NHS_ADMIN can see all Medication request (without limitations)
Logic
Verify the validity of access token
Return 401 in case validation fails
Check user scopes in order to perform this action (scope = 'medication_request_admin:details')
Return 403 in case invalid scope(s)
Get `client_type` from `mithril.clients`
Search Medication request by $.id:
SELECT * FROM medication_requests MR WHERE (MR.id = $.id OR MR.request_number = $.id) AND MR.is_active = TRUE
Configuration parameters
Description of the configuration parameters that are used when processing a request in the system
Dictionaries
Provides a list of links to dictionaries that are available in Confluence
Input parameters
Input parameter | Values | Type | Description | Example |
---|---|---|---|---|
id |
| String | Request id. Required | 48416485-cc98-46c4-8bba-e321de9e1ecd |
Request structure
See on API-specification (посилання на сторінку з API-специфікацією)
Description of the REST API request structure, example
Request data validation
Search Medication Request
Search record by `$.id` in column `medication_request.id`
If not found - Search record by `$.id` in column `medication_request.request_number`
If not found - Return 404 in case "Not found record in DB with this ID!"
Validate FK
Read data from `ops_db.medication_requests` by `id`
Validate legal_entity_id - legal_entity_id exists
Return 422 in case validation fails (422 EView)
Validate employee_id - employee_id exists
Return 422 in case validation fails (422 EView)
Validate division_id - division_id exists
Return 422 in case validation fails (422 EView)
Validate medical_program_id - medical_program_id exists
Return 422 in case validation fails (422 EView)
Validate all medication_id - medication_id exists
Return 422 in case validation fails (422 EView)
Validate patient_id - mpi_id exists
Return 422 in case validation fails (422 EView)
Processing
A list of processes related to receiving, changing or transmitting data according to the logic defined in the REST API
Response structure examples
Description of the REST API response structure, example
HTTP status codes
Response code | HTTP Status code | Message | Internal name | Description | |
---|---|---|---|---|---|
1 | Базові | ||||
2 |
| 401 | validation fails |
| Помилка валідації |
3 |
| 403 | invalid scope(s) |
| Відсутній доступ |
4 |
| 404 | Not found record in DB with this ID |
| У базі даних не знайдено запис за цим ID |
5 | Специфічні | ||||
6 |
| 422 | 422 EView |
| Помилка валідації |
Post-processing processes
Return object with responce structure from WS Sign Medication Request.
Technical modules where the method is used
List of pages describing technical modules where the method is used
Related content
ЕСОЗ - публічна документація