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
colourGrey
titleabsent


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`* * * * *`


Procedure logic for transition

  1. For info - status charts: Medication request Request Status Chart
  2. Get list of Medication requestsrequest Requests


    Code Block
    languagesql
    SELECT * FROM medication_request_requests RMR
    	WHERE RMR.status == NEW 
    		AND RMR.expired_at <= current_date()


  3. Update (Set values) Medication request Request
    1. status  =  EXPIRED
    2. updated_by = user SYSTEM_idUSER
    3. updated_at = timestamp