This concerns the potential for two users to step on each others toes (or even the same user, on their own toes) whilst working on a client's care plan.

Plait  attempts to prevent this by applying the following logic:

1. When beginning a new careplan draft, or continuing to edit one that has previously been saved, a lock will be created with an expiry of two hours.

2. When the user clicks Cancel, Publish or Update, this lock will be deleted.

3. The lock will NOT be automatically deleted when the expiry is reached.  However...:

4. If another user attempts to edit or delete the same client's careplan BEFORE the lock has expired, they will receive the following error and be prevented from doing do:

5. If they attempt this AFTER the lock has expired they will receive the following prompt:

6. At this point, the user could then click OK if they want to proceed with editing or deleting the careplan.  It is assumed that they will make sure that the other user really has finished or decided not to proceed with their work.

7. Similar logic will be applied if the user who took out the lock attempts to edit or delete the same client's careplan from another browser tab.  In this case though, the expiry date of the lock is irrelevant, and the user will be allowed to proceed (once prompted) regardless of whether the lock has expired or not:

8. In the case where the user does choose to proceed despite a lock being present, the following error can occur in exceptional circumstances: