ЕСОЗ - публічна документація
[DRAFT] Get Employee details [API-005-007-001-0098]
Сторінка знаходиться в процесі розробки. Інформація на ній може бути застарілою.
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
- 4 Service logic
- 5 Configuration parameters
- 6 Dictionaries
- 7 Input parameters
- 8 Request structure
- 9 Headers
- 10 Request data validation
- 10.1 Authorize
- 11 Processing
- 12 Response structure examples
- 13 HTTP status codes
- 14 Post-processing processes
- 15 Technical modules where the method is used
Properties of a REST API method document
Document type | Метод REST API |
---|---|
Document title | [DRAFT] Get Employee details [API-005-007-001-0098] |
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-001-0098 |
Microservices (namespace) | IL |
Component | Employees |
Component ID | COM-005-007 |
Link на API-специфікацію | |
Resource | {{host}}/api/employees/{{employee_id}} |
Scope | employee:details |
Protocol type | REST |
Request type | GET |
Sync/Async | Sync |
Public/Private | Public |
Purpose
This method is designed to obtain all Employees of the legal entity.
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)
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.
Configuration parameters
N/A
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
Input parameters
Input parameter | Mandatory | Type | Description | Example | |
---|---|---|---|---|---|
1 | employee_id |
| String | Required | d290f1ee-6c54-4b01-90e6-d701748f0851 |
2 |
|
|
|
|
|
Request structure
See on API-specification
Headers
Request data validation
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)
Processing
N/A
Response structure examples
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
See on API-specification
HTTP status codes
Response code | HTTP Status code | Message | Internal name | Description | |
---|---|---|---|---|---|
1 | Базові | ||||
2 |
| 200 | Response |
|
|
3 |
| 401 | Invalid access token |
|
|
4 |
| 403 | Access denied |
|
|
5 |
| 403 | Your scope does not allow to access this resource. Missing allowances: employee:details |
|
|
6 | Специфічні | ||||
7 |
|
|
|
|
|
Post-processing processes
N/A
Technical modules where the method is used
ЕСОЗ - публічна документація