ЕСОЗ - публічна документація

Resend SMS on Approval

Purpose

It can be processed in both sync and async methods depends on Server decision.

 

Specification

Link

https://medicaleventsmisapi.docs.apiary.io/#reference/approvals/resend-sms-on-approval/resend-sms-on-approval

Resource

/api/patients/{{patiend_id}}/approvals/{{id}}/actions/resend

Scope

approval:create

Components

Approvals

Microservices

API paragraph not found

Protocol type

REST

Request type

PATCH

Sync/Async

Async

Public/Private/Internal

Public

 

Logic

It can be processed in both sync and async methods depends on Server decision.

 

Input parameters

Input parameter

Values

Type

Description

Example

Input parameter

Values

Type

Description

Example

patiend_id

 

String

mpi_id

aff00bf6-68bf-4b49-b66d-f031d48922b3

id

 

String

approval_id

aff00bf6-68bf-4b49-b66d-f031d48922b3

 

Authorize

  1. Verify the validity of access token

    1. Return 401 in case of validation fails

  2. Check user scope approval:create in order to perform this action

    1. Return 403 in case of invalid scope

Request to process the request using a token in the headers

 

Headers

Наприклад:

  • Content-Type:application/json

  • Authorization:Bearer d368a4b0-4a0e-457a-b267-32359fa6288f

 

Request data validation

Validate authentication method

  1. Resend SMS on Approval is allowed for person_authentication_method which was specified on Create Approval in the authorize_with field.

    1. Return 409 in case of validation fails (message "Resend SMS is not allowed for this authentication method")

 

Processing

Service Logic

  1. Search for approval by patient_id + approval_id

    1. Validate person by patient_id

      1. In case error return 404 (message "Person not found")

    2. Validate approval by approval.id

      1. In case error return 404 (message "Approval with such id is not found")

  2. Send SMS with OTP-code to persons phone from approvals.urgent.phone_number

 

Response structure

See on Apiary

Example:

{ "data": { "id": "d5a5d991-0bf7-476f-b3cf-bec73f044b2e", "granted_resources": [ { "identifier": { "type": { "coding": [ { "system": "eHealth/resources", "code": "episode_of_care" } ] }, "value": "d5a5d991-0bf7-476f-b3cf-bec73f044b2e" }, "display_value": "null" } ], "granted_to": { "identifier": { "type": { "coding": [ { "system": "eHealth/resources", "code": "employee" } ] }, "value": "9183a36b-4d45-4244-9339-63d81cd08d9c" }, "display_value": "null" }, "expires_at": 1498749591, "reason": { "identifier": { "type": { "coding": [ { "system": "eHealth/resources", "code": "service_request" } ] }, "value": "9183a36b-4d45-4244-9339-63d81cd08d9c" }, "display_value": "null" }, "status": "new", "access_level": "read", "authentication_method_current": { "type": "OTP", "number": "+38093*****85" } }, "meta": { "code": 201, "url": "http://example.com/resource", "type": "object", "request_id": "req-adasdoijasdojsda" } }

 

{ "data": { "status": "pending", "eta": "2018-08-02T10:45:16.000Z", "links": [ { "entity": "job", "href": "/Jobs/NBXk9EyErUZv1RhXgyvgg" } ] }, "meta": { "code": 202, "url": "http://example.com/resource", "type": "object", "request_id": "req-adasdoijasdojsda" } }

 

HTTP status codes

HTTP status code

Message

What caused the error

HTTP status code

Message

What caused the error

 201

 use payload from response

 sync

 202

 use Get job details to get processing result. Response payload will be returned in the job details

 async: default method

 

 

ЕСОЗ - публічна документація