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.
Canonical end-user / admin documentation lives in Docusaurus:packages/docs/docs/recovery-housing/(published at/recovery-housingon the docs site). This file is an engineering snapshot (schema, route map, integration points) intended for developers working insrc/cores/rh/. For contributor conventions seepackages/docs/docs/recovery-housing/CONTRIBUTING.md.
Overview
The Recovery Housing module manages the full episode-based resident lifecycle for sober-living, recovery-housing, psychiatric-residential, and inpatient settings. It supports intake → admitted → on_hold → discharged transitions, 120-day phase progression, daily operations, compliance & audit, discharge planning, and outcomes / alumni tracking.Spec status
| Spec | Status |
|---|---|
| RH-01 Census, Beds & Episodes | ✅ Complete |
| RH-01.1 Bed Board & Facility Types | ✅ Complete |
| RH-02 Programs & Phases (120-Day Model) | ✅ Complete |
| RH-03 Safety Events, Incidents & Compliance | ✅ Complete |
| RH-04 Participation, Attendance & Daily Operations | ✅ Complete |
| RH-05 Discharge Planning | ✅ Complete |
| RH-06 Compliance & Staff Operations | ✅ Complete |
| RH-07 Outcomes, Alumni & Reporting | ✅ Complete |
| RH-08 Advanced Analytics & Predictive Insights | 📝 Deferred (Phase 2; needs ≥ 6 mo data) |
| RH-09 Resident Grievance Management | 📋 Spec |
| RH-10 Fire & Life Safety Compliance | 📋 Spec |
| RH-11 NARR Level & AzRHA Certification | 📋 Spec |
| RH-04 EN-4 UDS / 42 CFR Part 2 access controls | 📋 Spec — HIGH priority |
specs/rh/summaries/DEFERRED-PHASES-SUMMARY.md for the complete deferred / planned backlog and specs/rh/reports/rh-deep-review-20260418.md for the latest deep review.
End-user / admin documentation
Published Docusaurus surface (packages/docs/docs/recovery-housing/):
- Landing:
index.md(slug/recovery-housing) - User guides: Census & Operations · Programs & Phases · Safety & Compliance · Daily Operations · Discharge Planning · Compliance & Staff Operations · Outcomes & Alumni
- Admin guides: property setup · room configuration · program management · RH settings · compliance setup · audit setup · outcome indicators setup · report definitions setup
- Wizards: admission (as-built RH-UX-00); program creation, significant event reporting, discharge planning, compliance setup, outcomes assessment, grievance filing (planned reference)
- Planned (spec-only): RH-08, RH-09, RH-10, RH-11, RH-04 EN-4
- Developer reference:
packages/docs/docs/developer/rh/(architecture, hooks-reference, services-reference, events, schema, edge-functions, security-model) - Security & compliance:
packages/docs/docs/security-compliance/rh/(overview, DHS licensure, NARR / AzRHA, Fair Housing & ADA, fire & life safety, Title 36 grievance, HIPAA + 42 CFR Part 2 / UDS, role matrix, RLS catalog, audit logs)
The handful of standalone files underdocs/rh/*.md(this README,database-tables.md,RECOVERY_HOUSING_REFERENCES.md, plus historical*-user-guide.md/*-admin-guide.mdfiles) are engineering / regulatory references only. Anything user-facing belongs in Docusaurus.
Routes
src/routes/rh.tsx defines 53 routes. Top-level groups (URL prefix /rh):
| Area | Routes |
|---|---|
| Dashboard / overview | /rh, /rh/dashboard, /rh/forms |
| Census & Operations | /rh/bed-board, /rh/residences, /rh/residences/:id, /rh/episodes, /rh/episodes/:id, /rh/admissions/new |
| Programs & Phases | /rh/programs, /rh/programs/:id |
| Safety & Compliance | /rh/significant-events, /rh/significant-events/:id, /rh/uds-tests, /rh/uds-tests/:id, /rh/passes, /rh/passes/:id, /rh/med-audits, /rh/med-audits/:id |
| Daily Operations | /rh/schedule-templates, /rh/attendance, /rh/chores, /rh/transport, /rh/curfew-checks |
| Discharge Planning | /rh/discharge-plans, /rh/discharge-plans/:id, /rh/referrals, /rh/referrals/:id, /rh/follow-ups, /rh/follow-ups/:id, /rh/discharge-documents |
| Compliance & Staff Ops | /rh/compliance, /rh/compliance/requirements, /rh/compliance/requirements/:id, /rh/compliance/checklists, /rh/staff-operations/assignments, /rh/staff-operations/training, /rh/staff-operations/shift-notes, /rh/staff-operations/shift-notes/:id, /rh/audits, /rh/audits/:id, /rh/audits/:auditId/findings/:id |
| Outcomes & Alumni | /rh/outcomes, /rh/outcomes/assessments, /rh/outcomes/assessments/:id, /rh/outcomes/indicators, /rh/alumni, /rh/alumni/:id, /rh/reports, /rh/reports/new, /rh/reports/:id |
| Settings | /rh/settings (gated by RH_PERMISSIONS.SETTINGS_ADMIN) |
⚠️ Only/rh/settingsis wrapped in<RequirePermission>today. The remaining ~52 routes rely on RLS + nav gating only. A route-level permission sweep is filed as a HIGH-MEDIUM backlog item inDEFERRED-PHASES-SUMMARY.md.
Data model (key entities only)
Authoritative table catalogue:Census, residences, beds:packages/docs/docs/developer/rh/schema.md. Engineering DB cheat sheet:docs/rh/database-tables.md. ERD:docs/database/erd/RH_ERD.md.
rh_residences— properties / facilities (withfacility_type:recovery_housingPOS 55,psychiatric_residentialPOS 56,inpatient_unitPOS 51)rh_beds— bed inventory (with optionalunit_labelfor inpatient grouping)rh_census_snapshots— census timeseries
rh_resident_profiles— long-lived demographic recordrh_episodes— one row per admission;bed_id, status, admission/discharge datesrh_episode_payment_status— FA balance cache (populated byfa-episode-balanceedge function)rh_eligibility_checklists,rh_resident_agreements— gating + agreements
rh_programs,rh_program_phases,rh_phase_milestones,rh_phase_privilegesrh_episode_programs,rh_episode_phases,rh_milestone_completions
rh_significant_event_types,rh_significant_events,rh_significant_event_investigations,rh_significant_event_actionsrh_uds_random_schedule,rh_uds_tests⚠️ 42 CFR Part 2 protectedrh_passesrh_med_storage_audits
rh_schedule_templates,rh_schedule_instances,rh_attendance_recordsrh_chore_assignments,rh_transport_requests,rh_curfew_checksrh_participation_metrics
rh_discharge_plans,rh_discharge_checklists,rh_discharge_documentsrh_referralsrh_follow_up_schedules,rh_follow_up_contacts
rh_compliance_requirements,rh_compliance_checklistsrh_staff_assignments,rh_staff_trainings,rh_shift_notesrh_audit_schedules,rh_audit_findings
rh_outcome_indicators,rh_outcome_checkpoints,rh_outcome_assessments,rh_outcome_measurementsrh_alumni,rh_alumni_engagementrh_report_definitions
rh_module_settings— one row per organisation (defaults, follow-up cadence, notification toggles, sender address)
rh_update_episode_status(p_episode_id, p_new_status, p_user_id)— drives the episode state machinerh_assign_bed_to_episode(p_episode_id, p_bed_id, p_user_id)— validates + assigns + emits eventrh_get_residence_census(p_residence_id, p_as_of)— live censusrh_trigger_invoice_creation(p_agreement_id)— agreement → FA invoice request
rh_resident_admitted,rh_resident_discharged,rh_phase_advanced→ persisted tofw_domain_events. Consumers in FA / PM / HR are not yet wired (see deep-review actions tracker).
Status enum reference
| Entity | Statuses | ||
|---|---|---|---|
Episode (rh_episodes.status) | referred → waitlisted → admitted → on_hold → discharged | ||
Bed (rh_beds.status) | available · occupied · reserved · maintenance | ||
Significant event (rh_significant_events.status) | draft → submitted → under_review → closed (+ cancelled) | ||
Discharge plan (rh_discharge_plans.status) | `not_started → in_progress → ready → completed | cancelled` | |
Referral (rh_referrals.status) | `draft → sent → accepted | declined → completed | cancelled` |
Compliance checklist (rh_compliance_checklists.status) | pending → completed → verified (+ non_compliant) | ||
Audit schedule (rh_audit_schedules.status) | scheduled → in_progress → completed (+ cancelled) | ||
Audit finding (rh_audit_findings.status) | open → in_progress → resolved → closed | ||
| Audit finding severity | critical · major · minor · observation |
Integration points
- Platform Foundation (PF): multi-tenant org/site, auth/RBAC (
RH_PERMISSIONS.*), navigation, notifications (PF-10), document storage (PF-11; bucketpf-documents), forms (PF-08), CSV import (PF), templates (PF), wizards (PF-41 — RH wizard registration pending), jurisdiction profiles (PF-96). - FW (Forms & Workflow): intake, discharge, safety, custom assessments. Domain events persisted to
fw_domain_events. - HR (Human Resources): staff lookup via the Platform Workforce Layer (
@/platform/workforce) — no direct FK tohr_employees. - FA (Finance & Accounting): episode billing balance via the
fa-episode-balanceedge function (useFaEpisodeBalance); planned event consumer forrh_resident_admitted. - CL (Clinical): future — current-residence API for patient chart housing context (not yet implemented).
Reference
docs/rh/database-tables.md— engineering DB cheat sheetdocs/rh/RECOVERY_HOUSING_REFERENCES.md— regulatory & standards referencesdocs/database/erd/RH_ERD.md— entity-relationship diagramdocs/compliance/RH_RECOVERY_HOUSING_COMPLIANCE_TRACKING.md— live compliance trackersrc/cores/rh/AGENTS.md— AI agent instructions forsrc/cores/rh/specs/rh/— module specs, enhancement specs, UX wizard specs, deep reviews- Published end-user / admin docs:
/recovery-housing
Historical / archived guides
The following standalone guides predate the Docusaurus surface and are kept for historical context. New work should land in Docusaurus:compliance-user-guide.md,compliance-admin-guide.mddischarge-user-guide.md,discharge-admin-guide.mdoutcomes-alumni-user-guide.md,outcomes-alumni-admin-guide.md
Last updated: 2026-04-18 (RH Audit & Optimization — Phase 0)