> ## 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.

# COD Caseload

> List of patient charts flagged as Co-Occurring Disorder with assessment count, last assessment metadata, and treatment plan extension status.

The COD Caseload screen lists patient charts that have `cod_indicator = true` in `cl_patient_charts`, accessible at route `/cl/cod/caseload`.

## Overview

The page queries `cl_patient_charts` for the current organization filtered to `cod_indicator = true`, limited to 500 rows ordered by `updated_at` descending. Patient name and MRN are resolved from `pm_patients`. Assessment metadata (last assessment date, last assessment type, total count) is aggregated from `cl_cod_assessments`. A boolean `has_treatment_plan_extension` is derived from the presence of non-archived rows in `cl_cod_treatment_plan_extension`. The results are displayed as a list of cards. A live search field filters by patient name or MRN client-side. Each card shows patient name, MRN, a "COD" badge, an optional "Plan Extension" badge, assessment count, and last assessment date and type. Clicking a card navigates to `/cl/charts/<chart_id>?tab=cod-assessments`. A count of filtered vs. total flagged charts is shown alongside the search field.

## Who it's for

Requires permission `cl.cod_assessments.view` (enforced by `RequirePermission` in the route at `/cl/cod/caseload`).

## Before you start

* You must hold the `cl.cod_assessments.view` permission.
* Charts must be flagged with `cod_indicator = true` in `cl_patient_charts` to appear in this list.

## Steps

<Steps>
  <Step title="Open the COD Caseload screen">
    Navigate to `/cl/cod/caseload`. Skeleton rows are shown while data loads. Any data error is displayed in a destructive card.
  </Step>

  <Step title="Search for a patient">
    Type in the search field to filter by patient name or MRN. The count of matching vs. total flagged charts updates in real time.
  </Step>

  <Step title="Review a patient row">
    Each row shows the patient name, MRN (if present), a COD badge, an optional Plan Extension badge, total assessment count, and the last assessment date and type.
  </Step>

  <Step title="Open a patient's COD assessments">
    Click a patient row to navigate to `/cl/charts/<chart_id>?tab=cod-assessments`.
  </Step>
</Steps>

## Key concepts

<AccordionGroup>
  <Accordion title="Empty state">
    When no COD-flagged charts exist (or none match the current search), an empty state is shown: "No COD-flagged charts — Charts marked as Co-Occurring Disorder will appear here."
  </Accordion>

  <Accordion title="Plan Extension badge">
    The "Plan Extension" badge is shown when the chart has at least one non-archived row in `cl_cod_treatment_plan_extension` (`archived_at` is null).
  </Accordion>

  <Accordion title="Data limit">
    The hook fetches a maximum of 500 COD-flagged charts per query (`limit(500)`). Charts beyond this limit are not shown in the current view.
  </Accordion>

  <Accordion title="SUD data gating">
    The component note states that SUD content is gated at the chart detail layer. This caseload view displays only assessment counts, dates, and types — no SUD clinical content is shown on this screen.
  </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/CODCaseloadPage.tsx
  * src/cores/cl/hooks/useCODCaseload.ts
</Accordion>
