Purpose This method is designed to obtain all Employees of the legal entity.
Specification Apiary
Authorization Verify the validity of access token
Verify that token is not expired
Check user scopes in order to perform this action (scope = 'employee:details')
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 structures for Employee types DOCTOR, SPECIALIST, ASSISTANT, PHARMACIST, MED_ADMIN, LABORANT or MED_COORDINATOR
Click here to expand...
{
"data": {
"division": {
"id": "1e24e73c-835f-44a5-9726-b6c4bd81225b",
"legal_entity_id": "1ee3e298-4d6a-4c41-be48-a7b646477f60",
"mountain_group": false,
"name": "Відділення Клініки NoName",
"status": "ACTIVE",
"type": "CLINIC"
},
"doctor": {
"educations": [
{
"city": "Київ",
"country": "UA",
"degree": "MASTER",
"diploma_number": "DD123543",
"institution_name": "Академія Богомольця",
"issued_date": "2017-08-05",
"speciality": "Педіатр"
}
],
"qualifications": [
{
"certificate_number": "2017-08-05",
"institution_name": "Академія Богомольця",
"issued_date": "2017-08-05",
"speciality": "Педіатр",
"type": "STAZHUVANNYA"
}
],
"science_degree": {
"city": "Київ",
"country": "UA",
"degree": "CANDIDATE_OF_SCIENCE",
"diploma_number": "DD123543",
"institution_name": "Академія Богомольця",
"issued_date": "2017-08-05",
"speciality": "FAMILY_DOCTOR"
},
"specialities": [
{
"attestation_date": "2017-08-05",
"attestation_name": "Академія Богомольця",
"certificate_number": "AB/21331",
"level": "FIRST",
"qualification_type": "AWARDING",
"speciality": "FAMILY_DOCTOR",
"speciality_officio": true,
"valid_to_date": "2017-08-05"
}
]
},
"employee_type": "DOCTOR",
"end_date": null,
"id": "91b5d4ea-a443-44ff-b048-a5b36f4d3e8c",
"legal_entity": {
"edrpou": "3173108921",
"id": "1ee3e298-4d6a-4c41-be48-a7b646477f60",
"legal_form": "140",
"mis_verified": "VERIFIED",
"name": "Клініка NoName",
"owner_property_type": "STATE",
"public_name": "NoName Медікал",
"short_name": "NoName Медікал",
"status": "ACTIVE",
"type": "MSP"
},
"party": {
"about_myself": null,
"birth_date": "1983-07-11",
"declaration_count": 0,
"declaration_limit": 0,
"documents": [
{
"number": "120518",
"type": "PASSPORT"
}
],
"first_name": "Виктор",
"gender": "MALE",
"id": "431f8bab-0aaf-45ac-9839-1434165d424e",
"last_name": "Квітка-Основ'яненко",
"no_tax_id": false,
"phones": [
{
"number": "+380503410870",
"type": "MOBILE"
}
],
"second_name": "Сергеевич",
"tax_id": "3067305998",
"working_experience": null
},
"position": "P1",
"start_date": "2017-03-02",
"status": "APPROVED"
},
"meta": {
"code": 200,
"request_id": "ed5924b9-ed79-46f2-bfc2-9142a621fb15#71181",
"type": "object",
"url": "http://api-svc.il/api/employees/91b5d4ea-a443-44ff-b048-a5b36f4d3e8c"
}
}
HR, ACCOUNTANT, OWNER, PHARMACY_OWNER
Click here to expand...
{
"meta": {
"url": "http://example.com/resource",
"type": "object",
"code": 200,
"idempotency_key": "idemp-ssjssdjoa8308u0us0",
"request_id": "req-adasdoijasdojsda"
},
"data": {
"legal_entity_id": "d290f1ee",
"division_id": "b075f148-7f93-4fc2-b2ec-2d81b19a9b7b",
"title": "рекрутер",
"speciality": "рекрутинг",
"start_date": "2017-03-02T10:45:16.000Z",
"end_date": "2018-03-02T10:45:16.000Z",
"active": true,
"status": "pending_verification",
"employee_type": "hr",
"party": {
"first_name": "Петро",
"last_name": "Іванов",
"second_name": "Миколайович",
"birth_date": "1991-08-19T00:00:00.000Z",
"gender": "MALE",
"tax_id": "3126509816",
"national_id": "CC7150985243",
"email": "email@example.com",
"documents": [
{
"type": "PASSPORT",
"number": "120518",
"issue_date": "2015-04-07T00:00:00.000Z",
"expiry_date": "2015-04-07T00:00:00.000Z",
"issued_by": "DMSU"
}
],
"phones": [
{
"type": "MOBILE",
"number": "+380503410870"
}
]
},
"id": "d290f1ee-6c54-4b01-90e6-d701748f0851"
}
}