Versions Compared

Key

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

...

Name

Description

Format

Default value

MEDICATION_DISPENSE_AUTOTERMINATION_SCHEDULE

How often to perform this task

Cron Format

`* * * * *`

MEDICATION_DISPENSE_EXPIRATION

Medication dispense lifetime period

Minutes

10

Job logic

  1. Read MEDICATION_DISPENSE_EXPIRATION parameter value

  2. Fetch records from OPS.medication_dispenses, where:

    1. status = 'NEW'

    2. inserted_at < now() - MEDICATION_DISPENSE_EXPIRATION

  3. Update status for all records to EXPIRED:

    1. status = 'EXPIRED'

    2. updated_at = now()

    3. updated_by = SYSTEM_USER

  4. Write changes to audit log

  5. Write changes to event manager