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

[DRAFT] Get Employee Request by ID [API-005-007-002-0114]

Сторінка знаходиться в процесі розробки. Інформація на ній може бути застарілою.

https://e-health-ua.atlassian.net/wiki/spaces/EN/pages/17591304241 (remove the link block before publishing the document)

Properties of a REST API method document

Document type

Метод REST API

Document title

[DRAFT] Get Employee Request by ID [API-005-007-002-0114]

Guideline ID

GUI-0011

Author

@

Document version

1

Document status

DRAFT

Date of creation

ХХ.ХХ.ХХХХ (дата фінальної версії документа – RC або PROD)

Date of update

ХХ.ХХ.ХХХХ (дата зміни версії)

Method API ID

API-005-007-002-0114

Microservices (namespace)

IL

Component

Employees

Component ID

COM-005-007

Link на API-специфікацію

https://ehealthmisapi1.docs.apiary.io/#reference/public.-medical-service-provider-integration-layer/employee-requests/get-employee-request-by-id

Resource

{{host}}/api/employee_requests/{{id}}

Scope

employee_request:read

Protocol type

REST

Request type

GET

Sync/Async

Sync

Public/Private

Public

Purpose

This method searches and returns request for registration employee by id. This method uses scopes and context. 

According to the requirements: 

  • The legal entity (Owner, HR) can see only employee_requests that were made by this legal entity.

  • NHS Admin can see all employee_requests

Logic

N/A

Configuration parameters

N/A

Dictionaries

  • POSITION

  • EMPLOYEE_TYPE

  • GENDER

  • +DOCUMENT_TYPE

  • PHONE_TYPE

  • COUNTRY

  • EDUCATION_DEGREE

  • QUALIFICATION_TYPE

  • SPECIALITY_TYPE

  • SPECIALITY_LEVEL

  • SPEC_QUALIFICATION_TYPE

Input parameters

Input parameter

Mandatory

Type

Description

Example

Input parameter

Mandatory

Type

Description

Example

1

id

 

String

Required

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

2

 

 

 

 

 

Request structure

See on API-specification

Headers

Headers

Request data validation

Authorize

Request to process the request using a token in the headers

Validate request

  1. Verify the validity of access token

    1. in case error return 401

  2. Check user scopes in order to perform this action (scope = 'employee_request:read')

    1. in case error return 403

Validate id

  1. Verify id - employee_request_id exists

    1. in case error return 404 (not found employee request in DB with this ID)

Validate context

  1. Get legal_entity.id from '$.context'. Filter employee requests by legal_entity.id

    1. in case error return 404

Processing

N/A

Response structure examples

See on API-specification

{ "meta": { "code": 200, "url": "https://example.com/resource", "type": "object", "request_id": "6617aeec-15e2-4d6f-b9bd-53559c358f97#17810" }, "data": { "division_id": "b075f148-7f93-4fc2-b2ec-2d81b19a9b7b", "legal_entity_id": "d290f1ee-6c54-4b01-90e6-d701748f0851", "position": "P8", "start_date": "2017-03-02T10:45:16.000Z", "end_date": "2018-03-02T10:45:16.000Z", "status": "NEW", "employee_type": "DOCTOR", "party": { "first_name": "Петро", "last_name": "Іванов", "second_name": "Миколайович", "birth_date": "1991-08-19T00:00:00.000Z", "gender": "MALE", "no_tax_id": false, "tax_id: 3126509816 (string, required) - if no_tax_id=true then passport number, otherwise tax_id": "", "email": "email@example.com", "documents": [ { "type": "PASSPORT", "number": "АА120518", "issued_by": "Рокитнянським РВ ГУ МВС Київської області", "issued_at": "2017-02-28" } ], "phones": [ { "type": "MOBILE", "number": "+380503410870" } ], "working_experience": 10, "about_myself": "Закінчив всі можливі курси" }, "doctor": { "educations": [ { "country": "UA", "city": "Київ", "institution_name": "Академія Богомольця", "issued_date": "2017-02-28", "diploma_number": "DD123543", "degree": "MASTER", "speciality": "Педіатр" } ], "qualifications": [ { "type": "SPECIALIZATION", "institution_name": "Академія Богомольця", "speciality": "Педіатр", "issued_date": "2017", "certificate_number": "2017", "valid_to": "2017", "additional_info": "додаткова інофрмація" } ], "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" } ], "science_degree": { "country": "UA", "city": "Київ", "degree": "", "institution_name": "Академія Богомольця", "diploma_number": "DD123543", "speciality": "Педіатр", "issued_date": "2017" } }, "id": "b075f148-7f93-4fc2-b2ec-2d81b19a9b7b", "inserted_at": "2017-05-05T14:09:59.232112", "updated_at": "2017-05-05T14:09:59.232112" }, "urgent": { "user_id": "d290f1ee-6c54-4b01-90e6-d701748f0851" } }

HTTP status codes

Response code

HTTP Status code

Message

Internal name

Description

Response code

HTTP Status code

Message

Internal name

Description

1

Базові

2

 

200

Response

 

 

3

 

401

Access token validation failed

 

 

4

 

401

Error

 

 

5

 

403

Check user scopes in order to perform this action failed

 

 

6

 

403

Error

 

 

7

 

404

COMPOSITION_NOT_FOUND_404

 

 

8

 

404

Error

 

 

9

 

404

Get legal_entity.id from '$.context'. Filter employee requests by legal_entity.id failed

 

 

10

 

404

Not found employee request in DB with this ID

 

 

11

Специфічні

12

 

 

 

 

 

Post-processing processes

N/A

Technical modules where the method is used

 

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