コード例 #1
0
 def data_providers(self):
     config = self.report_config
     if self.location:
         if self.location.location_type.name.upper() == 'FACILITY':
             self.use_datatables = True
             return [
                 InventoryHistoryData(config=config),
                 RandRHistory(config=config),
                 Notes(config=config),
                 RecentMessages(config=config),
                 RegistrationData(config=dict(loc_type='FACILITY',
                                              **config),
                                  css_class='row_chart_all'),
                 RegistrationData(config=dict(loc_type='DISTRICT',
                                              **config),
                                  css_class='row_chart_all'),
                 RegistrationData(config=dict(loc_type='REGION', **config),
                                  css_class='row_chart_all')
             ]
         else:
             self.use_datatables = False
             return [
                 RandRSubmissionData(config=config),
                 DistrictSummaryData(config=config),
                 SohSubmissionData(config=config),
                 DeliverySubmissionData(config=config),
                 ProductAvailabilitySummary(config=config,
                                            css_class='row_chart_all')
             ]
     else:
         return []
コード例 #2
0
ファイル: supervision.py プロジェクト: ye-man/commcare-hq
    def data_providers(self):
        config = self.report_config
        data_providers = []
        if config['org_summary']:
            location = SQLLocation.objects.get(
                location_id=config['org_summary'][0].location_id)

            data_providers = [
                SupervisionSummaryData(config=config,
                                       css_class='row_chart_all'),
            ]

            if location.location_type.name.upper() == 'DISTRICT':
                data_providers.append(
                    DistrictSupervisionData(config=config,
                                            css_class='row_chart_all'))
            elif location.location_type.name.upper() == 'FACILITY':
                return [
                    InventoryHistoryData(config=config),
                    RandRHistory(config=config),
                    Notes(config=config),
                    RecentMessages(config=config, css_class='row_chart_all'),
                    RegistrationData(config=dict(loc_type='FACILITY',
                                                 **config),
                                     css_class='row_chart_all'),
                    RegistrationData(config=dict(loc_type='DISTRICT',
                                                 **config),
                                     css_class='row_chart_all'),
                    RegistrationData(config=dict(loc_type='REGION', **config),
                                     css_class='row_chart_all')
                ]
            else:
                data_providers.append(
                    SupervisionData(config=config, css_class='row_chart_all'))
        return data_providers
コード例 #3
0
ファイル: stock_on_hand.py プロジェクト: xbryanc/commcare-hq
    def data_providers(self):
        from custom.ilsgateway.tanzania.reports.facility_details import (InventoryHistoryData,
            RegistrationData, RandRHistory, Notes, RecentMessages)

        config = self.report_config
        data_providers = []
        if config['org_summary']:
            location = SQLLocation.objects.get(location_id=config['org_summary'][0].location_id)

            data_providers = [
                SohSubmissionData(config=config, css_class='row_chart'),
                ProductSelectionPane(config=config, css_class='row_chart'),
                ProductAvailabilitySummary(config=config, css_class='row_chart_all', chart_stacked=False),
            ]

            if location.location_type.name.upper() == 'DISTRICT':
                data_providers.append(DistrictSohPercentageTableData(config=config, css_class='row_chart_all'))
            elif location.location_type.name.upper() == 'FACILITY':
                return [
                    InventoryHistoryData(config=config),
                    RandRHistory(config=config),
                    Notes(config=config),
                    RecentMessages(config=config),
                    RegistrationData(config=dict(loc_type='FACILITY', **config), css_class='row_chart_all'),
                    RegistrationData(config=dict(loc_type='DISTRICT', **config), css_class='row_chart_all'),
                    RegistrationData(config=dict(loc_type='REGION', **config), css_class='row_chart_all')
                ]
            else:
                data_providers.append(SohPercentageTableData(config=config, css_class='row_chart_all'))
        return data_providers
コード例 #4
0
 def data_providers(self):
     config = self.report_config
     data_providers = []
     if config['location_id']:
         data_providers = [
             RandRSubmissionData(config=config, css_class='row_chart_all')
         ]
         location = get_location(config['location_id'])
         if location.location_type_name in ['REGION', 'MSDZONE', 'MOHSW']:
             data_providers.append(
                 RRStatus(config=config, css_class='row_chart_all'))
         elif location.location_type_name == 'FACILITY':
             return [
                 InventoryHistoryData(config=config),
                 RandRHistory(config=config),
                 Notes(config=config),
                 RecentMessages(config=config),
                 RegistrationData(config=dict(loc_type='FACILITY',
                                              **config),
                                  css_class='row_chart_all'),
                 RegistrationData(config=dict(loc_type='DISTRICT',
                                              **config),
                                  css_class='row_chart_all'),
                 RegistrationData(config=dict(loc_type='REGION', **config),
                                  css_class='row_chart_all')
             ]
         else:
             data_providers.append(
                 RRReportingHistory(config=config,
                                    css_class='row_chart_all'))
     return data_providers
コード例 #5
0
ファイル: delivery.py プロジェクト: ekush/commcare-hq
 def data_providers(self):
     data_providers = [
         DeliverySubmissionData(config=self.report_config,
                                css_class='row_chart_all'),
     ]
     config = self.report_config
     if config['location_id']:
         location = SQLLocation.objects.get(
             location_id=config['location_id'])
         if location.location_type.name.upper() in [
                 'REGION', 'MSDZONE', 'MOHSW'
         ]:
             data_providers.append(
                 DeliveryData(config=config, css_class='row_chart_all'))
             data_providers.append(
                 LeadTimeHistory(config=config, css_class='row_chart_all'))
         elif location.location_type.name.upper() == 'FACILITY':
             return [
                 InventoryHistoryData(config=config),
                 RandRHistory(config=config),
                 Notes(config=config),
                 RecentMessages(config=config),
                 RegistrationData(config=dict(loc_type='FACILITY',
                                              **config),
                                  css_class='row_chart_all'),
                 RegistrationData(config=dict(loc_type='DISTRICT',
                                              **config),
                                  css_class='row_chart_all'),
                 RegistrationData(config=dict(loc_type='REGION', **config),
                                  css_class='row_chart_all')
             ]
         else:
             data_providers.append(
                 DeliveryStatus(config=config, css_class='row_chart_all'))
     return data_providers