Skip to content

Add follow-up date and reason fields with dashboard section#3549

Open
Rolling2405 wants to merge 6 commits intoDARIAEngineering:mainfrom
Rolling2405:feature/follow-up-reminders
Open

Add follow-up date and reason fields with dashboard section#3549
Rolling2405 wants to merge 6 commits intoDARIAEngineering:mainfrom
Rolling2405:feature/follow-up-reminders

Conversation

@Rolling2405
Copy link
Copy Markdown
Contributor

@Rolling2405 Rolling2405 commented Apr 8, 2026

I rule and have completed some work on Case Manager that's ready for review!

This adds follow-up date and reason fields to patient records and a dashboard section that highlights patients needing follow-up, so case managers can easily track who they need to call back.

This pull request makes the following changes:

  • Add follow_up_date and follow_up_note columns to patients
  • Add needs_follow_up scope for patients where follow-up date is past or today
  • Add dashboard helper that renders a follow-up section with status badges
  • Use Bootstrap 5 utility classes and Font Awesome icons

Notes:

(If there are changes to the views, please include a screenshot so we know what to look for!)

For reviewer:

  • Adjust the title to explain what it does for the notification email to the listserv.
  • Tag this PR:
    • feature if it contains a feature, fix, or similar. This is anything that contains a user-facing fix in some way, such as frontend changes, alterations to backend behavior, or bug fixes.
    • dependencies if it contains library upgrades or similar. This is anything that upgrades any dependency, such as a Gemfile update or npm package upgrade.
  • If it contains neither, no need to tag this PR.

Rolling2405 and others added 2 commits April 7, 2026 18:35
New patient fields:
- follow_up_date: Date field for scheduling follow-up calls
- follow_up_reason: Short text describing why (max 200 chars)

Dashboard integration:
- New 'Follow-Ups Due' section between unconfirmed support and activity log
- Shows patients with follow_up_date <= today for current line
- Overdue rows highlighted in red, each with a Call button
- Badge shows count of due follow-ups

Patient form:
- Follow-up date and reason fields added below appointment date
- Included in PATIENT_DASHBOARD_PARAMS for strong parameters

Includes migration, model scope, controller, view partial, and i18n.
Designed to work with notification-center PR for bell notifications.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
View fixes:
- fa-solid fa-bell -> fas fa-bell, fa-solid fa-phone -> fas fa-phone (FA5)
- Remove bg-opacity-25 (no BS4 equivalent)
- me-1 -> mr-1 (BS4 spacing)
- badge bg-warning text-dark -> badge badge-warning (BS4 badge)

Infrastructure:
- Fix migration version [8.0] -> [8.1]

Tests:
- follow_ups_due scope: past dates included, today included,
  future dates excluded, nil dates excluded
- follow_up_reason validation: max 200 chars enforced

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Rolling2405 and others added 4 commits April 9, 2026 16:12
Update follow-up reminders partial:
- mr-1 → me-1
- badge badge-warning → badge bg-warning

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Change me-1 to mr-1 (BS4 margin utility)
- Change badge bg-warning to badge badge-warning (BS4 badge class)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add tests to DashboardsControllerTest verifying that patients with
due follow-ups appear on the dashboard, patients without follow-up
dates are excluded, and future follow-up dates are not shown.

Add tests to PatientsControllerTest verifying that follow_up_date
and follow_up_reason can be updated via XHR and JSON, can be cleared,
and that unauthenticated users are redirected.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Add test for line-scoping: follow-up patients from other lines excluded from dashboard
- Add test for blank follow_up_reason being valid
- Add test for follow_up_date without a reason being valid

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant