}
@Override
public PersonAddress getValue(FormEntryContext context, HttpServletRequest request) {
PersonAddress returnPersonAddress = new PersonAddress();
returnPersonAddress.setAddress1(getWidgetValue("address1", context, request));
returnPersonAddress.setAddress2(getWidgetValue("address2", context, request));
returnPersonAddress.setCityVillage(getWidgetValue("cityVillage", context, request));
returnPersonAddress.setStateProvince(getWidgetValue("stateProvince", context, request));
returnPersonAddress.setPostalCode(getWidgetValue("postalCode", context, request));
returnPersonAddress.setCountry(getWidgetValue("country", context, request));
returnPersonAddress.setLatitude(getWidgetValue("latitude", context, request));
returnPersonAddress.setLongitude(getWidgetValue("longitude", context, request));
returnPersonAddress.setCountyDistrict(getWidgetValue("countyDistrict", context, request));
returnPersonAddress.setNeighborhoodCell(getWidgetValue("neighborhoodCell", context, request));
returnPersonAddress.setTownshipDivision(getWidgetValue("townshipDivision", context, request));
returnPersonAddress.setSubregion(getWidgetValue("subregion", context, request));
returnPersonAddress.setRegion(getWidgetValue("region", context, request));
if (context.getMode() == Mode.EDIT) {
PersonAddress preferedAddress = context.getExistingPatient().getPersonAddress();
if (preferedAddress != null && returnPersonAddress.equalsContent(preferedAddress)) {
returnPersonAddress = preferedAddress;
}
}