Coordinates radiation oncology planning and delivery between a treatment management system (Aria/MOSAIQ-class) and Epic, keeping the fractionated course, delivered dose, and treatment appointments in sync across the two systems of record.
Tags: healthcare, epic, hl7v2, fhir, interoperability, scheduling, api-led, event-driven
Radiation Therapy Treatment Management System
Objective: Radiation oncology runs two systems of record that drift apart: the treatment management system (TMS) owns the prescribed course, plan approval, and per-fraction delivery, while Epic owns the patient, encounters, and charges. When they disagree, a patient gets scheduled for a fraction already delivered, a charge posts for a cancelled session, or an oncologist sees a stale dose total. Done looks like this: every course, plan approval, scheduled fraction, and delivered-dose event flows bidirectionally with one correlation ID; Epic reflects the authoritative fraction count and cumulative dose within SLA; and no charge posts for a fraction the TMS has not confirmed delivered. This accelerator packages the Radiation Therapy Treatment Management System Epic Data Sharing Playbook as a MuleSoft-anchored solution plan.
What's Getting Built
- TMS Radiation Oncology (System API) — normalizes Aria/MOSAIQ plan and delivery events into one canonical course model ·
INGEST plan-approval, INGEST delivered-fraction, INGEST scheduled-slot
- Course Reconcile (Process API) — reconciles prescribed course, scheduled fractions, and delivered dose against Epic and gates charges on delivery confirmation ·
POST /course, POST /fraction, POST /reconcile
- Course-State Sweep (Scheduler) — periodic full-course comparison of TMS delivered count against Epic Procedures to catch missed events ·
SCHEDULER sweep course state
- Unmatched-Event Park (Dead-letter queue) — parks unmatched, out-of-order, or mismatched-dose events with payload and reason for correlation-ID replay ·
PUT /{correlationId}, GET /{correlationId}, REPLAY /{correlationId}
- Epic Bridges HL7v2 (target) — writes treatment-appointment scheduling, per-fraction charges, and the completed-course note ·
SIU^S12/S14/S15, DFT^P03, MDM^T02
- Epic FHIR R4 (target) — writes the prescribed course order and each delivered fraction with cumulative dose, and reads Appointment for calendar reconciliation ·
PUT /ServiceRequest, POST /Procedure, GET /Appointment
Prerequisites
- Epic Bridges HL7v2 interfaces configured for ADT, SIU, DFT and MDM, with an assigned interface analyst and a test namespace
- Epic on FHIR R4 registration with ServiceRequest, Procedure, Appointment and DocumentReference read/write scopes via SMART on FHIR backend-services (client credentials)
- TMS integration endpoints available: Aria or MOSAIQ HL7 outbound plus the vendor course/plan/dose API or IHE-RO IOD export
- Anypoint Platform org with CloudHub or RTF, VM/Anypoint MQ queues provisioned, and a DLQ per inbound listener
- Patient and provider identity crosswalk: Epic MRN and provider SER mapped to TMS patient and physician IDs
- Signed clinical sign-off that Epic is the charge system of record and the TMS is the delivered-dose system of record
1. Epic interfaces and standards
This accelerator implements the Radiation Therapy Treatment Management System Epic Data Sharing Playbook. Register the connecting app on Epic on FHIR and confirm the customer has the relevant Epic modules licensed before building.
- Bridges HL7v2: ADT for patient/encounter, SIU for treatment-appointment scheduling, DFT for per-fraction technical charges, MDM for the completed-course summary note
- FHIR R4 ServiceRequest for the radiation therapy order and prescribed course
- FHIR R4 Procedure for delivered fractions and cumulative dose
- FHIR R4 Appointment and Cogito reporting for treatment-calendar reconciliation
- Hyperspace/Hyperdrive as the clinician view of the reconciled course and dose
Architecture
2. Business requirements
- Treat the TMS as the system of record for prescribed course, plan approval, and delivered dose; treat Epic as the system of record for patient identity, encounters, and charges.
- Keep the delivered fraction count and cumulative dose in Epic within a defined SLA of each treatment-machine delivery event.
- Never post a technical DFT charge for a fraction until the TMS confirms it as delivered, not merely scheduled.
- Reconcile the treatment calendar so a completed or cancelled fraction cannot remain bookable in Epic.
- Write a completed-course summary back to the chart as an MDM note when the prescribed fraction count is met.
3. Ingestion and mapping
- Ingest TMS plan and delivery events through the System API, normalizing Aria HL7 and MOSAIQ exports into one canonical course model in DataWeave.
- Map the prescribed course to a FHIR ServiceRequest carrying total dose, fraction count, modality, and treatment site.
- Map each delivered fraction to a FHIR Procedure with the delivered dose, machine ID, and fraction sequence number.
- Translate scheduled treatment slots to Epic SIU^S12/S14/S15 so the linac calendar and Epic Cadence stay aligned.
- Emit DFT^P03 only on a confirmed delivery event, tagging the correlation ID and fraction number in ZRT segments or a designated field.
4. Matching and normalization
- Resolve identity on Epic MRN plus a TMS patient-ID crosswalk; quarantine any event that cannot be matched rather than guessing.
- Normalize dose to a single unit (cGy) and detect prescription-vs-delivered mismatches before writing to Epic.
- Key reconciliation on the course-plus-fraction-sequence tuple so a re-sent delivery is idempotent, not a duplicate Procedure.
- Detect adaptive re-plans: a new plan approval supersedes the prior ServiceRequest and must not silently orphan delivered fractions.
- Compare the TMS delivered count against the sum of Epic Procedures each cycle and flag any divergence for review.
5. Orchestration and operations
- Run reconciliation event-driven off delivery events, with a scheduled sweep that compares full course state to catch missed events.
- Carry one correlation ID from the TMS event through System API, Process API, Bridges, and FHIR for end-to-end trace.
- Route unmatched, out-of-order, or mismatched-dose events to a DLQ with the original payload and failure reason.
- Alert on the absence of an expected delivery event for a patient with a scheduled fraction, the failure mode dashboards miss most often.
- Gate charge posting behind delivery confirmation so a scheduling change never triggers an erroneous DFT.
6. Security and compliance
- Encrypt PHI in transit and at rest.
- Audit-log every access to and modification of patient data, and carry a correlation ID end to end.
- Enforce minimum-necessary access for integration operators and support users.
- Restrict the FHIR backend-services client to the minimum ServiceRequest, Procedure, Appointment, and DocumentReference scopes; radiation dose data is highly sensitive and must not travel on over-broad scopes.
- Segregate the linac/TMS network zone from the integration tier and terminate TMS HL7 over TLS or a VPN, never cleartext MLLP across trust boundaries.
- Log every delivered-dose write with correlation ID, source machine, and prescribing physician for medico-legal traceability of the treatment record.
- Encrypt DLQ payloads at rest; a parked message contains a full dose and plan record and must not sit in plaintext.
Sample payload — Delivered fraction as FHIR R4 Procedure
{
"resourceType": "Procedure",
"status": "completed",
"category": {
"coding": [{
"system": "http://snomed.info/sct",
"code": "1287742003",
"display": "Radiotherapy"
}]
},
"code": {
"coding": [{
"system": "http://www.ama-assn.org/go/cpt",
"code": "77386",
"display": "IMRT delivery complex"
}]
},
"subject": { "reference": "Patient/eXd", "display": "MRN 4471029" },
"performedDateTime": "2026-08-20T09:14:00-05:00",
"basedOn": [{ "reference": "ServiceRequest/ro-course-88123" }],
"performer": [{
"actor": { "display": "LINAC-VAULT-2" }
}],
"extension": [{
"url": "https://accel.local/fx-sequence",
"valueInteger": 12
}, {
"url": "https://accel.local/delivered-dose-cgy",
"valueInteger": 200
}, {
"url": "https://accel.local/correlation-id",
"valueString": "c8f1e2a4-fx12-ro88123"
}]
}
Testing and validation
- Assert idempotency: replay the same delivered-fraction event twice and confirm exactly one Epic Procedure and one DFT result.
- Run a full fractionated course fixture (e.g. 25 fractions) and verify cumulative dose in Epic matches the TMS course total to the cGy.
- Fire an adaptive re-plan mid-course and confirm the new ServiceRequest supersedes the old one without orphaning prior Procedures.
- Suppress an expected delivery event and confirm the missing-event alert fires within the SLA window.
- Inject an unmatched patient ID and a prescribed-vs-delivered dose mismatch and confirm both route to the DLQ with the correct reason code.
- Validate SIU cancellation of a delivered fraction removes bookability in Epic without deleting the delivery record.
Phased rollout
Phase 1 — Connect
- Stand up the System API against the TMS test namespace and Epic Bridges test environment; establish the MRN and physician crosswalk.
- Verify one full course flows end-to-end in test with a single correlation ID visible across all hops.
Phase 2 — Map and test
- Finalize DataWeave mappings for ServiceRequest, Procedure, SIU, and DFT and run the fractionated-course and adaptive-re-plan MUnit suites.
- Run parallel reconciliation for a pilot cohort and compare TMS-vs-Epic dose totals daily until divergence is zero.
Phase 3 — Production
- Cut over one treatment vault with charge gating enabled and the missing-event alert live, monitoring the DLQ hourly.
- Expand vault by vault, adding the completed-course MDM note once delivered-dose accuracy holds across a full pilot course.
Success metrics
- Delivered-dose reconciliation latency from machine event to Epic Procedure write (p95, target under SLA)
- TMS-vs-Epic cumulative-dose divergence per course (target zero cGy)
- Erroneous DFT charges posted before delivery confirmation (target zero)
- Missing-delivery-event alerts fired vs. true positives (alert precision)
- DLQ volume and mean time to replay by failure reason
Troubleshooting
- Epic shows more delivered fractions than the TMS course actually delivered. — Likely cause: A re-sent or retried delivery event created duplicate Procedures because reconciliation was not keyed on the course-plus-fraction-sequence tuple. Fix: Enforce idempotency on the course/fraction-sequence key and upsert the Procedure rather than always inserting; reconcile and remove duplicates via the scheduled sweep.
- A DFT charge posted for a fraction the patient never received. — Likely cause: The charge was triggered off a scheduling or plan event instead of a confirmed delivery event. Fix: Gate DFT emission strictly on the TMS delivery-confirmed event and add a pre-post assertion that a matching completed Procedure exists.
- Cumulative dose in Hyperspace is stale after an adaptive re-plan. — Likely cause: The new plan approval created a fresh ServiceRequest but delivered Procedures were still linked to the superseded course. Fix: On re-plan, mark the prior ServiceRequest superseded and re-point subsequent Procedures at the new basedOn reference while preserving history.
- Delivery events for one patient stop appearing in Epic but no error is logged. — Likely cause: The TMS outbound feed silently dropped, and the pipeline only alerts on processing errors, not on the absence of expected events. Fix: Run the scheduled course-state sweep and alert when a patient with a scheduled fraction has no delivery event within the SLA window.
Deliverable: A deployable Anypoint blueprint: System API for the treatment management system (TMS), a Process API that reconciles the radiation oncology plan and delivery record against Epic, DataWeave mappings for HL7v2 ADT/SIU/DFT and FHIR ServiceRequest/Procedure, a DLQ with correlation-ID replay, and a Postman/MUnit test suite seeded with fractionated-course fixtures.