juggernautsei wrote on Thursday, August 25, 2016:
This is funny. I imported 21644 patients into the patient_data table. When we try to add a new record, we get this error.
"ERROR: insert failed: INSERT INTO patient_data SET pid = ‘10000’, date = NOW(),
title = ‘Mr.’, fname = ‘Patient’, mname = ‘’, lname = ‘Demo’, pubpid =
‘10000’, DOB = ‘2016-08-25’, sex = ‘Male’, ss = ‘’, drivers_license =
‘’, status = ‘’, genericname1 = ‘’, genericval1 = ‘’, genericname2 = ‘’,
genericval2 = ‘’, billing_note = ‘’, street = ‘’, city = ‘’, state =
‘’, postal_code = ‘’, country_code = ‘’, county = ‘’, mothersname = ‘’,
guardiansname = ‘’, contact_relationship = ‘’, phone_contact = ‘’,
phone_home = ‘’, phone_biz = ‘’, phone_cell = ‘’, email = ‘’,
email_direct = ‘’, providerID = ‘’, ref_providerID = ‘’, pharmacy_id =
‘0’, hipaa_notice = ‘’, hipaa_voice = ‘’, hipaa_message = ‘’, hipaa_mail
= ‘’, hipaa_allowsms = ‘’, hipaa_allowemail = ‘’, allow_imm_reg_use = ‘’,
allow_imm_info_share = ‘’, allow_health_info_ex = ‘’, allow_patient_portal
= ‘’, care_team = ‘’, cmsportal_login = ‘’, occupation = ‘’, industry =
‘’, language = ‘’, ethnicity = ‘’, race = ‘’, financial_review = ‘’,
family_size = ‘’, monthly_income = ‘’, homeless = ‘’, interpretter = ‘’,
migrantseasonal = ‘’, referral_source = ‘’, vfc = ‘’, religion = ‘’,
deceased_date = ‘’, deceased_reason = ‘’
I chased it down to new_comprehensive_save.php
$result = sqlQuery("SELECT MAX(pid)+1 AS pid FROM patient_data");
When I export the variable the number is 10000.
It seems that the MAX(pid) is 10000.
I’ll update with a fix once I find one.