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

Faster alternative to regular expression searching for patient identifiers

    XMLWordPrintable

Details

    • New Feature
    • Status: Closed
    • Should
    • Resolution: Fixed
    • None
    • OpenMRS 1.6.0
    • None
    • Low

    Description

      The current approach for handling patient identifier searches using admin-defined regular expressions is too slow. Regular expression (REGEXP) searches (at least in MySQL) do not use indexes and, therefore, unacceptably slow down the system.

      A quick fix is to clear out the patient.identifierRegex global property.

      A long-term fix would be to replace the regular expression search with the ability to define a list of search patterns. We need to be able to accommodate leading zeroes and identifier with or without a hyphen.

      Add a patient.identifierSearchPattern global property that allows for @SEARCH@, @SEARCH-1@ (search query without last character), and @CHECKDIGIT@ (last character) with commas separating multiple values.

      For example, setting patient.identifierSearchPattern to "@SEARCH@,0@SEARCH@,@SEARCH-1@@CHECKDIGIT@,0@SEARCH-1@@CHECKDIGIT@" would turn a request for "4127" into a search for "in ('4127','04127','412-7','0412-7')".

      Related tickets: TRAC-142, TRAC-1148, TRAC-1625, TRAC-1802

      Gliffy Diagrams

        Attachments

          Activity

            People

              bwolfe Ben Wolfe
              burke Burke Mamlin
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: