Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fixing bug where all reporting module cohort queries returned empty
results sets as a result of: Expanded cohort details - TRUNK-4906
  • Loading branch information
dkayiwa committed Jan 19, 2017
1 parent 85f2966 commit 8da90bf
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions api/src/main/java/org/openmrs/Cohort.java
Expand Up @@ -314,11 +314,18 @@ public void setName(String name) {
}

public Set<Integer> getMemberIds() {
memberIds = new TreeSet<Integer>();
for (CohortMembership member : getMembers()) {
memberIds.add(member.getPatient().getPatientId());
}
return memberIds;
}

public void setMemberIds(Set<Integer> memberIds) {
this.memberIds = new TreeSet<Integer>(memberIds);
for (Integer id : memberIds) {
addMembership(new CohortMembership(new Patient(id)));
}
}

public Collection<CohortMembership> getMembers() {
Expand Down

2 comments on commit 8da90bf

@djazayeri
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dkayiwa do you remember what triggered this change?

It makes me think we've changed some API in a breaking way.

fyi @wluyima

@dkayiwa
Copy link
Member Author

@dkayiwa dkayiwa commented on 8da90bf Apr 13, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@djazayeri yes i do. When running the old cohort builder, searches did not return any results.

Please sign in to comment.