> ## Documentation Index
> Fetch the complete documentation index at: https://docs.encoreos.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Audit Management

> Browse, create, and manage audits — with upcoming-audit tracking, guided tour, and a tabbed detail view for checklist, findings, team, and evidence.

This screen is the main list for managing all audits in the GR module at route `/gr/audits`.

## Overview

The Audit Management page shows a quick-stats area (total audits, and upcoming-audits counts within 30 days). Users can search audits by text and filter by status and audit type via dropdowns. Audits are rendered as `AuditCard` components in a list; clicking a card navigates to `/gr/audits/:id`. Creating a new audit requires permission `gr.audits.manage` and opens `AuditFormDialog`. A guided tour (`auditManagementTour`) can be started via the help button. Error states display a sanitized error message via `sanitizeErrorMessage`.

## Who it's for

Access follows your organization's role and module configuration. Creating a new audit requires permission `gr.audits.manage`.

## Before you start

* To create an audit, you need the `gr.audits.manage` permission.
* Have the audit title, type, scheduled date, and responsible team ready before creating.

## Finding an audit

1. Navigate to `/gr/audits` from the Governance & Compliance sidebar.
2. Use the text search and the Status/Type dropdowns to locate audits.
3. Click an audit card to navigate to its detail page.
4. Click **Create Audit** to open the creation dialog (requires `gr.audits.manage`).
5. Click the help button to start the audit management guided tour.

**Upcoming audits** — audits with `scheduled_date` within the next 30 days, shown in the stats area.

## Viewing an audit

The Audit Detail page (`/gr/audits/:id`) shows the audit title, status badge, type badge, and severity badge in the header, plus action buttons (Start Audit, Complete Audit, Edit, Add Finding). It renders five tabs: **Overview** (audit metadata), **Checklist** (audit checklist items via `useAuditChecklist`), **Findings** (findings via `useFindingsByAudit`), **Team** (team members via `useAuditTeam`), and **Evidence** (evidence documents via `useAuditEvidence`). Start and Complete Audit actions call the respective mutations (`startAudit`, `completeAudit`) and update the audit status.

Creating audits requires `gr.audits.manage`; managing the audit's state is available to any user who can view it.

Before you start: you must have the audit `id` from the Audit Management list (`/gr/audits`). To start or complete an audit, the audit must be in the appropriate status.

1. From `/gr/audits`, click an audit card to navigate to `/gr/audits/:id`.
2. Review the **Overview** tab: check audit type, severity, scheduled date, and responsible team.
3. Open the **Checklist** tab; review checklist items and update their status as the audit progresses.
4. Open the **Findings** tab to see existing findings or click **Add Finding** to log a new one via `AuditFindingFormDialog`.
5. Review assigned team members in the **Team** tab.
6. Open the **Evidence** tab to see documents linked to this audit.
7. Click **Start Audit** to change status to in-progress, or **Complete Audit** when all checklist items are done.

**Audit status** — drives which action buttons are shown (Start vs. Complete).

**Corrective actions** — findings with unresolved status feed the Corrective Actions list at `/gr/audits/corrective-actions`.

## Creating an audit

The New Audit page (`/gr/audits/new`) renders `AuditSetupWizardPage`, a full-page wizard powered by `ModuleWizardRenderer` (PF-41). Requires `gr.audits.manage`.

The wizard creates a `gr_audits` row (authoritative insert), `gr_audit_team_assignments` rows, and `gr_audit_checklists` rows. Wizard events are tracked via `trackWizardEvent` using template ID `'gr-audit-setup-wizard'`. On completion, navigation returns to `/gr/audits`.

Before you start: ensure you have identified the audit scope, type, team members, and checklist items.

1. Navigate to `/gr/audits/new` or click the create audit action from `/gr/audits`. The wizard loads its steps from the `audit_setup` template.
2. Follow each step as prompted by the `ModuleWizardRenderer`. Steps cover audit identification, team assignment, and checklist configuration.
3. On the final review step, submit the wizard. The platform creates the `gr_audits` record, team assignments, and checklists in sequence.
4. After completion, you are navigated to `/gr/audits`. The new audit appears in the list.
5. Click the **Back** arrow at any point to return to `/gr/audits` without creating an audit.

**ModuleWizardRenderer (PF-41)** — platform component that renders wizard steps from a `pf_wizard_templates` database record identified by `wizardType`.

**audit\_setup** — wizard type identifier for audit creation.

**gr\_audit\_team\_assignments / gr\_audit\_checklists** — ancillary records created alongside the primary `gr_audits` row.

**trackWizardEvent** — telemetry utility that records step progression using PHI-free identifiers (IDs, step indices, timing only).

## Related

<Columns cols={2}>
  <Card title="Governance & Compliance" icon="scale-balanced" href="/gr/overview">
    Governance & Compliance core overview.
  </Card>

  <Card title="Governance & parity" icon="clipboard-check" href="/governance/index">
    Documentation coverage and governance.
  </Card>
</Columns>

<Note>
  This page documents shipped product behavior. It is not medical, legal, or
  billing advice. Verify against your organization's policies and applicable
  regulations before using it for clinical, compliance, or billing decisions.
  Protected health information (PHI) shown in the product is governed by your
  tenant's access controls and is never exposed in this documentation.
</Note>

<Accordion title="Documentation sources">
  * src/routes/gr.tsx
  * src/cores/gr/pages/AuditList.tsx
  * src/cores/gr/pages/AuditDetail.tsx
  * src/cores/gr/hooks/useAuditList.ts
  * src/cores/gr/hooks/useAuditDetail.ts
  * src/cores/gr/hooks/useAuditMutation.ts
  * src/cores/gr/wizards/audit-setup/AuditSetupWizardPage.tsx
  * src/platform/permissions/constants.ts
</Accordion>
