Table of Contents | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
|
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 invalid or not.
Configuration
Value | Description | Example |
---|---|---|
DMS_PERSON_SYNCHRONIZATION_SCHEDULE | Cron parameter, represents start time of the EIS MVS data synchronization among invalid passport documents |
|
DMS_PERSON_VALIDATION_PERIOD_DAYS | Represents period in days when the existing saved dms data should be validated in dms registry if it still valid. |
|
DMS_PASSPORT_PERSONS_SYNCHRONIZATION_BATCH_SIZE | Amount of persons processed by DMS passport data synchronization job at once |
|
Data flow
Scheduller starts according to DMS_PERSON_SYNCHRONIZATION_SCHEDULE cron parameter. It creates oban job that selects DMS_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 | ||
---|---|---|
|
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):
...
dms_passport_verification_status = IN_REVIEW
dms_passport_verification_reason = AUTO
Step 1.1 Update Person
Invoke the Step If person_verifications.dms_passport_verification_status still IN_REVIEW
...
dms_passport_data_id = null
dms_passport_data_status = null
dms_passport_synced_at = null
dms_passport_verification_status = NOT_VERIFIED
dms_passport_verification_reason = AUTO_INCORRECT_DATA
dms_passport_unverified_at = current datetime
Step 2. Call CheckPassportDMSStatus
Call CheckPassportDMSStatus with third-party service https://e-health-ua.atlassian.net/wiki/spaces/EDDR/pages/18052513879/MVS+Trembita+methods#CheckPassportDMSStatus 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 dms_passport_data
If Step 2 was successful and PasStatus
= 1 returned. Get a record from mimir.dms_passport_data table by pass_type, pas_serial, pas_number :
...
Expand | ||
---|---|---|
| ||
|
Step 4. Update Person
Invoke the Step If person_verifications.dms_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 MVS performed)
...
dms_passport_data_id = mimir.dms_passport_data.id
dms_passport_data_status = 1
dms_passport_synced_at = date and time when synchronization has been performed (current datetime)
dms_passport_verification_status = NOT_VERIFIED
dms_passport_verification_reason = AUTO_NOT_VALID
dms_passport_unverified_at = current datetime
Step 4.1. Update another Persons
Invoke the Step If person_verifications.dms_passport_verification_status is not IN_REVIEW
...
dms_passport_data_id = mimir.dms_passport_data.id
dms_passport_data_status = 1
dms_passport_synced_at = date and time when synchronization has been performed (current datetime)
dms_passport_verification_status = NOT_VERIFIED
dms_passport_verification_reason = AUTO_NOT_VALID
dms_passport_unverified_at = current datetime
Step 4.2. Update Party
Invoke the Step if party_verifications.dms_passport_verification_status is not IN_REVIEW
...
dms_passport_data_id = mimir.dms_passport_data.id
dms_passport_data_status = 1
dms_passport_synced_at = date and time when synchronization has been performed (current datetime)
dms_passport_verification_status = NOT_VERIFIED
dms_passport_verification_reason = AUTO_NOT_VALID
dms_passport_unverified_at = current datetime
Step 5. Update Person
Invoke the Step If person_verifications.dms_passport_verification_status still IN_REVIEW
...
dms_passport_data_id = null
dms_passport_data_status = 0
dms_passport_synced_at = date and time when synchronization has been performed (current datetime)
dms_passport_verification_status = VERIFIED
dms_passport_verification_reason = AUTO_VALID
dms_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.
...