ЕСОЗ - публічна документація

Employee roles (Bulk export)

Purpose

Method to Get all employee roles from ehealth system as a raw data as a part of data exchange to do some operations on PIS side (data enrichment, search)

Specification

https://pisapi1.docs.apiary.io/#reference/public.-patient-information-system/bulk-data-export/get-employee-roles

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_role_bulk:read_pis')

    • return 403 (“Your scope does not allow to access this resource. Missing allowances: employee_role_bulk:read_pis”) in case of invalid scope(s)

Validate query parameters

Validate parameters by type and format

Parameter

Type

Format

Parameter

Type

Format

depth

integer

Positive number without fraction components

Service logic

Prepare snapshot (cron)

  1. Run cron-job to prepare data based on schedule (EMPLOYEE_ROLES_BULK_UPLOAD_SCHEDULE)

  2. Generate file that contains all the data from employee_roles table

  3. Generate N files depending on PIS_BULK_ACTIONS_MAX_DEPTH with data changed in 1-2-3 .. N days

  4. Upload files to MEDIA_STORAGE_BULK_ACTIONS_BUCKET

Retrieve data

  1. Download file from media storage MEDIA_STORAGE_BULK_ACTIONS_BUCKET depending on requested depth

    1. If depth is missing - get all records

    2. if depth is passed - select file that contains changes within requested period

  2. Retrieve records from file and render as response

ЕСОЗ - публічна документація