Table of Contents |
---|
...
This procedure (Automatic schedule task) is designed to expire previously created Medication request Request after ended time-life in NEW statuslifetime ends in status='NEW'.
Procedure logic for transition
- For info - status charts: Medication request Request Status Chart
Get list of Medication request requests
Code Block language sql SELECT * FROM medication_request_requests RMR WHERE RMR.status == NEW AND RMR.expired_at <= current_date()
- Update (Set values) Request for Medication request Request
- status = EXPIRED
- updated_by = user_id
- updated_at = timestamp