This document explain how to configure Address Hierarchies in OpenMRS, so that Bahmni UI can show correct address hierarchies.
Uploading address Hierarchy
Address Hierarchy needs to be configured in OpenMRS to display in Bahmni UI. It is best set up by uploading a Comma Separated Values (CSV) file of address hierarchy that represents the hierarchy you want in your implementation. If you have a hierarchy of State > District > Taluka / Block > Village / City then the CSV should have the format of State, District, Taluka , Village. << TODO: Someone needs to write this >>
Note: The CSV columns should be in the order of Bigger Geographical region to Smaller region. Otherwise the address fields would appear in reverse order on the Registration page and auto-complete won't be useful.
e.g.
Maharashtra | Gadchiroli | Chamorshi | Ghot |
Maharashtra | Gadchiroli | Chamorshi | Chamorshi |
Now, once you have such CSV in place, go to OpenMRS > Administration > Manage Address Hierarchy
In "Upload Address Hierarchy" section, select this CSV file to upload
Set "Delimiter (regex format):" to ',' (without quotes)
Leave "User-Generated Id Delimiter (regex format):" as blank
If you have an existing address hierarchy that you want to replace then mark "Overwrite Existing Hierarchy:" as Checked. This is left "unchecked" then new addresses would get appended to existing hierarchy.
Click upload to complete the upload process.
Map Address Fields
Once the Address CSV is successfully uploaded, you would see a list of fields in the "Address Hierarchy Levels"
Click on the Edit link next to the field to specify the "Name", "Address Field" and "Required" flag.
"Name" is what would be the Label displayed to the user on Registration Page.
"Address Field" is the field in "person_address" table where this field would be stored. From DB perspective this does not matter but keeping these closest to relevant fields is a good practice.
Once this is done for all fields, your address hierarchy set up is complete!
Now Registration page should start showing these fields!!