More than half the £22bn annual cost of caring for someone in their lat year of life is spent on healthcare, with hospital costs accounting for the largest chunk.