Versions Compared

Key

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

...

...

...

...

Purpose

This job is designed to expire previously created Medication requests. All active medication requests where dispense_valid_to in the past must be expired.

Process configuration

...

Name

...

Description

...

Format

...

Default value

...

MEDICATION_REQUEST_AUTOTERMINATION_SCHEDULE

...

How often to perform this task

...

Cron Format

...

`* * * * *`

Job logic

...

Fetch records from `medication_requests`, where:

  1. status = 'ACTIVE'

  2. dispense_valid_to < NOW()

...

Update status for all records:

  1. status  =  EXPIRED

  2. updated_by = SYSTEM_USER

  3. updated_at = timestamp

...

Write changes to audit log

...

Write changes to event manager

if the medication request is based on the activity with quantity:

...

The page is not supported. The method requirements can be found here [AUTO] Terminate Medication Request