Unexpected behavior

aethelwulffe wrote on Friday, July 15, 2011:

A sleep clinic (version 4.1dev…not sure what date right now) with a pretty standard set-up, normal table fields (pid auto-increment, no mask, etc…) had an issue and called me for some advice.  When they created a new patient, some other patient’s insurance info was already filled out in the record!  Came to find that there was a PID value in the insurance data of “000”.  We got rid of that and everything was fine.  Possibly that happened when someone entered 000 as a new patient ID, and perhaps deleted the patient, and the insurance data did not get deleted as well due to the number being a slab of zeros.  After that, the 000 table apparently matched the undefined PID for a new unsaved patient etc…
  I don’t have a db that I am ready to trash to try this out (very wrapped up in my project) but is it possible that a bit of a check needs to be made in the new patient entry form to avoid allowing a PID of that sort of value to be entered?