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

# Co-Sign Queue

> Queue of signed progress notes awaiting supervisory co-signature, with deadline tracking, bulk co-sign, and overlap alerts.

The Co-Sign Queue screen lists progress notes in `signed` or `pending_cosign` status that are awaiting supervisory co-signature, accessible at route `/cl/notes/cosign-queue`.

## Overview

The page queries `cl_progress_notes` for the current organization where `status` is `signed` or `pending_cosign` and `deleted_at` is null, ordered by `service_date` ascending. Notes are displayed in a card with a count of pending co-signatures. For each note the display shows note type (from a label map: progress, addendum, outpatient, residential, iop\_php), service date, duration in minutes, days since signing, an AI draft badge, a quality score badge, and a deadline badge computed from `cosignature_deadline_days` (read from `cl_module_settings`, defaulting to 14 days). Clicking the note row navigates to `/cl/charts/<chart_id>/notes/<note_id>`. A co-sign button opens `ProgressNoteSignDialog` for the selected note. Notes with `ai_draft_indicator = true` have the co-sign button disabled and are excluded from bulk selection. If overlapping service times are detected across the organization's notes, a warning card shows up to 5 overlap details (service date, begin/end times, overlap minutes). Bulk co-sign is available via `BulkCosignDialog` when one or more eligible notes are selected.

## Who it's for

Requires permission `cl.progress_note.cosign` (enforced by both `RequirePermission` in the route and inside the component).

## Before you start

* You must hold the `cl.progress_note.cosign` permission.
* Notes must be in `signed` or `pending_cosign` status to appear in the queue.

## Steps

<Steps>
  <Step title="Open the Co-Sign Queue">
    Navigate to `/cl/notes/cosign-queue`. The page loads with skeleton placeholders while data is fetched. Any overlapping service time alerts appear at the top.
  </Step>

  <Step title="Review pending notes">
    Each note row shows note type, service date, duration, days since signing, AI draft badge, quality score badge, and a deadline countdown badge (green outline, yellow warning at ≤3 days remaining, red destructive when overdue).
  </Step>

  <Step title="Co-sign an individual note">
    Click "Co-sign" on any eligible note row (not blocked by `ai_draft_indicator`). The `ProgressNoteSignDialog` opens. Complete the dialog to co-sign.
  </Step>

  <Step title="Bulk co-sign multiple notes">
    Check the checkbox next to one or more eligible notes (notes with `ai_draft_indicator = true` cannot be selected). Use "Select all eligible" to select all non-AI-draft notes. Click "Co-sign Selected (N)" to open `BulkCosignDialog`.
  </Step>

  <Step title="Navigate to a note's detail">
    Click the note row (not the co-sign button) to open the note detail at `/cl/charts/<chart_id>/notes/<note_id>`.
  </Step>
</Steps>

## Key concepts

<AccordionGroup>
  <Accordion title="Empty state">
    When no notes are pending, the card shows "All caught up — No notes are awaiting co-signature."
  </Accordion>

  <Accordion title="AI draft indicator">
    Notes with `ai_draft_indicator = true` have the co-sign button disabled and are excluded from bulk selection. The `AiDraftBadge` component renders a visible indicator on each such note.
  </Accordion>

  <Accordion title="Deadline badge states">
    * **Outline badge**: more than 3 days remaining
    * **Secondary badge with alert icon**: 1–3 days remaining
    * **Destructive badge with alert icon**: overdue (past deadline)
  </Accordion>

  <Accordion title="Overlap detection">
    `useOverlappingServiceTimes` runs client-side overlap detection across all non-deleted progress notes for the organization. Up to 5 overlap pairs are shown; a count is displayed if more exist. Overlap detection does not block co-sign.
  </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/ProgressNoteCosignQueuePage.tsx
  * src/cores/cl/hooks/useProgressNoteCosignQueue.ts
  * src/cores/cl/hooks/useClModuleSettings.ts
  * src/cores/cl/hooks/useOverlappingServiceTimes.ts
</Accordion>
