sraj49 wrote on Saturday, January 23, 2010:
FOr a prospective user I was insering data in to the patient_data table. When I run the INSERT query I get SQL error message as: SQL Error : Duplicate entry ‘0’ for key ‘pid’.
sraj49 wrote on Saturday, January 23, 2010:
FOr a prospective user I was insering data in to the patient_data table. When I run the INSERT query I get SQL error message as: SQL Error : Duplicate entry ‘0’ for key ‘pid’.
sraj49 wrote on Saturday, January 23, 2010:
How do I get over this issue? thanks fo rthe help
bradymiller wrote on Saturday, January 23, 2010:
hey,
What’s your OpenEMR version, operating system, and OpenEMR package(Xampp vs. ubuntu vs appliance vs source).
Also what is your sql-mode setting in your mysql configuration file(either my.cnf(linux) or my.ini(windows))?
Also, have you modified stuff demographic stuff in Adminstration->Layouts?
-brady
sraj49 wrote on Saturday, January 23, 2010:
Hi Brady,
I have tried in both 3.1.0 and 3.2.0 using Linux and also 3.1.0 on windows. I get the same error. It is giving the same error: 'Duplicate entry ‘0’ for key ‘pid’. I have not modified any stuff in Admin->Layout. what should be the sql mode? Where is it indicated in my.inc?
When I googled for this error this seems to be a common error. If I export a file and import it back through Phpmyadmin, i still get the error.
Raj
Raj
bradymiller wrote on Sunday, January 24, 2010:
hey,
Questions?
-Did your first instance of OpenEMR work?
-Is this an error after doing an import/export on phpmyadmin?
-sql-mode is a variable in your mysql configuration file, and should be blank (""). Let us know if it isn’t and what it is.
-brady
ideaman911 wrote on Sunday, January 24, 2010:
Brady & Raj;
Is it possible that the auto PID is somehow off and not known? Leaving it blank would be logically interpreted as a ZERO.
Joe Holzer Idea Man 315-622-9241 im@holzerent.com or joe.im0602x@gmail.com
http://www.holzerent.com or http://www.EMRofCNY.com
sraj49 wrote on Sunday, January 24, 2010:
I believe that the auto PID is somehow off and it is interpreting it as zero. I need to be educated a little bit more as to …where is " my.cnf" file? I have tow installation running, one for doing all trials and the other the production one. The problem came in when I did a new installation of openEMR , and tried to import a .csv file relating to database of past patients. I am directly importing them in to the patients_data table. Is it correct? When I enter each patient through the " Creat new patient module works fine.
Raj
ideaman911 wrote on Sunday, January 24, 2010:
Raj;
If I understand you, the problem you were describing is perhaps not the real issue, but the import is. Your minimum PID assigned to the first of your CSV load MUST be higher than the highest PID known by the system already. The crash at the zero seems related only to the fact that there is ANY PID already there, which would only be the case if you had previously entered a patient.
Find out what the highest number is and add at least one in the first PID field you want to load. Let me know if that fixes the issue. And I HOPE you are doing all this in a development, not a production, environ so as not to damage real data.
Joe Holzer Idea Man 315-622-9241 im@holzerent.com or joe.im0602x@gmail.com
http://www.holzerent.com or http://www.EMRofCNY.com
sraj49 wrote on Sunday, January 24, 2010:
Hi Brady and Joe,
Since this is a new client , what I did I inserted the data along with preassigned pubid and pid numbers from my side and complete the data base. When I now add a new patient the pid is auto assigned.
Raj
sraj49 wrote on Monday, January 25, 2010:
Joe,
Yes. It fixed the issue. We need to enter the first patient manually and then dump the rest. Then everything goes smooth. I have two installations, one for development and the other is the actual application with its own database. Thanks a lot.
Raj