Documentation
Tutorials
Workflows
Kebab actions
Daily Work
Dashboard & Reports
Quality Control
ISO 17025
Logs
Contacts
Billing
Analysis Setup
Settings
Initial Setup
Help & Reference
Architecture decisions
Kebab actions
0:000:00

Mark a sample for re-sampling

A short recipe for flagging a sample for re-collection when the customer agrees the original sample cannot be analysed and a fresh one will be drawn.


Goal

When a sample cannot be analysed — damaged in transit, insufficient quantity, broken cold chain, or any other deviation that prevents a valid measurement — and the customer agrees to a re-collection, mark the current sample for re-sampling.

The current sample auto-transitions to CANCELLED and the customer expects a fresh collection to resume the workflow.

When NOT to use this flow: If the customer rejects the sample with no intention of re-collecting, use the REJECT outcome (transitions to REJECTED). If the customer authorises proceeding with the deviation, use PROCEED_AS_IS (fires the §7.8.2.2 disclaimer).

Prerequisites

Before logging the outcome, confirm:

  • A customer consultation has been held per ISO 17025 §7.4.3 (date, contact person, notes).
  • The customer has explicitly agreed to re-sampling (outcome: RESAMPLE).
  • The customer's contact details are current — the automated notification email will be sent to the address on file.
  • A re-collection schedule has been agreed (date, location, collector).
  • The sample has not yet produced measurement results — if approved results exist, follow the report amendment flow (§7.8.8) instead of cancelling.

Steps

  1. Open the sample — From the Samples page, locate the sample to cancel. Click the kebab menu (⋮) on the row and choose Edit.
  2. Record the arrival condition — In the conditionOnArrival field, choose the value that describes the failure (e.g. DAMAGED, INSUFFICIENT_QUANTITY, TEMPERATURE_BREACH, LEAKED).
  3. Fill in §7.4.3 consultation details — Enter the consultation date (customerConsultedAt), select the user who spoke with the customer (customerConsultedById), and optionally add notes.
  4. Consultation outcome — In consultationOutcome, select Re-sample (RESAMPLE).
  5. Save — Click Save. The sample auto-transitions to CANCELLED with a status-log entry (noteCode: SAMPLE_CANCELLED_FOR_RESAMPLING).
  6. Optional — call the customer — Confirm the re-collection date by phone or email. The system sends an automated email, but a verbal confirmation shortens turnaround.
No manual status change is required — the transition is performed by the resolver as soon as the outcome is saved.

What happens behind the scenes

Saving the sample with consultationOutcome = RESAMPLE triggers the following chain:

  • The SampleResolver detects the non-neutral outcome and invokes applyConsultationStatusTransition(), which updates the status to CANCELLED (see apps/agrometrisis-api/src/app/modules/samples/sample.resolver.ts:1593).
  • A SampleStatusLog entry is created with noteCode = 'SAMPLE_CANCELLED_FOR_RESAMPLING' and parameters carrying the consultation timestamp and the consulting user (sample.resolver.ts:1596-1615).
  • A customer notification email is dispatched from the CANCELLATION_RESAMPLE template, referencing the sample code and proposed re-sampling.
  • Push notifications and a sampleStatusChanged websocket event are emitted so other operators' grids refresh without a reload (sample.resolver.ts:1619-1623).
  • ISO 17025 §7.4.1 (handling of test items) requires that the cancelled item be dispositioned according to the active retention policy — consult the Records Lifecycle workflow for the correct disposition (disposal or return to customer).

The ConsultationOutcome.RESAMPLE value is defined at apps/agrometrisis-api/src/app/modules/samples/enums/consultation-outcome.enum.ts:10 and is the only outcome that cancels the sample without rejecting it.


  • ISO 17025 §7.4.3 — Customer consultation: documents the decision that led to re-sampling. The same clause requires the lab to log the outcome before any further action is taken on the sample.
  • ISO 17025 §7.4.1 — Handling of test items: governs disposition of the cancelled sample per the retention policy. The item remains traceable in the system until formally dispositioned.

See also

  • Sample Workflow — full sample lifecycle.
  • Deviations Workflow — when the deviation also needs a formal CAPA beyond cancellation.