Status
- Specification DONE
- Apiary DONE
Purpose
This procedure (Automatic schedule task) is designed to expire previously created Medication request Request after ended time-life in NEW status.
Procedure logic for transition
- For info - status charts: Medication request Request Status Chart
Get list Medication request
SELECT * FROM medication_request_requests RMR WHERE RMR.status == NEW AND RMR.expired_at <= current_date()
- Update (Set values) Request for Medication request
- status = EXPIRED
- updated_by = user_id
- updated_at = timestamp