As others have already mentioned, it's VERY complicated.
In order for a rotation to be fundable by medicare, you need to be at your home institution or an affiliated site, and you must take care of some medicare patients.
1. What is "some medicare patients?" That's not entirely clear. My institution has said that as long as there is a single medicare patient, it's fine. But if you went and worked with a private doc who doesn't take medicare, then it's not fundable.
2. Who is in charge of enforcing these rules? It's the "Medicare Intermediaries" who are insurance companies that process claims for Medicare. There are several of them, so the rules for one part of the country may be different for another, and they can change the rules any time they want.
3. If a resident goes off site and it includes Medicare patients, is it billable? It can be if:
A. The place you go doesn't already bill for resident services under Medicare. i.e. if you go to a place that already has GME, then it's not billable.
B. The place needs to write a Letter of Affiliation contract with the GME office. This deliniates who is responsible for for paying the resident's salary, who will be allowed to bill Medicare, and other issues. It also MUST pay the supervising physician some amount of money for supervising the resident -- it can be a small amount. Many private offices either refuse to sign such contracts (worried that it's somehow going to create a problem for them), or GME offices are unwilling to manage all of the paperwork required for each private doc's office.
4. How do we actually get paid? We complete something called the Medicare Cost Report. I believe it gets submitted once per year. On it you must document exactly where each resident was for every day, and whether it's reimbursible or not. It is a HUGE pain. Most places have someone whose only job is to get this put together correctly. Remember that any errors can be considered Medicare fraud and can be punishable by $10K per error. If you never allow residents to go off site or have research time, it's easy.
5. Research is complicated. Lab research is never billable to Medicare. Clinical research if done with Medicare patients is probably OK. We still debate this. But research with a VA database is not. Lots of fun.