Versions Compared

Key

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

...

  1. Count all declarations in status active where OPS.declarations.employee_id==$.declaration_request.employee_id
    1.1 If there is an active declaration with the current person, exclude it from the selection in order to let doctor resign declaration with current patient
  2. Count all declaration_requests in status approvedapproved where IL.declaration_requests.data($.employee.id) ==$.declaration_request.employee_id
  3. Get all specialities of current doctor
    1. Select speciality from PRM.employees where PRM.employees.party_id == (select PRM.employees.party_id where PRM.employees.id=$.declaration_request.employee_id)
  4. Select config parameter for declarations_limit where speciality == $.declaration_request.scope select 3 
  5. Compare the result of selections 1+2 with the lowest config parameter from select 4. In case count (declarations+declaration_requests )> config_parameter, return 409 "The employee has reached the declaration limit"

...