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.

The Attendance screen at /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 via useAttendanceRecords, 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-level RequirePermission 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.view to access the RH module.

Steps

1

Open the Attendance screen

Navigate to /rh/attendance. The table loads the most recent attendance records ordered by creation time.
2

Check the real-time connection

The RealtimeConnectionBadge next to the heading shows whether live updates are active (driven by health.activeChannels > 0).
3

Review attendance records

The table shows activity date, episode ID, attendance status badge, arrival time, and notes for up to 20 records.
4

Record a new attendance entry

Click Record Attendance in the page header. The AttendanceRecordDialog opens. Complete the form and save.

Key concepts

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.
When useAttendanceRecords returns an error, a destructive alert banner is shown and the data table is hidden.
When no records exist, the DataTable renders the empty state with title “No attendance records found”.
The table renders at most 20 records (records.slice(0, 20)).

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.
  • src/routes/rh.tsx
  • src/cores/rh/pages/AttendancePage.tsx
  • src/cores/rh/hooks/useAttendanceRecords.ts