> ## Documentation Index
> Fetch the complete documentation index at: https://docs.encoreos.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Intake Compliance

> Dashboard showing the percentage of intake assessments that have all 8 tracked AHCCCS elements completed, with an element-level breakdown table and CSV export.

The Intake Compliance screen at `/cl/intake-compliance` provides a compliance overview of intake assessments, showing overall completion rates for the tracked intake elements and an element-by-element breakdown table.

## Overview

The page loads all intake assessments via `useIntakeAssessments` and computes three summary cards: Total Intakes, percentage with all elements complete (`intake_element_complete === true`), and count of incomplete assessments (with a "View" button that navigates to `/cl/intake?ahcccs_incomplete=1`). An element-level breakdown table displays each of the 8 tracked elements with a completed-count fraction, percentage, and a check/cross icon for 100% vs. under-100% completion. A CSV Export button downloads the element-breakdown data as a `.csv` file named `intake-compliance-<date>.csv`. The page header description reads "18-element assessment compliance overview."

**Elements tracked in code:**

1. Chief Complaint
2. History of Present Illness
3. Medical History
4. Mental Health History
5. Substance Use History
6. Social History
7. Preliminary Diagnoses
8. SDOH Screening Completed

## Who it's for

Requires permission: `clinical.intake.compliance_dashboard`

## Before you start

* Must hold `clinical.intake.compliance_dashboard`.
* Intake assessments must exist to see compliance data; an empty-state is shown otherwise.

## Steps

<Steps>
  <Step title="Open Intake Compliance">Navigate to `/cl/intake-compliance`. The dashboard loads summary cards and the element breakdown table.</Step>
  <Step title="Review summary cards">Read the three summary cards: Total Intakes (count of all assessments), All 18 Elements Complete (percentage and fraction), and Incomplete (count with a "View" shortcut to the filtered intake list).</Step>
  <Step title="Review element breakdown">Scroll down to the Element Breakdown table. Each row shows an element name, the completed/total fraction, the completion percentage, and a check icon (green) or cross icon (muted) for 100% vs. under-100%.</Step>
  <Step title="Export CSV">Click "Export CSV" to download the element-breakdown data as a CSV file. The button is disabled when no assessments are loaded. A success toast confirms the download.</Step>
</Steps>

## Key concepts

<AccordionGroup>
  <Accordion title="Summary card: All 18 Elements Complete">
    The percentage is computed as `(assessments where intake_element_complete === true) / total * 100`, rounded. The card header reads "All 18 Elements Complete". SME: confirm the relationship between the 8 code-tracked elements and the 18-element description.
  </Accordion>

  <Accordion title="Element completion logic">
    For each element, the code checks: string fields must be non-empty after trim; object fields must have at least one key; `preliminary_diagnoses` must be a non-empty array; `sdoh_screening` checks for a non-null `sdoh_screening_id`.
  </Accordion>

  <Accordion title="CSV export">
    The exported CSV has columns: Element, Completed, Total, % Complete. It is generated client-side using `Blob` and an anchor tag, not via a server endpoint.
  </Accordion>

  <Accordion title="Incomplete assessments shortcut">
    When `stats.incomplete > 0`, a "View" button is shown on the Incomplete card. It navigates to `/cl/intake?ahcccs_incomplete=1`.
  </Accordion>

  <Accordion title="Error and empty states">
    Load error: destructive card with a Retry button. No assessments: empty-state component with "No intake assessments to analyze."
  </Accordion>
</AccordionGroup>

## Related

<Columns cols={2}>
  <Card title="Clinical" icon="stethoscope" href="/cl/overview">
    Overview of the Clinical core.
  </Card>

  <Card title="Governance & parity" icon="scale-balanced" href="/governance/index">
    Documentation coverage and governance.
  </Card>
</Columns>

<Note>
  This page documents shipped product behavior. It is not medical, legal, or
  billing advice. Verify against your organization's policies and applicable
  regulations before using it for clinical, compliance, or billing decisions.
  Protected health information (PHI) shown in the product is governed by your
  tenant's access controls and is never exposed in this documentation.
</Note>

<Accordion title="Documentation sources">
  * src/routes/cl.tsx
  * src/cores/cl/pages/IntakeComplianceDashboardPage.tsx
</Accordion>
