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

Concept search should support row per Concept and row per ConceptName search modes

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Waiting on Information
    • Priority: TBD
    • Resolution: Unresolved
    • Affects Version/s: OpenMRS 1.9.8, Platform 1.10.0
    • Fix Version/s: None
    • Component/s: None
    • Complexity:
      Low

      Description

      In 1.10.x and earlier versions ConceptSearchResults are returned as one row per concept, we need to add an extra method to return one row per concept name search results.

      TODOs:

      1. Mark ConceptSearchResult.transientWeight as deprecated in 1.11+ because it is not needed
      2. In 1.11+, find a way to ask lucene for the matched term in the concept name
      3. In 1.10.x, 1.9.x, 1.8.x, the criteria for the corresponding concept search method in the DAO needs to be updated to allow returning multiple names for the concept. We would need to remove a hacky line in HibernateConceptDAO that picks the name that was entered first so that the criteria returns duplicate concepts but we filter them out as we create the ConceptSearchResult objects
      4. Add the methods below to ConceptService (The method names are just suggestions, they can be something else more intuitive)
        //this can return multiple names belonging to the same concept
        public List<ConceptSearchResult> getConceptNames(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)
        	        throws APIException;
        
        
        public Integer getCountOfConceptNames(String phrase, List<Locale> locales, boolean includeRetired,
        	        List<ConceptClass> requireClasses, List<ConceptClass> excludeClasses, List<ConceptDatatype> requireDatatypes,
        	        List<ConceptDatatype> excludeDatatypes, Concept answersToConcept);
        

      Extra Credit

      1. Update the concept search widget and autocomplete to have an option that allows a user to toggle between row per concept and row per concept names search modes

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned
              Reporter:
              wyclif Wyclif Luyima
              Votes:
              1 Vote for this issue
              Watchers:
              6 Start watching this issue

                Dates

                Created:
                Updated: