Document Generation & Workflows

Every clinical and administrative event that should produce a document or trigger a follow-up chain is modeled as a workflow. When an appointment is created, a patient onboarded, or a claim denied, a chain of connected steps fires automatically: documents generate from AI-populated templates, human gates ensure clinical sign-off, tasks route to the right staff, and notifications go out to patients. The result: no document is forgotten, no follow-up falls through the cracks, and every output traces back to the event that caused it.

Document templates are AI-generated and human-gated. The platform drafts each document from chart data in under 30 seconds, then routes it to the appropriate role for review and sign-off before finalization. Templates are versioned, org-customizable, and delivered via portal, fax, Direct message, print, or email.

Key Capabilities

Event-Driven Workflow Engine

Workflows fire from platform events: appointment created, encounter signed off, lab result received, claim denied, patient registered, referral ordered. Each workflow definition is a chain of typed steps — GenerateDocument, CreateTask, SendNotification, CheckCondition, WaitForEvent, HumanGate — that execute in order with configurable branching on failure. Practices customize trigger conditions and step configurations without code. A single trigger can spawn parallel sub-chains (e.g., an encounter sign-off fires both the billing chain and the patient communication chain simultaneously).

AI-Generated, Human-Gated Document Templates

Twenty-two template types ship out of the box, covering clinical, administrative, financial, and patient communication documents. AI populates merge fields from chart data — demographics, diagnoses, medications, lab values, encounter notes — and generates a draft in under 30 seconds. Every document passes through a human gate: the appropriate role (provider for clinical docs, biller for financial docs, front desk for administrative) reviews and signs off before the document is finalized and delivered. Templates are versioned independently from workflows so a template update does not require a workflow redeploy.

22 document templates organized by category
Category Templates Sign-off Role
Clinical After-Visit Summary, Progress Note, Referral Letter, Clinical Summary (C-CDA), Discharge Summary, Prior Auth Letter, Return-to-Work Clearance Provider (MD/DO/PA/NP)
Administrative HIPAA Notice, Treatment Consent, Telehealth Consent, CCM/RPM Consent, FMLA Certification, Disability Certification, Records Release Authorization Front Desk / MA
Financial Patient Statement, Good Faith Estimate, Superbill, Appeal Letter, Corrected Claim Cover RCM / Biller
Communication Recall Reminder, Abnormal Results Letter, Welcome Letter Nurse / Provider
Primary Care Scenario Library

Twelve end-to-end workflow scenarios are pre-configured for common primary care events. Each scenario defines the trigger, every step in the chain, the documents generated, the human gates required, and the expected completion time. Select a scenario below to see the full workflow pipeline.

Workflow Instance Tracker

Real-time visibility into every running workflow: which step is current, which gate is waiting for sign-off, which steps completed or failed. Staff see their pending gates in the unified task queue alongside denial follow-ups and co-sign requests. A workflow that stalls at a human gate for longer than the configured timeout escalates automatically — first to the assignee's supervisor, then to a practice-wide alert.

Multi-Channel Document Delivery

Documents deliver via patient portal, secure fax, Direct messaging (for C-CDA exchange), print queue, or email (encrypted link). The delivery method is configured per template and overridable per instance. Delivery confirmation is tracked: portal-viewed timestamp, fax confirmation code, Direct message acknowledgment, print pickup flag. Failed deliveries auto-retry with channel fallback (e.g., fax failure falls back to portal + SMS notification).

Template Versioning & Org Customization

Every template version is a separate artifact with its own merge-field set, body, and output format. Practices clone system defaults and customize headers, logos, verbiage, and merge fields. Version history is auditable: who changed what, when, and why. Rollback is one click — the previous version becomes current, and any in-flight documents already generated from the new version are flagged for re-review. Templates follow the IC versioning scheme: break.feature.bug.buildtimestamp.

Workflow Analytics Dashboard

Metrics on workflow completion rates, average time-to-completion, most common failure points, document sign-off latency, and delivery success rates. The dashboard identifies bottlenecks — for example, "FMLA certifications average 4.2 days to sign-off; assign to PA/NP for faster turnaround" or "Prior auth appeal letters have a 12% failure rate at the payer submission step; review fax delivery logs." Drill down by workflow type, persona, time range, or patient cohort.

Persona Connections

Technical Highlights

Seven noun-apps compose the document and workflow surface on the IC platform: DocumentTemplate, DocumentTemplateVersion, GeneratedDocument, WorkflowDefinition, WorkflowStep, WorkflowInstance, and WorkflowStepExecution. Every entity is org-scoped, carrying OrganizationID as the Cosmos partition key and the full four-field audit trail (LastUpdatedDateTimeUtc, LastUpdatedByUserID, IsSoftDeletedBool, CreatedDateTimeUtc). Relationships are enforced by API, not FK constraints, following IC hard rule #14.

Data Model

API Surface

Documents map to FHIR R4 DocumentReference resources at the platform's standard FHIR API surface. Workflow trigger events are published to an internal event bus; external integrations subscribe via webhooks with HMAC-SHA256 signing. The template rendering engine accepts Handlebars syntax with a curated set of helpers (date formatting, medication list rendering, diagnosis grouping). AI draft generation uses the platform's ambient-AI pipeline with the same provenance chain as Clinical Documentation — every merge-field value traces to a source fact in the patient record.

Cross-Module Dependencies

Phase Roadmap

Phase 1 — Manual Document Generation + Core Templates
  • 10 core document templates (AVS, Referral Letter, Patient Statement, Consent forms, Superbill, Welcome Letter, Recall Reminder, Prior Auth Letter, Good Faith Estimate, Progress Note)
  • Manual "Generate Document" action from encounter, patient, or appointment context
  • Human sign-off gate with role-based routing
  • PDF output with practice logo/header customization
  • Portal delivery only (no fax or Direct messaging yet)
  • Template editor with merge-field preview
Phase 2 — Workflow Engine + Full Template Library
  • Event-driven workflow engine with all trigger types
  • All 22 document templates with AI draft generation
  • 12 pre-built primary care workflow scenarios
  • Human gates with timeout escalation
  • Multi-channel delivery (portal, fax, Direct, print, email)
  • Template versioning with rollback
  • Workflow instance tracker with real-time status
  • Workflow analytics dashboard
  • FHIR DocumentReference export
Phase 3 — AI Optimization + Marketplace
  • AI template optimization: learns from provider edits to reduce manual corrections over time
  • Cross-org template marketplace: practices share and import template customizations
  • Predictive workflow suggestions: platform recommends workflow definitions based on practice patterns
  • Natural language workflow builder: describe a workflow in plain English, platform generates the definition
  • Bulk document generation for population health campaigns

Success Metrics

MetricTargetWhy It Matters
Document generation time (trigger to draft) ≤ 30 seconds Staff should not wait for AI to produce a draft; near-instant keeps workflows moving.
Human gate sign-off latency, p95 ≤ 4 hours Prevents downstream delays in billing, referrals, and patient communication.
Workflow completion rate ≥ 95% No dropped chains; every trigger reaches its terminal step or is explicitly cancelled.
Template accuracy (no manual edits needed) ≥ 80% AI quality measure; high accuracy reduces provider burden and sign-off latency.
Document delivery confirmation rate ≥ 98% Patients and recipients actually received the document; failed deliveries are caught and retried.
Appeal letter generation time ≤ 3 minutes Down from 20 minutes manual; denial-code-specific rationale auto-populated from chart.

Try in the Demo