ЕСОЗ - публічна документація
Get Employee details
Purpose
This method is designed to obtain all Employees of the legal entity.
Specification
Link | Посилання на Apiary або Swagger | |
Resource | /api/employees/{{employee_id}} | Посилання на ресурс, наприклад: /api/persons/create |
Scope | employee:details | Scope для доступу |
Components | Employees | Зазначається перелік бізнес компонентів, які використовують цей метод, наприклад: ePrescription |
Microservices | il/api | Перелік мікросервісів, які використовує метод API, наприклад: Auth, ABAC |
Protocol type | REST | Тип протоколу, який використовується запитом, наприклад: SOAP | REST |
Request type | GET | Тип запиту API, наприклад: GET, POST, PATCH… |
Sync/Async | Sync | Метод є синхронним чи асинхронним? |
Public/Private/Internal | Public | Потрібно зазначити тип методу за ступенем доступності |
Logic
Search in the legal_entity by :legal_entity_id (legal_entity_id from Context)
return error if not found
Search in the employee by :employee_id and is_active = true
return error if not found
Check employee.employee_type
employee_type in (DOCTOR, PHARMACIST)
employee_type in (HR, ACCOUNTANT, OWNER, PHARMACY_OWNER)
Input parameters
Input parameter | Values | Type | Description | Example |
---|---|---|---|---|
employee_id |
| String | Required | d290f1ee-6c54-4b01-90e6-d701748f0851 |
Filters
See on Apiary
Dictionaries
+DIVISION_TYPE
LEGAL_FORM
OWNER_PROPERTY_TYPE
EMPLOYEE_TYPE
+DOCUMENT_TYPE
PHONE_TYPE
EDUCATION_DEGREE
COUNTRY
QUALIFICATION_TYPE
SPECIALITY_TYPE
SPECIALITY_LEVEL
SPEC_QUALIFICATION_TYPE
SCIENCE_DEGREE
LEGAL_ENTITY_TYPE_V2
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:details')
Return (403, 'Your scope does not allow to access this resource. Missing allowances: employee:details') in case of invalid scope(s)
Headers
Content-Type:application/json
Authorization:Bearer c2778f3064753ea70de870a53795f5c9
Service logic
Service returns specified Employee related to the legal entity from token:
Get Employee by ID from
prm.employees
Filter by medication_request_id and patient_id and status (optional)
Validate data consistency:
Ensure that requested Employee relates to the legal entity from token:
Return 403 ('Access denied') in case of error
Render a response according to specification with found Employee:
render a response structure depends on employee types
get parties.specialities, for each parties.specialities.speciality check condition if parties.specialities.speciality<>employee.speciality.speciality then set speciality_officio=false and add to employees.speciality else don't add to response.
Response structure
Additional info with educations, qualifications, science degree and specialities are stored in prm.parties, however speciality.speciality_officio=true is also saved to prm.employees.
get employees.speciality
get parties.specialities, for each parties.specialities.speciality check condition if parties.specialities.speciality<>employee.speciality.speciality then set speciality_officio=false and add to employees.speciality else don't add to response.
form array of specialities as in example below
DOCTOR, SPECIALIST, ASSISTANT, PHARMACIST, MED_ADMIN, LABORANT or MED_COORDINATOR
HR, ACCOUNTANT, OWNER, PHARMACY_OWNER
HTTP status codes
HTTP status code | Message | What caused the error |
---|---|---|
200 | Response |
|
401 | Invalid access token |
|
403 | Your scope does not allow to access this resource. Missing allowances: employee:details |
|
ЕСОЗ - публічна документація