ЕСОЗ - публічна документація
[DRAFT] PIS. Get employees (Bulk data export) [API-005-012-002-0477]
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
- 3.1.1 Prepare snapshot (cron)
- 3.1.2 Retrieve data
- 3.1 Service logic
- 4 Configuration parameters
- 5 Dictionaries
- 6 Input parameters
- 7 Request structure
- 8 Headers
- 9 Request data validation
- 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] PIS. Get employees (Bulk data export) [API-005-012-002-0477] |
Guideline ID | GUI-0011 |
Author | @ |
Document version | 1 |
Document status | DRAFT |
Date of creation | ХХ.ХХ.ХХХХ (дата фінальної версії документа – RC або PROD) |
Date of update | ХХ.ХХ.ХХХХ (дата зміни версії) |
Method API ID | API-005-012-002-0477 |
Microservices (namespace) | IL |
Component | Bulk export |
Component ID | COM-005-012 |
Link на API-специфікацію | |
Resource | {{host}}/api/pis/bulk/employees |
Scope | employee_bulk:read_pis |
Protocol type | REST |
Request type | GET |
Sync/Async | Sync |
Public/Private | Public |
Purpose
Method to Get all employees from ehealth system as a raw data as a part of data exchange to do some operations on PIS side (data enrichment, search)
Logic
Service logic
Prepare snapshot (cron)
Run cron-job to prepare data based on schedule (
EMPLOYEES_BULK_UPLOAD_SCHEDULE
)Generate file that contains all the data from
employees
tableGenerate N files depending on
PIS_BULK_ACTIONS_MAX_DEPTH
with data changed in 1-2-3 .. N daysUpload files to
MEDIA_STORAGE_BULK_ACTIONS_BUCKET
Retrieve data
Download file from media storage
MEDIA_STORAGE_BULK_ACTIONS_BUCKET
depending on requested depthIf
depth
is missing - get all recordsif
depth
is passed - select file that contains changes within requested period
Retrieve records from file and render as response
Configuration parameters
N/A
Dictionaries
N/A
Input parameters
Input parameter | Mandatory | Type | Description | Example | |
---|---|---|---|---|---|
1 |
|
|
|
|
|
2 |
|
|
|
|
|
Request structure
See on API-specification
Headers
Request data validation
Authorization
Verify that MIS API token exists in request
in case of error - return 401 (“Api key is not set")
Verify the validity of MIS API token
in case of error - return 401 (“Invalid api key”)
Verify that MIS API token is not expired
in case of error - return 401 (“Invalid api key”)
Check MIS scopes in order to perform this action (scope = 'employee_bulk:read_pis')
return 403 (“Your scope does not allow to access this resource. Missing allowances: employee_bulk:read_pis”) in case of invalid scope(s)
Validate query parameters
Validate parameters by type and format
Parameter | Type | Format |
---|---|---|
depth | integer | Positive number without fraction components |
Processing
N/A
Response structure examples
See on API-specification
HTTP status codes
Response code | HTTP Status code | Message | Internal name | Description | |
---|---|---|---|---|---|
1 | Базові | ||||
2 |
|
|
|
|
|
3 |
|
|
|
|
|
4 | Специфічні | ||||
5 |
|
|
|
|
|
Post-processing processes
N/A
Technical modules where the method is used
Название |
---|
|
Related content
ЕСОЗ - публічна документація