Connect a virtual visit platform to Epic or Cerner so telehealth appointments are scheduled, launched, documented, and billed through the same workflow as in-person care — no parallel system to reconcile.
Tags: healthcare, provider, telehealth, scheduling, fhir, epic, cerner, salesforce
Telehealth and Virtual Care Integration
Objective: The virtual care platform was bought quickly and wired to nothing. Schedulers book in one system and the visit happens in another, clinicians re-key notes afterwards, and revenue cycle cannot tell a virtual encounter from a missed one. This plan makes the telehealth platform a participant in the EHR workflow — the appointment, the join link, the encounter, the documentation, and the charge all reference the same visit.
What's Getting Built
- Telehealth Booking and Join (Experience API) — patient-facing booking, join, and reschedule endpoints consumed by the portal, Health Cloud, or mobile app ·
POST /visits, GET /visits/{id}/join, POST /visits/{id}/reschedule
- Visit Lifecycle Orchestration (Process API) — runs the visit state machine, provisions the session, and writes the encounter and documentation back to the EHR ·
POST /visits/{id}/provision, POST /visits/{id}/status, POST /visits/{id}/encounter
- Virtual Care Platform (System API) — thin wrapper over the video platform covering session create, revoke, and status webhook ·
POST /sessions, DELETE /sessions/{id}, POST /webhooks/status
- EHR Scheduling and Encounter (System API) — thin wrapper over the EHR FHIR scheduling and encounter endpoints for booking and write-back ·
POST /Appointment, PUT /Encounter/{id}, POST /DocumentReference
- Virtual care platform (Zoom / Amwell / Teams) (target) — provisions the video session and issues the short-lived join token ·
POST /sessions, DELETE /sessions/{id}
- Epic / Cerner Encounter and notes (target) — holds the virtual Encounter with class VR and the filed DocumentReference for charge capture ·
PUT /Encounter/{id}, POST /DocumentReference
Prerequisites
- Anypoint Platform org with API Manager exposed to patient-facing channels.
- MuleSoft Accelerator for Healthcare appointment scheduling assets imported from Exchange as the scheduling foundation.
- Virtual care platform API credentials — Zoom for Healthcare, Amwell, Teladoc, or Microsoft Teams — with a signed BAA in place.
- Epic or Cerner scheduling and encounter API access (FHIR Appointment, Encounter, DocumentReference).
- Salesforce Health Cloud, patient portal, or mobile app as the patient-facing channel.
Choose your path
- EHR-native launch — Choose when your EHR ships an embedded video partner and the visit can start from the chart. Integration is thinner — you are wiring provisioning and status, not the clinical workflow — and clinicians never leave the EHR.
- Standalone platform orchestration — Choose when the virtual platform is used across multiple EHRs or serves on-demand care with its own clinician pool. MuleSoft owns the visit lifecycle and writes results back to whichever EHR holds the chart.
EHR vendor notes
Epic
- Book through FHIR Appointment with a telehealth visit type; the join link belongs on the appointment, not in a separate email the patient loses.
- Write the visit back as an Encounter with
class = VR and file the note as a DocumentReference against that encounter so charge capture sees a real visit.
- Epic telehealth visit types are configured per department — map them explicitly, because a virtual booking against an in-person visit type will schedule a room.
Cerner (Oracle Health)
- Millennium scheduling exposes virtual visit types where licensed; confirm the API tier with your Oracle Health contract before designing around FHIR Appointment.
- Encounter class and location must reference the virtual location entry in the tenant location registry, or the encounter will not close cleanly.
- Documentation write-back paths differ by tenant configuration — validate DocumentReference filing in a non-production tenant first.
Architecture
1. Business requirements
- Book a virtual visit through the same patient-facing flow as an in-person one, with the correct visit type.
- Provision the video session and deliver the join link to patient and clinician without manual steps.
- Reflect visit status — waiting, in progress, completed, no-show — back to the EHR and the engagement platform in near real time.
- File documentation and the charge against the encounter so virtual care bills like any other visit.
- Degrade to a phone visit without losing the encounter when video fails.
2. Visit lifecycle orchestration
- Treat the visit as a state machine: booked → provisioned → patient waiting → in progress → completed (or canceled, no-show, converted to phone).
- Provision the video session at booking, not at start time; a session that fails to create should surface while a human can still fix it.
- Emit an event on every transition so the portal, the EHR, and the contact center all see the same status.
- Make provisioning idempotent by appointment ID — a rescheduled visit must not leave two live sessions.
3. API design
- Experience API: patient-facing booking, join, and reschedule endpoints consumed by the portal, Health Cloud, or mobile app.
- Process API: visit lifecycle, session provisioning, and write-back orchestration — the only component that knows both systems.
- System APIs: thin wrappers over the virtual care platform and over the EHR scheduling and encounter endpoints.
- Never hand the video platform's raw session credentials to a patient channel; issue a short-lived, single-purpose join token.
4. Device readiness and the waiting room
- Run a pre-visit connectivity and device check and record the result — most "the platform is broken" tickets are a patient browser permission.
- Publish waiting-room arrivals to the clinician's worklist so a waiting patient is visible in the EHR, not only in the video console.
- Support a staff-initiated invite for patients who cannot self-join, and log who initiated it.
- Time out abandoned sessions and mark the appointment no-show through the same path in-person no-shows use.
5. Documentation, coding, and billing write-back
- File the note against the virtual Encounter, and carry the modality so coders can apply the correct place-of-service and modifier.
- Capture consent to treat by telehealth, plus the patient's physical location at the time of the visit — licensure and billing both depend on it.
- Record actual connected duration from the platform rather than scheduled duration; time-based codes need the real number.
- Reconcile daily: every completed session should have exactly one closed encounter.
6. Error handling and operations
- Retry transient platform and EHR failures with bounded backoff; never retry a session provisioning call without an idempotency key.
- Fall back to a phone visit on video failure and keep the same encounter, so the visit is documented once.
- Alert when the provisioning failure rate or the waiting-room abandonment rate crosses threshold — both are patient-visible.
- Monitor for orphaned sessions (live video, no appointment) and close them on a schedule.
7. Security and compliance
- Encrypt PHI in transit and at rest.
- Audit-log every access to and modification of patient data.
- Enforce minimum-necessary access for integration operators and support users.
For additional HIPAA controls, API policies, and reference security patterns, see the MuleSoft Accelerator for Healthcare on Anypoint Exchange.
Sample payload — FHIR Encounter (virtual visit in progress)
{
"resourceType": "Encounter",
"id": "enc-virtual-88213",
"status": "in-progress",
"class": {
"system": "http://terminology.hl7.org/CodeSystem/v3-ActCode",
"code": "VR",
"display": "virtual"
},
"subject": { "reference": "Patient/eXampleMRN" },
"appointment": [{ "reference": "Appointment/appt-88213" }],
"participant": [{
"individual": { "reference": "Practitioner/1093" }
}],
"period": { "start": "2026-02-10T17:02:14Z" },
"location": [{
"location": { "reference": "Location/virtual-clinic" },
"status": "active"
}]
}
Testing and validation
- Book a virtual visit end to end; confirm the session provisions, both join links deliver, and the EHR shows a telehealth appointment with the right visit type.
- Join as the patient before the clinician and confirm the waiting-room arrival appears on the clinician worklist.
- Kill the video session mid-visit and confirm the fallback to phone keeps the same encounter rather than opening a second one.
- Reschedule a provisioned visit and confirm the old session is revoked — one live session per appointment, always.
- Complete a visit and confirm connected duration, place of service, and modality reach the charge with no manual entry.
Phased rollout
Phase 1 — Connect
- Deploy the Experience, Process, and System APIs; connect the sandbox virtual care platform and a non-production EHR scheduling endpoint.
- Map telehealth visit types and the virtual location entry, and configure join-token TTL and waiting-room timeouts as properties.
Phase 2 — Map and test
- Pilot one specialty and one clinic; complete Testing and validation including the video-failure fallback and reschedule paths.
- Turn on encounter and documentation write-back for the pilot cohort and reconcile sessions against closed encounters daily.
Phase 3 — Production
- Expand by specialty, monitoring provisioning failure and waiting-room abandonment rates against threshold.
- Hand off the runbook covering video outage fallback, orphaned session cleanup, and licensure-location exceptions.
Success metrics
- Session provisioning success ≥ 99.5% of booked virtual visits, measured at booking rather than at start time.
- Patient-side connection success ≥ 95% on first join attempt, with device pre-check completion tracked separately.
- Virtual encounters closed and coded same day ≥ 98% — no reconciliation backlog carried into the next week.
- Median time from patient arrival in the waiting room to clinician join within the clinic's stated target.
Configuration checklist
Before first sandbox deploy, complete the shared Healthcare integration configuration checklist — secure property keys, TLS, OAuth, and credential naming conventions are documented once for all Exchange use cases.
8. Implementation starting point
Start from the MuleSoft Accelerator for Healthcare appointment scheduling assets on Anypoint Exchange — virtual visits are a scheduling flow before they are a video flow.
Add a System API for the virtual care platform covering session create, revoke, and status webhook.
Extend the Process API with the visit state machine, and drive every consumer from its events rather than from polling.
Keep visit-type mappings, join-token TTL, and waiting-room timeouts in configuration — these get tuned repeatedly in the first month.
Troubleshooting
- Patient join link expired before the visit — Likely cause: the token TTL was measured from provisioning rather than from the appointment start. Fix: Issue the join token relative to the appointment window and re-issue on demand from the portal.
- Two live sessions for one appointment — Likely cause: reschedule provisioned a new session without revoking the old one. Fix: Key provisioning on appointment ID and revoke on any reschedule or cancel event before creating the replacement.
- Completed visit never billed — Likely cause: the encounter was left open because the platform completion webhook was not consumed. Fix: Reconcile sessions to encounters daily and close from the reconciliation job when the webhook is missed.
- Clinician cannot see a waiting patient — Likely cause: waiting-room status published to the portal but not to the EHR worklist. Fix: Publish every state transition to both consumers from the Process API, not from the channel that happened to notice.
Deliverable: A virtual visit that is booked, launched, documented, and billed through the same EHR workflow as an in-person appointment, with a state machine that survives video failure.