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

# Practice Management Cost Reports

> Visualize encounter cost data as a chart and summary table, grouped by service line or status.

The Cost Reports page (`/pm/cost-reports`) provides a chart and summary table of encounter-level cost data, with a dimension selector to pivot between service line and status groupings.

## Overview

The Cost Reports page loads encounter cost records from `pm_encounter_costs` via `useEncounterCosts`, capped at 200 records per fetch, ordered by `service_date` descending. It provides a **dimension selector** dropdown that switches the chart and summary table between two groupings: **By Service Line** (field `service_line`) and **By Status** (field `status`). Results are rendered as a side-by-side two-card layout: a **Cost Distribution** card containing `CostReportChart` and a **Summary** card containing `CostReportTable`. No date range or additional filter controls are exposed on this page beyond the dimension selector.

## Who it's for

Requires permission `pm.cost_accounting.view` (`PM_PERMISSIONS.COST_ACCOUNTING_VIEW`).

## Before you start

* You must hold `pm.cost_accounting.view`.
* Cost reports populate only after encounter cost records have been calculated and stored in `pm_encounter_costs`.

## Steps

<Steps>
  <Step title="Open Cost Reports">
    Navigate to `/pm/cost-reports`. The page loads and displays the chart and summary table using data for your organization.
  </Step>

  <Step title="Switch the grouping dimension">
    Use the dropdown (default: **By Service Line**) to switch between **By Service Line** and **By Status**. Both the chart and the summary table update to reflect the selected dimension.
  </Step>

  <Step title="Review the chart and table">
    The **Cost Distribution** card shows the `CostReportChart` for the selected dimension. The **Summary** card shows the `CostReportTable` with aggregated cost data.
  </Step>
</Steps>

## Key concepts

<AccordionGroup>
  <Accordion title="Dimension options">
    Two dimensions are available: `service_line` (label: "By Service Line") and `status` (label: "By Status"). These correspond to columns on the `pm_encounter_costs` table.
  </Accordion>

  <Accordion title="Data cap">
    The hook fetches up to 200 encounter cost records per query. Reports reflect only the most recent 200 records by `service_date`. If your organization has more than 200 records, older data will not appear.
  </Accordion>

  <Accordion title="Empty state">
    When no cost data exists yet, the page displays: "No cost data yet — Cost reports will populate once encounter costs have been calculated." Loading state shows two skeleton placeholders.
  </Accordion>
</AccordionGroup>

## Related

<Columns cols={2}>
  <Card title="Practice Management" icon="briefcase" href="/pm/overview">
    Overview of the Practice Management 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/pm.tsx
  * src/cores/pm/pages/CostReportsPage.tsx
  * src/cores/pm/hooks/useEncounterCosts.ts
  * src/platform/permissions/constants.ts
</Accordion>
