Details
-
Bug
-
Status: Closed
-
Should
-
Resolution: Fixed
-
None
-
None
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+."))
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);
}