last date sorting patient records