The addresshierarchy subfolder contains configuration files expected by the Address Hierarchy module.
Below is a typical content of the 'addresshierarchy' configuration subfolder:
addresshierarchy/
├── addressConfiguration.xml
├── addresshierarchy.csv
├── messages_en.properties
└── messages_fr.properties
This file is usually named addresshierarchy.csv
, however this name is configurable.
It contains the address hierarchy entries themselves. This is typically a large file since it usually contains thousands of lower level entries. Here is an sample snippet for Haiti with the entries down to the third commune level. We see on each row Pays,Département,Commune
(country, district, borough):
Haiti,Artibonite,Anse Rouge
Haiti,Artibonite,Desdunes
Haiti,Artibonite,Dessalines
...
Haiti,Sud-Est,Marigot
Haiti,Sud-Est,Thiotte
NOTE: This file provides raw entries, without a header row.
The entries levels will be mapped, following their order of enumeration in the file, to the fields in the address template, see below.
This file defines the address template. Example, for Haiti:
<addressConfiguration>
<wipe>true</wipe>
<addressComponents>
<addressComponent>
<field>COUNTRY</field>
...
</addressComponent>
<addressComponent>
<field>STATE_PROVINCE</field>
...
</addressComponent>
<addressComponent>
<field>CITY_VILLAGE</field>
...
</addressComponent>
<addressComponent>
<field>ADDRESS_2</field>
...
</addressComponent>
</addressComponents>
<addressHierarchyFile>
<filename>addresshierarchy.csv</filename>
<entryDelimiter>,</entryDelimiter>
...
</addressHierarchyFile>
</addressConfiguration>```
In this Haiti example, the configuration loader will map address field and hierarchy levels as such because of the enumeration order in each of the two files:
Address field | Hierarchy level |
---|---|
COUNTRY |
Pays |
STATE_PROVINCE |
Département |
CITY_VILLAGE |
Commune |
ADDRESS_2 |
- |
The i18n .properties
files are used to localise the address-related fields of PersonAdress
and Location
entities by filling the i18n reverse cache of Ext I18n.
- For
PersonAdress
the following fields are supported:address1
toaddress15
,cityVillage
,countyDistrict
,stateProvince
,country
,postalCode
,latitude
,longitude
- For
Location
the following fields are supported:address1
,address2
,cityVillage
,countyDistrict
,stateProvince
,country
,postalCode
,latitude
,longitude
The messages files can be similarly defined as those loaded by the messageproperties domain.
- The Address Hierarchy module version 2.17.0 or above must be installed.
- Find out more how the Address Hierarchy module at https://wiki.openmrs.org/display/docs/Address+Hierarchy+Module
- Find out more about the address template at https://wiki.openmrs.org/x/OgTX
- A full configuration example for Haiti at https://github.com/mekomsolutions/openmrs-config-haiti/tree/master/configuration/addresshierarchy
- Please look at the test configuration folder for sample import files for all domains, see here.