When you try to approve an Analysis Record (AR) and approval is blocked because one of the linked instruments was out of calibration on the date the analysis was performed, this recipe describes the ELOT EN ISO/IEC 17025:2017-compliant resolution paths.
What counts is the instrument's status on the analysis date, not today (§6.4.13(e), §7.5.1: the status must be demonstrable for the date of the work). An instrument that was calibrated on the analysis date but has lapsed since does not block; one that was out of calibration that day stays blocked even after it is recalibrated today.
LAB_DIRECTOR), Quality Manager (QUALITY_MANAGER), or Reviewer (REVIEWER) approves anyway, logging a justification of ≥20 characters. The override is audited.No path is silent — every approval over an out-of-calibration instrument leaves a trace in the system.
| # | Prerequisite | Where verified |
|---|---|---|
| 1 | The AR is in status REVIEWED, ready for transition to APPROVED. | status field on the Analysis Detail page. |
| 2 | At least one Measurement on the AR references an Instrument with requiresCalibration = true. | Measurements tab on the AR. |
| 3 | The calibration in force on the analysis date — the latest record on the instrument's Calibrations tab dated on or before it — has a next-due date before the analysis date. With no such record the instrument was not calibrated on that date (§6.4.4), and the approval is blocked as well. | Calibrations tab of the instrument. |
| 4 | For Option C, the user holds a role allowed by the "Quality System Override" role-permission entry — default: LAB_DIRECTOR, QUALITY_MANAGER, or REVIEWER. | Settings → Role Permissions. |
| 5 | For Option A, the user can create or edit a CalibrationRecord on that instrument. | Role permissions. |
Instruments with requiresCalibration = false (e.g. volumetric glassware, manual tools), and instruments whose record in force has no next-due date, are exempt and do not trigger the block.
Before choosing between A and B, open the Measurements tab on the AR and note:
errors.approvalBlockedCalibration. The frontend recognises the code and opens the override dialog instead of a generic snackbar; the message names the analysis date and each instrument (name, serial number, the date its calibration ran out).CalibrationRecord, or correct the existing one, with its real dates from the certificate: calibrationDate on or before the analysis date, nextDueDate on or after it, the certificate number and withinTolerance. A date older than the late-entry threshold asks for a late-entry reason — say why the record is being entered now.OVERRIDE_CALIBRATION_APPROVE is written with userId, entityType = 'AnalysisRecord', entityId, reason, timestamp, and the list of overdue instruments as changes. That tab is a plain list — no filter or CSV export there. To filter by action (OVERRIDE_CALIBRATION_APPROVE) and export CSV for the internal-audit folder, use the standalone Audit Trail page (/audit-trail, gated by the "Audit Trail" permission). The export carries user, timestamp, justification, and the related data — exactly what §6.4.7 expects you to have available.
To avoid repeated rejections for insufficient documentation, structure the justification as:
"Calibration of <instrument name> (S/N <serial>) had expired on <date>, before the analysis date <date>. The analysis cannot be repeated because <reason — e.g. sample consumed, holding time exceeded>. Metrological confidence is maintained via <internal QC against reference material Lot XXX within limits / duplicate analysis on backup instrument>. CAPA-<number> has been opened and calibration is scheduled for <date>."
The block logic is implemented in the _enforceCalibrationGuard method of analysis-record.resolver.ts. For each Measurement on the AR, the distinct instrumentId values are collected and the Instrument rows with requiresCalibration = 1 are loaded. For those, calibrationsInForceAt() (calibrations/calibration-at-date.ts — the same lookup the vertical audit pack uses) returns the calibration record in force on the analysis date: the latest CalibrationRecord with calibrationDate <= the analysis date. The instrument blocks when that record's nextDueDate is before the analysis date, and also when there is no such record (not calibrated on that date). A record in force with no end date → exempt. The analysis date is taken as a date in the server's local timezone.
If nothing blocks, the guard passes immediately; otherwise, without an overrideReason, the method throws a GraphQLError with extension code errors.approvalBlockedCalibration and an instruments[] payload carrying id, name, serialNumber, and nextCalibrationDate — the date the calibration ran out (the record's nextDueDate; empty when the instrument had no calibration in force).
On the override path, the shared OverrideHelper.assertAndRecord() helper (common/override.helper.ts) performs these checks in order:
isOverrideRole(role) — otherwise rejected with the message errors.overrideCalibrationDenied. This check is not hard-coded to the three named roles — it reads the tenant's QUALITY_SYSTEM_OVERRIDE role-permission entry (Settings → Role Permissions), whose default happens to be exactly LAB_DIRECTOR + QUALITY_MANAGER + REVIEWER, but can be changed.reason.trim().length >= 20 (the MIN_OVERRIDE_REASON_LENGTH constant) — otherwise rejected with the message errors.overrideReasonTooShort.recordEvent({ action: 'OVERRIDE_CALIBRATION_APPROVE', ... }), which writes the entry to the shared AuditTrail table (not a separate "OverrideLog" — it's the same table every audit event in the tenant is written to).The order is intentionally fail-fast: a user without the role will never see a "reason too short" message and therefore cannot probe the system for how to slip past the check.
A short Greek + English narrative is part of the guard's error message itself, so even tooling that does not surface extensions.instruments (e.g. raw curl) still shows which instrument is overdue.
On the frontend, the AnalysisDetail component (analysis-detail.ts, around lines 840-862) inspects err.errors[0].extensions.code (Apollo v4 shape) and opens the override dialog via showOverrideDialog.set(true), stashing the recordId in pendingApprovalRecordId. Submitting the reason calls the same mutation again, this time with overrideReason set — the guard re-runs, sees the reason, and proceeds to log it.
instrumentId column on Measurement has a foreign key to Instrument with no CASCADE — deleting the instrument fails with a foreign-key error as long as any measurement references it. The "deleted instrument, orphaned measurement" scenario therefore cannot occur through normal application use.withinTolerance: false): the approval guard judges only the dates of the record in force; an out-of-tolerance or not-fit-for-use record is flagged by the vertical audit pack. Treat such results under §6.4.9 (Option B or C).CalibrationRecord copies them from the latest record. The approval guard reads only the records in force on the analysis date; the instrument fields feed the lists, the badge and the work checks.Important bulk-approve caveat. The bulk-approve path (analysis-record.resolver.ts, around line 1787) calls _enforceCalibrationGuard(r, undefined, userRole, userId) with overrideReason = undefined, so no override is allowed: every AR with an out-of-calibration instrument fails and must be fixed individually: a corrected record, a repeat, or an override with a reason. This is intentional — bulk approval must not become a shortcut for exceptions.
If you need to clear a large queue, the workflow is:
For the full clause text, see Reference → ISO/IEC 17025:2017.
ESYD assessors frequently spot-check override examples. A well-structured AuditTrail entry with a clear justification, a CAPA reference, and metrological-confidence evidence (QC charts, replicate measurements on a backup instrument) is strong evidence that the lab is not silently bypassing controls but handling the exception with maturity. Conversely, terse "emergency" justifications are a red flag.
Systematic use of Option C (for example more than 5 overrides per month on the same instrument) should trigger a review of the calibration programme under §6.4.7 and possibly an increase in frequency or a change of provider.