Status
Purpose
This procedure (Automatic schedule task) is designed to expire previously created Medication request Request after lifetime ends in status='NEW'.
Process configuration
Procedure logic for transition
- For info - status charts: Medication request Request Status Chart
Read MEDICATION_REQUEST_REQUEST_EXPIRATION parameter value.
Fetch records from `medication_request_requests`, where:
- status = 'NEW'
- inserted_at < now() - MEDICATION_REQUEST_REQUEST_EXPIRATION
- Update (Set values) Medication request Request
- status = EXPIRED
- updated_by = SYSTEM_USER
- updated_at = timestamp