Compliance → Corrective Actions
Purpose
A unified queue of corrective action plans (CAPAs) tracking findings from audits, spot checks, and theft/loss incidents through to verified completion. Each CAPA captures the finding, severity, assigned remediation owner, due date, and lifecycle status.
This is general product information about CS Logbook, not legal advice. The CAPA queue is a tracking aid; it does not define remediation obligations. Verify current requirements with the DEA Diversion Control Division and your state veterinary/pharmacy board.
Regulatory basis: documented remediation supports your records trail (DEA recordkeeping rules, records of receipts and disposals). Many state veterinary boards also address documented remediation of compliance findings in their inspection follow-up — confirm your state's specifics directly.
When to use it
- Daily: review your clinic's open CAPAs each morning — what's overdue, what's due this week
- Audit completion: every audit (biennial, internal, spot-check) that finds a discrepancy auto-creates a CAPA; review the queue immediately after
- Theft/loss reporting: every Form 106 filing creates a CAPA per affected substance — track remediation through verified completion
- DEA audit prep: an inspector will ask "show me your remediation log for last year's findings" — this page is the answer
Walkthrough
Step 1 — Open the corrective actions queue
Navigate to /home/<your-clinic>/compliance/corrective-actions (or via the sidebar nav).
The page is laid out in three sections:
- Filters — search by title/description/assignee, filter by status (pending / in_progress / completed / verified) and severity (critical / major / minor)
- Table — one row per CAPA, with overdue rows highlighted in red
- Summary stats — count cards for pending, in_progress, completed, and overdue (the last in destructive coloring)
Step 2 — Review a CAPA's details
Click View Details on any row to see the full CAPA record, including the source audit reference and any linked compliance documents.
Step 3 — Update CAPA lifecycle
CAPAs move through a 4-state lifecycle:
pending → in_progress → completed → verified
↓
(overdue if past due_date)The Actions menu on each row offers:
- Update Status — move the CAPA forward (pending → in_progress → completed)
- Add Comment — record progress, blockers, or context as a CAPA comment
- Verify Completion — appears only for
status='completed'; advances toverifiedand locks the immutable-linkage fields
⚠️ The actions in this section are deferred to a follow-up Sprint B commit. The CAPA list view, filters, and summary stats are all functional now; the action handlers are stubbed pending implementation. Track via NocoDB
corrective-actions-stub-handlers.
Step 4 — Audit-source CAPAs are immutable on key fields
When a CAPA is created from an audit (biennial / internal / spot-check), the parent audit's finalize_audit flow locks these fields on the CAPA: audit_id, title, description, category, severity, assigned_by, assigned_date, created_at. Lifecycle fields (status, completion_*, verification_*) stay mutable so clinics can record actual remediation progress after finalization.
This is the Sprint B audits-finalize-lock design (commit f571119f). It prevents a closed audit from being silently rewritten via its CAPA records.
Field reference
audit_corrective_actions table (read-only fields shown by this view)
| Column | Type | Notes |
|---|---|---|
id |
uuid | Primary key |
audit_id |
uuid | References parent audit; immutable after audit finalize |
account_id |
uuid | Tenant isolation |
title |
text | Required; immutable after audit finalize |
description |
text | Required; immutable after audit finalize |
category |
varchar | e.g., inventory, documentation, labeling, storage, disposal |
severity |
varchar | critical, major, minor |
assigned_to |
uuid | User responsible for remediation |
assigned_by |
uuid | User who assigned; immutable after audit finalize |
assigned_date |
date | Required; immutable after audit finalize |
due_date |
date | Optional but recommended |
status |
varchar | pending, in_progress, completed, verified |
completion_* |
various | Set when status advances to completed |
verification_* |
various | Set when status advances to verified |
created_at |
timestamptz | Immutable after audit finalize |
Edge cases
Overdue rows
A CAPA is considered overdue when due_date < now() AND status NOT IN ('completed', 'verified'). The row gets bg-destructive/5 styling and an "⚠️ Overdue" tag. The Overdue summary card counts these.
Filtering
The status filter has 5 options: All / Pending / In Progress / Completed / Verified. The severity filter has 4: All / Critical / Major / Minor. The search input matches title, description, and assignee name (case-insensitive substring).
Empty state
When the filters return zero rows, the table shows "No corrective actions found" rather than the empty rollup state — meaning the clinic has CAPAs, but none match the current filter.
Common mistakes
- Closing CAPAs without verification. The
completed→verifiedtransition is the audit-trail completion. Skipping it leaves the CAPA in a half-resolved state; an inspector will flag this. - Assigning CAPAs without due dates. The Overdue card and the row's red highlighting depend on
due_date. Without a due date, the CAPA can stay in pending forever without a visibility signal. - Editing CAPA title or description after audit finalize. The DB rejects this via the
prevent_finalized_capa_rewritetrigger. Use the comment thread instead to add context.
Related
- Audits → Internal Audit — most CAPAs originate from internal audits
- Audits → Biennial Inventory — discrepancies in the biennial flow create CAPAs
- Audits → Spot Checks — spot-check findings create CAPAs via the discrepancy investigation modal
- Audits → Theft / Loss — every Form 106 filing creates one CAPA per affected substance
- Audits → Discrepancies — unified discrepancies view (alternative entry point to this queue)