A MuleSoft blueprint that syncs surgical supply readiness, case-cart contents, and implant/UDI documentation between the SPD/inventory system and Epic OpTime, so preference cards, case pick lists, and intraoperative supply capture stay in agreement. Distinct from device-telemetry and decision-support playbooks: it is inventory-and-materials centric, not vitals or CDS.
Tags: healthcare, epic, hl7v2, fhir, interoperability, connected-devices, system-api, process-api
Surgical Supplies
Objective: Perioperative teams lose time and revenue when the surgical supply chain and the Epic OR record disagree: carts get picked against stale preference cards, implants used in the room never reach the chargeable record, and UDI capture is incomplete or arrives after the case closes. The root cause is a materials system (SPD or ERP inventory) and Epic OpTime keeping two ledgers that only reconcile by hand. Done looks like: preference-card pick lists flow to the floor with real-time on-hand availability, supplies and implants scanned in the room post to the OpTime case with UDI, and every consumed item either produces a charge or a documented reason it did not. This accelerator packages the Surgical Supplies Epic Data Sharing Playbook as a MuleSoft-anchored solution plan.
What's Getting Built
- Supply System (System API) — reads the SPD/ERP item master and on-hand feed and intakes GS1 case-cart scans ·
GET /items, GET /inventory/on-hand, POST /scans
- Case Cart Pick List (Experience API) — serves preference-card pick lists with live on-hand to SPD and takes OR scan client input ·
GET /cases/{logId}/pick-list, POST /cases/{logId}/scans
- OpTime Supply Reconciliation (Process API) — matches scans to the open case, validates UDI against GUDID, and reconciles SPD usage against OpTime ·
CONSUME queue by surgical log ID, POST /reconcile, GET /cases/{logId}/variance
- case-supply-queue (Anypoint MQ queue) — per-surgical-log queue that preserves case ordering and holds early scans for safe replay ·
PUBLISH by {logId}, CONSUME by {logId}, DLQ replay by serial + logId
- Reconciliation Sweep (Scheduler) — periodic per-closing-case sweep that catches scans that never arrived event-driven ·
SCHEDULER per closing case
- Epic OpTime (target) — posts supply usage, charges, and implant/UDI documentation to the OpTime case via Bridges and FHIR ·
DFT^P03 supply usage/charge, POST FHIR Device / DeviceUseStatement, POST FHIR SupplyDelivery / ChargeItem
Prerequisites
- Epic OpTime live with preference cards, case tracking, and supply/implant documentation enabled; Bridges configured for supply and DFT interfaces
- Materials management source with a queryable item master and on-hand inventory (SPD/ERP) plus barcode/GS1 case-cart scanning at point of use
- Epic HL7v2 interface for supply usage and charges (DFT^P03) and, where available, FHIR R4 endpoints for Device, DeviceUseStatement, SupplyDelivery, and ChargeItem
- GS1 GTIN and FDA UDI (GUDID) reference access to parse and validate scanned implant barcodes
- Anypoint Platform with CloudHub or RTF, Anypoint MQ for the reconciliation queue and DLQ, and API Manager for policy enforcement
- Item-master crosswalk mapping supplier catalog numbers and GTINs to Epic supply record IDs (ERX/inventory item IDs)
1. Epic interfaces and standards
This accelerator implements the Surgical Supplies Epic Data Sharing Playbook. Register the connecting app on Epic on FHIR and confirm the customer has the relevant Epic modules licensed before building.
- OpTime (case tracking, preference cards, supply and implant documentation)
- Bridges HL7v2 DFT^P03 for supply usage and charge posting
- FHIR R4 Device and DeviceUseStatement for implant and UDI documentation
- FHIR R4 SupplyDelivery and SupplyRequest for case-cart fulfillment
- FHIR R4 ChargeItem for consumed-supply charge capture
- GS1 GTIN parsing and FDA UDI/GUDID for implant identification
Architecture
2. Business requirements
- Push preference-card pick lists to SPD with current on-hand quantity so carts are picked against what actually exists, not what the card assumes.
- Post every supply and implant scanned in the room to the correct OpTime case as documented usage, with UDI for implantable devices.
- Guarantee each consumed item either generates a charge or carries a documented no-charge reason; a used implant with no charge and no reason is a defect, not an omission.
- Reconcile the SPD ledger against OpTime documented usage per case and surface the variance before the case is closed and billed.
- Capture UDI at point of use in the OR, not retrospectively, so device-recall traceability holds for the actual patient.
3. Ingestion and mapping
- Build a System API over the item master and on-hand feed; normalize supplier catalog number, GTIN, unit of measure, and lot/serial into a canonical supply model in DataWeave.
- Parse GS1 Application Identifiers from scanned barcodes (01 GTIN, 17 expiry, 10 lot, 21 serial) and reject scans missing a GTIN rather than posting an ambiguous item.
- Crosswalk GTIN and catalog number to the Epic supply record ID via a managed lookup table; treat an unmapped item as a reconciliation exception, never a silent drop.
- Map documented implant usage to FHIR R4 Device with udiCarrier and to DeviceUseStatement referencing the OpTime encounter and patient.
- Map consumable supply usage to DFT^P03 or FHIR ChargeItem, carrying quantity, unit, and the case/log correlation ID.
4. Matching and reconciliation
- Match scanned items to the open OpTime case by surgical log ID plus room and time window; do not match by patient name alone.
- Validate every implant UDI against GUDID; flag a scan whose GTIN is not in GUDID for manual review before it posts as a documented device.
- Diff SPD consumption against OpTime documented usage per case: report items on the cart but not documented, and documented but not decremented from inventory.
- Detect and suppress duplicate scans of the same serial within a case so a single implant is not documented or charged twice.
- Hold posting until the case log is in a state that accepts supply documentation; queue early scans rather than erroring.
5. Orchestration
- Use API-led layering: System API for SPD/inventory, Process API for the case-to-supply reconciliation, and a thin Experience layer for the SPD pick-list and OR scan clients.
- Stamp a correlation ID at first scan and propagate it through GUDID lookup, DFT/FHIR posting, and reconciliation so one item's path is traceable end to end.
- Drive posting from an Anypoint MQ queue keyed by surgical log ID to preserve per-case ordering and enable safe replay.
- Run the SPD-versus-OpTime reconciliation as a scheduled sweep per closing case, not only event-driven, to catch scans that never arrived.
- Keep the item-master crosswalk hot-reloadable so a newly stocked implant can be mapped without redeploying the app.
6. Error handling and operations
- Route unmapped GTINs, GUDID misses, and no-open-case scans to a dead-letter queue with the raw barcode and correlation ID preserved for replay.
- Alert on the absence of documented usage for a case that consumed cart items, which is the failure mode dashboards miss most often.
- Fail closed on charge posting: never invent a charge for an item whose crosswalk or quantity is uncertain; hold it for review instead.
- Track per-case reconciliation lag so a backlog of unposted scans is visible before billing, not after a denied claim.
- Make DLQ replay idempotent by keying on serial plus surgical log ID so a reprocessed scan cannot double-document an implant.
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.
- Enforce that a scanned item can only be documented against the OpTime case matching its room and time window, preventing cross-case supply or implant attribution.
- Validate and sanitize GS1 barcode payloads before parsing; reject malformed AIs rather than passing raw scan data into downstream posting.
- Restrict the item-master crosswalk and no-charge-reason tables to change control, since a bad mapping silently misbills or misdocuments implants.
- Retain UDI and lot/serial capture with tamper-evident audit for the device-recall traceability window required for implantables.
Sample payload — FHIR R4 DeviceUseStatement for an implant documented to an OpTime case
{
"resourceType": "DeviceUseStatement",
"status": "completed",
"subject": { "reference": "Patient/eN3xQ2" },
"context": { "reference": "Encounter/optime-log-4471902" },
"timingDateTime": "2026-08-20T14:32:00-05:00",
"device": {
"identifier": {
"system": "http://hl7.org/fhir/NamingSystem/gs1-di",
"value": "00889842011234"
},
"display": "Titanium interference screw 8mm"
},
"bodySite": { "text": "Left knee" },
"note": [ { "text": "UDI: (01)00889842011234(17)280131(10)LOT4471(21)SN00918" } ],
"identifier": [ { "system": "urn:muley:correlation-id", "value": "cc-4471902-0007" } ]
}
Testing and validation
- Unit-test the GS1 parser against barcodes with missing, reordered, and variable-length AIs; assert a missing GTIN is rejected, not defaulted.
- Test the GTIN-to-Epic-supply crosswalk for unmapped, one-to-many, and retired items; confirm each becomes a reconciliation exception.
- Validate GUDID lookup handling for hits, misses, and timeouts; a lookup timeout must queue for review, not block the case.
- Simulate duplicate serial scans within one case and confirm exactly one DeviceUseStatement and one ChargeItem result.
- Run a full case fixture end to end: pick list to SPD, scans in the room, DFT/FHIR posting, and SPD-versus-OpTime variance report.
- Chaos-test DLQ replay to confirm idempotency keyed on serial plus surgical log ID prevents double documentation.
Phased rollout
Phase 1 — Connect
- Stand up the System API over the SPD item master and on-hand feed; verify read of inventory and GS1 scan intake in a non-prod OpTime environment.
- Establish the Bridges DFT and FHIR Device/SupplyDelivery endpoints and confirm connectivity with a single test surgical log.
Phase 2 — Map and test
- Build the DataWeave supply model, GTIN crosswalk, and GUDID validation; run recorded case-cart scan sets through reconciliation in a test harness.
- Validate documented-usage and charge posting against OpTime supply documentation and the DFT interface with clinical informatics sign-off.
Phase 3 — Production
- Pilot on one service line and OR suite; monitor per-case reconciliation lag and no-usage-on-consumed-cart alerts daily.
- Expand service line by service line, promoting new implant GTINs through the hot-reloadable crosswalk without redeploys.
Success metrics
- Percentage of consumed items with matching OpTime documented usage per case (target the high 90s).
- Implant UDI capture rate at point of use versus retrospective entry.
- Median reconciliation lag from room scan to posted OpTime documentation.
- Rate of consumed items with neither a charge nor a documented no-charge reason (drive toward zero).
- DLQ volume by cause: unmapped GTIN, GUDID miss, no open case.
Troubleshooting
- Implants scanned in the room never appear on the OpTime case. — Likely cause: Scans arrived before the surgical log was in a state that accepts supply documentation and were dropped instead of queued. Fix: Queue early scans on the per-log Anypoint MQ topic and post when the log opens; alert if a case closes with queued but unposted scans.
- A single implant is documented and charged twice on the same case. — Likely cause: Duplicate serial scans were processed independently without idempotency. Fix: Deduplicate on serial plus surgical log ID at ingestion and key DLQ replay on the same tuple.
- Consumed supplies post as documented usage but never generate a charge. — Likely cause: The GTIN mapped to an Epic supply record with no charge linkage or an uncertain quantity, and the flow failed open. Fix: Fail closed: hold the item for review, and correct the crosswalk or no-charge-reason mapping before reposting.
Deliverable: A deployable Anypoint application with a Supply System API over the SPD/inventory source, an OpTime Supply Reconciliation process API, and DataWeave maps that turn inventory feeds and case-cart scans into Epic OpTime supply documentation and implant/UDI records, plus DLQ replay and reconciliation dashboards.