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). - You have a way to notify the customer of the cancellation — the system does NOT send an automated email for this outcome, so notification is manual (phone/email).
- 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
- Open the sample — From the Samples page, locate the sample to cancel. Click the kebab menu (⋮) on the row and choose Edit.
- Record the arrival condition — In the
conditionOnArrival field, choose the value that describes the failure (DAMAGED, INSUFFICIENT, UNPRESERVED, or OTHER). - 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. - Consultation outcome — In
consultationOutcome, select Request re-sampling (RESAMPLE). - Save — Click Save. The sample auto-transitions to
CANCELLED with a status-log entry (noteCode: SAMPLE_CANCELLED_FOR_RESAMPLING). - Contact the customer — Notify them by phone or email of the re-collection date. The system does not send an automated email for this outcome — only other operators' grids refresh automatically — so notifying the customer is a manual step.
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:1598). - A SampleStatusLog entry is created with
noteCode = 'SAMPLE_CANCELLED_FOR_RESAMPLING' and parameters carrying the consultation timestamp and the consulting user (sample.resolver.ts:1594-1614). - No automated email is sent to the customer for this outcome — notifying them is a manual step (see Step 6).
- Push notifications and a
sampleStatusChanged websocket event are emitted so other operators' grids refresh without a reload (sample.resolver.ts:1618-1622). - 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.