Drives AI medical coding off Epic clinical documentation and returns ICD-10-CM/PCS and CPT codes to the HIM abstraction worklist with mandatory human-in-the-loop review, evidence linkage, and confidence-based autopost thresholds. Distinct from CDS Hooks decision-support: this is a post-discharge revenue-cycle coding pipeline, not point-of-care alerting.
Fully Autonomous Coding
Objective: Coders spend their day re-reading notes to find the same diagnoses and procedures, and encounters queue faster than they clear. The goal: an AI engine reads the finalized documentation for an encounter, proposes ICD-10-CM/PCS and CPT/HCPCS codes with a confidence score and the exact note text justifying each code, then drops that draft into the coder's Epic abstraction worklist. Done looks like every codeable encounter getting a draft within minutes of documentation-final, high-confidence codes pre-populated but never auto-billed without sign-off, and each accept or reject feeding audit and retraining. The model never touches the claim; a credentialed coder owns the final code set. This accelerator packages the Fully Autonomous Coding Epic Data Sharing Playbook as a MuleSoft-anchored solution plan.
What's Getting Built
- FHIR DocumentReference Ingest (System API) — reads finalized clinical notes and backfills encounters via Bulk Data export ·
GET /DocumentReference?docStatus=final, GET /Encounter/{id}, POST /$export
- Coding Orchestrator (Process API) — assembles the note packet, calls the AI coding engine, normalizes codes, and routes by confidence band ·
CONSUME encounter-queue, POST /code, POST /route
- idempotency-keys (Object Store) — encounter-CSN keys so streaming and bulk paths converge on one work item ·
GET /{csn}, PUT /{csn}
- HIM Worklist (Experience API) — posts the proposed codes plus evidence spans into the Epic abstraction worklist and captures coder accept or reject ·
POST /review-packet, POST /worklist/{csn}/accept
- Bridges DFT to Revenue Cycle (target) — files the coder-approved code set back to the encounter keyed on CSN ·
MLLP SEND DFT^P03, MDM^T02
- DLQ and Audit Store (Object Store) — holds incomplete encounters for replay and retains the immutable evidence-and-decision audit trail ·
PUT /dlq/{csn}, GET /dlq/{csn}, PUT /audit/{correlationId}
Prerequisites
- Epic FHIR R4 endpoint registered on open.epic.com with a SMART Backend Services (client_credentials) app scoped to DocumentReference.read, Condition.read, Procedure.read, Encounter.read
- Epic Bulk Data (Flat FHIR $export) enabled with group-level export for daily catch-up and reconciliation of finalized encounters
- HIM governance decision on confidence thresholds: the autopost cutoff, the mandatory-review band, and the always-suppress band, signed off by the coding compliance officer
- An AI coding engine (in-house or vendor) reachable over HTTPS that accepts note text and returns coded suggestions with per-code evidence offsets and confidence
- Anypoint Platform with VPC/VPN or PrivateLink to the AI engine, Anypoint MQ for the encounter work queue and DLQ, and Object Store v2 for idempotency keys
- Epic interface engineer contact for the inbound channel that files coder-reviewed codes back to the encounter (HL7v2 DFT/BAR or Epic coding API)
1. Epic interfaces and standards
This accelerator implements the Fully Autonomous Coding 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 DocumentReference (finalized progress, H&P, op notes, discharge summaries)
- FHIR R4 Encounter, Condition, and Procedure resources for context and reconciliation
- FHIR Bulk Data Access group-level $export for daily encounter backfill
- Epic Bridges HL7v2 DFT and MDM for feeding reviewed codes into revenue cycle
- Hyperdrive HIM abstraction worklist as the human-in-the-loop review surface
- Cogito for coder productivity, autopost acceptance rate, and DNFB analytics
Architecture
2. Business requirements
- Code every codeable encounter as a draft, but let a credentialed coder own the final code set; the model proposes, the human disposes.
- Attach to each proposed code the verbatim note span and DocumentReference id that justifies it, so the coder verifies instead of re-reading the chart.
- Route codes by confidence into three bands: autopost-and-hold-for-signoff, mandatory-review, and suppress; never let a code reach a claim without human acceptance.
- Trigger on documentation-final, not on encounter-open, so the model never codes a chart that is still being written.
- Capture every accept, edit, and reject as labeled feedback for model retraining and OIG-defensible audit.
3. Ingestion and note assembly
- Subscribe to finalized DocumentReference resources per encounter; gate on docStatus=final and note type so drafts and addenda-in-progress are excluded.
- Assemble the full note packet per encounter: pull all relevant DocumentReference content plus Encounter, Condition, and Procedure context in one DataWeave transform.
- Use Bulk Data group-level $export nightly to reconcile any encounter whose final-document event was missed by the streaming path.
- De-identify or tokenize before the note leaves the System API boundary if the AI engine runs outside the PHI trust zone.
- Stamp a correlation id keyed on encounter CSN so streaming and bulk paths converge on one work item, not two.
4. Coding orchestration and confidence routing
- The Process API calls the AI engine, then normalizes its output to a canonical code set with system URIs for ICD-10-CM, ICD-10-PCS, and CPT.
- Validate every returned code against the active code set version for the date of service; reject codes retired or not yet effective.
- Apply the governance thresholds in DataWeave, not in the model: the band boundaries are a config-managed policy, not a hardcoded number.
- Suppress codes the engine cannot tie to an evidence span; an unsupported code is worse than a missing one for a coder.
- Bundle proposed codes, evidence, confidence, and model version into one review packet per encounter.
5. Human-in-the-loop review and writeback
- Post the review packet to the Epic HIM abstraction worklist via the Experience API so coders work inside Hyperdrive, not a bolt-on tool.
- Only codes a coder accepts or edits are eligible for writeback; rejected and unreviewed codes never leave the worklist.
- File the coder-approved code set back through Bridges as a DFT/BAR message keyed on the same encounter CSN and correlation id.
- Record the delta between model proposal and coder-final set per code as the training and QA signal.
- Never write a code back to Epic that no human touched, even at 0.99 confidence; the sign-off is the compliance control, not the score.
6. Operations and monitoring
- Alert on the absence of an expected coding draft for a finalized encounter, which is the failure mode a throughput dashboard hides.
- Track DNFB (discharged-not-final-billed) days as the real business metric; API latency is a proxy, DNFB is the outcome.
- Dead-letter any encounter whose note packet is incomplete rather than coding a partial chart, and replay after documentation completes.
- Version and log the model release id on every packet so a coding-quality regression can be traced to a specific model version.
- Reconcile daily: every finalized encounter either has a review packet, a DLQ entry, or a documented suppression reason.
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.
- Segregate the AI engine into its own trust zone; if it is a third party, de-identify or tokenize note text at the System API and re-associate codes only inside the PHI boundary.
- Enforce that writeback is gated on an authenticated coder identity captured in the worklist accept event; an autoposted code with no signing user id must be rejected at the Bridges channel.
- Retain the full evidence-and-decision trail (proposed code, span, confidence, model version, coder action, timestamp) as an immutable audit log for coding-compliance and OIG audits.
- Pin AI engine responses to a signed model version; block writeback if the model version is not on the approved-for-production allowlist.
Sample payload — FHIR DocumentReference (finalized discharge summary triggering a coding draft)
{
"resourceType": "DocumentReference",
"id": "eN4kd9x1p2",
"status": "current",
"docStatus": "final",
"type": {
"coding": [{
"system": "http://loinc.org",
"code": "18842-5",
"display": "Discharge summary"
}]
},
"subject": { "reference": "Patient/eXYZ123" },
"context": {
"encounter": [{ "reference": "Encounter/eENC456" }],
"period": { "start": "2026-08-14T08:00:00Z", "end": "2026-08-18T15:30:00Z" }
},
"content": [{
"attachment": {
"contentType": "text/plain",
"url": "Binary/bDISCH789"
}
}]
}
Testing and validation
- Feed a golden set of pre-coded encounters through the pipeline and assert the proposed code set matches the human-adjudicated answer key within tolerance per code category.
- Test the confidence router at each band boundary with codes just above and just below the threshold to prove the routing policy is config-driven.
- Verify that a code returned with no evidence span is suppressed, not posted, and lands in the audit log with a suppression reason.
- Prove the streaming and bulk paths converge: emit a final-document event and a nightly export for the same CSN, assert exactly one review packet.
- Confirm no code reaches the DFT writeback channel without a captured coder accept event, using a simulated unsigned autopost.
- Load-test month-end volume against the AI engine and assert DLQ drains and DNFB metric stays within target.
Phased rollout
Phase 1 — Connect
- Register the SMART Backend Services app on open.epic.com and validate DocumentReference.read, Encounter.read, Condition.read, and Procedure.read scopes against the sandbox.
- Stand up the AI engine connectivity over PrivateLink/VPN and confirm the coding response contract includes per-code evidence offsets and confidence.
Phase 2 — Map and test
- Build the DataWeave note-assembly and code-normalization transforms and validate against the golden pre-coded encounter set.
- Tune and lock the three confidence bands with the coding compliance officer, and run the boundary and no-evidence-suppression tests.
Phase 3 — Production
- Shadow-run in parallel with fully manual coding for a defined period, comparing model proposals to coder-final sets before any autopost.
- Enable autopost-with-signoff for the highest-confidence band only, monitor DNFB and acceptance rate, then widen the band gradually.
Success metrics
- Coder acceptance rate of proposed codes, tracked separately per confidence band
- Discharged-not-final-billed (DNFB) days versus pre-blueprint baseline
- Encounters coded end-to-end within target minutes of documentation-final
- Autopost precision: share of high-band codes accepted unchanged by the coder
- Percent of finalized encounters with a review packet, DLQ entry, or logged suppression
Troubleshooting
- Encounters are finalized in Epic but no coding draft ever appears in the HIM worklist. — Likely cause: The DocumentReference trigger is firing on docStatus other than final, or the streaming subscription filter excludes the note type. Fix: Assert the gate on docStatus=final and audit the note-type filter; run the nightly Bulk Data reconciliation to backfill missed encounters and alert on the missing-draft condition.
- The AI engine returns codes but many are suppressed and never reach coders. — Likely cause: The engine is returning codes without evidence offsets, so the no-evidence suppression rule drops them. Fix: Confirm the coding response contract includes per-code evidence spans; if the engine cannot supply them, route those codes to the mandatory-review band instead of suppressing, per governance.
- Codes appear on claims that no coder reviewed. — Likely cause: The DFT writeback channel accepted a packet whose coder accept event carried no signing user id. Fix: Enforce the authenticated-coder gate at the Experience API and reject unsigned packets at the Bridges channel; audit the immutable decision log for the offending correlation ids.
- Coding-quality QA flags a sudden drop in accuracy for one code category. — Likely cause: A new AI model version was promoted without shadow validation on the golden set. Fix: Roll back to the last approved model version on the allowlist, re-run the golden-set regression, and block promotion until the category passes tolerance.
Deliverable: A deployable Anypoint blueprint: System APIs over Epic FHIR DocumentReference and Bulk Data, a Process API that orchestrates the AI coding engine and confidence scoring, and an Experience API that posts proposed ICD-10/CPT codes plus evidence spans into the Epic HIM abstraction worklist for coder review, with full audit and appeal trails.