import json


def load_chunkfile_index(index_file):
    """ Loads an index file as a dictionary from key to filename.
    Note, that the keys in the dictionary are string objects, ie. if you look
    for patientid 42, then the query is my_dict[str(42)]

    :param index_file: path to the index file
    """
    with open(index_file, 'r') as f:
        return json.load(f, encoding='utf-8')