The Attendance screen atDocumentation Index
Fetch the complete documentation index at: https://docs.encoreos.io/llms.txt
Use this file to discover all available pages before exploring further.
/rh/attendance displays a table of resident attendance records for scheduled activity instances and allows staff to record new attendance entries. The page includes a real-time connection badge indicating whether live updates are active.
Overview
The page loads attendance records viauseAttendanceRecords, which queries the rh_attendance_records table joined to rh_episodes and rh_schedule_instances, filtered by organization_id and ordered by created_at descending. The hook subscribes to real-time events on rh_attendance_records via useRealtimeSubscription; when an event fires, the query is refetched. The connection status (useConnectionStatus) drives the RealtimeConnectionBadge displayed next to the page heading. The table shows the first 20 records. Columns displayed are: activity date (from schedule_instance.activity_date), Episode ID (first 8 characters), attendance_status rendered as an AttendanceStatusBadge, arrival_time, and notes. If loading fails, a destructive Alert is shown with the message “Unable to load attendance data. Please try refreshing the page.” The Record Attendance button opens the AttendanceRecordDialog.
Who it’s for
No route-levelRequirePermission beyond the outer RHViewGuard, which requires RH_PERMISSIONS.DASHBOARD_VIEW (rh.dashboard.view). The ATTENDANCE_CREATE (rh.attendance.create) and ATTENDANCE_EDIT (rh.attendance.edit) permissions exist in RH_PERMISSIONS but are not applied as a route-level guard on this path.
Before you start
- Hold
rh.dashboard.viewto access the RH module.
Steps
Open the Attendance screen
Navigate to
/rh/attendance. The table loads the most recent attendance records ordered by creation time.Check the real-time connection
The
RealtimeConnectionBadge next to the heading shows whether live updates are active (driven by health.activeChannels > 0).Review attendance records
The table shows activity date, episode ID, attendance status badge, arrival time, and notes for up to 20 records.
Key concepts
Real-time updates
Real-time updates
useAttendanceRecords subscribes to all events on rh_attendance_records via useRealtimeSubscription. When a change arrives, the query refetches automatically. The RealtimeConnectionBadge reflects whether there is at least one active channel.Error state
Error state
When
useAttendanceRecords returns an error, a destructive alert banner is shown and the data table is hidden.Empty state
Empty state
When no records exist, the
DataTable renders the empty state with title “No attendance records found”.Record limit
Record limit
The table renders at most 20 records (
records.slice(0, 20)).Related
Recovery Housing
Recovery Housing references and overview.
Governance & parity
Documentation coverage and governance.
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.
Documentation sources
Documentation sources
- src/routes/rh.tsx
- src/cores/rh/pages/AttendancePage.tsx
- src/cores/rh/hooks/useAttendanceRecords.ts