def createICDdictionary(filename):
    """This function takes the sorted_icd_codes file as an arg. and create the following dictionary:
    ex. {'1': 'BEXT', '3': 'CALI', '2': 'BINT',....,'35': 'XTRN'}"""
    fh = open(filename)
    ICDdict = {}
    for line in fh:
        line = line.strip().split()
        ICDdict[line[0]] = line[1]
        #ICDdict[line[0]] = "Q"+line[1]   # the data set has a "Q" before each ICD code
    print(ICDdict)
    return ICDdict