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

Encounter search will not match on id unless it contains digits

    Details

    • Complexity:
      Low

      Description

      I found this by code inspection. It looks wrong
      In HibernateEncounterDAO.createEncounterByQueryCriteria, there are two main clauses: one for if an identifier argument is provided, and one not. In the case where the identifier is not supplied, the query is supposed to match either patient name or identifier. However the code seems to choose which based on whether there is a digit in the text:

      } else {
      String name = null;
      String identifier = null;
      if (query.matches(".
      d+.
      "))

      { identifier = query; }

      else

      { // there is no number in the string, search on name name = query; }

      criteria = new PatientSearchCriteria(sessionFactory, criteria).prepareCriteria(name, identifier,
      new ArrayList<PatientIdentifierType>(), false, orderByNames, false);
      }

        Gliffy Diagrams

          Attachments

            Attachments-Category-Modification

              Activity

                People

                • Assignee:
                  sashu2014 Sam Shuster
                  Reporter:
                  denised Denise Draper
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  5 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: