Table of Contents |
---|
Purpose
This WS is designed to resend SMS to a person ( with verification_type = OTP) with Medication request info. This could be done only for medication request with intent order
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.
Specification
Page Properties | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Version API paragraph not found 1.0 Date of release API paragraph not found Link Посилання на Apiary або Swagger Resource /api/medication_requests/{{id}}/actions/resend Наприклад: /api/persons/create Scope medication_request:resend Зазначається потрібний scope Components ePrescription, Reimbursement Зазначається перелік бізнес компонентів, які використовують цей метод, наприклад: ePrescription Microservices API paragraph not found Перелік мікросервісів, які використовує метод API. Наприклад: Auth, ABAC Protocol type REST Тип протоколу, який використовується запитом, наприклад: SOAP | REST Request type PATCH Тип HTTP методу, який використовується запитом, наприклад: POST | GET… Sync/Async Sync Метод є синхронним чи асинхронним? |
Logic
API paragraph not found
Preconditions
API paragraph not found
Global and configurable parameters
No
Input parameters
...
Input parameter
...
Values
...
Type
|
Logic
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.
Процеси роботи з випискою електронних рецептів
Preconditions
API paragraph not found
Global and configurable parameters
No
Input parameters
Input parameter | Values | Type | Description | Example |
---|---|---|---|---|
id | String | Medication Request identifier. Required. | a89f6a26-4221-4597-a1d2-542d5e40b565 |
Filters
No
Request structure
API paragraph not found
Authorize
...
Verify the validity of access token
Check user scope (scope = 'medication_request:resend') in order to perform this action
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).
Headers
Content-Type:application/json
Authorization:Bearer c2778f3064753ea70de870a53795f5c9
Validate request
Resend of medication request info is possible only for medication requests with intent order
...
Get medication request intent
Check that intent == order
...
API paragraph not found
Request data validation
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
...
").
Request data validation
...
Validate status
...
For info - status charts: Medication_request
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!")
...
Parameters that are used when processing the request
Configuration parameters
API paragraph not found
Dictionaries
API paragraph not found
Processing
Send SMS for person
Get authentication_method of MPI
If authentication_method == OTP - send SMS:
Generate text SMS (call Man method - templates rendering service with template "TEMPLATE_SMS_FOR_SIGN_MEDICATION_REQUEST".
Sending SMS for MPI via service.
Response structure
...
.
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").
Dictionaries
MEDICATION_REQUEST_BLOCK_REASON
MEDICATION_REQUEST_INTENT
MEDICATION_REQUEST_CATEGORY
MEDICATION_REQUEST_PRIORITY
eHealth/SNOMED/additional_dosage_instructions
eHealth/SNOMED/anatomical_structure_administration_site_codes
eHealth/SNOMED/route_codes
eHealth/SNOMED/administration_methods
eHealth/SNOMED/dose_and_rate
eHealth/ICD10_AM/condition_codes
eHealth/ICPC2/condition_codes
ADDRESS_TYPE
SETTLEMENT_TYPE
STREET_TYPE
PHONE_TYPE
DIVISION_TYPE
POSITION
MEDICATION_FORM
MEDICATION_UNIT
eHealth/clinical_impression_patient_categories
LICENSE_TYPE
FUNDING_SOURCE
MR_BLANK_TYPES
MEDICATION_REQUEST_REJECT_REASON
Processing
API paragraph not found
Response structure
Example:
Expand | ||
---|---|---|
| ||
|
Post-processing processes
No
HTTP status codes
...
HTTP status code
...
Message
...
What caused the error
...
200
...
Response
...
...
401
...
Unauthorized Error
...
...
409
...
|
Post-processing processes
No
HTTP status codes
HTTP status code | Message | What caused the error |
---|---|---|
200 | Response |
|
401 | Invalid access token |
|
403 |
| |
404 | Not found | |
409 |
| |
429 | Sending SMS timeout. Try later. Next attempt will be available at <attempts.oldest.value + SEND_TIMEOUT> |
Backward compatibility
API paragraph not found