Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Table of Contents

Key elements

This job is more universal and has replaced the previous one [Depricated] [AUTO] Deactivate Program medications

Purpose

This procedure (automatic schedule task) is designed to deactivate medical program participants (program medications and program devices) after end date ends.

Process configuration

Name

Description

Format

Default value

MEDICAL_PROGRAM_PARTICIPANTS_DEACTIVATION_SCHEDULE

How often to perform this task

Cron Format

0 0 * * *

PROGRAM_DEVICES_DEACTIVATION_SCHEDULE

Schedule for deactivating ended program devices

Cron Format

0 0 * * *

Job logic

  1. Deactivate program medications:

    1. Fetch records from PRM.program_medications, where:

      1. is_active = TRUE

      2. end_date < current_date()

    2. Update all records to:

      1. is_active = FALSE

      2. medication_request_allowed = FALSE

      3. care_plan_activity_allowed = FALSE

      4. updated_at = now()

      5. updated_by = SYSTEM_USER

    3. Write changes to audit log

    4. Write changes to event manager

  2. Deactivate program devices:

    1. Fetch records from PRM.program_devices, where:

      1. is_active = TRUE

      2. end_date < current_date()

    2. Update all records to:

      1. is_active = FALSE

      2. device_request_allowed = FALSE

      3. care_plan_activity_allowed = FALSE

      4. updated_at = now()

      5. updated_by = SYSTEM_USER

    3. Write changes to audit log

    4. Write changes to event manager