...
Table of Contents |
---|
Purpose
This job is designed to expire previously created Medication requests. All active medication requests where dispense_valid_to in the past must be expired.
Process configuration
Parameter
Value
(Cron Format)
termination
Name | Description |
---|
Format | Default value |
---|---|
MEDICATION_REQUEST_AUTOTERMINATION_SCHEDULE |
How often to perform |
this task | Cron Format | `* * * * *` |
...
Job logic
...
Get list Medication request
...
language | sql |
---|
...
Fetch records from `medication_requests`, where:
status = 'ACTIVE'
dispense_valid_to
<
NOW()
Update
(Set values) Medication requeststatus for all records:
status =
EXPIREDEXPIRED
updated_by =
SYSTEMSYSTEM_USER
updated_at = timestamp
Write changes to audit log
Write changes to event manager