Versions Compared

Key

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

...

Table of Contents

Purpose

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

Process configuration

Parameter

Name

Description

Value

Format

Default value

MEDICATION_REQUEST_REQUEST_SCHEDULE

(Cron Format)

How often to perform

termination

this task

Cron Format

`* * * * *`

MEDICATION_REQUEST_REQUEST_EXPIRATION

(Minutes, integer > 0)

Medication request request

Request

lifetime period

Minutes

30

...

Job logic

...

  1. Read MEDICATION_REQUEST_REQUEST_EXPIRATION parameter EXPIRATION parameter value.

  2. Fetch records from `medication_request_requests`, where:

    1. status = 'NEW'

    2. inserted_at < NOW() -

     MEDICATION
    1.  MEDICATION_REQUEST_REQUEST_EXPIRATION

  3. Update

    (Set values) Medication request Request

    status for all records:

    1. status  =  EXPIRED

    2. updated_by =

       SYSTEM

       SYSTEM_USER

    3. updated_at = timestamp