def get_deltadx_groups(df):
    """This function uses the supplied dataframe to divide the data by diagnosis change.
    
    The groups returned by this function are no_change, cn_mci, mci_ad, and cn_ad.
    """
    
    # isolate patients with no diagnosis change
    no_change = df[df['DX'] == df['DX_bl2']]
    
    # isolate patients who progressed from 'CN' to 'AD'
    cn_mci = df[(df['DX'] == 'MCI') & (df['DX_bl2'] == 'CN')]
    
    # isolate patients who progressed from 'MCI' to 'AD'
    mci_ad = df[(df['DX'] == 'AD') & (df['DX_bl2'] == 'MCI')]
    
    # isolate patients who progressed from 'CN' to 'AD'
    cn_ad = df[(df['DX'] == 'AD') & (df['DX_bl2'] == 'CN')]
    
    return no_change, cn_mci, mci_ad, cn_ad