Pharmacy order discontinuation

Description

From https://openvpms.org/project/pharmacy-order-discontinuation

For practices using HL7 pharmacy orders, orders are discontinued at the time of invoice finalisation.

That is, any pharmacy order that was submitted as part of invoicing can no longer be dispensed once the invoice is finalised.

For some practices, this does not meet the requirements of their workflow. For these practices, a facility is required to delay the discontinuation of orders for a period after finalisation.

This will be supported by providing:

  • the practice level option Pharmacy Order Discontinue Period.
    When set, this determines the period after invoice finalisation when orders should be discontinued

  • a job to discontinue pharmacy orders, when Pharmacy Order Discontinue Period is set
    This will be automatically configured when Pharmacy Order Discontinue Period is changed. i.e. it will be configured to run when for a Period > 0 and disabled for anything else.

Migration

To support this change:

  • a hidden Status will be added to invoice items to to indicate that orders have been submitted/discontinued. This will replace the existing ordered flag. The status may be one of:

    • empty - no orders have been submitted

    • ORDERED - one or more orders have been submitted

    • DISCONTINUED - all orders have been discontinued

  • a hidden End Time will be added to invoices and invoice items to indicate when the invoice was Finalised

Note that this status will not be used to indicate the status of laboratory orders.

Existing invoices will not have their End Time set.

Environment

None

Status

Assignee

Tim Anderson

Reporter

Tim Anderson

Labels

None

Components

Fix versions

Priority

Minor
Configure