Table of Contents | ||||
---|---|---|---|---|
|
Required parameters are marked with "*"
...
Purpose*
Use this method to approve previously created Declaration Request.
Specification*
...
Link
...
Table of Contents | ||||
---|---|---|---|---|
|
Purpose
Use this method to approve previously created Declaration Request
Specification
Link | ||
Resource | /api/v3/declaration_requests/{{id}}/actions/approve | |
Scope | declaration_request:approve | |
Components | Необхідно зазначити перелік компонентів, які використовують цей метод, наприклад: ePrescriptionDeclarations | |
Using Dictionaries | Потрібно вказати словники, які використовує метод APIAPI paragraph not found | |
Using Microservices | Вкажіть перелік мікросервісів, які використовує метод API. Наприклад: Auth, ABACAPI paragraph not found | |
Protocol type | Вкажіть тип протоколу, який використовується запитом, наприклад: SOAP | REST | JSON | |
Request type | PATCH | |
Sync/Async | Метод є синхронним чи асинхронним? |
...
Sync | |
Public/Private/Internal | Public |
Logic
In case if authentication_method is OTP, request example:
...
In case if authentication_method is OFFLINE or N/A, request body should be empty.
Before approve patient's scanned documents should be uploaded to the (Signed URL's). All links are generated for one one-page document in jpeg format. Document should be no more than 10MB10 MB. If make declaration request via cabinet then nothing must be uploaded to URL. Clients can use signed URL's to directly access s3 storage and upload files via API.
...
Filter | Values | Type | Description | Example |
---|---|---|---|---|
id | String | Required | b075f148-7f93-4fc2-b2ec-2d81b19a9b7b |
Request structure
...
See on Apiary
Code Block |
---|
{ "verification_code": 3748 } |
Authorize
...
Verify the validity of access token
Check user scopes declaration_request:write in order to perform this action
In case error - generate 401 response
Request to process the request using a token in the headers
Headers
...
Content-Type:application/json
Authorization:Bearer c2778f3064753ea70de870a53795f5c9
...
Validate request
Validate request using JSON schema
In case validation failed - generate 422 error
Expand | ||
---|---|---|
|
Validation data request
...
Validate person verification status
validate patient's verification_status is not equal to NOT_VERIFIED.
in case of error return 409, "Patient is not verified"
Processing
...
Get declaration request details
...
Invoke verification module to verify OTP
Check uploaded documents
Invoke Media Content Storage to check documents exist
...
Generate hash seed
- Hash of previous block in declarations chain or other random component that should be signed with declaration
Change patient request
Change entity status in IL_DB.declaration_request to APPROVED
Set updated_at - now() (Get current date-time)
Set updated_by - user_id (Extract user from token)
Generate printout form
Invoke MAN to render print form.
...
Set IL.declaration_request.printout_content:
Expand |
---|
|
Response structure
...
Code 201
Expand | ||
---|---|---|
| ||
|
Code 422
Expand | ||
---|---|---|
| ||
|
Post-processing processes
...
API paragraph not found
HTTP status codes
HTTP status code | Message | What caused the error |
---|---|---|
201 | 201 Response |
|
401 | Invalid scopes | |
409 | Patient is not verified | |
422 | This doctor has X declarations and could not sign more |
Backward compatibility
Сумісність з попередніми версіями методуAPI paragraph not found