Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Note

Note: This functionality will change in OpenMRS 1.9+.  Please see the documentation on Address Templates. This page is outdated and no longer receives updates!

There are certain address layouts that come with OpenMRS right now, they are: general, kenya, lestho, malawi, rwanda, tanzania, usa . 

You can modify the layout.address.format  setting (formerly global property from platform 1.8 downwards) to one of those values or to the "codeName" of a new custom layout (instructions below) to see a different address/location layout on the new patient screen and location editor.

...

Now after the next </bean> tag, add:

Code Block

<bean id="addressTemplateCustomized" class="org.openmrs.layout.web.address.AddressTemplate">
		<property name="displayName"><value>My custom address layout format</value></property>
		<property name="codeName"><value>custom</value></property>
		<property name="country"><value>My Country Name</value></property>
		<property name="nameMappings">
			<props>
				<prop key="postalCode">Location.postalCode</prop>
				<prop key="stateProvince">Location.stateProvince</prop>
				<prop key="cityVillage">Location.cityVillage</prop>
				<prop key="address1">Location.address1</prop>
				<prop key="address2">Location.address2</prop>
				<prop key="longitude">Location.longitude</prop>
				<prop key="latitude">Location.latitude</prop>
				<prop key="country">Location.country</prop>
				<prop key="countyDistrict">Location.district</prop>
				<prop key="neighborhoodCell">Location.cell</prop>
				<prop key="subregion">Location.sublocation</prop>
				<prop key="region">Location.location</prop>
			</props>
		</property>
		<property name="sizeMappings">
			<props>
				<prop key="postalCode">10</prop>
				<prop key="stateProvince">10</prop>
				<prop key="cityVillage">10</prop>
				<prop key="address1">40</prop>
				<prop key="address2">40</prop>
				<prop key="longitude">10</prop>
				<prop key="latitude">10</prop>
				<prop key="country">10</prop>
			</props>
		</property>
		<property name="lineByLineFormat">
			<list>
				<value>address1</value>
				<value>address2</value>
				<value>cityVillage stateProvince country postalCode</value>
				<value>latitude longitude</value>
			</list>
		</property>
	</bean>

...

Info

These changes will be persisted across restarts, but will NOT be persisted across upgrades.  You will have to redo this every time you upgrade openmrs to a new version

Note: This functionality will change in OpenMRS 1.9+.  Please see the documentation on Address Templates.