Versions Compared

Key

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

...

Purpose

This procedure (automatic schedule task) is designed to expire previously created Medication dispense after lifetime ends in status='NEW'.

Process configuration

Parameter

Name

Description

Format

Value

Default value

MEDICATION_DISPENSE_SCHEDULE

(Cron Format)

How often to perform

termination

this task

Cron Format

`* * * * *`

MEDICATION_DISPENSE_EXPIRATION

(Minutes, integer > 0) Medication Dispense lifetime

Medication dispense lifetime period

Minutes

10

Specification

Search candidates

...

Job logic

  1. Read MEDICATION_DISPENSE_

...

  1. EXPIRATION parameter value

...

  1. Fetch records from OPS.medication_dispenses, where:

    1. status = 'NEW'

    2. inserted_at < now() -

...

    1.  MEDICATION_DISPENSE_EXPIRATION

Change status

...

  1. Update status for all records to EXPIRED:

    1. status = 'EXPIRED'

    2. updated_at = now()

    3. updated_by = SYSTEM_USER

  2. Write changes to audit log

  3. Write changes to event manager