Versions Compared

Key

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

Table of Contents
Purpose

This procedure job is designed to expire previously created Request for Medication request after ended time-life in ACTIVE status.Medication requests. All active medication requests where dispense_valid_to in the past must be expired

Process configuration


Parameter
Description
Value
MEDICATION_REQUEST_AUTOTERMINATION_SCHEDULE
(Cron Format) How often to perform termination`* * * * *`


...

  1. For info - status charts: Medication_request
  2. Get list Medication request 

    Code Block
    languagesql
    SELECT * FROM medication_requests MR
        WHERE MR.status == ACTIVE
            AND MR.endeddispense_valid_atto <= current_date()



  3. Update (Set values) Medication request
    1. status  =  EXPIRED
    2. updated_by = SYSTEM_USER
    3. updated_at = timestamp
  4. Write changes to audit log
  5. Write changes to event manager