First check out https://healthdata.gov/. The US government has a lot of targeted data sets that may be exactly what you need or at least get you started.
As far as accessing "non-gov" data, I've been implementing EHRs for a decade and I've yet to see organizations make that available other than through an HIE. There are a lot of regulations in the industry and security tends to be very tight.
That being said, I do have a couple of ideas that may help. If you were able to volunteer at a healthcare organization as an analyst (e.g. Volunteers in Medicine) you'd be able to get access to their data.
Moreover, if your research will help a hospital or large medical group solve a pressing problem, data access may not be an issue and they'd be willing to help you out.