Table of Contents |
---|
Purpose
API paragraph not found
Specification
...
id | API_Specification |
---|
...
Link
...
...
Посилання на Apiary або Swagger
...
Resource
...
/api/admin/medication_requests/{{id}}
...
Посилання на ресурс, наприклад: /api/persons/create
...
Scope
...
medication_request_admin:details
...
Scope для доступу
...
Components
...
ePrescription
...
Зазначається перелік бізнес компонентів, які використовують цей метод, наприклад: ePrescription
...
Microservices
...
API paragraph not found
...
Перелік мікросервісів, які використовує метод API, наприклад: Auth, ABAC
...
Protocol type
...
REST
...
Тип протоколу, який використовується запитом, наприклад: SOAP | REST
...
Request type
...
GET
...
Тип запиту API, наприклад: GET, POST, PATCH…
...
Sync/Async
...
Sync
...
Метод є синхронним чи асинхронним?
...
Public/Private/Internal
...
Private
...
Потрібно зазначити тип методу за ступенем доступності
Logic
API paragraph not found
Input parameters
...
Input parameter
...
Values
...
Type
...
Description
...
Example
...
id
...
String
...
Medication Request identifier OR request_number. Required
...
48416485-cc98-46c4-8bba-e321de9e1ecd
Request structure
API paragraph not found
Authorize
Request to process the request using a token in the headers
Headers
Наприклад:
Content-Type:application/json
Authorization:Bearer c2778f3064753ea70de870a53795f5c9
Request data validation
API paragraph not found
Processing
API paragraph not found
Response structure
Example:
...
title | Response example |
---|
...
Table of Contents |
---|
Purpose
WS returns data of MR to NHS Admin
Logic
Verify the validity of access token
Check user scopes in order to perform this action (scope = 'medication_request_request:read')
Search Requests for Medication request requests by id in WS url:
Code Block SELECT * FROM medication_request_requests WHERE id=$.id AND legal_entity_id = $.context.legal_entity_id
Logic WS for medication request requests based on care plan
Get party_id from $.context.user_id
Get list from $.prm.employees for this party_id
Get care_plan_id from $.medication_request_requests.data_based_on_care_plan_id
Check $.approvals for user's employees (granted_to) on care_plan_id (granted_resources) and $.medication_request_requests.person_id (granted_by)
Search Medication request requests by filters: data_based_on_care_plan_id, person_id.
Code Block SELECT * FROM medication_request_requests MRR WHERE MRR.id = $.id AND MRR.data_based_on_care_plan_id = $.id AND MRR.person_id = $.id AND MRR.is_active = TRUE
Input parameters
Input parameter | Values | Type | Description | Example |
---|---|---|---|---|
id |
| String | Request id. Required | 48416485-cc98-46c4-8bba-e321de9e1ecd |
Headers
Content-Type:application/json
Authorization:Bearer c2778f3064753ea70de870a53795f5c9
Validate request
Validate FK
Validate id - medication_request_request_id exists
Return 422 in case validation fails (422 EView)
Dictionaries
API paragraph not found
Response structure
See on Apiary
Example:
Expand | ||
---|---|---|
| ||
|
Post-processing processes
API paragraph not found
HTTP status codes
Page Properties | |
---|---|
HTTP status codes
HTTP status code | Message | What caused the error |
---|
...
200 | Response |
|
422 |
| validation fails |