Trajectories and determinants of emergency department use among nursing home residents: a time series analysis (2012–2019)