use of org.openmrs.module.coreapps.AddressSupportCompatibility in project openmrs-module-coreapps by openmrs.
the class FormatAddressFragmentController method controller.
public void controller(FragmentConfiguration config, FragmentModel model) {
config.require("address");
PersonAddress address = (PersonAddress) config.getAttribute("address");
AddressSupportCompatibility addressSupport = Context.getRegisteredComponent("coreapps.AddressSupportCompatibility", AddressSupportCompatibility.class);
Set<String> tokens = addressSupport.getNameMappings().keySet();
List<String> formattedLines = new ArrayList<String>();
for (String lineFormat : addressSupport.getLineByLineFormat()) {
formattedLines.add(replaceWithProperties(lineFormat, tokens, address));
}
model.addAttribute("lines", formattedLines);
}
Aggregations