コード例 #1
0
ファイル: models.py プロジェクト: aristide/commcare-hq
    def get_providers(self):
        """
        return a list of all the providers for this patient
        """
        from pact.api import get_all_providers
        all_providers = get_all_providers()
        pt_providers = list(self.get_provider_ids())

        providers_dict = {x.fields['id']: x.fields for x in all_providers}

        return [providers_dict[x] for x in pt_providers if x in providers_dict]
コード例 #2
0
ファイル: models.py プロジェクト: SEL-Columbia/commcare-hq
    def get_providers(self):
        """
        return a list of all the providers for this patient
        """
        from pact.api import get_all_providers
        all_providers = get_all_providers()
        pt_providers = list(self.get_provider_ids())

        providers_dict = dict((x.fields['id'], x.fields) for x in all_providers)
        #filtered= filter(lambda x: x.fields['id'] in pt_providers, all_providers)
        #return [x.fields for x in filtered]

        return [providers_dict[x] for x in pt_providers if x in providers_dict]