code: def get_service_categories(self, restricted=True):
          
          bsc = api.get_tool("bika_setup_catalog")
          query = {
              "portal_type": "AnalysisCategory",
              "is_active": True,
              "sort_on": "sortable_title",
          }
          categories = bsc(query)
          client = self.get_client()
          if client and restricted:
              restricted_categories = client.getRestrictedCategories()
              restricted_category_ids = map(
                  lambda c: c.getId(), restricted_categories)
              # keep correct order of categories
              if restricted_category_ids:
                  categories = filter(
                      lambda c: c.getId in restricted_category_ids, categories)
          return categories
docs: Return all service categories in the right order
  
          :param restricted: Client settings restrict categories
          :type restricted: bool
          :returns: Category catalog results
          :rtype: brains