code: function calculateTotalConceptIds(item) {
    if (item._concepts.length === 0) {
      return [];
    }
    var conceptItems = item._concepts[0].items;
    var totalConceptIds = conceptItems.map(function(parent) {
      // Because any available totals are sorted to the top of the list of children,
      // and the grand total is always the first one, just check if the first child
      // is in the list of exclusiveChildIds for the parent, and return it if so.
      var firstChildId = parent.items[0].id;
      if (parent.exclusiveChildIds.indexOf(firstChildId) >= 0) {
        return [firstChildId];
      }
      // Dimensions in singleValuedDimensionIds became concepts with allowMultiple false.
      if (!parent.allowMultiple) {
        // Needs runLater for activeItems to work correctly - see comment above.
        return parent.activeItems.map(concept => concept.id);
      }
    });
    // totalConceptIds will have undefined elements if it couldn't find a total for a dimension.
    // Only return the array if every element is defined. Otherwise, return undefined.
    if (totalConceptIds.every(defined)) {
      return totalConceptIds;
    }
    return undefined;
  }
docs: Map the _total_ concept ids into arrays of (arrays of length 1). If a total is not available for a dimension, but it is in singleValuedDimensionIds, then use its current value instead - eg. region type, frequency, and some measure types. Returns undefined if any concepts do not have a total available. Eg. Return [['TOT'], ['3'], ['TOT']].