def add_case_total_legacy(self):
        logger.debug('Adding legacy totals')
        results = CaseData.objects \
            .values('user_id') \
            .exclude(type=self.cc_case_type) \
            .filter(
                domain=self.domain,
                closed=False,
                user_id__in=self.users_needing_data) \
            .annotate(count=Count('case_id'))

        self._add_data(results, LEGACY_TOTAL_CASES)
Count of cases per user that are currently open (legacy indicator).
dataset/ETHPy150Open dimagi/commcare-hq/corehq/apps/callcenter/indicator_sets.py/CallCenterIndicators.add_case_total_legacy