/wiki/spaces/EN/pages/17591304241 (remove the link block before publishing the document)
Properties of a REST API method document
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