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

# Pathway Adherence

> Aggregate dashboard showing active, completed, withdrawn, and overdue-milestone counts across clinical pathway enrollments.

This screen is the Pathway Adherence Dashboard, accessible at `/cl/pathway-adherence`. It shows aggregate counts computed from `cl_patient_pathways` and `cl_pathway_milestones` for the current organization.

## Overview

The Pathway Adherence Dashboard presents four summary stat cards for the current organization:

* **Active pathways** — count of `cl_patient_pathways` rows with `status = 'active'`.
* **Completed** — count of rows with `status = 'completed'` (displayed with success tone).
* **Withdrawn** — count of rows with `status = 'withdrawn'` (displayed with warning tone).
* **Overdue milestones** — count of `cl_pathway_milestones` rows where `status = 'overdue'`, or where `status` is `pending` or `in_progress` and `expected_completion_date` is before the current date/time (displayed with destructive tone).

All four counts are computed client-side by `usePathwayAdherence` from two queries: all pathway rows and all milestone rows for the organization. The page header text reads "Pathway Adherence" with subtitle "Aggregate metrics for clinical pathway enrollment and milestone progress." While loading, four skeleton placeholders are shown. On error, a destructive Alert with a sanitized error message is displayed.

## Who it's for

Requires permission: `cl.pathways.view_dashboard`

## Before you start

* You must hold the `cl.pathways.view_dashboard` permission.
* There are no module-setting gates or feature flags on this route beyond the permission check.

## Steps

<Steps>
  <Step title="Navigate to the Pathway Adherence Dashboard">
    Go to `/cl/pathway-adherence`. The four stat cards load automatically for your organization.
  </Step>

  <Step title="Review active pathways">
    The **Active pathways** card shows how many patient pathway enrollments are currently in progress.
  </Step>

  <Step title="Review completed and withdrawn pathways">
    The **Completed** and **Withdrawn** cards show aggregate counts. SME: confirm the clinical interpretation of each status before acting on these numbers.
  </Step>

  <Step title="Identify overdue milestones">
    The **Overdue milestones** card (destructive/red tone when non-zero) counts milestones that have passed their `expected_completion_date` without completion. Review the individual pathway records for detail.
  </Step>
</Steps>

## Key concepts

<AccordionGroup>
  <Accordion title="Overdue milestone calculation">
    A milestone is counted as overdue if its `status` is `overdue`, OR if `status` is `pending` or `in_progress` and `expected_completion_date` is before `new Date()` at query time. This is a client-side calculation.
  </Accordion>

  <Accordion title="Stat card tones">
    * Active pathways: default (neutral)
    * Completed: success (green)
    * Withdrawn: warning (yellow)
    * Overdue milestones: destructive (red)
  </Accordion>

  <Accordion title="Data scope">
    `usePathwayAdherence` queries all `cl_patient_pathways` and `cl_pathway_milestones` for the current `organization_id`. Counts are not filtered by clinician or program.
  </Accordion>

  <Accordion title="Empty / error states">
    If data is null (no pathways or milestones), all four counts display as 0. On query error, the stat cards are replaced by a destructive Alert with a sanitized error message.
  </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/PathwayAdherenceDashboardPage.tsx
  * src/cores/cl/hooks/pathways/usePatientPathways.ts
  * src/cores/cl/hooks/pathways/index.ts
</Accordion>
