Example #1
0
    def filter_values(self):
        filter_values = super(BaseSqlData, self).filter_values

        for k, v in LOCATION_HIERARCHY.iteritems():
            clean_IN_filter_value(filter_values, v['prop'])

        return filter_values
 def __init__(self, config=None, loc_level='state', show_test=False):
     super(AggCCSRecordMonthlyDataSource, self).__init__(config)
     self.loc_key = '%s_id' % loc_level
     self.excluded_states = get_test_state_locations_id(self.domain)
     self.config['excluded_states'] = self.excluded_states
     clean_IN_filter_value(self.config, 'excluded_states')
     self.show_test = show_test
 def __init__(self, config=None, loc_level='state', show_test=False):
     super(AggCCSRecordMonthlyDataSource, self).__init__(config)
     self.loc_key = '%s_id' % loc_level
     self.excluded_states = get_test_state_locations_id(self.domain)
     self.config['excluded_states'] = self.excluded_states
     clean_IN_filter_value(self.config, 'excluded_states')
     self.show_test = show_test
Example #4
0
    def filter_values(self):
        filter_values = super(BaseSqlData, self).filter_values

        for k, v in six.iteritems(LOCATION_HIERARCHY):
            clean_IN_filter_value(filter_values, v['prop'])

        return filter_values
Example #5
0
    def filter_values(self):
        filter_values = dict(**super(CareSqlData, self).filter_values)

        for column_name in list(self.geography_config.keys()) + [
                'domains', 'practices', 'schedule', 'cbt_name'
        ]:
            clean_IN_filter_value(filter_values, column_name)
        return filter_values
Example #6
0
 def __init__(self, config=None, loc_level=1, show_test=False, beta=False):
     self.config = config
     self.loc_level = loc_level
     self.excluded_states = get_test_state_locations_id(self.domain)
     self.config['excluded_states'] = self.excluded_states
     clean_IN_filter_value(self.config, 'excluded_states')
     self.show_test = show_test
     self.beta = beta
Example #7
0
 def filter_values(self):
     filter_values = {
         'start_date': self.config.start_date,
         'end_date': self.config.end_date,
         'locations_id': self.config.locations_id
     }
     clean_IN_filter_value(filter_values, 'locations_id')
     return filter_values
Example #8
0
 def __init__(self, config=None, loc_level=1, show_test=False, beta=False):
     self.config = config
     self.loc_level = loc_level
     self.excluded_states = get_test_state_locations_id(self.domain)
     self.config['excluded_states'] = self.excluded_states
     clean_IN_filter_value(self.config, 'excluded_states')
     self.show_test = show_test
     self.beta = beta
Example #9
0
 def filter_values(self):
     filter_values = {
         'start_date': self.config.start_date,
         'end_date': self.config.end_date,
         'locations_id': self.config.locations_id
     }
     clean_IN_filter_value(filter_values, 'locations_id')
     return filter_values
Example #10
0
 def filter_values(self):
     filter_values = super().filter_values
     for key in self.SINGLE_SELECT_COLS:
         if filter_values.get(key):
             filter_values[key] = filter_values[key][0]
     for key in self.MULTI_SELECT_COLS:
         clean_IN_filter_value(filter_values, key)
     if self._age_ranges:
         filter_values.update(self._get_age_range_filter_values())
     return filter_values
Example #11
0
 def __init__(self, domain, filter_values):
     config = {
         'domain': domain,
     }
     for (key, value) in filter_values.items():
         if key == 'date_of_data_collection':
             continue
         elif key and value:
             self.__setattr__(key, [x.value for x in value])
             config[key] = self.__getattribute__(key)
             clean_IN_filter_value(config, key)
     self.config = config
Example #12
0
 def __init__(self, domain, filter_values):
     config = {
         'domain': domain,
     }
     for (key, value) in filter_values.items():
         if key == 'date_of_data_collection':
             continue
         elif key and value:
             self.__setattr__(key, [x.value for x in value])
             config[key] = self.__getattribute__(key)
             clean_IN_filter_value(config, key)
     self.config = config
Example #13
0
 def filter_values(self):
     users = tuple([user.user_id for user in self.users])
     config = dict(
         startdate=self.datespan.startdate,
         enddate=self.datespan.enddate,
         users=users
     )
     return clean_IN_filter_value(config, "users")
Example #14
0
 def __init__(self, config=None, loc_level='state', show_test=False, beta=False):
     super(AggChildHealthMonthlyDataSource, self).__init__(config)
     self.excluded_states = get_test_state_locations_id(self.domain)
     self.loc_key = '%s_id' % loc_level
     self.beta = beta
     self.config.update({
         'age_0': '0',
         'age_6': '6',
         'age_12': '12',
         'age_24': '24',
         'age_36': '36',
         'age_48': '48',
         'age_60': '60',
         'age_72': '72',
         'excluded_states': self.excluded_states
     })
     clean_IN_filter_value(self.config, 'excluded_states')
     self.show_test = show_test
 def __init__(self, config=None, loc_level='state', show_test=False, beta=False):
     super(AggChildHealthMonthlyDataSource, self).__init__(config)
     self.excluded_states = get_test_state_locations_id(self.domain)
     self.loc_key = '%s_id' % loc_level
     self.beta = beta
     self.config.update({
         'age_0': '0',
         'age_6': '6',
         'age_12': '12',
         'age_24': '24',
         'age_36': '36',
         'age_48': '48',
         'age_60': '60',
         'age_72': '72',
         'excluded_states': self.excluded_states
     })
     clean_IN_filter_value(self.config, 'excluded_states')
     self.show_test = show_test
Example #16
0
 def __init__(self, config, data_source=None, show_test=False, beta=False):
     super(NationalAggregationDataSource, self).__init__(config)
     excluded_states = get_test_state_locations_id(self.config['domain'])
     self.config.update({
         'aggregation_level': 1,
         'age_0': '0',
         'age_6': '6',
         'age_12': '12',
         'age_24': '24',
         'age_36': '36',
         'age_48': '48',
         'age_60': '60',
         'age_72': '72',
         'excluded_states': excluded_states
     })
     clean_IN_filter_value(self.config, 'excluded_states')
     self.data_source = data_source
     self.excluded_states = excluded_states
     self.beta = beta
     self.show_test = show_test
 def __init__(self, config, data_source=None, show_test=False, beta=False):
     super(NationalAggregationDataSource, self).__init__(config)
     excluded_states = get_test_state_locations_id(self.config['domain'])
     self.config.update({
         'aggregation_level': 1,
         'age_0': '0',
         'age_6': '6',
         'age_12': '12',
         'age_24': '24',
         'age_36': '36',
         'age_48': '48',
         'age_60': '60',
         'age_72': '72',
         'excluded_states': excluded_states
     })
     clean_IN_filter_value(self.config, 'excluded_states')
     self.data_source = data_source
     self.excluded_states = excluded_states
     self.beta = beta
     self.show_test = show_test
Example #18
0
    def filter_values(self):
        filter_values = super(CareSqlData, self).filter_values

        for column_name in self.geography_config.keys() + ['domains', 'practices', 'schedule']:
            clean_IN_filter_value(filter_values, column_name)
        return filter_values
Example #19
0
 def filter_values(self):
     return clean_IN_filter_value(
         super(NutritionBirthWeightDetails, self).filter_values,
         'mother_ids')
Example #20
0
 def filter_values(self):
     return clean_IN_filter_value(
         super(ChildrenDeaths, self).filter_values, 'mother_ids')
Example #21
0
 def __init__(self, config=None):
     super(ChampSqlData, self).__init__(config)
     if 'user_id' in self.config and self.config['user_id']:
         clean_IN_filter_value(self.config, 'user_id')
Example #22
0
 def filter_values(self):
     clean_IN_filter_value(self.config, 'awc_id')
     return self.config
Example #23
0
 def filter_values(self):
     users = tuple([user.user_id for user in self.users])
     config = dict(startdate=self.datespan.startdate,
                   enddate=self.datespan.enddate,
                   users=users)
     return clean_IN_filter_value(config, "users")
Example #24
0
 def filter_values(self):
     return clean_IN_filter_value(super(ChildrenDeaths, self).filter_values, 'mother_ids')
Example #25
0
 def filter_values(self):
     if 'user_id' in self.config and self.config['user_id']:
         clean_IN_filter_value(self.config, 'user_id')
     if 'district' in self.config and self.config['district']:
         clean_IN_filter_value(self.config, 'district')
     if 'cbo' in self.config and self.config['cbo']:
         clean_IN_filter_value(self.config, 'cbo')
     if 'clienttype' in self.config and self.config['clienttype']:
         clean_IN_filter_value(self.config, 'clienttype')
     if 'client_type' in self.config and self.config['client_type']:
         clean_IN_filter_value(self.config, 'client_type')
     if 'userpl' in self.config and self.config['userpl']:
         clean_IN_filter_value(self.config, 'userpl')
     if 'age_range' in self.config and self.config['age_range']:
         clean_IN_filter_value(self.config, 'age_range')
     if 'age' in self.config and self.config['age']:
         for idx, age in enumerate(self.config['age']):
             self.config['age_start_{}'.format(idx)] = int(age['start'])
             self.config['age_end_{}'.format(idx)] = int(age['end'])
         del self.config['age']
     if 'hiv_status' in self.config and self.config['hiv_status']:
         clean_IN_filter_value(self.config, 'hiv_status')
     return self.config
Example #26
0
 def filter_values(self):
     return clean_IN_filter_value(super(DeliveryLiveBirthDetails, self).filter_values, 'mother_ids')
Example #27
0
 def filter_values(self):
     if 'user_id' in self.config and self.config['user_id']:
         clean_IN_filter_value(self.config, 'user_id')
     if 'district' in self.config and self.config['district']:
         clean_IN_filter_value(self.config, 'district')
     if 'cbo' in self.config and self.config['cbo']:
         clean_IN_filter_value(self.config, 'cbo')
     if 'clienttype' in self.config and self.config['clienttype']:
         clean_IN_filter_value(self.config, 'clienttype')
     if 'client_type' in self.config and self.config['client_type']:
         clean_IN_filter_value(self.config, 'client_type')
     if 'userpl' in self.config and self.config['userpl']:
         clean_IN_filter_value(self.config, 'userpl')
     if 'age_range' in self.config and self.config['age_range']:
         clean_IN_filter_value(self.config, 'age_range')
     if 'age' in self.config and self.config['age']:
         for idx, age in enumerate(self.config['age']):
             self.config['age_start_{}'.format(idx)] = int(age['start'])
             self.config['age_end_{}'.format(idx)] = int(age['end'])
         del self.config['age']
     if 'hiv_status' in self.config and self.config['hiv_status']:
         clean_IN_filter_value(self.config, 'hiv_status')
     return self.config
Example #28
0
 def filter_values(self):
     clean_IN_filter_value(self.config, 'awc_id')
     return self.config
Example #29
0
 def filter_values(self):
     return clean_IN_filter_value(super(NutritionBirthWeightDetails, self).filter_values, 'mother_ids')
Example #30
0
 def filter_values(self):
     filter_values = super(UsersIdsData, self).filter_values
     for column_name in ['awc', 'gp', 'block']:
         if filter_values.get(column_name):
             return clean_IN_filter_value(filter_values, column_name)
     return filter_values
Example #31
0
 def filter_values(self):
     return clean_IN_filter_value(
         super(PatientListReport, self).filter_values, 'owner_id')
Example #32
0
 def filter_values(self):
     return clean_IN_filter_value(
         super(BaseSqlData, self).filter_values, 'archived_locations')
Example #33
0
 def filter_values(self):
     return clean_IN_filter_value(super(DeliveryLiveBirthDetails, self).filter_values, 'mother_ids')
Example #34
0
 def filter_values(self):
     filter_values = super(UsersIdsData, self).filter_values
     for column_name in ["awc", "gp", "block"]:
         if filter_values.get(column_name):
             return clean_IN_filter_value(filter_values, column_name)
     return filter_values
Example #35
0
 def filter_values(self):
     return clean_IN_filter_value(super(PatientListReport, self).filter_values, 'owner_id')
Example #36
0
 def filter_values(self):
     filter_values = super(UsersIdsData, self).filter_values
     for column_name in ['awc', 'gp', 'block']:
         if filter_values.get(column_name):
             return clean_IN_filter_value(filter_values, column_name)
     return filter_values
Example #37
0
 def filter_values(self):
     return clean_IN_filter_value(super(BaseSqlData, self).filter_values, 'archived_locations')
Example #38
0
 def filter_values(self):
     return clean_IN_filter_value(super().filter_values, 'owner_id')