def _get_services_time(self): services = [service for service in service_list() if service.service.include_in_reports] filtering = self.__default_service_filtering() total_time_spent = 0 for service in services: enc_ids = service.objects.filter(**filtering).values_list('encounter__id', flat=True) total_time_spent += TimeDotation.time_spent_on_encounters(enc_ids, service) return total_time_spent
def test_include_in_reports(self): classes = [s for s in service_list() if s.service.include_in_reports] stat_classes = [s[0] for s in ServiceReport()._get_service_stats()] self.assertEqual(classes, stat_classes)
def _get_service_stats(self): return [ service.get_stats(self.filtering) for service in service_list(self.person) if service.service.include_in_reports ]
def _get_services(self): services = [service for service in service_list(self.person, diseases_last=True) if service.service.include_in_reports] return services