Note |
---|
Info |
REST API method / Метод REST API (настанова) Сторінка знаходиться в процесі розробки. Інформація на ній може бути застарілою. |
Info |
---|
/wiki/spaces/EN/pages/17591304241 (remove the link block before publishing the document) |
Table of Contents |
---|
Properties of a REST API method document
Page Properties | ||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||||||||||||||||||||||
|
Purpose
This WS is designed to resend SMS to person with Medication request info.
Key points
Only authenticated and authorized user with an appropriate scope can resend Medication request info.
Medication request info can be resend only to a person with verification_type = OTP.
Medication request info can be resend only for medication requests with intent order.
Medication request info can be resend only from ‘ACTIVE' status.
Configuration parameters
No
Dictionaries
Input parameters
Description of input parameters
Input parameter | Mandatory | Type | Description | Example | |
---|---|---|---|---|---|
1 | id | M | String | Medication Request identifier | a89f6a26-4221-4597-a1d2-542d5e40b565 |
Request structure
See on API-specification (посилання на сторінку з API-специфікацією)
Description of the REST API request structure, example
Expand | ||
---|---|---|
| ||
|
Headers
...
Key
...
Value
...
Mandatory
...
Description
...
Example
...
Content-Type
...
application/json
...
M
...
Тип контенту
...
Content-Type:application/json
...
Authorization
...
Bearer c2778f3064753ea70de870a53795f5c9
...
M
...
Перевірка користувача
...
Authorization:Bearer c2778f3064753ea70de870a53795f5c9
...
Request data validation
Authorize
Verify the validity of access token
in case of error - return 401 (“Invalid access token”) in case of 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 = 'medication_request:resend')
return 403 (“Your scope does not allow to access this resource. Missing allowances: medication_request:resend”) in case of invalid scope(s).
Validate Medication request
Get Medication request identifier from the URL. Check Medication request exists in OPS DB
in case of error - return 404 ('Not found').
Validate intent
Get Medication request by $.id in OPS DB. Check that Medication request intent = ‘order’
if invalid - return 409 ("For medication request plan information cannot be resent").
Validate status
Get Medication request by $.id in OPS DB. Check that Medication request status = ‘ACTIVE’
if invalid - return 409 ("Invalid status Medication request for resend action!").
Validate medical program
Get Medication request by $.id in OPS DB. If medical program exists in the medication request:
Get medical program settings by $.medical_program.id.
Check medication_request_notification_disabled = false or null/absent
if true - return 409 ("Notifications are not allowed for the medical program!").
Validate verification code
Get Medication request by $.id in OPS DB. Check that Medication request verification code is not null
if invalid - return 403 ("Can't resend Medication request without verification code!").
Validate person
Get authentication_method of person in MPI DB. Check that persons authentication_method == ‘OTP’ or ‘THIRD_PERSON’ with authentication_method == ‘OTP’
if invalid - return 409 ("Person or third person has no OTP auth method").
Processing
Call SMS timeout procedure to check if resending is allowed using:
MR_MAX_ATTEMPTS_COUNT as MAX_ATTEMPTS_COUNT;
MR_SEND_TIMEOUT as SEND_TIMEOUT;
"medication_request" as entity_name;
medication_request_id as entity_id.
In case of error - return 429 ("Sending SMS timeout. Try later. Next attempt will be available at <attempts.oldest.value + SEND_TIMEOUT>").
Generate SMS text
get template from sign_template_sms parameter;
enrich template with data from Medication request.
Send SMS to a person.
...
Response structure examples
See on API-specification (посилання на сторінку з API-специфікацією)
Description of the REST API response structure, example
Expand | ||
---|---|---|
| ||
|
Response code | HTTP Status code | Message | Internal name | Description | |
---|---|---|---|---|---|
1 | Базові | ||||
2 | 401 | Invalid access token | Недійсний токен доступу | ||
3 | 403 | Can't resend Medication request without verification code! | Неможливо перевідправити інформацію по рецепту без коду верифікації! | ||
4 | 404 | Not found | не знайдено | ||
5 | 409 | For medication request plan information cannot be resent | Для рецепту з типом "План лікування" інформація не може бути повторно відправлена | ||
6 | 409 | Invalid status Medication request for resend action! | Недопустимий статус електронного рецепту для повторної відправки інформації | ||
7 | 409 | Notifications are not allowed for the medical program! | Надсилання смс повідомлень не дозволенні для обраної медичної програми | ||
8 | 409 | Person or third person has no OTP auth method | Пацієнт чи законний представник не мають методу автентифікації OTP (Автентифікації через СМС) | ||
9 | Специфічні | ||||
10 | 422 | Your scope does not allow to access this resource. Missing allowances: medication_request:resend | Для вашої ролі відсутній доступ до цього ресурсу. Необхідний доступ на повторне надсилання смс з інформацією про електронний рецепт | ||
11 | 429 | Sending SMS timeout. Try later. Next attempt will be available at <attempts.oldest.value + SEND_TIMEOUT> | Час очікування надсилання SMS. Спробуйте пізніше. Наступна спроба буде доступна за <attempts.oldest.value + SEND_TIMEOUT> |
Post-processing processes
Description of actions performed on data after processing
Technical modules where the method is used
List of pages describing technical modules where the method is used
Page Properties Report | ||||
---|---|---|---|---|
|
...