Skip to content

Commit

Permalink
COH-57 Cohort members with filled end dates should not be returned
Browse files Browse the repository at this point in the history
  • Loading branch information
dkayiwa committed Mar 4, 2024
1 parent 296006b commit c8d837c
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,11 @@ public Collection<CohortMember> findCohortMembersByCohortUuid(String cohortUuid)
@Override
@Transactional(readOnly = true)
public Collection<CohortMember> findCohortMembersByPatientUuid(String patientUuid) {
return cohortMemberDao.findBy(
PropValue.builder().property("uuid").associationPath(Optional.of("patient")).value(patientUuid).build());
Criteria criteria = cohortMemberDao.createCriteria();
criteria.createAlias("patient", "patient");
criteria.add(Restrictions.eq("patient.uuid", patientUuid));
criteria.add(Restrictions.isNull("endDate"));
return criteria.list();
}

@Override
Expand Down

0 comments on commit c8d837c

Please sign in to comment.