Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

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

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

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

    1. if preperson has required set of medical events (TBD):

      • set expiresdeactivation_at 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 expiresdeactivation_at date < current_datetimedate() - PREPERSON_EXPIRATIONDEACTIVATION

        • set status = inactive

        • set is_active = false

        • set updated_at = current_datetime()

        • set updated_by = system_user()

      2. else if expiresdeactivation_at date >= current_datetimedate() - PREPERSON_EXPIRATIONDEACTIVATION, then skip the preperson.