Hey, can anyone tell my what I’m doing wrong with this file? I am trying to upload it for my address hierarchy and I am getting the following error. I am using this documentation:
Address Hierarchy Module - Documentation - OpenMRS Wiki I am also, attempting to import as .csv so I have “,” (minus the quotes) and checked to over write the existing hierarchy.
Hi @dnelson,
I have uploaded the csv file that you have shared and I didn’t face any issue. It uploaded successfully. You can find the same in below screenshot.
I have imported the file as .csv, used delimter as “,” and checked the box to overwrite the existing hierarchy.
Can you please change the tag <org.openmrs.layout.address.AddressTemplate> to <org.openmrs.layout.web.address.AddressTemplate> in your Address Template, not sure this is the one causing the error. Let us know if you are still facing the issue.
It seems that originally uploaded an incorrect file that seemed to load several “blank” lines but I just can’t seem to overwrite it. It’s so frustrating. Any way to put the original data in the applicable tables, perhaps?
Based on this error in the openmrs log: Caused by: java.sql.BatchUpdateException: Cannot delete or update a parent row: a foreign key constraint fails (openmrs.address_hierarchy_entry, CONSTRAINT parent-to-parent FOREIGN KEY (parent_id) REFERENCES address_hierarchy_entry (address_hierarchy_entry_id) ON DELETE CASCADE)
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Cannot delete or update a parent row: a foreign key constraint fails (openmrs.address_hierarchy_entry, CONSTRAINT parent-to-parent FOREIGN KEY (parent_id) REFERENCES address_hierarchy_entry (address_hierarchy_entry_id) ON DELETE CASCADE)