Versions Compared

Key

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

...

...

Table of Contents
Status

Page Properties


Specification
Status
colourRed
titlespecs
Apiary
Status
colourGrey
titleabsent
JSON Schema request
Status
colourGrey
titleabsent
JSON Schema response
Status
colourRedGrey
titlespecsabsent


Purpose

This procedure is designed to expire previously created Request for Medication request after ended time-life in ACTIVE status.

Process configuration


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


Procedure logic for transition

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

    Code Block
    languagesql
    SELECT * FROM medication_requestrequests MR
        WHERE MR.status == ACTIVE
            AND RMMR.ended_at <= current_date()



  3. Update (Set values) Request for Medication request
    1. status  =  STOPPEDEXPIRED
    2. updated_by = userSYSTEM_idUSER
    3. updated_at = timestamp