Currently, OpenMRS searches for patients by running some complex hibernate queries against our relational data model. We can get better performance (e.g. like mentioned here) and better functionality (such as searching by more fields) by changing our implementation to be based on hibernate-search.
As part of
TRUNK-2999 we integrated hibernate-search into the platform, and started using it for concept searches. The purpose of this ticket is to do similar work, and start using hibernate-search in our patient and person searches.
Make sure you review the changes that were made as part of
TRUNK-2999. The changes in this ticket will be similar.
- Existing behaviors for searching for a patient are preserved
- Searching by exact patient identifier finds the patient (and no others)
- Searching by a single name component finds patients, sorted in an intelligent order
- Searching by multiple name component finds patients, sorted in an intelligent order
- (To Do: are there more?)
- Typing the value of a person attribute whose type is searchable (see docs) finds the patient.
- Searching by a name fragment and a searchable person attribute returns patients who match both criteria
- Searching for a patient by String uses hibernate-search, instead of plain hibernate queries
- Searching for a person by String uses hibernate-search, instead of plain hibernate queries
- The PatientSearchCriteria class is deprecated
- Searching against a demo database with 100000 patients is measurably faster
This ticket is about making backwards-compatible changes to openmrs-core's patient/person search APIs. We should make sure that any downstream changes have tickets created for them, but they are out of scope for this ticket.
- the registrationcore module can have improved similar patient matching algorithms after this ticket is done
- the namephonetics module may need to be refactored after this ticket is done
- HibernatePersonDAO.getSimilarPeople() should be refactored after this ticket is done
- TODO: more