Blueprint for wiring an ECG management system into Epic: waveform storage, MUSE-style resting/stress interpretations, and diagnostic ECG images filed as encapsulated results to Cupid/Cupid via MuleSoft API-led integration.
Tags: healthcare, epic, hl7v2, fhir, connected-devices, interoperability, api-led, system-api
ECG Management System
Objective: Cardiology techs acquire resting 12-lead, stress, and Holter ECGs on carts that feed an ECG management system. The clinical value only lands when the confirmed interpretation, measurements, and rendered waveform image reach the chart so a cardiologist can sign off and the read is discrete and reportable. Today the ECG system holds the truth and Epic holds a stale PDF, orders never close, and the reader is not attributed. Done looks like: every confirmed ECG posts as a discrete result with global measurements, the waveform is retrievable inline, the order reconciles automatically, and amended reads are handled without duplicating the tracing. This accelerator packages the ECG Management System Epic Data Sharing Playbook as a MuleSoft-anchored solution plan.
What's Getting Built
- ECG Result & Waveform Ingest (System API) — terminates the ECG-system MLLP result feed and retrieves the encapsulated waveform image ·
MLLP LISTEN ORU^R01, ACK^R01 on persist, DICOM C-FIND/C-MOVE
- Normalize & Match (Process API) — matches accession to placer order, normalizes global measurements, and reconciles the ServiceRequest ·
CONSUME VM queue, GET open ServiceRequest by placer, WRITE filler order number
- Correlation State (Object Store) — holds placer order number and study UID for order reconciliation and duplicate debounce ·
GET /{studyUID}, PUT /{studyUID}, DELETE /{studyUID}
- Categorized Dead-Letter Queues (Anypoint MQ) — separate dead-letter queues for unmatched accession, unmapped procedure, and image-fetch timeout ·
PUBLISH unmatched-accession, PUBLISH unmapped-procedure, PUBLISH image-timeout
- Epic Bridges / Cupid (target) — files the confirmed ECG as a discrete result with encapsulated waveform and closes the order ·
SEND ORU^R01 (MLLP), OBX-11=C amendment
Prerequisites
- Epic Bridges interface engine configured to receive inbound ORU^R01 and ORM^O01 / OMG^O19 order messages over MLLP with a defined ECG result component list
- ECG management system (GE MUSE, Philips TraceMaster, or equivalent) exposing HL7v2 result feed plus a retrieval API or DICOM Q/R for waveform images
- Epic Cupid or Cupid module live for cardiology results, with a build for ECG procedure IDs and discrete measurement components (rate, PR, QRS, QT, QTc, axis)
- Anypoint Platform environment with a persistent VM or MLLP listener, Object Store v2 for correlation state, and Anypoint MQ for the dead-letter queue
- Master procedure and order compendium mapping ECG system test types and Universal Service IDs to Epic procedure and OBR codes
- Provider master cross-reference mapping ECG-system reader IDs to Epic SER records so the interpreting physician is attributed correctly
1. Epic interfaces and standards
This accelerator implements the ECG 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 ORU^R01 for confirmed interpretation, ORM^O01/OMG^O19 for order pass-through)
- Cupid / Cupid (cardiology result filing and discrete measurement components)
- FHIR R4 Observation with cardiology-ecg category and DiagnosticReport for the read
- FHIR R4 Media or DocumentReference for the encapsulated waveform PDF/image
- ServiceRequest for placer/filler order reconciliation
- LOINC (11524-6 EKG study, 8867-4 heart rate) and DICOM encapsulated PDF SOP class
Architecture
2. Business requirements
- File every confirmed ECG interpretation to Epic as a discrete, reportable result, not a scanned PDF, so measurements flow to Cogito and flowsheets.
- Deliver the rendered 12-lead waveform image alongside the numeric result so the cardiologist reads the tracing in Hyperdrive without launching the ECG system.
- Reconcile the ECG-system read against the Epic placer order and auto-close the ServiceRequest when the confirmed result arrives.
- Attribute the interpreting physician from the ECG-system reader ID so signature and productivity credit are correct.
- Handle preliminary, confirmed, and amended states distinctly so a corrected QTc never silently overwrites without an audit trail.
3. Ingestion: results and waveform images
- Accept the ECG-system ORU^R01 on an MLLP listener in the System API; ACK at the transport layer only after the message is persisted to the VM queue.
- Retrieve the waveform as a DICOM encapsulated PDF via C-FIND/C-MOVE or the vendor REST endpoint, keyed by the OBX-5 study accession, not by patient name.
- Treat the image fetch as a separate step from result filing so a slow image server never blocks the discrete interpretation.
- Carry the ECG-system study UID end to end as the correlation ID stamped on every log line and DLQ entry.
- Reject and DLQ any result whose accession has no matching order rather than filing an orphaned tracing.
4. Mapping and normalization
- Map global measurements from OBX segments to Epic discrete components: ventricular rate to 8867-4, plus PR, QRS, QT, QTc, and P-QRS-T axes.
- Normalize the vendor interpretation statement set (e.g. Minnesota codes or vendor phrases) to the Epic-agreed narrative component; do not free-text guess.
- Map ECG test type and Universal Service ID (OBR-4) to the Epic procedure via the compendium; fail loudly on an unmapped test type.
- In DataWeave, emit the waveform as an OBX-5 encapsulated data reference (ED) or as a paired Media/DocumentReference in the FHIR variant.
- Convert the reader ID to the Epic SER provider record and set the result status from OBX-11 (P/F/C) so amendments file as corrections.
5. Orchestration and order reconciliation
- Run order pass-through and result return as two flows sharing Object Store state keyed by placer order number and study UID.
- On a confirmed ORU, look up the open ServiceRequest; if found, file the filler order number so Epic closes the order automatically.
- Debounce duplicate confirmations for the same study UID within a configurable window so a resend does not create a second discrete result.
- For amended reads, set OBX-11 to C and reference the prior result so Cupid supersedes rather than appends a conflicting QTc.
- Alert on the absence of an expected confirmed result within the acquisition-to-read SLA, which is the failure mode dashboards miss most often.
6. Error handling and operations
- Route unmatched accessions, unmapped procedures, and image-fetch timeouts to distinct DLQs so triage is not a single undifferentiated pile.
- Make image retrieval idempotent and retryable independent of the result flow; replay from the DLQ using the stored study UID.
- Log the study UID, placer order, accession, and reader ID on every hop so a stuck read is one query away.
- Monitor MLLP ACK latency and DICOM C-MOVE success rate as leading indicators before Epic filing errors surface.
- Guard PHI in logs: log identifiers and status codes, never the interpretation narrative or embedded image bytes.
7. 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 DICOM C-MOVE/C-FIND to the registered AE title of the MuleSoft System API; reject unknown calling AE titles at the ECG management system.
- Store the encapsulated waveform only transiently in Object Store with a short TTL; the durable copy of record lives in Epic, not in Anypoint.
- Validate that the reader ID resolves to an active SER record before filing so a decommissioned or spoofed reader cannot post a signed interpretation.
Sample payload — Confirmed 12-lead ECG interpretation (ORU^R01) with encapsulated waveform
MSH|^~\&|MUSE|CARDIOLOGY|EPIC|HOSP|20260820T141530||ORU^R01|MSG00711|P|2.5.1
PID|1||E10042^^^EPIC^MR||DOE^JANE^A||19620314|F
ORC|RE|ECG-88213^EPIC|MUSE-77120^MUSE||CM
OBR|1|ECG-88213^EPIC|MUSE-77120^MUSE|11524-6^EKG 12 lead study^LN|||20260820T141002|||||||||1780293^HEART^ANNA^^^MD^^^SER
OBX|1|NM|8867-4^Ventricular rate^LN||72|/min|60-100|N|||C
OBX|2|NM|PR^PR interval||156|ms|120-200|N|||C
OBX|3|NM|QRS^QRS duration||94|ms|<120|N|||C
OBX|4|NM|QTc^QTc Bazett||438|ms|<450|N|||C
OBX|5|TX|8601-7^EKG impression^LN||Normal sinus rhythm. Normal ECG.||||||C
OBX|6|ED|11524-6^EKG waveform^LN||MUSE^application^pdf^Base64^JVBERi0xLjQKJ...||||||C
Testing and validation
- Send a confirmed ORU with a matching placer order and assert the ServiceRequest closes and all five discrete measurement components file to Cupid.
- Send a result with an accession that has no open order and assert it lands in the unmatched-accession DLQ, not the chart.
- Fetch a waveform via DICOM C-MOVE and confirm the encapsulated PDF is retrievable inline from the filed Epic result.
- Replay an amended ORU (OBX-11=C) with a changed QTc and assert Cupid supersedes the prior read with an audit entry rather than appending.
- Resend an identical confirmed study UID within the debounce window and assert no duplicate discrete result is created.
- Send an ORU with an unmapped test type in OBR-4 and confirm the flow fails loudly to the unmapped-procedure DLQ.
Phased rollout
Phase 1 — Connect
- Stand up the MLLP listener and DICOM SCP in a non-prod Anypoint environment and pair to the ECG-system test partition.
- Establish Bridges connectivity to Epic non-prod and confirm ACK round-trip for a canned ORU.
Phase 2 — Map and test
- Build and validate the procedure, measurement-component, and reader-to-SER cross-reference maps against a sample of real confirmed reads.
- Run the full test matrix including amendments, orphan accessions, and image-fetch timeouts before any production traffic.
Phase 3 — Production
- Cut over one ECG modality (resting 12-lead) first, monitor confirmed-result SLA and DICOM success for two weeks, then add stress and Holter.
- Enable the missing-expected-result alert and DLQ triage runbook before decommissioning the legacy fax/PDF path.
Success metrics
- Percent of confirmed ECGs filed as discrete results with all global measurements populated (target > 99 percent)
- Median acquisition-to-chart latency for confirmed interpretations
- DICOM C-MOVE waveform retrieval success rate
- Order auto-reconciliation rate versus manual order matching by staff
- DLQ volume by category (unmatched accession, unmapped procedure, image timeout) trended weekly
Troubleshooting
- Discrete measurements file but the waveform image is missing from the Epic result. — Likely cause: The result flow filed before the DICOM C-MOVE completed, or the encapsulated PDF exceeded the OBX-5 ED size limit. Fix: Decouple image retrieval into its own retryable flow keyed by study UID, and file the image as a linked Media/DocumentReference reference rather than inline bytes when it exceeds the segment limit.
- Confirmed reads file but the placer order never closes in Epic. — Likely cause: The filler order number was not written back, or the ECG-system accession did not match the stored placer order in Object Store. Fix: Verify ORC-3 filler order population and reconcile the accession-to-placer mapping; DLQ and re-drive any results whose study UID has no Object Store entry.
- An amended QTc appears as a second result instead of correcting the original. — Likely cause: OBX-11 arrived as F instead of C, or the amendment did not reference the prior result identifier. Fix: Map the ECG-system amendment state explicitly to result status C and carry the prior study UID so Cupid supersedes the earlier read.
Deliverable: A MuleSoft API-led project: an MLLP + DICOM System API ingesting ECG-system ORU results and waveform images, a Process API matching accession to placer order and normalizing measurements, DataWeave maps to Epic-bound ORU with encapsulated waveform and reader-to-SER attribution, categorized DLQs, and a test suite for confirmed, amended, orphan, and duplicate reads.