> ## 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.

# Governance Requirements

> Browse and create compliance requirements — category/status/priority filters, tabbed detail with checks and remediations, and a wizard.

The Requirements page is the main library for compliance requirements. It supports search, filtering by category/status/priority, and paginated browsing. It is located at route `/gr/compliance/requirements`.

## Overview

The page is rendered by `RequirementLibrary` and calls `useRegulatoryRequirementList` with deferred search and multi-dimensional filters. Pagination is rendered via a custom `getPageNumbers` helper. Users can switch between grid and list view. The **Add Requirement** button navigates to `/gr/compliance/requirements/new` (protected separately by `gr.compliance.admin`). An AI wizard button is also present (navigates to the compliance requirement wizard). Reference categories are loaded via `useReferencePicklist`. No permission gate is declared on this route in `gr.tsx`.

## Who it's for

Access follows your organization's role and module configuration.

* No special permission is required to view the requirement library.
* Creating requirements requires `gr.compliance.admin`.

## Finding a requirement

1. Go to **Governance & Compliance → Compliance → Requirements** at `/gr/compliance/requirements`.
2. Use the search bar to find requirements by keyword.
3. Apply Category, Status, and Priority filters to narrow the list.
4. Toggle between grid and list view as preferred.
5. Select a requirement card to open the Requirement Details page.
6. Select **Add Requirement** to create a new requirement (requires `gr.compliance.admin`).

| Concept    | Description                                                                 |
| ---------- | --------------------------------------------------------------------------- |
| Category   | Classification of the requirement domain (sourced from reference picklists) |
| Priority   | `low`, `medium`, `high`, `critical`                                         |
| Status     | Compliance posture of the requirement (compliant, non-compliant, etc.)      |
| Pagination | Server-side pagination with ellipsis-aware page number rendering            |

## Viewing a requirement

The Requirement Details page (`/gr/compliance/requirements/:id`) shows a single compliance requirement record with full context: metadata, compliance checks, remediations, and linked risks.

The page is rendered by `RequirementDetail` and loads data via `useRegulatoryRequirementDetail`. Tabs include: **Overview** (metadata, status, category, priority), **Checks** (compliance check history), **Remediations** (linked remediation items), and **Risks** (linked risks via `useRisksByRequirement`). Users with `gr.compliance.admin` can edit, add checks, add remediations, and delete the requirement (via `useRegulatoryRequirementMutation`). A due-date urgency indicator is computed from `differenceInDays`. No permission gate is declared on this route in `gr.tsx`.

Admin actions (edit, delete, add checks/remediations) require: `gr.compliance.admin`

1. Go to **Governance & Compliance → Compliance → Requirements** and select a requirement.
2. Review the **Overview** tab for status, category, priority, description, and due date.
3. Open the **Checks** tab to view compliance check history and add new checks (if permitted).
4. Open the **Remediations** tab to view linked remediation items and create new ones (if permitted).
5. Open the **Risks** tab to view risks linked to this requirement.
6. Use the **Edit** button to update requirement details (requires `gr.compliance.admin`).

| Concept          | Description                                                                   |
| ---------------- | ----------------------------------------------------------------------------- |
| Compliance check | An individual evaluation of whether the requirement is met at a point in time |
| Remediation      | A corrective action item linked to a requirement when it is not met           |
| Linked risks     | Risks in the risk register associated with this requirement                   |
| Priority         | `low`, `medium`, `high`, `critical` — used for triage and urgency display     |

## Creating a requirement

The New Requirement page (`/gr/compliance/requirements/new`) renders `ComplianceRequirementWizardPage`, a full-page wizard powered by `ModuleWizardRenderer` (PF-41). Requires `gr.compliance.admin`.

Before you start: have the requirement title, applicable regulatory framework or source reference, responsible owner, check frequency, and any required document types identified.

1. Navigate to `/gr/compliance/requirements/new` or use the add-requirement action from `/gr/compliance/requirements`. The wizard loads from the `compliance_requirement` template.
2. Follow the `ModuleWizardRenderer` prompts. Steps typically cover requirement identification, regulatory source linkage, check schedule, and document evidence configuration.
3. Submit the wizard. The `gr_compliance_requirements` row is created. Non-fatal ancillary inserts (check, evidence) proceed in the background; a warning toast appears if they fail.
4. After completion you are navigated to the compliance requirements list. The new requirement appears there.

**ModuleWizardRenderer (PF-41)** — renders wizard steps from the `pf_wizard_templates` table.

**gr\_compliance\_requirements** — the authoritative database record created by this wizard.

**gr\_compliance\_checks** — ancillary scheduled-check record; failure is non-fatal.

**gr\_compliance\_evidence** — ancillary document requirement records; failure is non-fatal.

**useRegulatoryRequirementMutation** — hook providing `createRequirement` for the authoritative insert.

## 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" />
</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/RequirementLibrary.tsx
  * src/cores/gr/pages/RequirementDetail.tsx
  * src/cores/gr/hooks/useRegulatoryRequirement.ts
  * src/cores/gr/hooks/useLinkedRisks.ts
  * src/cores/gr/hooks/useRegulatoryRequirementMutation.ts
  * src/cores/gr/wizards/compliance-requirement/ComplianceRequirementWizardPage.tsx
  * src/platform/permissions/constants.ts
</Accordion>
