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 request Request after lifetime ends in status='NEW'.

Process configuration


ParameterDescriptionValue
MEDICATION_REQUEST_REQUEST_SCHEDULE(Cron Format) How often to perform termination`* * * * *`
MEDICATION_REQUEST_REQUEST_EXPIRATION(Minutes, integer > 0) Medication request Request lifetime30




...

  1. For info - status charts: Medication request Request Status Chart
  2. Read MEDICATION_REQUEST_REQUEST_EXPIRATION parameter value.

  3. Fetch records from `medication_request_requests`, where:

    • status = 'NEW'
    • inserted_at < NOW() - MEDICATION_REQUEST_REQUEST_EXPIRATION
  4. Update (Set values) Medication request Request
    1. status  =  EXPIRED
    2. updated_by = SYSTEM_USER
    3. updated_at = timestamp