Efficient Representation Learning For Longitudinal Data In Healthcare Applications