ЕСОЗ - публічна документація
[DRAFT] REST API Approve Person Request [API-010-001-005-0376]
Сторінка знаходиться в процесі розробки. Інформація на ній може бути застарілою.
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
- 2.1 Key features
- 3 Logic
- 3.1 Preconditions
- 4 Configuration parameters
- 5 Dictionaries
- 6 Input parameters
- 7 Request structure
- 8 Headers
- 9 Request data validation
- 9.1 JSON Schema
- 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 | [Document status] REST API [Назва методу] [ID методу] |
Guideline ID | GUI-0011 |
Author | @ |
Document version | 1 |
Document status | DRAFT |
Date of creation | ХХ.ХХ.ХХХХ (дата фінальної версії документа – RC або PROD) |
Date of update | ХХ.ХХ.ХХХХ (дата зміни версії) |
Method API ID | API-010-001-005-0376 |
Microservices (namespace) | MPI |
Component | Master Patient Index |
Component ID | COM-010-001 |
Link на API-специфікацію | |
Resource |
|
Scope | person_request:write |
Protocol type | REST |
Request type | PATCH |
Sync/Async | Sync |
Public/Private | Public |
Purpose
Use this method to approve previously created Person Request.
Key features
Only authenticated and authorized user can use this service
Only NEW person request can be activated
The request can be activated only by the employee who works in the same legal entity in which the request was made.
Logic
Preconditions
Person request must be created.
Configuration parameters
Description of the configuration parameters that are used when processing a request in the system
Dictionaries
GENDER
DOCUMENT_TYPE
ADDRESS_TYPE
COUNTRY
SETTLEMENT_TYPE
STREET_TYPE
PHONE_TYPE
CONFIDANT_PERSON_TYPE
PREFERRED_WAY_COMMUNICATION
DOCUMENT_RELATIONSHIP_TYPE
Provides a list of links to dictionaries that are available in Confluence
Input parameters
Input parameter | Mandatory | Type | Description | Example | |
---|---|---|---|---|---|
1 | id |
| String | Required | eeebb86d-5cba-43c9-885b-6482ecaf826b |
2 |
|
|
|
|
|
Request structure
See on API-specification
Headers
Key | Value | Mandatory | Description | Example | |
---|---|---|---|---|---|
1 | Content-Type | application/json |
| Тип контенту | Content-Type:application/json |
2 | Authorization | Bearer {token} |
| Перевірка користувача | Authorization:Bearer {token} |
3 | api-key | {secret} |
| Секретний ключ | api-key: {secret} |
Request data validation
Validate request using JSON schema
In case validation failed - generate 422 error
JSON Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"verification_code": {
"type": "string"
}
},
"required": [
"verification_code"
],
"additionalProperties": false
}
Processing
Get person request details
Get person request from IL_DB.person_request
Determine authorization method
Get authorization_method from IL_DB.person_request
SELECT IL_DB.person_request.authentication_method
FROM IL_DB.person_request
WHERE IL_DB.person_request.id = :id
If authentication_method is NA - return error
If person have block confidant_person
- check uploaded the confidant person's document and the document which confirms the guardianship.
If person's authentication_method == OFFLINE - check uploaded documents
If authentication_method = OTP (or THIRD_PERSON.auth_method = OTP) - verify SMS code and add phone to db.verification.verified_phones
If authentication_method = THIRD_PERSON and third_person.auth_method = OFFLINE - check uploaded documents from third person
Invoke verification module to verify OTP
Check uploaded documents
Invoke Media Content Storage to check documents exist
Generate printout form
Invoke MAN to render print form.
Request mapping:
Parameter | Source |
---|
Parameter | Source |
---|---|
id | PERSON REQUEST |
cURL example
curl --request POST \
--header 'Accept: text/html' \
--header 'Content-Type: application/json' \
{:host}/templates/{:person_request_printout_id}/actions/render
Set IL.person_request.printout_content:
MANResponse.$.data
Change person request
Change entity status in IL_DB.person_request to APPROVED
Set updated_at - now() (Get current date-time)
Set updated_by - user_id (Extract user from token)
Response structure examples
See on API-specification
HTTP status codes
Response code | HTTP Status code | Message | Internal name | Description | |
---|---|---|---|---|---|
1 | Базові | ||||
2 |
| 201 | Response |
|
|
3 |
| 401 |
|
|
|
4 |
| 403 | Invalid scope |
|
|
5 |
| 422 | Invalid verification code |
|
|
6 | Специфічні | ||||
7 |
| 422 | Only for active MPI record can be created medication request! |
|
|
Post-processing processes
Description of actions performed on data after processing
Technical modules where the method is used
List of pages describing technical modules where the method is used
ЕСОЗ - публічна документація