Uploaded image for project: 'OpenMRS Core'
  1. OpenMRS Core
  2. TRUNK-4763

List<ConceptSearchResult> getConcepts(String phrase... can return the same concept twice

    XMLWordPrintable

    Details

    • Complexity:
      Medium

      Description

      It's possible for the ConceptService API method:

      List<ConceptSearchResult> getConcepts(String phrase, List<Locale> locales, boolean includeRetired,
      	        List<ConceptClass> requireClasses, List<ConceptClass> excludeClasses, List<ConceptDatatype> requireDatatypes,
      	        List<ConceptDatatype> excludeDatatypes, Concept answersToConcept, Integer start, Integer size)
      

      ... to return two search results for the same concept. This is because of an intricacy of the underlying query--although the query groups by concept id and specifies concept id DISTINCT, because it also groups by concept word, it only removes duplicates where both the concept word AND the concept id are duplicate.

      That is why the current unit test for this use case passes--in the test the sample string matches the same concept word twice. With a slight modification, the test will fail.

        Gliffy Diagrams

          Attachments

            Activity

              People

              Assignee:
              mogoodrich Mark Goodrich
              Reporter:
              mogoodrich Mark Goodrich
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - 2 hours
                  2h
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 2 hours
                  2h