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

getConceptByName should immediately return concept if only one matching concept

    Details

    • Complexity:
      Low

      Description

      The getConceptByName service method (which defers to an underlying DAO method) does a DB query to find all possible matching ConceptNames.

      If it finds a single matching name, it immediately returns the concept associated with that name.

      However, if multiple names are returned, it performs a secondary comparison to determine which concept to return (and logs a warning about a name referencing multiple concepts).

      A slight change should be made here: if multiple names are returned, but they all reference the same concept that concept should be returned without logging a warning. (This can happen quite frequently in the case where a concept's short name is the same as it's fully-specified name).

      This should be as simple as moving the transformNamesToConcepts to be called earlier in the process, and changing the signature of transformNamesToConcepts to return a set, therefore removing duplicates.

      Rafal Korytkowski does this make sense to you?

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                henziger Eric Henziger
                Reporter:
                mogoodrich Mark Goodrich
              • Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 1 hour
                  1h