Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents

Image RemovedImage Added

Method is used for approve or reject employee request.

...

Code Block
languagexml
titleSample Request
collapsetrue
curl -X GET -H 'Content-Type: application/json' 'http://ehealth.nebo15.com/employee_requests/d290f1ee-6c54-4b01-90e6-d701748f0851'

Create/Update employee

Invoke Create Employee WS 

Image RemovedImage Added

Method logic:

  1. if $employee_id is not null - update party and employee_doctors using data from employee_request by employee_id.

  2. else Search Search party_id by tax_id and birth_date for deduplication Party
    1. if If found, update object party - Update party WS. See specificationif
    2. If not found, create object party - - Create object party 
  3. Update Party.  See specification

    1. The following fields can't be changed:

      1. tax_id
  4. Create party WS. See  See specification
    1. create related entity party-user in PRM 
  5. Chech employee_id in request
    1. if employee_id is exist in request, Update employee.
    2. if  employee_id is not exist, Create employee.
  6. Update employee. See specification
    1. The following fields can't be changed:
      1. employee_type
    2. if employee_type = 'DOCTOR', update doctor object
  7. Create new employee. See specification
    1. If employee_type = 'OWNER': deactivate all other records with the employee_type = 'OWNER' for the legal_entity, where new owner is creating:
Code Block
languagesql
update employees e 
set is_active = false
inserted_by = $new_owner_id
inserted_at = md5(clock_timestamp()
where e.legal_entity_id = $employee_request.legal_entity_id
and e.employee_type = 'OWNER'

...

Code Block
languagexml
titleSample Request
collapsetrue
curl -X POST -H 'Content-Type: application/json' -d '{
  "legal_entity_id": "d290f1ee",
  "division_id": "b075f148-7f93-4fc2-b2ec-2d81b19a9b7b",
  "employee_id": "b075f148-7f93-4fc2-b2ec-2d81b19a9b7b",
  "position": "лікар",
  "start_date": "2017-03-02T10:45:16.000Z",
  "end_date": "2018-03-02T10:45:16.000Z",
  "status": "NEW",
  "employee_type": "doctor",
  "party": {
    "first_name": "Петро",
    "last_name": "Іванов",
    "second_name": "Миколайович",
    "birth_date": "1991-08-19T00:00:00.000Z",
    "gender": "MALE",
    "tax_id": "3126509816",
    "email": "email@example.com",
    "documents": [
      {
        "type": "PASSPORT",
        "number": "120518"
      }
    ],
    "phones": [
      {
        "type": "MOBILE",
        "number": "+380503410870"
      }
    ]
  },
  "doctor": {
    "educations": [
      {
        "country": "UA",
        "city": "Київ",
        "institution_name": "Академія Богомольця",
        "issued_date": "2017",
        "diploma_number": "DD123543",
        "degree": "Молодший спеціаліст",
        "speciality": "Педіатр"
      }
    ],
    "qualifications": [
      {
        "type": "Інтернатура",
        "institution_name": "Академія Богомольця",
        "speciality": "Педіатр",
        "issued_date": "2017",
        "certificate_number": "2017"
      }
    ],
    "specialities": [
      {
        "speciality": "Педіатрія",
        "speciality_officio": true,
        "level": "Перша категорія",
        "qualification_type": "Присвоєння",
        "attestation_name": "Академія Богомольця",
        "attestation_date": "2017",
        "valid_to_date": "2020",
        "certificate_number": "AB/21331"
      }
    ],
    "science_degree": {
      "country": "UA",
      "city": "Київ",
      "degree": "Доктор філософії",
      "institution_name": "Академія Богомольця",
      "diploma_number": "DD123543",
      "speciality": "Педіатр",
      "issued_date": "2017"
    }
  }
}' 'http://ehealth.nebo15.com/employees'


Add role

Add user role by invoke service - название метода

...