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