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

# Create Report

> Define a new recovery housing report — type, schedule, frequency, day, and recipient emails — using the report definition form.

The Create Report page hosts the `ReportDefinitionForm` for defining a new RH report, accessible at `/rh/reports/new`.

## Overview

The page renders a `ReportDefinitionForm` inside a card. The form has two tabs: **Basic Info** (name, type, notes, active toggle) and **Schedule** (scheduling toggle and conditional fields for frequency, day, and recipients). On successful save the user is redirected to `/rh/reports`.

## Who it's for

No additional permission gate is present on `/rh/reports/new` beyond the outer `RH_PERMISSIONS.DASHBOARD_VIEW` (`rh.dashboard.view`) guard.

## Before you start

* Your account must hold `rh.dashboard.view`.
* An organization context and authenticated user (`userId`) must be present; the form silently returns without saving if either is absent.

## Steps

<Steps>
  <Step title="Open the Create Report page">
    Navigate to **Recovery Housing → Reports → New** or go directly to `/rh/reports/new`.
  </Step>

  <Step title="Complete Basic Info tab">
    Enter a **Report Name** (required). Select a **Report Type** from: `census`, `program_completion`, `outcomes`, `discharge`, `compliance`, `grant`, `alumni`, or `custom`. Optionally add **Notes**. Use the **Active** toggle to control whether the report is available for use (default: on).
  </Step>

  <Step title="Optionally configure a schedule">
    Switch to the **Schedule** tab. Toggle **Enable Scheduling** on to reveal scheduling fields. Select a **Frequency** (`daily`, `weekly`, `monthly`, `quarterly`, `annual`). If weekly, choose a **Day of Week**. If monthly, quarterly, or annual, enter a **Day of Month** (1–31). Enter one or more **Recipient** email addresses separated by commas.
  </Step>

  <Step title="Save the report">
    Click **Create Report**. On success the page navigates to `/rh/reports`. If the mutation fails, the error is handled by the mutation hook.
  </Step>
</Steps>

## Key concepts

| Field                   | Validation                   | Notes                                                   |
| ----------------------- | ---------------------------- | ------------------------------------------------------- |
| `report_name`           | Required, min 1 char         | Stored as `report_name`                                 |
| `report_type`           | Required enum                | One of 8 values listed above                            |
| `is_scheduled`          | Boolean toggle               | Enables conditional schedule fields                     |
| `schedule_frequency`    | Required when scheduled      | `daily` / `weekly` / `monthly` / `quarterly` / `annual` |
| `schedule_day_of_week`  | 0–6, only for weekly         | 0 = Sunday                                              |
| `schedule_day_of_month` | 1–31, monthly+ only          | Not validated against month length                      |
| `recipient_emails`      | Comma-separated valid emails | Validated with regex; stored as array                   |

## Related

<Columns cols={2}>
  <Card title="Recovery Housing" icon="house" href="/rh/references">
    Recovery Housing references and overview.
  </Card>

  <Card title="Governance & parity" icon="scale-balanced" 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/rh.tsx
  * src/cores/rh/pages/ReportCreatePage.tsx
  * src/cores/rh/components/forms/ReportDefinitionForm.tsx
</Accordion>
