Versions Compared

Key

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

Purpose

Resend sms on service request

Specification

...

Link

...

https://medicaleventsmisapi.docs.apiary.io/#reference/service-requests/manage-service-requests-in-patient-context/resend-sms-on-service-request

...

Resource

...

/api/patients/{{patient_id}}/service_requests/{{service_request_id}}/actions/resend

...

Scope

...

service_request:use

...

Components

...

Service request

...

Microservices

...

API paragraph not found

...

Protocol type

...

REST

...

Request type

...

PATCH

...

Sync/Async

...

Async

...

Public/Private/Internal

...

Public

Logic

Method to resend sms on service request. It can be processed in both sync and async methods depends on Server decision.

Input parameters

...

Input parameter

...

Values

...

Type

...

Description

...

Example

...

patient_id

...

String

...

Unique patient identifier

...

7075e0e2-6b57-47fd-aff7-324806efa7e5

...

service_request_id

...

String

...

Unique service request identifier

...

aff00bf6-68bf-4b49-b66d-f031d48922b3

Request structure

API paragraph not found

Authorize

  • Verify the validity of access token

    • Return (401, 'unauthorized') in case of validation fails

  • Verify that token is not expired

    • in case of error - return (401, 'unauthorized')

  • Check user scopes in order to perform this action (scope = 'service_request:write')

    1. Return (403, 'invalid scopes') in case of invalid scope(s)

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 transition

Resend SMS is allowed only for service requests in the following state:

Status=Active AND Program Processing Status in (New, In Queue)

...

Table of Contents
minLevel1
maxLevel3

Purpose

Resend sms on service request

Specification

Page Properties

Link

https://medicaleventsmisapi.docs.apiary.io/#reference/service-requests/manage-service-requests-in-patient-context/resend-sms-on-service-request

Resource

/api/patients/{{patient_id}}/service_requests/{{service_request_id}}/actions/resend

Scope

service_request:use

Components

Service request

Microservices

API paragraph not found

Protocol type

REST

Request type

PATCH

Sync/Async

Async

Public/Private/Internal

Public

Logic

Method to resend sms on service request. It can be processed in both sync and async methods depends on Server decision.

Input parameters

Input parameter

Values

Type

Description

Example

patient_id

String

Unique patient identifier

7075e0e2-6b57-47fd-aff7-324806efa7e5

service_request_id

String

Unique service request identifier

aff00bf6-68bf-4b49-b66d-f031d48922b3

Request structure

API paragraph not found

Authorize

  • Verify the validity of access token

    • Return (401, 'unauthorized') in case of validation fails

  • Verify that token is not expired

    • in case of error - return (401, 'unauthorized')

  • Check user scopes in order to perform this action (scope = 'service_request:write')

    1. Return (403, 'invalid scopes') in case of invalid scope(s)

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 transition

  1. Check if service request with service_request_id from request is exist

    1. in case of error - return 404 (“Not found”) in case of validation fails

  2. Validate person

    1. Check if person with patient_id from request is exist

      1. in case of error - return 404 (“Not found”) in case of validation fails

    2. Check if person with patient_id from request is not preperson

      1. in case of validation fails skip all steps below

  3. Validate legal entity

    1. Check that legal_entity_type is included in chart variables ME_ALLOWED_TRANSACTIONS_LE_TYPES config parameter

      1. in case of error return 409 "Action is not allowed for the legal entity"

    2. Check that legal_entity has status = active

      1. in case of error return 409 "Action is not allowed for the legal entity" 

  4. Validate service_request

    1. Check that status = ‘active' and ProgramProcessinStatus in (’new', 'in‘in_queue')

      1. in case of error - return 409 error ('Service You can not resend SMS for service request in status %status% and program_processing_')

      2. in case of error - return 409 error ('You can not resend SMS for service request in program processing status %program_processing_status% cannot be canceled')

Processing

Service logic

  1. Send SMS to patient (if authentication_method_current == SMS)

    1. Template = SERVICE_REQUEST_CREATE_SMS

...