Population-based electronic health records