Table of Contents | ||||
---|---|---|---|---|
|
Purpose*
Resend sms on service request
Specification*
...
Link
...
...
Resource
...
Table of Contents | ||||
---|---|---|---|---|
|
Purpose
This WS is designed to resend sms with OTP-code to the person’s verified phone on service request in case OTP wasn’t delivered in first time.
Specification
Page Properties | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
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 |
| |
service_request_id | String | Unique service request identifier |
|
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')
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)
...
Authorization:Bearer d368a4b0-4a0e-457a-b267-32359fa6288f
Request data validation
Validate transition
Check if service request with service_request_id from request is exist
in case of error - return 404 (“Not found”) in case of validation fails
Validate person
Check if person with patient_id from request is exist
in case of error - return 404 (“Not found”) in case of validation fails
Check if person with patient_id from request is not preperson
in case of validation fails skip all steps below
Validate legal entity
Check that legal_entity_type is included in chart variables
ME_ALLOWED_TRANSACTIONS_LE_TYPES
config parameterin case of error return 409 "Action is not allowed for the legal entity"
Check that legal_entity has status = active
in case of error return 409 "Action is not allowed for the legal entity"
Validate service_request
Check that status = ‘active' and ProgramProcessinStatus in (’new', 'in_queue‘in_queue')
in case of error - return 409 error ('You can not resend SMS for service request in status %status%')
in case of error - return 409 error ('Service You can not resend SMS for service request in status %status% and program _ processing _ status %program_processing_status% cannot be canceled')
Processing
...
Service logic
Send SMS to patient (if authentication_method_current == SMS)Template = SERVICE_REQUEST_CREATE_SMS
Get person's authentication_method of MPI
If authentication_method == OTP - send SMS:
Generate text SMS (call Man method- templates rendering service with template
SERVICE_REQUEST_CREATE_SMS
.
Send SMS
Save internal information to corresponding DB
Response structure
...
See on Apiary
Example:
Expand | ||
---|---|---|
| ||
|
Expand | ||
---|---|---|
| ||
|
Post-processing processes
...
API paragraph not found
HTTP status codes
...
Page Properties | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
|
...