Versions Compared

Key

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

Purpose

This job is designed for initial and further regular synchronization of Persons with the EIS MVS registry in order to check if their passport documents are among stolen or lost ones.

Configuration

Value

Description

Example

MVS_PERSON_SYNCHRONIZATION_SCHEDULE

Cron parameter, represents start time of the MVS data synchronization

"0 1 * * *"

MVS_PERSON_VALIDATION_PERIOD_DAYS

Represents period in days when the existing saved MVS data should be validated in MVS registry if it still valid.

"270"

MVS_PASSPORT_PERSONS_SYNCHRONIZATION_BATCH_SIZE

Amount of persons processed by MVS passport data synchronization job at once

"100"

Data flow

Scheduller starts according to MVS_PERSON_SYNCHRONIZATION_SCHEDULE cron parameter. It creates oban job that selects MVS_PASSPORT_PERSONS_SYNCHRONIZATION_BATCH_SIZE Persons that match to some filter parameters. For each the job receives Person’s passport data on input and returns the result of reconciliation with the EIS MVS registry to output (details in “Step description” section below):

...

View file
namemvs passport status check v7.drawio.xml

Step description

Step 1. Get list of Persons

Get the list of active Persons (status=active, is_active=true) who meet the following criteria (using logical AND):

...

  • mvs_passport_verification_status = IN_REVIEW

  • mvs_passport_verification_reason = AUTO

Step 1.1 Update Person

Invoke the Step If person_verifications.mvs_passport_verification_status still IN_REVIEW

...

  • mvs_passport_data_id = null

  • mvs_passport_data_status = null

  • mvs_passport_synced_at = null

  • mvs_passport_verification_status = NOT_VERIFIED

  • mvs_passport_verification_reason = AUTO_INCORRECT_DATA

  • mvs_passport_unverified_at = current datetime

Step 2. Call CheckPassportStatus

Call CheckPassportStatus with third-party service https://e-health-ua.atlassian.net/wiki/spaces/EDDREH/pages/1805251387918229035067/RC_MVS+Trembita+methods_EN+methods#CheckPassportStatusDMS#CheckPassportStatus using the following request params:

...

  • pass_type = 0101

  • pas_number = mpi.persons_documents.number (number as last six symbols)

  • pas_serial = mpi.persons_documents.number (serial as first two symbols)

Step 3. Create or update mvs_passport_data

If Step 2 was successful and PasStatus = 1 returned. Get a record from mimir.mvs_passport_data table by pass_type, pas_serial, pas_number :

...

Expand
titleSet data to EXISTING record
  • pas_status - PasStatus from CheckPassportStatus response

  • updated_at - current date and time (set even record is not changed, but synchronized)

Step 4. Update Person

Invoke the Step If person_verifications.mvs_passport_verification_status still IN_REVIEW (because if changed to VERIFICATION_NEEDED+ONLINE_TRIGGERED, then it means that person record has been changed while current sync with EIS MVS performed)

...

  • mvs_passport_data_id = mimir.mvs_passport_data.id

  • mvs_passport_data_status = 1

  • mvs_passport_synced_at = date and time when synchronization has been performed (current datetime)

  • mvs_passport_verification_status = NOT_VERIFIED

  • mvs_passport_verification_reason = AUTO_LOST

  • mvs_passport_unverified_at = current datetime

Step 4.1. Update another Persons

Invoke the Step If person_verifications.mvs_passport_verification_status is not IN_REVIEW

...

  • mvs_passport_data_id = mimir.mvs_passport_data.id

  • mvs_passport_data_status = 1

  • mvs_passport_synced_at = date and time when synchronization has been performed (current datetime)

  • mvs_passport_verification_status = NOT_VERIFIED

  • mvs_passport_verification_reason = AUTO_LOST

  • mvs_passport_unverified_at = current datetime

Step 4.2. Update Party

Invoke the Step if party_verifications.mvs_passport_verification_status is not IN_REVIEW

...

  • mvs_passport_data_id = mimir.mvs_passport_data.id

  • mvs_passport_data_status = 1

  • mvs_passport_synced_at = date and time when synchronization has been performed (current datetime)

  • mvs_passport_verification_status = NOT_VERIFIED

  • mvs_passport_verification_reason = AUTO_LOST

  • mvs_passport_unverified_at = current datetime

Step 5. Update Person

Invoke the Step If person_verifications.mvs_passport_verification_status still IN_REVIEW

...

  • mvs_passport_data_id = null

  • mvs_passport_data_status = 0

  • mvs_passport_synced_at = date and time when synchronization has been performed (current datetime)

  • mvs_passport_verification_status = VERIFIED

  • mvs_passport_verification_reason = AUTO_NOT_LOST

  • mvs_passport_unverified_at = null

Step 6. Technical error returned

If technical error: PasStatus = -2, -1, timeout, etc. returned in Step 2 - the Person is considered unprocessed.

...