Purpose
This procedure (automatic schedule task) is designed to deactivate Medications after the end date ends.
Specification
Logic
Fetch records from PRM.medications, where:
is_active = TRUE
end_date < current_date()
Update all records to:
is_active = FALSE
updated_at = now()
updated_by = SYSTEM_USER
Write changes to audit log
Write changes to event manager
Process configuration
Name | Description | Format | Default value |
---|---|---|---|
MEDICATION_DEACTIVATION_SCHEDULE | How often to perform this task | Cron Format | `0 0 * * *` |