A genetically supported drug repurposing pipeline for diabetes treatment using electronic health records