Identification of factors associated with diagnostic error in primary care