Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Table of Contents

Purpose

Use this end-point This method is designed to obtain all Employees of the legal entity specified by the legal_entity_id.

Specification

...

id

...

String

...

Required

...

d290f1ee-6c54-4b01-90e6-d701748f0851

Filters

API paragraph not found

Dictionaries

API paragraph not found

Request structure

...

Page Properties

Link

https://ehealthmisapi1.docs.apiary.io/#reference/public.-medical-service-provider-integration-layer/employees/get-employees-list

Посилання на Apiary або Swagger

Resource

/api/employees

Посилання на ресурс, наприклад: /api/persons/create

Scope

employee:read

Scope для доступу

Components

DeclarationsEmployees, Legal Entity, Divisions

Зазначається перелік бізнес компонентів, які використовують цей метод, наприклад: ePrescription

Microservices

API paragraph not foundil/api

Перелік мікросервісів, які використовує метод API, наприклад: Auth, ABAC

Protocol type

REST

Тип протоколу, який використовується запитом, наприклад: SOAP | REST

Request type

PATCHGET

Тип запиту API, наприклад: GET, POST, PATCH…

Sync/Async

Sync

Метод є синхронним чи асинхронним?

Logic

API paragraph not found

Preconditions

API paragraph not found

Global and configurable parameters

No

Input parameters

...

Input parameter

...

Values

...

Type

...

Description

...

Example

Public/Private/Internal

Public

Input parameters

See on Apiary

Filters

See on Apiary

  1. Search employees by filters in ws url:

    1. required filters

      1. legal_entity_id (MSP id)

    2. optional filters: 

      1. status (employees status APPROVED, DISMISSED, REORGANIZED). By default used APPROVED

      2. employee_type (employees type DOCTOR, HR, ACCOUNTANT, PHARMACIST, etc). By default returned all types of employees.

      3. no_tax_id (filer employees with or w/o tax_id).

      4. tax_id (filter employees by tax_id)

      5. party_id (filter employees by party)

      6. edrpou (filter employees by legal_entity edrpou)

      7. division_id (filter employees by division)

      8. page (Page number)

      9. page_size (A limit on the number of objects to be returned, between 1 and 300. Default: 50)

  2. If according to filters employees are not found, WS returns empty data array.

WS returns shortened details, which consist of:

  • employee and party objects

  • for DOCTOR and PHARMACIST - additional returns specialities information

  • pagination data - for tecnical info.

Dictionaries

  • EMPLOYEE_TYPE

  • SPECIALITY_TYPE

  • SPECIALITY_LEVEL

  • SPEC_QUALIFICATION_TYPE

  • POSITION

  • +DIVISION_TYPE

Authorize

  • Verify the validity of access token

...

    • Return (401, 'Invalid access token') in case of validation fails

  • Verify that token is not expired

    • in case of error - return (401, 'Invalid access token')

  • Check user scopes in order to perform this action

...

  • (scope = 'employee:read')

    • Return (403, 'Your scope does not allow to access this resource. Missing allowances: employee:read') in case of invalid scope(s)

Headers

Content-Type:application/json

Authorization:Bearer c2778f3064753ea70de870a53795f5c9

Request data validation

Validate transition

Validate transitionю Allowed transitions:

pending_verification → closed

Check is_active = true

If not passed, Return Error 403 message "Invalid transition"

Processing

Update Declaration status

$declaration.status = closed

$declaration.updated_by = user_id

$declaration.updated_at = timestamp

Response structure

See on Apiary

-

Processing

Service returns specified Employees related to the legal entity from token:

  1. Get Employees from prm.employees

    1. Filter by medication_request_id and patient_id and status (optional)

  2. Filter list above by submitted search parameters

  3. Render a response according to specification with found Employees

    1. Return empty array if no data found.

Response structure

Example:

Expand
titleResponse example
Code Block
{
  "meta": {
    "code": 200,
    "url": "https://example.com/resource",
    "type": "object",
    "request_id": "req-adasdoijasdojsda"
  },
  "data": [
    {
      "id": "d290f1ee-6c54-4b01-90e6-d701748f0851",
      "position": "P1",
      "employee_type": "DOCTOR",
      "status": "APPROVED",
      "start_date": "2017-03-02T10:45:16.000Z",
      "end_date": "2018-03-02T10:45:16.000Z",
      "party": {
        "id": "b075f148-7f93-4fc2-b2ec-2d81b19a9b7b",
        "no_tax_id": true,
        "first_name": "Петро",
        "last_name": "Іванов",
        "second_name": "Миколайович",
        "declaration_limit": 0,
        "declaration_count": 0
      },
      "division": {
        "id": "d290f1ee-6c54-4b01-90e6-d701748f0851",
        "name": "Бориспільське відділення Клініки Ноунейм",
        "legal_entity_id": "d290f1ee",
        "type": "CLINIC",
        "status": "ACTIVE",
        "mountain_group": false,
        "dls_id": "2872985",
        "dls_verified": true
      }
}

Post-processing processes

...

,
      "legal_entity": {
        "id": "b075f148-7f93-4fc2-b2ec-2d81b19a9b7b",
        "name": "Клініка Ноунейм",
        "short_name": "Ноунейм",
        "public_name": "Клініка Ноунейм",
        "type": "MSP",
        "edrpou": "5432345432",
        "status": "ACTIVE"
      },
      "doctor": {
        "specialities": [
          {
            "speciality": "THERAPIST",
            "speciality_officio": true,
            "level": "FIRST",
            "qualification_type": "AWARDING",
            "attestation_name": "Академія Богомольця",
            "attestation_date": "2017-02-28",
            "valid_to_date": "2020-02-28",
            "certificate_number": "AB/21331"
          }
        ]
      }
    }
  ],
  "paging": {
    "page_number": 2,
    "page_size": 50,
    "total_entries": 1000,
    "total_pages": 23
  }
}

HTTP status codes

Page Properties

HTTP status code

Message

What caused the error

 200200

Response

 

401

Invalid access token

Error

  1. Check of the user`s scope failed

403

Invalid transition

Backward compatibility

API paragraph not found

This WS is designed to search employees by legal_entity_id. 

  1. Verify the validity of access token

  2. Check user scopes in order to perform this action

  3. Search employees by filters in ws url:

    1. required filters

      1. legal_entity_id (MSP id)

    2. optional filters: 

      1. status (employees status APPROVED, DISMISSED). By default used APPROVED

      2. type (employees type DOCTOR, HR, ACCOUNTANT, PHARMACIST, etc). By default returned all types of employees.

      3. limit (limit response size - quantity of employee objects). By default returned 50 objects.

      4. starting_after (cursor to fetch next page)

      5. ending_before (cursor to fetch previous page)

  4. If according to filters employees are not found, WS returns empty data array.

WS returns shortened details, which consist of:

...

employee and party objects

...

for DOCTOR and PHARMACIST - additional returns specialities information

...

403

Your scope does not allow to access this resource. Missing allowances: employee:read