Id sau pid

lemonsoftwarero wrote on Friday, May 23, 2008:

Hello,

I noticed that sometimes in the code an ‘id’ is used (for patients), sometimes is used ‘pid’. Usually these two could be the same, but not always. ID - autoincrement field, unique and PID - maximum + 1 from pid field (which is unique at some point in time but not the same as id).

My Question: what id/pid should be used?
In sessions all over the openemr is PID, but this could be dangerous in some situations: e.g. delete last inserted patient, insert new patient -> this will take the previous patient pid. At this moment in openEMR everything seems ok, but if we reported some infos (to the clearing house for example) for the old patient, the new one will replace it as pid. I hope you’ll understand what I’m saying.

sunsetsystems wrote on Friday, May 23, 2008:

“pid” has always been the definitive patient identifier throughout OpenEMR.  I agree that it’s not a very good design.

Rod
www.sunsetsystems.com