Exemplo n.º 1
0
    def group_name_fn(self, group_name):
        text = None
        if is_mapping(group_name, self.domain):
            self.request_params['type_value_chain'] = group_name
            self.request_params['group_by'] = 'domain'
            text = next((item for item in get_mapping(self.domain)
                         if item['val'] == group_name), None)['text']

        if is_domain(group_name, self.domain):
            self.request_params['type_domain'] = group_name
            self.request_params['group_by'] = 'practice'
            text = next((item for item in get_domains(self.domain)
                         if item['val'] == group_name), None)['text']

        if is_practice(group_name, self.domain):
            # TODO practices should probably redirect to other report
            self.request_params['type_practice'] = group_name

            text = next((item for item in get_pracices(self.domain)
                         if item['val'] == group_name), None)['text']

        from custom.care_pathways.reports.adoption_bar_char_report import AdoptionBarChartReport
        url = html.escape(
            AdoptionBarChartReport.get_url(*[self.domain]) + "?" +
            six.moves.urllib.parse.urlencode(self.request_params))
        return html.mark_safe(
            "<a class='ajax_dialog' href='%s' target='_blank'>%s</a>" %
            (url, text))
Exemplo n.º 2
0
    def group_name_fn(self, group_name):
        text = None
        if is_mapping(group_name, self.domain):

            text = next((item for item in get_mapping(self.domain) if item['val'] == group_name), None)['text']

        if is_domain(group_name, self.domain):
            text = next((item for item in get_domains(self.domain) if item['val'] == group_name), None)['text']

        if is_practice(group_name, self.domain):
            text = next((item for item in get_pracices(self.domain) if item['val'] == group_name), None)['text']

        return text
Exemplo n.º 3
0
    def group_name_fn(self, group_name):
        text = None
        if is_mapping(group_name, self.domain):

            text = next((item for item in get_mapping(self.domain) if item['val'] == group_name), None)['text']

        if is_domain(group_name, self.domain):
            text = next((item for item in get_domains(self.domain) if item['val'] == group_name), None)['text']

        if is_practice(group_name, self.domain):
            text = next((item for item in get_pracices(self.domain) if item['val'] == group_name), None)['text']

        return text
Exemplo n.º 4
0
    def group_name_fn(self, group_name):
        text = None
        if is_mapping(group_name, self.domain):
            self.request_params['type_value_chain'] = group_name
            self.request_params['group_by'] = 'domain'
            text = next((item for item in get_mapping(self.domain) if item['val'] == group_name), None)['text']

        if is_domain(group_name, self.domain):
            self.request_params['type_domain'] = group_name
            self.request_params['group_by'] = 'practice'
            text = next((item for item in get_domains(self.domain) if item['val'] == group_name), None)['text']

        if is_practice(group_name, self.domain):
            # TODO practices should probably redirect to other report
            self.request_params['type_practice'] = group_name

            text = next((item for item in get_pracices(self.domain) if item['val'] == group_name), None)['text']

        from custom.care_pathways.reports.adoption_bar_char_report import AdoptionBarChartReport
        url = html.escape(AdoptionBarChartReport.get_url(*[self.domain]) + "?" + urllib.urlencode(self.request_params))
        return html.mark_safe("<a class='ajax_dialog' href='%s' target='_blank'>%s</a>" % (url, text))