Inbound referrals arrive as fax/email packets, EHR orders, and portal submissions, and every stall is a referral that leaks out of the network. This blueprint is orchestration, not extraction: it wires the existing IDP referral prompt suite into a lifecycle, matches patient and provider, verifies benefits and prior authorization, books the visit into the EHR, and tracks the whole chain with a leakage flag that fires the moment a referral stalls — a human touching only the exceptions.
Tags: healthcare, provider, referral-management, intelligent-document-processing, prior-authorization, benefits-verification, scheduling, api-led, salesforce, epic, cerner, fhir, da-vinci, agentforce
Referral Management Orchestration
Objective: Referrals arrive as multi-page fax/email packets, EHR orders, and portal submissions. Today a person opens each one, keys the data, chases what's missing, verifies benefits and prior auth, and books the visit by hand. Every stall leaks a referral out of the network — lost revenue, delayed care, no visibility until a referring physician calls asking why their patient never got scheduled. Working looks like every referral captured and structured automatically, triaged against patient/provider records, benefits and auth verified electronically, the visit booked into the EHR — leakage flag firing the moment a referral stalls, staff touching only exceptions.
What's Getting Built
- Referral Orchestration (Process API) — runs the RECEIVED to COMPLETE state machine and converges fax, EHR, and portal referrals onto one lifecycle ·
POST /referrals, GET /referrals/{referralId}, PATCH /referrals/{referralId}/state
- Referral Intake Classifier-to-Extractor Fan-out (Batch flow) — segments batched faxes, classifies packet pages, and routes each page range to its IDP extractor ·
RUN idp-prompt-multi-patient-packet-segmentation, RUN idp-prompt-referral-packet-page-classification, RUN idp-prompt-*-extraction
- Referral Leakage Clock (Scheduler) — ages each state transition against its SLA and raises the leakage flag with stage and reason ·
SCHEDULER poll aging referrals, PATCH /referrals/{referralId}/leakage
- Epic / Cerner ServiceRequest Intake (System API) — maps inbound FHIR ServiceRequest referral orders to the canonical shape orchestration consumes ·
GET /ServiceRequest/{id}, POST /ServiceRequest/$subscribe
- Salesforce Referral Case (target) — system of record carrying lifecycle status, leakage flag, and history for the agent desktop ·
POST /case, PATCH /case/{caseId}
This plan is orchestration, not extraction. The IDP referral suite already in the library — idp-prompt-referral-packet-page-classification and its five downstream extraction prompts — does the reading. This blueprint wires those prompts into a lifecycle, adds the state machine carrying a referral from "packet received" to "appointment booked," and hands off to the existing benefits, prior-auth, scheduling, and directory blueprints instead of rebuilding.
Value chain phase
Referral intake through scheduled care, with leakage measured at every handoff.
- Scope: Multi-channel capture, classification/extraction, patient/provider triage, benefits and prior-auth verification, EHR scheduling, leakage tracking.
- Data: Raw packets (fax/email/PDF), classified page ranges, extracted fields, match results, benefits/auth state, scheduling state, leakage status.
- Receives from: Fax/email gateway, Epic/Cerner orders (FHIR ServiceRequest), payer and patient portal submissions.
- Hands off to: EHR scheduling calendar,
healthcare-contact-center agent desktop, payer/prior-auth systems, Agentforce outreach.
Prerequisites
- Anypoint Platform org with API Manager and a non-production deployment target.
- MuleSoft IDP (Einstein) licensed, with the referral prompt suite (named under Platform notes and step 2) deployed as
GENERIC document actions, reused as-is.
- Salesforce Health Cloud (or Service Cloud) as case system of record, work-guide routing exceptions — low-confidence fields, unmatched patients, deferred auth — to the right queue.
- Epic/Cerner FHIR System API access scoped to ServiceRequest and Appointment/Slot resources; call
healthcare-appointment-scheduling's Process API, not a second integration.
- Clearinghouse or Da Vinci connectivity for
healthcare-benefits-eligibility-verification (270/271) and healthcare-prior-authorization (CRD/DTR/PAS), consumed not reimplemented.
healthcare-patient-360 and healthcare-provider-directory-management reachable for matching/routing.
healthcare-qhin-integration (Kno2) entitlement for missing docs before a human loops in.
- Agentforce configured for outreach, with
platform-utility-apis reachable for notification/error logging.
- Named compliance owner: fax/email PHI ingestion needs its own BAA outlasting the build.
Choose your path
- Fax/email IDP-first — Unstructured referral: a faxed packet, scanned PDF, or emailed form, entering through
idp-prompt-referral-packet-page-classification and the extractor fan-out below.
- Electronic EHR-referral-first — Already-structured referral: an Epic/Cerner FHIR ServiceRequest or payer/portal submission. Skip classification and extraction; orchestrate directly from the resource.
Both paths converge on the same Process API and Salesforce case; a referral never knows which door it came through. Most networks run both concurrently.
Platform notes
- IDP — The page-classification prompt is the fan-out point: it reads the packet once and returns a page-range map by document type (insurance card, SMN, chart notes, cover sheet, etc.). Each range routes to its extractor —
idp-prompt-insurance-card-extraction for card pages, idp-prompt-statement-of-medical-necessity-extraction for SMN pages, idp-prompt-clinical-information-extraction for chart notes, idp-prompt-prescriber-information-extraction for letterhead/fax-header pages, and idp-prompt-patient-demographics-extraction against the whole packet since demographics can land anywhere. A batched fax runs idp-prompt-multi-patient-packet-segmentation first, splitting by patient before classification.
- Integration — Benefits, prior auth, scheduling, patient matching, and provider routing call existing System/Process APIs (
healthcare-benefits-eligibility-verification, healthcare-prior-authorization, healthcare-appointment-scheduling, healthcare-patient-360, healthcare-provider-directory-management). The only new surface is the orchestration layer and leakage state machine.
- Flow Orchestration — A referral is a state machine, not a request/response call:
RECEIVED → CLASSIFIED → EXTRACTED → TRIAGED → BENEFITS_VERIFIED → AUTH_PENDING/AUTH_CLEARED → SCHEDULED → COMPLETE, with a parallel LEAKED flag firing from any state aging past SLA.
- Agentforce — Drives outbound outreach when information is missing or stalled, and answers referring-office status inquiries without a human pulling the case first. Every outreach logs against the case.
Architecture
1. Business requirements
- Capture every inbound referral — fax, email, EHR order, or portal submission — as one structured record within minutes, no re-keying.
- Route each packet page to the extractor built for its type; loop in a human only on fields failing confidence, not the whole document.
- Match the patient and referred-to provider before anything downstream runs, so benefits, auth, and scheduling share identities.
- Verify benefits and prior auth electronically where supported, treating a deferred decision or approaching deadline as a first-class state.
- Book the visit the moment auth clears (or isn't required); flag a referral leaked the moment it stalls past SLA, not just at end.
2. Referral intake — classifier-to-extractor fan-out
- On the fax/email path, hand batched packets to
idp-prompt-multi-patient-packet-segmentation first, splitting into per-patient page ranges.
- Run
idp-prompt-referral-packet-page-classification against each patient's packet; it returns a page-range map by document type, deciding which extractor runs against which pages.
- Route each range to its extractor: insurance-card pages to
idp-prompt-insurance-card-extraction, SMN pages to idp-prompt-statement-of-medical-necessity-extraction, chart notes to idp-prompt-clinical-information-extraction, prescriber pages to idp-prompt-prescriber-information-extraction, and idp-prompt-patient-demographics-extraction against the full packet.
- Gate on confidence per field, not per document: any low-confidence field routes to the work-guide queue before promotion out of
EXTRACTED.
- On the electronic path, map the FHIR ServiceRequest to the same canonical shape the extractors produce, so orchestration never knows which path a referral took.
- Assemble classified pages and extracted fields into one record and open the Salesforce case the lifecycle operates on.
3. Triage — patient and provider match
- Match the patient against
healthcare-patient-360 first; an unmatched or ambiguous match blocks promotion and routes to the triage queue instead of guessing.
- Resolve the referred-to provider and location through
healthcare-provider-directory-management's golden record — a closed clinic or departed provider is its own leakage cause, not just a later scheduling failure.
- If documentation referenced in the SMN or chart notes is missing — prior imaging, a specialist's note — query
healthcare-qhin-integration before a human chases it by phone.
- Branch exceptions by type: unmatched patient to registration/HIM, unmapped provider to referral coordination, missing evidence to the QHIN step above before falling back to a person.
4. Benefits verification and prior authorization
- Call
healthcare-benefits-eligibility-verification for the 270/271 check against insurance-card fields; land the result on the case as benefits state.
- Where auth is required, call
healthcare-prior-authorization, preferring Da Vinci CRD/DTR/PAS over a payer portal — submit the DTR package built from extracted fields rather than re-collecting.
- Model a deferred payer decision as
AUTH_PENDING, not stalled; set a deadline from the payer's SLA and alert before it lapses.
- A missed deadline is a leakage trigger: flag at-risk and escalate, not wait for someone to notice.
5. Scheduling
- Once benefits are verified and auth cleared (or not required), call
healthcare-appointment-scheduling's Process API to book into Epic or Cerner.
- For surgical referrals, hand off to
epic-perioperative-workflows instead: it carries the laterality, ASA class, and case-request fields a surgical booking needs, returning the OR acknowledgment.
- Treat "no slot within window" as its own leakage cause, distinct from a benefits or auth failure — capacity failed, not verification.
- On booking, write the appointment reference onto the case and move state to
SCHEDULED.
6. Leakage tracking, outreach, and the agent desktop
- Age every state transition against its own SLA — extraction, patient/provider match, benefits/auth turnaround, scheduling — raising the flag the moment any breaches, tagged with stage and reason.
- Trigger Agentforce outreach when the packet is missing information or a stalled referral needs a status update.
- Use
platform-utility-apis for outbound notification and the standard error record on a failed call, so failures show up in the same tooling as every other integration.
- Surface current state, leakage flag, and history on
healthcare-contact-center's agent desktop, so a "where's my referral" call resolves without a transfer.
7. Security and compliance
- Encrypt PHI in transit and at rest across every hop: fax/email gateway, IDP, Salesforce, and every downstream System API called.
- Audit-log every access to and modification of the referral record, including which prompt produced which field and which human corrected it.
- Enforce minimum-necessary access for operators; for fax/email, confirm the BAA covers the packet at rest during IDP processing, not just transit.
- For additional HIPAA controls, API policies, and security patterns, see the MuleSoft Accelerator for Healthcare on Exchange.
Sample payload — structured referral after intake
{
"referralId": "REF-2026-08-27-004417",
"source": "FAX",
"lifecycleStatus": "AUTH_PENDING",
"leakage": { "flag": false, "stage": null, "reason": null, "ageHours": 6 },
"idp": {
"multiPatientSegmentation": { "applied": false },
"classifiedPages": [
{ "documentType": "Fax Cover Sheet", "startPage": 1, "endPage": 1 },
{ "documentType": "Insurance Card", "startPage": 2, "endPage": 2 },
{ "documentType": "Statement of Medical Necessity", "startPage": 3, "endPage": 5 },
{ "documentType": "Chart Notes", "startPage": 6, "endPage": 8 }
],
"overallConfidence": 0.91,
"fieldsRequiringReview": []
},
"patient": { "matchStatus": "MATCHED", "patient360Id": "Patient/eXampleMRN", "firstName": "Ava", "lastName": "Nguyen" },
"referringProvider": { "name": "Dr. Sarah Kim, MD", "npi": "1234567893" },
"referredToProvider": {
"directoryMatchStatus": "MATCHED",
"practitionerRoleId": "PractitionerRole/prole-1093-endo-north",
"location": "North Clinic"
},
"insurance": { "payer": "Anthem Blue Cross", "memberId": "ZLB123456789", "planType": "Commercial" },
"clinical": {
"icd10": "E10.9",
"hba1cValue": "8.5",
"clinicalJustificationSummary": "Poorly controlled Type 1 diabetes, elevated HbA1c despite MDI therapy."
},
"benefits": { "status": "VERIFIED", "eligibilityResponseId": "271-9982314" },
"priorAuth": {
"required": true,
"status": "PENDING_DETERMINATION",
"submittedAt": "2026-08-27T14:02:00Z",
"deadline": "2026-08-31T23:59:59Z"
},
"scheduling": { "status": "AWAITING_AUTH", "appointmentId": null },
"caseId": "Case/00128841"
}
Testing and validation
- Fax a three-document packet (cover sheet, insurance card, SMN) end to end; confirm one case, every page attributed to one document type, every field populated or null.
- Submit the same referral via Epic FHIR ServiceRequest; confirm it converges on the same canonical shape and state machine as the fax path.
- Force one field below the confidence threshold; confirm it routes to human review, blocking promotion out of
EXTRACTED while the rest proceeds.
- Submit a batched multi-patient fax; confirm
idp-prompt-multi-patient-packet-segmentation splits it before classification, each patient a distinct case.
- Submit a prior-auth request the payer defers; confirm
AUTH_PENDING with a tracked deadline, let it lapse, and confirm leakage fires with stage and reason.
- Send one referral through two channels; confirm dedup to one case, and surgical referrals route through
epic-perioperative-workflows.
Phased rollout
Phase 1 — Connect
- Confirm the IDP referral prompt suite is deployed, stand up the Process API, and wire it to Salesforce case creation.
- Connect one downstream blueprint end to end — usually
healthcare-benefits-eligibility-verification — proving RECEIVED → BENEFITS_VERIFIED.
Phase 2 — Map and validate
- Wire the full classifier-to-extractor fan-out, confidence-gated review queue, patient/provider triage, and prior auth; validate against historical packets.
- Turn on Agentforce outreach in assistive mode and validate the agent-desktop view with one pilot.
Phase 3 — Production
- Widen to all intake channels and document types, enable electronic prior auth end to end, and cut scheduling to production for standard and surgical paths.
- Stand up the leakage dashboard; hand SLA tuning, exception-queue ownership, and model monitoring to operations.
Success metrics
- Referral leakage rate — percentage stalling past SLA at any stage — trending down against baseline; the number deciding whether orchestration works.
- Median time from packet received to appointment scheduled, by fax/email versus electronic intake.
- Percentage of referrals promoted without a human correction, trending up as thresholds mature.
- Prior-auth deadline-miss rate on referrals requiring auth, and the resulting denial rate, both trending down.
Troubleshooting
- Referrals leak silently, discovered only when the referring office calls — Cause: leakage measured at case closure, not per stage. Fix: age each transition independently; raise the flag the moment any SLA breaches.
- A field gets misclassified and routed to the wrong extraction prompt — Cause: classifier grouped a page under the wrong document type. Fix: validate the page-range map covers every page exactly once before fan-out; route low-confidence types to human triage.
- Duplicate referrals for the same patient across channels — Cause: fax, portal, and EHR-order paths aren't deduplicated before case creation. Fix: match on patient + referring provider + referred-to provider + procedure/date, the pattern
healthcare-diagnostic-order-lifecycle uses, and merge before a second case opens.
- Prior auth deadline is missed and the claim gets denied — Cause:
AUTH_PENDING treated as stalled, not a tracked deadline. Fix: derive a deadline from the payer SLA at submission, alert ahead of it, flag leakage once it lapses.
- IDP writes a wrong value instead of flagging it for review — Cause: confidence gate applied to the whole document, not per field. Fix: threshold every field independently.
- A surgical referral is booked through the standard path and arrives at OpTime without laterality or ASA class — Cause: referral type wasn't checked before the scheduling handoff. Fix: branch to
epic-perioperative-workflows before calling healthcare-appointment-scheduling; block booking if required fields are absent.
Deliverable: A Referral Orchestration Process API and Salesforce case lifecycle wiring the IDP referral prompt suite to patient/provider triage, benefits and prior-auth verification, and EHR scheduling — landing every referral as one tracked case with a leakage flag, humans in the loop only on exceptions.