Uploaded image for project: 'HTML Widgets'
  1. HTML Widgets
  2. HTMLWIDGETS-21

ConceptSearchController needs to replace ConceptWord with ConceptSearchResult for 1.11

    Details

    • Type: Task
    • Status: Closed
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.6.8
    • Labels:
    • Complexity:
      Undetermined

      Description

      For OpenMRS version 1.11 and above, as you can see here: https://github.com/openmrs/openmrs-module-htmlwidgets/blob/master/omod/src/main/java/org/openmrs/module/htmlwidgets/web/controller/ConceptSearchController.java

      List<ConceptWord> words = Context.getConceptService().getConceptWords(query, l, false, includeClasses, null, null, null, questionConcept, null, null);
          	for (Iterator<ConceptWord> i = words.iterator(); i.hasNext();) {
          		ConceptWord w = i.next();
          		String ds = w.getConcept().getDisplayString();
          		if (w.getConceptName().isPreferred() || w.getConceptName().getName().equalsIgnoreCase(ds)) {
          			out.print(w.getConceptName().getName());
          		}
          		else {
          			out.print( w.getConcept().getDisplayString() + " (" + w.getConceptName().getName() + ")");
          		}
          		out.print("|" + w.getConcept().getId() + (i.hasNext() ? "\n" : ""));
          	}
      

      Needs to be replaced with something like:

      List<ConceptSearchResult> results = Context.getConceptService().getConcepts(query, l, false, includeClasses, null, null, null, questionConcept, null, null);
          	for (Iterator<ConceptSearchResult> i = results.iterator(); i.hasNext();) {
          		ConceptSearchResult res = i.next();
          		String ds = res.getConcept().getDisplayString();
          		if (res.getConceptName().isPreferred() || res.getConceptName().getName().equalsIgnoreCase(ds)) {
          			out.print(res.getConceptName().getName());
          		}
          		else {
          			out.print( res.getConcept().getDisplayString() + " (" + res.getConceptName().getName() + ")");
          		}
          		out.print("|" + res.getConcept().getId() + (i.hasNext() ? "\n" : ""));
          	}
      

      Without addressing this, the reporting module and others which depend on htmlwidgets for concept searches do not return any concepts on 1.11

      You can reproduce this problem on the page: http://uat01.openmrs.org:8080/openmrs/module/reporting/cohorts/editCohortDefinition.form?type=org.openmrs.module.reporting.cohort.definition.CodedObsCohortDefinition

      Do we need to be backwards compatible?

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                raff Rafal Korytkowski
                Reporter:
                dkayiwa Daniel Kayiwa
              • Votes:
                0 Vote for this issue
                Watchers:
                8 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: