Table of Contents | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
|
...
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:
dracs_birth_verification_status = ‘IN_REVIEW’
dracs_birth_verification_reason = ‘AUTO_ONLINE’
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:
verification_status = ‘IN_REVIEW’
verification_reason = ‘AUTO’
Get persons birth acts - perform GetBirthArByChildNameAndBirthDate DRACS method with following request params:
ChildName = persons.first_name
ChildBirthDate = persons.birth_date
ChildPatronymic = persons.second_name (skip if empty)
ChildSurname = persons.last_name
Get ResultData field from GetBirthArByChildNameAndBirthDate method response and decode it from base64 to get XML file of birth acts list.
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’
if true - rollback it in person_verifications table in MPI db for person_id to previous state
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:
...
in case not found - insert new act record to dracs_birth_acts table, also add technical data:
set id = autogenerate uuid
set inserted_at = now()
set updated_at = now()
in case found - check that condition
op_date = OP_DATE and ar_op_name = AR_OP_NAME
is also met for found record:in case condition is met - full duplicate of birth acts already exists, update dracs_birth_acts tablefor found record:
set updated_at = now()
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 registryin case at least one field was updated
save existing record to dracs_birth_acts_hstr table
dracs_birth_act_id = id of current birth act from dracs_birth_acts table
dracs_birth_act_data = full data of current birth act in jsonb format (without technical fields, use fields matching from table below)
inserted_at = now()
fully update existing birth act in dracs_birth_acts table with new values from DRACS registry
set updated_at = now()
in case none of the fields were updated - update dracs_birth_acts tablefor found birth act:
op_date = OP_DATE from response
ar_op_name = AR_OP_NAME from response
updated_at = now()
...