ЕСОЗ - публічна документація

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Current »

Purpose

This procedure (automatic schedule task) is designed to expire previously created Medication dispense after lifetime ends in status='NEW'.

Process configuration

Name

Description

Format

Default value

MEDICATION_DISPENSE_SCHEDULE

How often to perform this task

Cron Format

`* * * * *`

MEDICATION_DISPENSE_EXPIRATION

Medication dispense lifetime period

Minutes

10

Job logic

  1. Read MEDICATION_DISPENSE_EXPIRATION parameter value

  2. Fetch records from OPS.medication_dispenses, where:

    1. status = 'NEW'

    2. inserted_at < now() - MEDICATION_DISPENSE_EXPIRATION

  3. Update status for all records to EXPIRED:

    1. status = 'EXPIRED'

    2. updated_at = now()

    3. updated_by = SYSTEM_USER

  4. Write changes to audit log

  5. Write changes to event manager

  • No labels