Details
-
Bug
-
Status: Ready for Work
-
Should
-
Resolution: Unresolved
-
Core 2.1.0
-
None
-
None
Description
Original Bug Report
I am running openmrs Version: 2.1.2 and i am attempting to create a new cohort of patients with a certain encounter type - which is successful but returns 0 results yet the database has the information.
Dev Notes:
The cohort builder's CachingPatientFilter fetches a cohort of patients that match the selected criteria. And then calls Cohort.intersect() with another cohort containing all patients. This lead to allPatientsCohort.getMemberships().retainAll(selectedPatientsCohort.getMemberships()) which eventually calls CohortMembership.compareTo()
Proposed Solution
Change the new CohortMembership design to allow null start dates, and use this as the default. See: https://talk.openmrs.org/t/more-changes-to-the-new-cohort-membership-model/15818
Acceptance Criteria:
- drop the not-null constraint on CohortMembership.startDate
- remove any Java logic that defaults CohortMembership.startDate to new Date(), and instead default it to null.
- Cohort.intersect should behave in a way that makes sense if you give it {Patient 123, startDate Jan 1} and {Patient 123, startDate Feb 15}.
I would be satisfied if the output is either a cohort with {Patient 123, startDate Feb 15}, or else a cohort with {Patient 123, startDate null}
but the dev who works on this can propose anything else that makes sense.
Gliffy Diagrams
Attachments
Issue Links
- is caused by
-
TRUNK-4906 Expanded cohort details
-
- Closed
-
- is related to
-
TRUNK-5375 New Core 2.1 Cohort module significantly slows down Cohort manipulation
-
- Closed
-
- relates to
-
TRUNK-5379 Cohort Membership: Resolve design inconsistents
-
- Closed
-
-
TRUNK-5211 Cohort membership should allow null start date, and should default to this
-
- Closed
-
-
TRUNK-5380 Cohort Membership: Performance Issues
-
- Closed
-
- resolves
-
RCM-106 Patient searches return 0 results on platform 2.1
-
- Closed
-
- links to