Table of Contents

...

  • 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 

  • validate person.id is UUID
    • in case error return 422
  • search person by person.id in MPI 
    • in case error return 422, "such person doesn't exist"
  • search persons in mpi (Пошук персон. Версія 3)
    • If new person's tax_id and authentication_number match with founded person by passed person.id - add mpi_id to declaration request
      • else validate person be deduplication model (if score >  PERSON_ONLINE_DEDUPLICATION_MATCH_SCORE, then add mpi_id to declaration request)
        • else return error 409, "such person can't be updated. New person should be created instead"

If person.id is not 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

...

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

...