You can either donate money to this project by entering the amount above and clicking the 'Add to cart' button, or you can pledge an amount by clicking here to email your commitment. If you make a pledge, then when we have 100% funding commitments, you will be notified by email and you can then make your actual donation. Note that development will not commence until all funds are received.

Project description:

OpenVPMS uses a technique called optimistic locking to ensure that multiple users editing the same object don't overwrite each other's changes. If two users edit the same object, the first user to save wins, and the second user's changes are rolled back.

Whilst this prevents data corruption, it means that the second user to save loses their changes.

This project will introduce edit locks so that when a user edits an object, they acquire a lock. If another tries to edit the same object, a message will be displayed and editing will be prevented.

Initially, only support for invoice edit locks will be provided, but this may be extended to other objects in future.

Locks

Locks are acquired when editing an object. A lock contains:

the object being edited

the user

the time the lock was acquired

When editing completes, the lock is released.

If a lock has been acquired for an object, and another user tries to edit the same object, an error message will be displayed e.g.

This invoice is being currently being edited by J Smith.

Invoice Editing

Invoices are the primary cause of save conflicts, so these will be the first candidates for edit locks. It also means that deadlock detection won't be required.

Invoice locks need to be acquired when performing:

Customer Charges (new, edit, delete, finalisation)

Check-In

Consult

Check-Out

Estimates - Invoice

Customer Orders - Invoice

Prescriptions - Dispense

Invoices also update many other objects. These must not be edited while their associated invoice is edited. This includes:

medications

prescriptions

investigations

documents

reminders

visits

Lock Expiry

Locks will automatically expire if a user logs out or their session is terminated.

One of our members has started the ball rolling with a donation of $100. Thanks very much! If everyone were to donate this amount there would be more than enough funds to have this project available in version 1.9.