def intersect_groups_with_user(user, other_user, user_membership=False, other_user_membership=False):
    """Find the intersection of the groups the patient and user belong to."""

    other_group_users = {x.group: x for x in other_user.group_users}