Bahmni uses the Address Hierarchy module of OpenMRS to keep a list of address entries. Follow steps below to configure a new address hierarchy for your implementation.
This step is not mandatory. |
There are two things which can be configured in address section:
Bahmni allows you to configure address hierarchy form by two ways.
When a item is selected from the 'Village' Dropdown, all the above levels will be autopopulated automatically.
When parent level is filled, the child level will be filtered based on the value entered in parent field. For example, If 'Chattisgarh' is entered in State, only the districts which comes under 'Chattisgarh' will be present in the autocomplete list of 'District' field.
To configure it, the following can be added in app.json's config section.
"addressHierarchy": { "showAddressFieldsTopDown": true, "strictAutocompleteFromLevel": "address3" //address3 is the addressfield name of Tehsil } |
Address Hierarchy needs to be configured in OpenMRS for it to be displayed in the Bahmni UI. It is best set up by uploading a Comma Separated Values (CSV) file with the desired address hierarchy. For e.g., if a hierarchy is defined as State -> District -> Taluka / Block -> Village / City then the CSV should have the format of State, District, Taluka , Village
Note that 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 will not be useful. |
For example, refer below. Also refer to attached address_hierarchy.csv |
Hierarchy | State | District | Taluka | Village |
Incorrect | Maharashtra | Ghot | Chamorshi | Gadchiroli |
Correct | Maharashtra | Gadchiroli | Chamorshi | Chamorshi |
After creating such a CSV, visit OpenMRS > Administration > Manage Address Hierarchy page to upload it.
In the "Upload Address Hierarchy" section:
Once the Address CSV is successfully uploaded, a list of fields will be visible in the Address Hierarchy Levels as shown below:
Once this is done for all fields, the address hierarchy setup is complete.