# Chain of custody

> Raise a chain of custody record to track samples to the laboratory.

A **chain of custody** record tracks which samples were dispatched, to whom and
when - the paper trail from site to laboratory.

## Raise a record

Choose **New chain of custody** and fill in the builder:

<Steps>
  <Step title="Reference and lab">
    Give it a **reference** and choose the **laboratory** it is dispatched to.
  </Step>
  <Step title="Dispatch details">
    Set **dispatched from**, the **date dispatched**, a **batch reference**, a
    **status** and any remarks. **Dispatched to** is optional - it defaults to the
    chosen laboratory; fill it in only to name a specific contact or site.
  </Step>
  <Step title="Samples">
    Pick the **samples** and, for each, the number of **containers** and any notes.
    The picker has a quick **search**, per-column **filters** and click-to-**sort**
    headers to manage long lists.
  </Step>
</Steps>

Samples that have **already been sent to the lab** on another chain of custody are
flagged with an amber warning - in the picker and above the sample list - naming the
record they are on, so you do not dispatch the same sample twice. It is a warning,
not a block.

## Statuses

Chain of custody records move through **Draft**, **Issued**, **Received** and
**Complete**.

## Export

From a record's menu, export it as **AGS**, **CSV** or **PDF** (a built-in layout
or your own template). The list shows each record's reference, where it was
dispatched to, sample count, dispatch date and status. Per-sample notes appear in
both the CSV and the PDF Notes column.
