// Required attribute defaults to true if not specified
required = ! "false".equalsIgnoreCase(attributes.get("required"));
if (FIELD_PERSON_NAME.equalsIgnoreCase(field)) {
nameWidget = new NameWidget();
nameErrorWidget = new ErrorWidget();
createWidgets(context, nameWidget, nameErrorWidget,
existingPatient != null && existingPatient.getPersonName() != null ? existingPatient.getPersonName() : null);
}
else if (FIELD_GENDER.equalsIgnoreCase(field)) {