# Testing schedules

> Build a sample-by-test schedule, assign a lab, and export it.

A **testing schedule** sets out which tests to run on which samples, ready to send
to a laboratory.

## Build a schedule

Choose **New schedule** and fill in the builder:

<Steps>
  <Step title="Reference and lab">
    Give the schedule a **reference** and choose the **laboratory** - its test
    catalogue becomes available to pick from. The reference can **auto-fill** from a
    format you set in Product OS (for example job ref, date, time and lab code) - it
    fills in the lab code once you pick the lab, and stays editable.
  </Step>
  <Step title="Details">
    Set **Prepared by**, the **issue** and **due** dates, a **status** and any
    remarks. **Prepared by** can be prefilled automatically (for example with your
    initials) - set that up in Product OS. The **due date** can prefill from the
    issue date plus the lab's turnaround, and is marked **preliminary** until the lab
    confirms it - both stay editable. **Issued to** is optional - it defaults to the
    chosen laboratory, so only fill it in to name a specific contact or site.
  </Step>
  <Step title="Tests">
    Add **tests** from the lab's catalogue or type a **custom test**. Each test you
    add is listed below the picker, so you can see and remove them even before any
    samples are chosen.
  </Step>
  <Step title="Sample-by-test matrix">
    Pick the **samples** - the picker has a quick **search**, per-column **filters**
    (the same operators as the data tables) and click-to-**sort** headers to manage
    long lists. Then **tick** each test you need for a sample. The quantity defaults
    to 1 - adjust it in the box that follows, or add a note. Most of the time one
    tick per test is all you need.
  </Step>
</Steps>

Samples that are already **out for testing** on another active schedule are flagged
with an amber warning - in the picker and above the matrix - so you do not
accidentally send the same sample to the lab twice. It is only a warning; you can
still schedule them if you mean to.

## Statuses

Schedules use a status list you control. Out of the box it is the standard AGS
testing statuses (**Awaiting start**, **In progress**, **Completed**, **Cancelled**,
**Not received**, **Not required** and **Restricted**). In Product OS, under **Labs**,
you can **reorder** them, **rename** the labels, **hide** any you do not use and
**add your own**. Built-in statuses keep their standard AGS code; custom statuses
still export cleanly.

## Export

From a schedule's menu, export it as **AGS** (versions 4.0.3 to 4.2.0), **CSV** or
**PDF** - the PDF uses a built-in layout or your own template. The list shows each
schedule's reference, lab, sample and test counts, due date and status.

**CSV** downloads a zip with two files: a **summary** (the schedule's general
data - reference, prepared by, issued to, dates, status and the overall note) and
a **details** sheet (one row per sample and test). Splitting them keeps the details
sheet clean for import while still capturing the header information.

Notes flow through to both the CSV and the PDF: the **per-sample note** and each
**per-test note** appear in the schedule's Notes column.
