Set visit status to Completed when invoice finalised

Description

At present, the Visit status is set to Completed when the check-out workflow finishes.
For invoicing where the patient isn't checked-in, a Visit is automatically created, and is left In Progress after the invoice is finalised. This makes it a candidate for selection in subsequent consults, which is typically not desired.

To avoid this the Visit status should be set to Completed the moment its associated invoice is finalised and the Visit end time should reflect the time it was Completed

Environment

None

Status

Assignee

Tim Anderson

Reporter

TonyT

Labels

None

Fix versions

Priority

Minor