Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Table of Contents
minLevel1
maxLevel6
outlinefalse
styledefault
typelist
printablefalse

...

  1. If person must be verified by DRACS birth acts registry by conditions from Step 1 - update person_verifications table in MPI db for person_id, set values:

    1. dracs_birth_verification_status = ‘IN_REVIEW’

    2. dracs_birth_verification_reason = ‘AUTO_ONLINE’

  2. If confidant person relationship must be verified by DRACS birth acts registry by conditions from Step 1 - ppdate confidant_person_relationships table in MPI db for person_id and relationship_id, set values:

    1. verification_status = ‘IN_REVIEW’

    2. verification_reason = ‘AUTO’

  3. Get persons birth acts - perform GetBirthArByChildNameAndBirthDate DRACS method with following request params:

    1. ChildName = persons.first_name

    2. ChildBirthDate = persons.birth_date

    3. ChildPatronymic = persons.second_name (skip if empty)

    4. ChildSurname = persons.last_name

  4. Get ResultData field from GetBirthArByChildNameAndBirthDate method response and decode it from base64 to get XML file of birth acts list.

    1. in case GetBirthArByChildNameAndBirthDate ResultCode <> 0 or connection error or timeout is occured - check that persons dracs_birth_verification_status = ‘IN_REVIEW’ or confidant person relationship verification status = ‘IN_REVIEW’

      1. if true - rollback it in person_verifications table in MPI db for person_id to previous state

      2. if false - skip this person, go to next person in list.

...

Save each birth act from formed list to dracs_birth_acts table in transaction according to fields matching:

...

  1. in case not found - insert new act record to dracs_birth_acts table, also add technical data:

    1. set id = autogenerate uuid

    2. set inserted_at = now()

    3. set updated_at = now()

  2. in case found - check that condition op_date = OP_DATE and ar_op_name = AR_OP_NAME is also met for found record:

    1. in case condition is met - full duplicate of birth acts already exists, update dracs_birth_acts tablefor found record:

      1. set updated_at = now()

    2. in case condition is not met - birth act was updated, check that fields of birth act from database (according to fields matching, but exclude technical fields ar_reg_date, ar_reg_number, op_date, ar_op_name) were updated in DRACS registry

      1. in case at least one field was updated

        1. save existing record to dracs_birth_acts_hstr table

          1. dracs_birth_act_id = id of current birth act from dracs_birth_acts table

          2. dracs_birth_act_data = full data of current birth act in jsonb format (without technical fields, use fields matching from table below)

          3. inserted_at = now()

        2. fully update existing birth act in dracs_birth_acts table with new values from DRACS registry

          1. set updated_at = now()

      2. in case none of the fields were updated - update dracs_birth_acts tablefor found birth act:

        1. op_date = OP_DATE from response

        2. ar_op_name = AR_OP_NAME from response

        3. updated_at = now()

...

  1. Compare Confidant persons documents_relationship data with each birth act data using comparison process:

    1. get documents_relationship.number (with type = BIRTH_CERTIFICATE) from confidant person

    2. get certificates.cert_serial + certificates.cert_number with certificates.cert_status = 1 from birth act

    3. perform normalization of found numbers (remove special symbols, bring to lower register)

    4. compare found numbers:

      1. if at least one act is equal – proceed with all valid acts data to next comparison step

      2. if all acts are not equal – skip this confidant person, if Person does not have other confidant persons – proceed to Step 5

  2. Compare Confidant persons personal data with each birth act data (compared from previous comparison step) using comparison process:

    1. get last_name, first_name, second_name, tax_id and birth_date from confidant person

    2. get father_surname, father_name, father_patronymic, father_numident, father_date_birth, mother_surname, mother_name, mother_patronymic, mother_numident, mother_date_birth from birth act

    3. perform normalization of found fields (remove special symbols, bring to lower register)

    4. compare confidant person with parents by following steps:

      1. compare last_name, first_name, second_name, birth_date with father_surname, father_name, father_patronymic, father_date_birth or mother_surname, mother_name, mother_patronymic, mother_date_birth

        1. if at least one act is equal – compare tax id on the next step

        2. if all acts are not equal – skip this confidant person, if Person does not have other confidant persons – proceed to Step 5.

      2. compare tax_id (if exists) with corresponding father_numident or mother_numident (if exists)

        1. if does not exist or exists and at least one act is equal – proceed with all valid acts data to next comparison step

        2. if not equal – skip this confidant person, if Person does not have other confidant persons – proceed to Step 5

  3. Check compared Confidant persons parent rights from birth acts (compared from previous comparison step):

    1. get father_parent_rights and mother_parent_rights from birth act

    2. check that father_parent_rights <> 183 or mother_parent_rights <> 185 for corresponding confidant person

      1. if father_parent_rights <> 183 or mother_parent_rights <> 185 for Confidant person – proceed to next step

      2. if father_parent_rights = 183 or mother_parent_rights = 185 for any Confidant person – skip this confidant person, if Person does not have other confidant persons – proceed to Step 5

  4. Search for active person using Active person search algorithm with successfully compared confidant person last_name, first_name, second_name and tax_id (if exists)

    1. if tax_id does not exists or search returns ‘No active person found’ or ‘Impossible to clearly identify an active person’ messages – skip this confidant person, if Person does not have other confidant persons – proceed to Step 5

    2. if one active person is found – check that it can be used as confidant person using following validations https://e-health-ua.atlassian.net/wiki/spaces/CSIEH/pages/17612832814/18000249948/RC_+CSI-1323+_Create+Confidant+Person+relationship+request#Validate-confidant-person

      1. if no validation fails – create Confidant person relationship as described https://e-health-ua.atlassian.net/wiki/spaces/CSIEH/pages/17613422651/18000249998/RC_+CSI-1323+_Approve+Confidant+Person+relationship+request#Create-confidant-person-relationship-(action-%3D-INSERT) here, only set:

        1. verification_status = ‘VERIFIED’

        2. verification_reason = ‘AUTO’

        3. dracs_birth_synced_at = now()

      2. remove confidant person data from persons.confidant_person field

...