Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Table of Contents

Purpose

This WS is designed to resend sms with OTP-code to the person’s verified phone on device request in case OTP wasn’t delivered in first time.

...

Page Properties
idAPI_Specification

Link

https://ehealthmedicaleventsapi.docs.apiary.io/#reference/device-requests/resend-sms-on-device-request/resend-sms-on-device-request

Посилання на Apiary або Swagger

Resource

/api/patients/{{patient_id}}/device_requests/{{device_request_id}}/actions/resend

Посилання на ресурс, наприклад: /api/persons/create

Scope

device_request:resend

Scope для доступу

Components

Devices

Зазначається перелік бізнес компонентів, які використовують цей метод, наприклад: ePrescription

Microservices

Перелік мікросервісів, які використовує метод API, наприклад: Auth, ABAC

Protocol type

REST

Тип протоколу, який використовується запитом, наприклад: SOAP | REST

Request type

GET

Тип запиту API, наприклад: GET, POST, PATCH…

Sync/Async

Sync

Метод є синхронним чи асинхронним?

Public/Private/Internal

Public

Потрібно зазначити тип методу за ступенем доступності

Logic

API paragraph not found

...

  1. Get person's authentication_method of MPI

  2. If authentication_method == OTP :or THIRD_PERSON (with OTP) 

    1. if device_request has a program specified

      1. Generate text SMS with template CREATE_DEVICE_REQUEST_SMS_TEMPLATE

      _SMS_FOR_CREATE
      1. .

      2. enrich template with data from Device Request: request_number, verification_code

    2. if device_request has no program specified

      1. Generate text SMS with template СREATE_DEVICE_REQUEST_SMS_TEMPLATE_WITHOUT_CODE.

      2. enrich template with data from Device Request: request_number

  3. Call SMS timeout procedure to check if resending is allowed using:
    - DR_MAX_ATTEMPTS_COUNT as MAX_ATTEMPTS_COUNT
    - DR_SEND_TIMEOUT as SEND_TIMEOUT
    - "device_request" as entity_name
    - device_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>")

  4. Check if sms notifications are enabled:

    1. if device_request has a program specified

      1. in case of an error check that the specified program has setting request_notification_disabled set in false or the setting is absent

        1. return an error 409 "Action is not allowed for the specified medical program"

    2. if device_request has no program specified

      1. check config parameter DEVICE_REQUESTS_SMS_ENABLED is set in true

        1. else return an error 409 “Action is disabled by the configuration”

  5. Send SMS to a person

Response structure

...