MuleSoft blueprint for ingesting home hemodialysis and peritoneal dialysis session data from patient devices and vendor clouds into Epic Cogito-backed nephrology review, mapping treatment metrics to FHIR R4 Observations and DeviceUseStatement with adherence reconciliation against orders.
Tags: healthcare, epic, fhir, us-core, hl7v2, connected-devices, loinc, interoperability
Home Dialysis
Objective: Home hemodialysis and PD patients generate treatment data on machines and vendor cloud portals that nephrologists cannot see between visits, so fluid removal, dwell volumes, blood pressures, and skipped sessions go unreviewed until the next appointment or an ED admission. The problem is getting per-session records from heterogeneous device clouds reconciled against the patient's Epic prescription and enrollment, then surfaced in a worklist where a nurse can act on adherence gaps and out-of-range metrics. Done looks like every completed and missed session landing in Epic within hours, tied to the right patient and order, with derived flags and a clean device-to-chart audit trail. This accelerator packages the Home Dialysis Epic Data Sharing Playbook as a MuleSoft-anchored solution plan.
What's Getting Built
- Device Intake (System API) — polls or subscribes to each vendor device cloud, one connector per vendor, isolating vendor schema churn from the rest of the flow ·
GET /vendor/sessions, POST /webhook, PUBLISH mq.sessions
- Normalize & Reconcile (Process API) — resolves device serial to patient via the enrollment roster, normalizes units, reconciles against the active prescription, and derives adherence and deviation flags ·
CONSUME mq.sessions, GET /ServiceRequest, GET /CarePlan
- Review Worklist (Experience API) — shapes summarized session bundles into the nephrology review worklist with a higher-priority lane for flagged sessions ·
GET /worklist, GET /session/{id}
- Epic FHIR R4 (target) — receives per-session Observations, DeviceUseStatement, and Device as an all-or-nothing transaction bundle ·
POST / (transaction bundle), POST /Observation, POST /DeviceUseStatement
- Bridges ORU Fallback (target) — HL7v2 fallback intake for vendor clouds that cannot accept FHIR writes, mapping OBX from the same normalized model ·
MLLP SEND ORU^R01, MLLP RECEIVE ACK^R01
- Dead Letter Queue (Dead-letter queue) — holds unmatched, malformed, or failed-write records with correlation ID and raw payload for replay ·
PUBLISH dlq, CONSUME dlq
Prerequisites
- Epic FHIR R4 endpoint with app registered on open.epic.com and Backend Services OAuth 2.0 client-credentials JWT authentication enabled
- Bridges interface engine access for HL7v2 ORU R01 fallback intake, with a defined interface spec and test facility
- Vendor device cloud API credentials for each contracted HHD and PD platform, plus data-sharing BAA covering PHI egress
- Patient enrollment roster mapping device serial numbers to Epic patient FHIR IDs and active dialysis prescriptions
- Nephrology-approved reference ranges and prescription parameters per modality for deviation flagging
- Anypoint Platform with CloudHub 2.0 or RTF, Anypoint MQ for queues and DLQs, and API Manager policies configured
1. Epic interfaces and standards
This accelerator implements the Home Dialysis Epic Data Sharing Playbook. Register the connecting app on Epic on FHIR and confirm the customer has the relevant Epic modules licensed before building.
- FHIR R4 Observation for treatment metrics such as UF volume, dwell volume, blood pressure, weight, and effluent
- FHIR R4 DeviceUseStatement and Device linking the cycler or hemodialysis machine to the patient
- FHIR R4 ServiceRequest and CarePlan representing the dialysis prescription for reconciliation
- HL7v2 ORU R01 as Bridges fallback intake for vendor clouds without FHIR write support
- Cogito Clinical for adherence and treatment-trend reporting on ingested Observations
- US Core Observation and Patient profiles with LOINC-coded results
Architecture
2. Business requirements
- Ingest every completed session and every missed or aborted session, because the absence of a treatment is the clinically important signal, not just abnormal values.
- Reconcile each record against the patient's active dialysis prescription so deviations in prescribed exchanges, dwell volume, or session count are flagged, not just raw metrics.
- Support both peritoneal dialysis cyclers and home hemodialysis machines, whose data models differ and must not be forced into one shape.
- Land data in Epic within hours of session upload so a nurse can intervene before the next scheduled treatment.
- Preserve device provenance and correlation IDs end to end for audit and for tracing a disputed value back to the source machine.
3. Ingestion and mapping
- Poll or subscribe to each vendor device cloud in a dedicated System API, one connector per vendor, isolating vendor schema churn from the rest of the flow.
- Map PD fields such as total UF, total dwell volume, number of exchanges, and effluent to LOINC-coded FHIR Observations; map HHD fields such as blood flow rate, pre and post weight, and treatment time similarly.
- Emit a FHIR DeviceUseStatement per session linking the Device by serial number to the patient, so the chart shows which machine produced the data.
- Use HL7v2 ORU R01 through Bridges as the fallback path for vendor clouds that cannot accept FHIR writes, mapping OBX segments from the same normalized model.
- Stamp every message with a correlation ID at intake and carry it through DataWeave transforms, queue metadata, and Epic write responses.
4. Matching and normalization
- Resolve device serial number to Epic patient FHIR ID using the enrollment roster; quarantine any serial with no active enrollment rather than guessing.
- Normalize units before mapping, converting mL, L, kg, and lb to canonical units so downstream reference ranges are comparable.
- Bind the session to the active ServiceRequest or CarePlan prescription effective on the session date, not the current prescription, to handle mid-cycle prescription changes.
- Derive adherence flags by comparing actual session count against prescribed frequency over the reporting window.
- Deduplicate re-uploaded sessions by device serial plus session start timestamp so cloud re-syncs do not create duplicate Observations.
5. Orchestration and worklist delivery
- Fan session records through Anypoint MQ so device-cloud latency spikes never block the Epic write path.
- Compute deviation and missed-treatment flags in the Process API, then hand a summarized session bundle to the Experience API that shapes the nephrology review worklist.
- Batch write Observations for a session as a single FHIR transaction bundle so a session is all-or-nothing in the chart.
- Route flagged sessions to a higher-priority worklist lane so out-of-range fluid removal or a missed treatment surfaces ahead of routine records.
- Reconcile a daily roll-up against expected session counts and raise an alert when an enrolled patient produces no data, the failure mode a value-only dashboard misses.
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.
- Scope Backend Services OAuth tokens to the minimum FHIR resource types written, and rotate the signing JWK on the documented cadence.
- Encrypt device-cloud payloads in transit with TLS 1.2 or higher and validate vendor certificates; never accept unauthenticated webhook posts.
- Quarantine records whose device serial does not map to an enrolled patient so unmatched PHI is never written to an arbitrary chart.
- Redact device serial numbers and patient identifiers from log output, retaining only the correlation ID for troubleshooting.
Sample payload — Normalized PD session mapped to a FHIR R4 Observation
{
"resourceType": "Observation",
"status": "final",
"category": [{
"coding": [{
"system": "http://terminology.hl7.org/CodeSystem/observation-category",
"code": "therapy",
"display": "Therapy"
}]
}],
"code": {
"coding": [{
"system": "http://loinc.org",
"code": "49576-1",
"display": "Ultrafiltration volume"
}]
},
"subject": { "reference": "Patient/eXyZ12ab34" },
"effectiveDateTime": "2026-08-19T23:14:00-05:00",
"valueQuantity": {
"value": 1180,
"unit": "mL",
"system": "http://unitsofmeasure.org",
"code": "mL"
},
"device": { "reference": "Device/pd-cycler-SN-8842019" },
"identifier": [{
"system": "https://muley.example/correlation-id",
"value": "hd-20260819-8842019-c3f1"
}]
}
Testing and validation
- Unit-test DataWeave transforms with MUnit for both PD and HHD field sets, asserting LOINC codes and canonical units on every mapped Observation.
- Test the enrollment-resolution branch with a known-unmatched serial and assert the record is quarantined, not written.
- Replay a duplicate cloud re-sync and assert deduplication produces no second Observation for the same session key.
- Validate ORU R01 fallback output against the Bridges interface spec in the test facility before enabling the vendor on that path.
- Assert missed-treatment flagging by feeding a window with fewer sessions than the prescribed frequency and checking the derived flag.
- Run FHIR transaction bundles against the Epic sandbox and confirm all-or-nothing behavior on a deliberately invalid Observation.
Phased rollout
Phase 1 — Connect
- Register the Backend Services app on open.epic.com and complete OAuth JWT handshake against the sandbox.
- Stand up one vendor System API and confirm authenticated session pulls with correlation IDs flowing into Anypoint MQ.
Phase 2 — Map and test
- Build and MUnit-test PD and HHD DataWeave mappings to FHIR Observations and DeviceUseStatement against the Epic sandbox.
- Validate enrollment resolution, deduplication, and missed-treatment flagging with recorded vendor sample data.
Phase 3 — Production
- Enable one vendor and a pilot patient cohort with the daily no-data reconciliation alert active.
- Add remaining vendors and expand the enrolled cohort once worklist flagging and error rates hold steady.
Success metrics
- Median device-to-chart latency per session, measured from cloud upload to Epic write acknowledgment
- Percentage of enrolled patients with a daily no-data alert, tracked as a coverage gap indicator
- Quarantine rate for unmatched device serials, trended to catch enrollment roster drift
- FHIR write success rate and DLQ depth per vendor
- Missed-treatment flags surfaced to the worklist versus confirmed clinician actions
Troubleshooting
- Sessions arrive from a vendor cloud but never appear in Epic, and the DLQ is empty. — Likely cause: The device serial has no active enrollment mapping, so records are being quarantined silently upstream of the write path. Fix: Check the quarantine queue and enrollment roster, add the serial-to-patient mapping, then replay the quarantined records.
- Duplicate Observations for the same treatment appear in the chart after a cloud re-sync. — Likely cause: The deduplication key is not stable because the vendor changed the session start timestamp precision on re-upload. Fix: Normalize the timestamp to the minute in the dedup key and reconcile existing duplicates via a one-time cleanup script.
- UF volume values look implausibly large or small in Cogito trend reports. — Likely cause: A vendor reports volume in liters while the mapping assumed milliliters, so unit normalization was skipped. Fix: Add the vendor unit to the canonical conversion table in DataWeave and re-run MUnit unit-conversion assertions.
- A patient stopped producing data but no one noticed for a week. — Likely cause: Monitoring alerted only on abnormal values, not on the absence of an expected session. Fix: Enable the daily no-data reconciliation alert that compares enrolled patients against received sessions for the window.
Deliverable: A System API for home dialysis device cloud ingestion, a Process API normalizing and reconciling HHD and PD sessions against Epic prescriptions and enrollments, and an Experience API delivering flagged session summaries to a nephrology worklist. Ships DataWeave-to-FHIR R4 mappings, HL7v2 ORU fallback, DLQ topology, sample payloads, MUnit tests, and a phased rollout runbook.