Delete or hide address level data

Hi guys,

I want to not show some address data level in my registration form. Do you have any idea how to hide/remove fields like District, House No., Street, and Address Data?

To clear our the actual field that are by default after installation of Bahmni there are few steps that you need to follow to create your own Address Hierarchy.

Addressee Hierarchy in Bahmni is designed through an XML file which are available in Openmrs - > Administrator - > Manage Address Template there you can see a XML structure file with all properties referring to Address Information into Registration Dashboard in ERP.

You can customize this XML by using some of the attributes that Bahmni already provides for us, to read further into for more details follow the official page here.

Some Bahmni data’s are accessible only through a database if you want to modify or delete them, as we know each component talks to its own database, which may be created within MySQL or Postgres.

Since we want to modify the Address Hierarchy thought OpenMRS we need to login in it’s database.

mysql -uopenmrs-user -ppassword openmrs

List all available databases in your machine:

SHOW DATABASES;

Select the database you want to use in this case is openmrs:

USE openmrs

List all openmrs data tables:

SHOW TABLES;

As a final result you should delete everything inside those two tables: address_hierarchy_level and address_hierarchy_entry.

DELETE FROM address_hierarchy_level;

DELETE FROM address_hierarchy_entry;

After you have accomplished by creating your desired XML structure and deleting all the data from openmrs now you just need to create a CV file which includes the XML structure you just created for your implementation.

Upload CSV with address mappings

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

After creating such a CSV, visit OpenMRS > Administration > Manage Address Hierarchy page to upload it.

In the " Upload Address Hierarchy" section:

Settings for the Screenshot above:

  • Select the CSV file to upload
  • Delimiter (regex format): ‘,’ (without quotes)
  • User-Generated Id Delimiter (regex format): leave as blank
  • Overwrite Existing Hierarchy : If there is an existing address hierarchy that needs to be replaced, then it should be marked as “checked”. If this is left “unchecked” then new addresses will get appended to the existing hierarchy.
  • Click Upload

For more details refer to Bahmni here in this page.

1 Like