Connects a third-party computer-assisted coding engine to Epic HIM abstraction and DRG assignment so coders work suggested ICD-10, CPT, and DRG codes inside Hyperdrive instead of a bolt-on window. Covers document push, code retrieval, DRG reconciliation, and write-back to the coding record.
Tags: healthcare, epic, hl7v2, fhir, revenue-cycle, api-led, interoperability, loinc
Encoder
Objective: HIM coders and CDI staff need a third-party encoder to suggest diagnosis, procedure, and DRG codes without leaving Epic's coding workflow. Today the encoder runs in a separate window, forcing coders to rekey context and hand-carry final codes back into the abstraction record, which breeds transcription errors and DNFB delays. Done looks like this: when an account reaches the coding work queue, its documents flow to the encoder, suggested code sets and the calculated DRG return correlated to the same account, the coder accepts or edits in Hyperdrive, and finalized codes plus DRG write back cleanly, with any DRG mismatch against the Epic Grouper flagged before the claim drops. This accelerator packages the Encoder Epic Data Sharing Playbook as a MuleSoft-anchored solution plan.
What's Getting Built
- Epic (System API) — pulls encounter documents and account context from Epic for coding ·
GET /DocumentReference, GET /Encounter/{csn}, POST /Condition, POST /Procedure
- Encoder (System API) — delivers clinical documents to the CAC engine and retrieves suggested codes and DRG ·
MLLP SEND MDM^T02, POST /documents, GET /codes/{correlationId}, GET /drg/{correlationId}
- Coding Orchestrator (Process API) — triggers on the coding work queue, reconciles the encoder DRG against the Epic Grouper, and writes finalized codes back ·
POST /encounters/{csn}/code, POST /reconcile-drg, PUT /coding-record
- Epic HIM (target) — receives finalized Condition and Procedure write-back and coded charge and DRG posting ·
POST /Condition, POST /Procedure, MLLP SEND DFT^P03
- Dead Letter Queue (Anypoint MQ) — holds un-correlated results and failed submissions for review and idempotent replay by correlation ID ·
PUBLISH {correlationId}, CONSUME {correlationId}
Prerequisites
- Epic HIM/coding module enabled with abstracting and coding work queues configured, plus Bridges interface engine access
- Encoder or CAC vendor endpoint with published API for document submission and code/DRG retrieval, and licensed ICD-10-CM/PCS, CPT/HCPCS, and grouper content
- Epic MDM interface for clinical document push and a coding write-back interface (custom web service or FHIR) provisioned by the Epic team
- Anypoint Platform org with CloudHub or RTF, HL7 and HTTP connectors, and Anypoint MQ for queuing and DLQ
- Agreed code-set and grouper versions on both sides for the current fiscal year, including ICD-10 and MS-DRG effective dates
- Registered client credentials and mutual TLS between MuleSoft and both the encoder and Epic endpoints
1. Epic interfaces and standards
This accelerator implements the Encoder 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 MDM T02 for clinical document delivery to the encoder
- Epic HIM coding and abstracting work queues surfaced in Hyperdrive
- FHIR R4 DocumentReference and Encounter for account and document context
- FHIR R4 Claim and Condition/Procedure for finalized diagnosis and procedure code write-back
- HL7v2 DFT P03 for coded charge and DRG posting to billing
- Epic MS-DRG/APR-DRG Grouper for reconciliation against the encoder DRG
Architecture
2. Business requirements
- Suggested codes must appear against the same Epic account the coder opened; a code set with no reliable account correlation is worse than none.
- Return ICD-10-CM diagnoses, ICD-10-PCS and CPT/HCPCS procedures, and the calculated MS-DRG or APR-DRG as one correlated result per encounter.
- Never auto-finalize a claim on encoder output alone; the coder or CDI reviewer accepts, edits, or rejects each suggestion in Hyperdrive.
- Reconcile the encoder DRG against the Epic Grouper before charges post, and block silent divergence that inflates or deflates reimbursement.
- Keep DNFB days flat or falling; the blueprint must not add a queue that strands accounts waiting on encoder round-trips.
3. Document ingestion and context assembly
- Trigger on the account entering the coding work queue, then pull the encounter's discharge summary, operative notes, and H&P via DocumentReference rather than scraping the whole chart.
- Deliver documents to the encoder as MDM T02 through Bridges or as a DocumentReference bundle, whichever the vendor ingests natively.
- Stamp every submission with a correlation ID keyed to the Epic CSN so returning code sets rejoin the correct account.
- Include encounter class, discharge disposition, patient age, and sex, because grouper logic and DRG assignment depend on them.
- Batch multi-document accounts into a single logical submission so the encoder groups against the complete record, not one note at a time.
4. Code and DRG mapping
- Map encoder output to Epic-expected code systems in DataWeave: ICD-10-CM and ICD-10-PCS by exact code, CPT/HCPCS with modifiers preserved.
- Carry present-on-admission (POA) indicators and hospital-acquired-condition flags through unchanged, since they move the DRG.
- Normalize the DRG payload to include DRG code, description, relative weight, and the MDC so reconciliation has something to compare.
- Reject any code the current Epic fiscal-year code table does not recognize into a review lane rather than dropping it silently.
- Preserve encoder confidence scores and evidence links as annotations on the suggestion so coders can judge, not just accept.
5. DRG reconciliation and write-back
- Recompute or request the Epic Grouper DRG on the finalized code set and compare it to the encoder DRG before any DFT posts.
- On a DRG match, write finalized Condition and Procedure resources plus the DRG to the Epic coding record and post charges via DFT P03.
- On a DRG mismatch, hold the account, raise a CDI review task, and attach both DRGs with their relative weights for adjudication.
- Make write-back idempotent on the correlation ID so a retried finalize never double-posts codes or charges.
- Emit a coded-and-reconciled event so downstream Cogito analytics and DNFB dashboards see completion in near real time.
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 document push to the minimum note types the encoder needs to group; do not stream the entire longitudinal chart to a coding engine.
- Enforce mutual TLS and per-environment client credentials so the encoder cannot receive PHI from a mis-scoped non-production tenant.
- Log coder accept, edit, and reject actions with user identity for coding-integrity and RAC audit defense.
- Scrub or tokenize direct identifiers not needed for grouping when the encoder is a multi-tenant SaaS.
Sample payload — Encoder result returned to the Process API for reconciliation
{
"correlationId": "CSN-874512-20260819",
"patientClass": "inpatient",
"dischargeDisposition": "01",
"diagnoses": [
{ "system": "ICD-10-CM", "code": "J96.01", "display": "Acute respiratory failure with hypoxia", "poa": "Y", "confidence": 0.94 },
{ "system": "ICD-10-CM", "code": "J18.9", "display": "Pneumonia, unspecified organism", "poa": "Y", "confidence": 0.88 }
],
"procedures": [
{ "system": "ICD-10-PCS", "code": "5A1945Z", "display": "Respiratory ventilation, 24-96 hours", "confidence": 0.91 }
],
"drg": { "system": "MS-DRG", "code": "189", "description": "Pulmonary edema and respiratory failure", "relativeWeight": 1.2154, "mdc": "04" }
}
Testing and validation
- Submit a known coded chart and assert the returned ICD-10-CM, ICD-10-PCS, and MS-DRG exactly match a coder-validated gold record.
- Force a DRG mismatch between encoder and Epic Grouper and confirm the account holds and a CDI review task is created rather than posting charges.
- Send a code retired in the prior fiscal year and verify it routes to the review lane and does not write to the coding record.
- Replay a finalize with the same correlation ID and confirm idempotent write-back with no duplicate Condition, Procedure, or DFT.
- Load-test the coding-queue trigger at end-of-month volume and confirm DNFB round-trip latency stays within the agreed SLA.
- Validate POA and HAC flags survive the DataWeave transform end to end, since a dropped POA silently changes the DRG.
Phased rollout
Phase 1 — Connect
- Stand up the System APIs to Epic (Bridges/FHIR) and to the encoder vendor, with mutual TLS and credentials per environment.
- Confirm code-set and grouper versions match on both sides for the current fiscal year before any mapping work.
Phase 2 — Map and test
- Build DataWeave maps for ICD-10-CM/PCS, CPT/HCPCS, and DRG, then validate against coder-signed gold charts.
- Run parallel coding on a sample: encoder-in-Epic suggestions versus current standalone workflow, and reconcile every DRG.
Phase 3 — Production
- Enable for one coding team or service line with DRG reconciliation blocking on mismatch and CDI review tasking live.
- Expand by service line as DNFB and DRG-match rates hold, keeping the DLQ and reconciliation dashboards monitored.
Success metrics
- DRG match rate between encoder and Epic Grouper on finalized accounts
- Coder suggestion acceptance rate versus edit and reject rate
- DNFB days and average coding round-trip latency per account
- Rate of codes routed to the review lane for unrecognized or retired codes
- DLQ depth and mean time to reprocess failed submissions
Troubleshooting
- Encoder returns code sets but they never attach to the right Epic account. — Likely cause: Correlation ID is not keyed to the Epic CSN or is dropped on the return leg. Fix: Stamp the CSN-based correlation ID on submission, require it on the response, and reject un-correlated results to the DLQ.
- Claims post with a DRG that differs from what coders saw in Epic. — Likely cause: Reconciliation runs after charges post, or the Epic Grouper and encoder use different fiscal-year content. Fix: Move reconciliation before DFT posting and pin both sides to the same grouper effective date; hold on mismatch.
- A subset of diagnoses silently disappears between encoder and the coding record. — Likely cause: Codes not present in the current Epic fiscal-year code table are dropped by the DataWeave map. Fix: Route unrecognized or retired codes to an explicit review lane and alert, rather than filtering them out.
- Retried finalize creates duplicate Procedure resources and duplicate charges. — Likely cause: Write-back is not idempotent and treats each retry as a new submission. Fix: Key write-back on the correlation ID and upsert, so a replayed finalize reconciles to the existing coding record.
Deliverable: A deployable Anypoint blueprint: System API to the encoder vendor, a Process API that orchestrates code-set assignment against Epic HIM coding queues via Bridges HL7v2 and FHIR, DataWeave mappings for ICD-10-CM/PCS, CPT/HCPCS, and MS-DRG/APR-DRG, plus DLQ, reconciliation, and CDI-query error handling.