Enviar rexistro por email: Development of data-driven framework for automatically identifying patient cohorts from linked electronic health records