Info |
---|
Note |
Сторінка знаходиться в процесі розробки. Інформація на ній може бути застарілою. |
Info |
---|
/wiki/spaces/EN/pages/17591304241 (remove the link block before publishing the document) |
Table of Contents |
---|
Properties of a REST API method document
Page Properties | ||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||||||||||||||||||||||
|
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
Description of the configuration parameters that are used when processing a request in the systemN/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
Expand | |||
---|---|---|---|
| |||
Code Block |
Headers
...
Key
...
Value
...
Mandatory
...
Description
...
Example
...
Content-Type
...
application/json
...
M
...
Тип контенту
...
Content-Type:application/json
...
Authorization
...
Bearer c2778f3064753ea70de870a53795f5c9
...
M
...
Перевірка користувача
...
Authorization:Bearer c2778f3064753ea70de870a53795f5c9
...
| ||
|
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
A list of processes related to receiving, changing or transmitting data according to the logic defined in the REST APIN/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
Expand | |||||
---|---|---|---|---|---|
| |||||
|
HR, ACCOUNTANT, OWNER, PHARMACY_OWNER
Expand | |||||
---|---|---|---|---|---|
| |||||
|
...
Expand | ||
---|---|---|
| ||
|
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
Description of actions performed on data after processing
Technical modules where the method is used
List of pages describing technical N/A
Technical modules where the method is used
Page Properties Report | ||||
---|---|---|---|---|
|
...