Skip to main content

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

TableSELECTINSERTUPDATEDELETEWITH CHECKStatus
rh_residentsComplete
rh_episodesComplete
rh_buildingsComplete
rh_roomsComplete
rh_bedsComplete
rh_bed_assignmentsComplete
rh_programsComplete
rh_program_phasesComplete
rh_chargesComplete
rh_referralsComplete

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

FunctionPurpose
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)