import csv


def prepPtHLA(fname='allHLAtypings.csv'):
    """
    We must create a dictionary of all the patient HLA typings
    return: HLA typing as query-able dictionary
    ex. pt_hla[PID] = [HLA typing as list]
    """

    with open(fname, encoding='utf-8-sig') as csv_data:
        reader = csv.DictReader(csv_data)
        pt_hla = {}

        for row in reader:
            key = row['PID']
            val = row['HLA'].split(',')

            pt_hla[key] = val

    return pt_hla