import csv


def get_return_fields(filepath):
    """Extract the returnable fields for results from the file with
    description of filters in ENA as a dictionary with the key being the field
    id and the value a list of returnable fields

    filepath: path with csv with filter description
    """
    returnable_fields = {}
    with open(filepath, "r") as f:
        reader = csv.DictReader(f, delimiter=';')
        for row in reader:
            returnable_fields.setdefault(
                row["Result"],
                row["Returnable fields"].split(", "))
    return returnable_fields