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

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 25 Next »

Purpose

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

Process configuration

Name

Description

Format

Default value

MEDICATION_REQUEST_REQUEST_SCHEDULE

How often to perform this task

Cron Format

`* * * * *`

MEDICATION_REQUEST_REQUEST_EXPIRATION

Medication request request lifetime period

Minutes

30

Job logic

  1. Read MEDICATION_REQUEST_REQUEST_EXPIRATION parameter value

  2. Fetch records from `medication_request_requests`, where:

    1. status = 'NEW'

    2. inserted_at < NOW() - MEDICATION_REQUEST_REQUEST_EXPIRATION

  3. Update status for all records:

    1. status  =  EXPIRED

    2. updated_by = SYSTEM_USER

    3. updated_at = timestamp

  • No labels