Skip to content

Commit

Permalink
#13029 - Search by NationalID is not consistently working in all loca…
Browse files Browse the repository at this point in the history
…tions - fix NationalId search from Case and Contact search fields
  • Loading branch information
sergiupacurariu committed Mar 27, 2024
1 parent 9ff8d18 commit 3281027
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,6 @@
import de.symeda.sormas.backend.common.AbstractDomainObject;
import de.symeda.sormas.backend.common.ChangeDateBuilder;
import de.symeda.sormas.backend.common.ChangeDateFilterBuilder;
import de.symeda.sormas.backend.common.ConfigFacadeEjb;
import de.symeda.sormas.backend.common.CriteriaBuilderHelper;
import de.symeda.sormas.backend.common.DeletableAdo;
import de.symeda.sormas.backend.contact.Contact;
Expand Down Expand Up @@ -871,7 +870,9 @@ public <T extends AbstractDomainObject> Predicate createCriteriaFilter(CaseCrite
CriteriaBuilderHelper.ilike(cb, from.get(Case.EXTERNAL_ID), textFilter),
CriteriaBuilderHelper.ilike(cb, from.get(Case.EXTERNAL_TOKEN), textFilter),
CriteriaBuilderHelper.unaccentedIlike(cb, from.get(Case.HEALTH_FACILITY_DETAILS), textFilter),
CriteriaBuilderHelper.unaccentedIlike(cb, from.get(Case.INTERNAL_TOKEN), textFilter)));
CriteriaBuilderHelper.unaccentedIlike(cb, from.get(Case.INTERNAL_TOKEN), textFilter),
//the below field is intentionally added to be available to be checked from two different filter fields
CriteriaBuilderHelper.ilike(cb, joins.getPerson().get(Person.NATIONAL_HEALTH_ID), textFilter)));

filter = CriteriaBuilderHelper.and(cb, filter, likeFilters);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1383,7 +1383,9 @@ public Predicate buildCriteriaFilter(ContactCriteria contactCriteria, ContactQue
CriteriaBuilderHelper.ilikePrecise(cb, casePerson.get(Person.UUID), textFilter + "%"),
CriteriaBuilderHelper.unaccentedIlike(cb, casePerson.get(Person.FIRST_NAME), textFilter),
CriteriaBuilderHelper.unaccentedIlike(cb, casePerson.get(Person.LAST_NAME), textFilter),
phoneNumberPredicate(cb, cqc.getSubqueryExpression(CaseQueryContext.PERSON_PHONE_SUBQUERY), textFilter));
phoneNumberPredicate(cb, cqc.getSubqueryExpression(CaseQueryContext.PERSON_PHONE_SUBQUERY), textFilter),
//the below field is intentionally added to be available to be checked from two different filter fields
CriteriaBuilderHelper.ilike(cb, joins.getPerson().get(Person.NATIONAL_HEALTH_ID), textFilter));
filter = CriteriaBuilderHelper.and(cb, filter, likeFilters);
}
}
Expand Down

0 comments on commit 3281027

Please sign in to comment.