Detection and prediction of clopidogrel treatment failures using longitudinal structured electronic health records