Fetch Provider's appointments or patients (EPIC)

Hello Epic team,

I’m currently integrating EPIC for my project and have a question regarding the appointment API.

Requirement: Using backend service account for a provider, I want to able to fetch all upcoming patients scheduled for a surgery in a given timeframe, so I can onboard the patients to Stabl platform and guide them for some exercises before the surgery.

Problem: By looking at FHIR/R4/Appointment endpoint, I see that it requires a patient id, which I don’t have at this point.

Is there a way:

  1. Either I can fetch all patients being treated by a provider?
  2. Or get all patients scheduled for a surgery by appointment API?
  3. Maybe another approach to get the required result?

It would be super helpful if someone can guide me with the problem, newbie to the FHIR world - so help would be appreciated.

Questions for Epic are best raised at open@epic.com. However, my understanding is that right now the Epic FHIR interface is patient-centric. There are some proprietary and v2 interfaces that might provide some of what you’re looking for. I don’t know if there are any plans to expose these capabilities over FHIR.