Using topological data analysis and pseudo time series to infer temporal phenotypes from electronic health records