...
Name | Description | Format | Default value |
---|---|---|---|
MEDICATION_DISPENSE_AUTOTERMINATION_SCHEDULE | How often to perform this task | Cron Format | `* * * * *` |
MEDICATION_DISPENSE_EXPIRATION | Medication dispense lifetime period | Minutes | 10 |
Job logic
Read MEDICATION_DISPENSE_EXPIRATION parameter value
Fetch records from OPS.medication_dispenses, where:
status = 'NEW'
inserted_at < now() - MEDICATION_DISPENSE_EXPIRATION
Update status for all records to EXPIRED:
status = 'EXPIRED'
updated_at = now()
updated_by = SYSTEM_USER
Write changes to audit log
Write changes to event manager