else {
valueWidget = new ConceptSearchAutocompleteWidget(conceptAnswers, cptClasses);
}
} else if (parameters.get("answerDrugs") != null) {
// we support searching through all drugs via AJAX
RemoteJsonAutocompleteWidget widget = new RemoteJsonAutocompleteWidget("/" + WebConstants.WEBAPP_NAME + "/module/htmlformentry/drugSearch.form");
widget.setValueTemplate("Drug:{{id}}");
if (parameters.get("displayTemplate") != null) {
widget.setDisplayTemplate(parameters.get("displayTemplate"));
} else {
widget.setDisplayTemplate("{{name}}");
}
if (existingObs != null && existingObs.getValueDrug() != null) {
widget.setInitialValue(new Option(existingObs.getValueDrug().getName(), existingObs.getValueDrug().getDrugId().toString(), true));
}
valueWidget = widget;
} else {
// Show Radio Buttons if specified, otherwise default to Drop