DANIEL: A Distributed and Scalable Approach for Global Representation Learning with EHR Applications