Opened 6 years ago

Closed 6 years ago

#625 closed enhancement (fixed)

Prevent registration of patients with identical data

Reported by: Nicklas Nordborg Owned by: Nicklas Nordborg
Priority: minor Milestone: Reggie v2.16
Component: net.sf.basedb.reggie Keywords:
Cc:

Description

The scenario is that two different users are registering patient information in either the "Pathology referral form" or "Blood referral form" wizards.

The most common problem is that a new patient is required and if both users start the wizard nearly at the same time, both will ask for the 'next free PATNNNN' name and both will get the same response.

Another issue might be that both users are registering information for the same patient (eg. same personal number), in which case it could happen that two new records are created for the same patient.

Change History (2)

comment:1 Changed 6 years ago by Nicklas Nordborg

(In [2613]) References #625: Prevent registration of patients with identical data

Implemented a check when a new patient is created so that there is no existing one with the same personal number or name. To prevent another transaction from adding a patient in the time-frame between the check and the commit, a lock is used to force the other transactions to wait.

If the check finds an existing patient an exception is thrown and the registration is aborted.

comment:2 Changed 6 years ago by Nicklas Nordborg

Resolution: fixed
Status: newclosed

(In [2614]) Fixes #625: Prevent registration of patients with identical data

When generating a new patient code (which happens in step 2 of 3 in the wizard), the code is reserved for 5 minutes. If another user also uses the wizard at the same time the next patient code will be handed out (and reserved). This should avoid collisions most of the time as long as the final step doesn't take more than 5 minutes.

The drawback is that "holes" may be created in the sequence if the first uses aborts the registration and the second user completes the registration.

Note: See TracTickets for help on using tickets.