Table of Contents

Anchor
Declaration Request JSON Schema
Declaration Request JSON Schema
Validate request

...

  • If "no_tax_id"= true, tax_id field should be empty, in case error return 422
  • If "no_tax_id"=false and age>14, tax_id should be present, in case error return 422

Validate person_id

USE_DEDUPLICATION_MODEL - is a flag in in ehealth.charts that turn on logic:

If person.id is in request then 

...

  • search persons in mpi (Пошук персон. Версія 3)
    • If we found person by tax_id and authentication_number
      • return error 409, "such person exists. Update this person."
    • In case authentication_method = OFFLINE, or don't found authentication_number, or we found authentication_number but tax_id don't match - We create pairs of new person with people from cluster and send to the model.
      • in case deduplication model gave score <  PERSON_ONLINE_DEDUPLICATION_MATCH_SCORE, create new person
      • else return error 409, "such person exists. Update this person.

Validate phone number limit

...

  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 approved 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 == 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"

Validate person authentication phone

USE_DEDUPLICATION_MODEL - is a flag in in ehealth.charts that turn on logic:

If person have confidant_person, then person.auth_phone = person.confident_person.phone

  • in case error return 422 - msg "Person must have same phone as the confidant person"

Validate person documents

...