Error when uploading patients CSV file

Hello Community

I am trying to do bulk creation of patients using a CSV file but I keep getting this error

Address Hierarchy level {0} does not exist.

Here’s part of my address hierarchy template

<org.openmrs.layout.address.AddressTemplate>
    <nameMappings class="properties">
      <property name="address1" value="District"/>
      <property name="address2" value="Village"/>
      <property name="address3" value="ResidentialAddress"/>
      <property name="address4" value="Homevillage"/>
      <property name="country" value="Location.country"/>
      </nameMappings>
    <sizeMappings class="properties">
      <property name="address1" value="40"/>
      <property name="address2" value="40"/>
      <property name="address3" value="40"/>
      <property name="address4" value="40"/> 
      <property name="country" value="40"/>    

And the headers of the address entries in the CSV file

Hi @tapologo , what mechanism are you using to create patients using a CSV file?

Hi

I downloaded the sample CSV file from the wiki and updated it with my custom headers and data, I then uploaded it using CSV Upload on Bahmni

@tapologo,

As you are uploading patients using CSV in Bahmni.I am assuming you are referring this wiki page.

Can you share the CSV file with error after uploading it in Bahmni?

And as you are getting the following error

Address Hierarchy level {0} does not exist.

related to Address Hierarchy have you did any changes in default Address Hierarchy of Bahmni?

Correct

patientsprod1_2020-06-02_18_01_37.err.csv (549 Bytes)

Yes, I changed it to match our local hierarchy

@tapologo,

I have gone through with your Patient CSV error file other columns are good only need to check the column “person_address.address3”, Can you just try with removing comma (", ") from your CSV column “person_address.address3” value “Room 010, Girls Block” means keep value like this “Room 010 Girls Block”.

Note: Mostly when we are adding the value in CSV with a comma (", “) then CSV will take as 2 values and it will add to the next column, therefore, we should not use a comma (”, ") in one cell.

With the above steps, I think your problem should resolve and patient should be imported.

And about the Address Hierarchy, I think something missed to configure, Can you share your openmrs Database table “address_hierarchy_level” records.