ЕСОЗ - публічна документація

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 6 Next »

Purpose

Automatically deactivate prepersons to prevent fraud if they doesn’t have appropriate set of medical events.

Job logic

  1. Job starts once in 24 hours by default (configured parameter PREPERSON_DEACTIVATION_SCHEDULE).

  2. After starting it gets value from global parameter PREPERSON_DEACTIVATION.

  3. Select all entries from mpi.prepersons with status=active and deactivation_date is not null:

    1. if preperson has Observation.codes = height and weight and gender and Observation.status = valid:

      • set deactivation_date = null

      • set updated_at = current_datetime()

      • set updated_by = system_user()

    2. else if preperson has no required set of medical events:

      1. if deactivation_date < current_date() - PREPERSON_DEACTIVATION

        • set status = inactive

        • set is_active = false

        • set updated_at = current_datetime()

        • set updated_by = system_user()

      2. else if deactivation_date >= current_date() - PREPERSON_DEACTIVATION, then skip the preperson.

  • No labels