ЕСОЗ - публічна документація
[DRAFT] Resend SMS on Service request [API-007-010-001-0314]
Сторінка знаходиться в процесі розробки. Інформація на ній може бути застарілою.
https://e-health-ua.atlassian.net/wiki/spaces/EN/pages/17591304241 (remove the link block before publishing the document)
- 1 Properties of a REST API method document
- 2 Purpose
- 3 Logic
- 3.1 Service logic
- 4 Configuration parameters
- 5 Dictionaries
- 6 Input parameters
- 7 Request structure
- 8 Headers
- 9 Request data validation
- 9.1 Authorize
- 9.2 Validate transition
- 10 Processing
- 11 Response structure examples
- 12 HTTP status codes
- 13 Post-processing processes
- 14 Technical modules where the method is used
Properties of a REST API method document
Document type | Метод REST API |
---|---|
Document title | [DRAFT] Resend SMS on Service request [API-007-010-001-0314] |
Guideline ID | GUI-0011 |
Author | @ |
Document version | 1 |
Document status | DRAFT |
Date of creation | ХХ.ХХ.ХХХХ (дата фінальної версії документа – RC або PROD) |
Date of update | ХХ.ХХ.ХХХХ (дата зміни версії) |
Method API ID | API-007-010-001-0314 |
Microservices (namespace) | ME |
Component | Service request |
Component ID | COM-007-010 |
Link на API-специфікацію | |
Resource | {{host}}/api/patients/{{patient_id}}/service_requests/{{service_request_id}}/actions/resend |
Scope | service_request:use |
Protocol type | REST |
Request type | PATCH |
Sync/Async | Async(def)/Sync |
Public/Private | Public |
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.
Logic
Method to resend sms on service request. It can be processed in both sync and async methods depends on Server decision.
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
Configuration parameters
N/A
Dictionaries
N/A
Input parameters
Input parameter | Mandatory | Type | Description | Example | |
---|---|---|---|---|---|
1 | patient_id |
| String | Unique patient identifier |
|
2 | service_request_id |
| String | Unique service request identifier |
|
Request structure
See on API-specification
Headers
Request data validation
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
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 case of error - return 409 error ('You can not resend SMS for service request in status %status%')
in case of error - return 409 error ('You can not resend SMS for service request in program processing status %program_processing_status%')
Processing
N/A
Response structure examples
See on API-specification
HTTP status codes
Response code | HTTP Status code | Message | Internal name | Description | |
---|---|---|---|---|---|
1 | Базові | ||||
2 |
| 201 | Use payload from response | sync |
|
3 |
| 202 | Use Get job details to get processing result. Response payload will be returned in the job details | async: default method |
|
4 |
| 403 | iInvalid scopes |
|
|
5 |
| 404 | Not found |
|
|
6 |
| 409 | Action is not allowed for the legal entity |
|
|
7 |
| 409 | You can not resend SMS for service request in status %status% |
|
|
8 |
| 409 | You can not resend SMS for service request in program processing status %program_processing_status% |
|
|
9 | Специфічні | ||||
10 |
|
|
|
|
|
Post-processing processes
N/A
Technical modules where the method is used
List of pages describing technical modules where the method is used
ЕСОЗ - публічна документація