def indicators(self): """ Return all the dict data source indicator configurations that could be used by a report that uses the same case type/form as this DataSourceConfiguration. """ ret = [] for prop in self.data_source_properties.values(): if prop.type == 'meta': ret.append(make_form_meta_block_indicator( prop.source, prop.column_id )) elif prop.type == "question": ret.append(make_form_question_indicator( prop.source, prop.column_id )) elif prop.type == 'case_property' and prop.source == 'computed/owner_name': ret.append(make_owner_name_indicator(prop.column_id)) elif prop.type == 'case_property': ret.append(make_case_property_indicator( prop.source, prop.column_id )) ret.append({ "display_name": "Count", "type": "count", "column_id": "count" }) return ret
def indicators(self): """ Return all the dict data source indicator configurations that could be used by a report that uses the same case type/form as this DataSourceConfiguration. """ ret = [] for prop in self.data_source_properties.values(): if prop['type'] == 'meta': ret.append( make_form_meta_block_indicator(prop['source'], prop['column_id'])) elif prop['type'] == "question": ret.append( make_form_question_indicator(prop['source'], prop['column_id'])) elif prop['type'] == 'case_property' and prop[ 'source'] == 'computed/owner_name': ret.append(make_owner_name_indicator(prop['column_id'])) elif prop['type'] == 'case_property': ret.append( make_case_property_indicator(prop['source'], prop['column_id'])) ret.append({ "display_name": "Count", "type": "count", "column_id": "count" }) return ret
def get_indicator(self, aggregation, is_multiselect_chart_report=False): column_id = get_column_name( self._property) + "_" + self._get_datatype(aggregation) return make_case_property_indicator( self._property, column_id, datatype=self._get_datatype(aggregation))
def _get_indicator(self, ui_aggregation, is_multiselect_chart_report=False): column_id = get_column_name(self._property, suffix=self._get_datatype(ui_aggregation)) return make_case_property_indicator( self._property, column_id, datatype=self._get_datatype(ui_aggregation))
def get_case_data_source(app, case_type): prop_map = get_case_properties(app, [case_type], defaults=DEFAULT_CASE_PROPERTY_DATATYPES.keys()) return DataSourceConfiguration( domain=app.domain, referenced_doc_type="CommCareCase", table_id=_clean_table_name(app.domain, case_type), display_name=case_type, configured_filter=make_case_data_source_filter(case_type), configured_indicators=[make_case_property_indicator(property) for property in prop_map[case_type]], )
def get_case_data_source(app, case_type): prop_map = get_case_properties(app, [case_type], defaults=list(DEFAULT_CASE_PROPERTY_DATATYPES)) return DataSourceConfiguration( domain=app.domain, referenced_doc_type='CommCareCase', table_id=_clean_table_name(app.domain, case_type), display_name=case_type, configured_filter=make_case_data_source_filter(case_type), configured_indicators=[ make_case_property_indicator(property) for property in prop_map[case_type] ] )
def get_case_data_source(app, case_type): property_builder = ParentCasePropertyBuilder(app, DEFAULT_CASE_PROPERTY_DATATYPES.keys()) return DataSourceConfiguration( domain=app.domain, referenced_doc_type='CommCareCase', table_id=_clean_table_name(app.domain, case_type), display_name=case_type, configured_filter=make_case_data_source_filter(case_type), configured_indicators=[ make_case_property_indicator(property) for property in property_builder.get_properties(case_type) ] )
def _get_indicator(self, ui_aggregation, is_multiselect_chart_report=False): column_id = get_column_name(self._property, suffix=self._get_datatype(ui_aggregation)) return make_case_property_indicator(self._property, column_id, datatype=self._get_datatype(ui_aggregation))