> ## 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 Collections Queue

> Outstanding patient balances organized by aging tier, with bulk actions and supervisor review for collections management.

This page is the Collections Queue, accessible at `/pm/collections-queue`.

## Overview

The Collections Queue page displays a data table of patients with outstanding balances derived from the `pm_collection_actions` table. The queue is built by fetching all collection action records for the organization and deduplicating to the latest action per patient, producing one row per patient. Each row shows a truncated patient identifier, an <Tooltip tip="A classification of how long a balance has been outstanding">aging tier</Tooltip> badge (`current`, `30_day`, `60_day`, `90_day`, `120_plus`), aging days, the last action type, and the action date. Users with `pm.collections.manage` see checkboxes for bulk selection and a "Review" button that opens the `SupervisorReviewSheet` side panel for the selected patient. The page is wrapped in a `PermissionGate` for `pm.collections.view`; users lacking that permission do not see the page content.

## Who it's for

Requires permission `pm.collections.view` (route guard: `PM_PERMISSIONS.COLLECTIONS_VIEW`). Bulk actions and the "Review" button require the additional `pm.collections.manage` permission.

## Before you start

* Collection action records must exist in `pm_collection_actions` for the queue to display patients.
* Supervisory review and bulk actions require `pm.collections.manage`.

## Steps

<Steps>
  <Step title="Open Collections Queue">
    Navigate to `/pm/collections-queue`. The table loads all patients with collection actions for your organization, deduplicated to the most recent action per patient.
  </Step>

  <Step title="Review patients by aging tier">
    The "Aging Tier" column displays a color-coded badge: Current, 30 Day, 60 Day, 90 Day, or 120+ Day. Higher tiers (90 Day, 120+ Day) are rendered with destructive styling to indicate urgency.
  </Step>

  <Step title="Select rows for bulk action (manage permission required)">
    Check individual row checkboxes or the header checkbox to select all. When one or more rows are selected, the `CollectionsBulkToolbar` appears above the table.
  </Step>

  <Step title="Open supervisor review">
    Click "Review" on any row (requires `pm.collections.manage`) to open the `SupervisorReviewSheet` side panel for that patient. The panel receives the patient ID, a truncated display name, and the aging tier.
  </Step>
</Steps>

## Key concepts

<AccordionGroup>
  <Accordion title="Aging tiers">
    Aging tier values are: `current`, `30_day`, `60_day`, `90_day`, `120_plus`. These are stored in `pm_collection_actions.aging_tier` and displayed as labeled badges. Tiers at 90 days and above use destructive color tokens.
  </Accordion>

  <Accordion title="Collection action types">
    The "Last Action" column shows the `action_type` from the most recent collection action record. Action types include: `phone_call`, `email`, `sms`, `letter`, `tier_escalation`, `supervisor_review`, `payment_arrangement`, `external_referral`, `writeoff_request`. Underscores are replaced with spaces for display.
  </Accordion>

  <Accordion title="Empty state">
    When the queue is empty, the page shows "No outstanding patient balances — The collections queue is empty." An error state (data fetch failure) shows a retry button that reloads the page.
  </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/CollectionsQueuePage.tsx
  * src/cores/pm/hooks/useCollections45.ts
  * src/cores/pm/components/collections/AgingTierBadge.tsx
  * src/cores/pm/types/payment-plans-collections.ts
  * src/platform/permissions/constants.ts
</Accordion>
