Apple Inc. is in discussions with the Department of Veterans Affairs to provide portable electronic health records to military veterans, a partnership that would simplify patients’ hospital visits and allow the technology giant to tap millions of new customers, according to people familiar with the effort and emails reviewed by The Wall Street Journal.