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.
Module: Recovery Housing
Prefix:rh_
Tables: 51
Last Updated: 2026-01-11
Overview
The Recovery Housing module manages residential recovery programs including bed/room inventory, resident episodes, program phases, milestones, and billing integration.Sites & Beds ERD
Residents & Episodes ERD
Programs & Phases ERD
Billing & Charges ERD
Referrals & Waitlist ERD
RLS Policy Coverage
| Table | SELECT | INSERT | UPDATE | DELETE | WITH CHECK | Status |
|---|---|---|---|---|---|---|
| rh_residents | ✅ | ✅ | ✅ | ✅ | ✅ | Complete |
| rh_episodes | ✅ | ✅ | ✅ | ✅ | ✅ | Complete |
| rh_buildings | ✅ | ✅ | ✅ | ✅ | ✅ | Complete |
| rh_rooms | ✅ | ✅ | ✅ | ✅ | ✅ | Complete |
| rh_beds | ✅ | ✅ | ✅ | ✅ | ✅ | Complete |
| rh_bed_assignments | ✅ | ✅ | ✅ | ✅ | ✅ | Complete |
| rh_programs | ✅ | ✅ | ✅ | ✅ | ✅ | Complete |
| rh_program_phases | ✅ | ✅ | ✅ | ✅ | ✅ | Complete |
| rh_charges | ✅ | ✅ | ✅ | ✅ | ✅ | Complete |
| rh_referrals | ✅ | ✅ | ✅ | ✅ | ✅ | Complete |
Key Tables
rh_residents
Individual resident profiles with demographics and contact info.rh_episodes
Admission episodes linking residents to programs and sites.rh_beds
Individual bed inventory with availability tracking.rh_programs
Recovery program definitions with phase structures.rh_charges
Billing charges linked to episodes and GL accounts.Helper Functions
| Function | Purpose |
|---|---|
rh_has_org_access(org_id, user_id) | Check RH module access |
rh_get_available_beds(site_id, date) | Get available beds for date |
rh_get_census(site_id, date) | Get census count for date |
rh_calculate_length_of_stay(episode_id) | Calculate LOS in days |
Cross-Module Dependencies
- PF: Organizations, sites, profiles
- FA: Charge posting, invoice creation
- FW: Intake forms, discharge workflows
- HR: Staff assignments (future)