Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
mherman22 committed Nov 12, 2024
1 parent 90d4627 commit 46446c3
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,14 @@
public class FhirPersonDaoImpl extends BasePersonDao<Person> implements FhirPersonDao {

@Override
@SuppressWarnings("unchecked")
public List<PersonAttribute> getActiveAttributesByPersonAndAttributeTypeUuid(@Nonnull Person person,
public List<PersonAttribute> getActiveAttributesByPersonAndAttributeTypeUuid(@Nonnull Person person,
@Nonnull String personAttributeTypeUuid) {
OpenmrsFhirCriteriaContext<PersonAttribute, PersonAttribute> criteriaContext = createCriteriaContext(
PersonAttribute.class);
CriteriaBuilder cb = criteriaContext.getCriteriaBuilder();

criteriaContext.addJoin("person", "p",
(from) -> cb.and(cb.equal(from.get("id"), person.getId()), cb.equal(from.get("voided"), false)));
(from) -> cb.and(cb.equal(from.get("personId"), person.getId()), cb.equal(from.get("personVoided"), false)));
criteriaContext.addJoin("attributeType", "pat",
(from) -> cb.and(cb.equal(from.get("uuid"), personAttributeTypeUuid), cb.equal(from.get("retired"), false)));
criteriaContext.addPredicate(cb.equal(criteriaContext.getRoot().get("voided"), false));
Expand Down

0 comments on commit 46446c3

Please sign in to comment.