Uploaded image for project: 'OpenMRS Core'
  1. OpenMRS Core
  2. TRUNK-5379

Cohort Membership: Resolve design inconsistents

    Details

    • Type: Bug
    • Status: Code Review (Initial)
    • Priority: TBD
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Complexity:
      Medium

      Description

      Break the following tasks into subtasks or other tickets that are ready for work:

      1. Make these methods behave like typical Java Collection of membership (excluding voided memberships):

      • contains(Integer patientId) - true if any non-voided membership for patient
      • size() - total number of non-voided memberships
      • isEmpty() - true if size() == 0

      2. Refactor getMemberships() to exclude voided memberships.

      3. Add methods for interacting with active memberships directly at Cohort level:

      • hasActiveMembership(Integer patientId) - true if has active membership for patient
      • activeMembershipSize() - number of active memberships
      • hasNoActiveMemberships() - true if activeMembershipSize() == 0

      4. Implement CohortMembership.equals() to return true if patient, start, end end dates match

      Will not be covered by this ticket:

      • Is "voided" really necessary for CohortMemberships?
      • Unclear what the union, intersect and subtract utility method should do; ie, do they take the dates into account?¬† (I believe right now they don't.)

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                fruether Fred Rue
                Reporter:
                mogoodrich Mark Goodrich
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated: