Skip to content

OTR-1954: Add the ability for follow-ups to be billable & attached to a schedule#6785

Merged
bxr1nG merged 13 commits intodevelopfrom
feature/followup-visit-tracking-board
Apr 15, 2026
Merged

OTR-1954: Add the ability for follow-ups to be billable & attached to a schedule#6785
bxr1nG merged 13 commits intodevelopfrom
feature/followup-visit-tracking-board

Conversation

@bxr1nG
Copy link
Copy Markdown
Contributor

@bxr1nG bxr1nG commented Mar 31, 2026

Daniel Abrams and others added 8 commits March 19, 2026 22:07
Introduces a third visit type that combines follow-up association (partOf)
with full appointment lifecycle and all progress note modules. Key changes:

- New FollowupSubtype (annotation/scheduled) with FHIR coding system
- Follow-up modal now has Scheduled/Annotation radio toggle
- Scheduled flow: select parent encounter then reuse standard Add Visit page
- create-appointment accepts parentEncounterId, sets partOf + follow-up type
- Patient visit history excludes scheduled follow-up appointments from
  top-level rows, shows them indented under parent
- Tracking board shows follow-up indicator icon for scheduled follow-ups
- Multiple zambdas updated: isFollowupEncounter filter changed to
  isAnnotationFollowupEncounter to allow scheduled follow-ups through
- Appointment store fetches parent encounter tree for scheduled follow-ups
- EncounterSwitcher resets exam observations on encounter switch
- Oystehr SDK zambdaApiUrl configured for local development

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
… provider

- Radio buttons moved inside the white card for Annotation/Scheduled toggle
- Create Follow-Up Visit from progress note menu prepopulates initial visit
- Provider prepopulates with logged-in user instead of encounter attender
- Annotation form labels updated (date/time/provider)
- Location populates instantly from FHIR query

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Unit tests (21): Follow-up subtype helpers — isFollowupEncounter,
getFollowupSubtype, isScheduledFollowupEncounter,
isAnnotationFollowupEncounter, getEncounterVisitType

Component tests (6): AddPatientFollowup — radio toggle rendering,
mode switching between Annotation and Scheduled, breadcrumbs

E2E tests (1 flow with 7 steps): Full creation flow — navigate to
follow-up page, select Scheduled Visit, pick parent encounter,
continue to Add Visit, fill walk-in visit form, verify on tracking
board, verify indented under parent in patient record

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Test now creates a scheduled follow-up visit through the full UI flow
(select parent, fill Add Visit form, submit) and verifies redirect to
tracking board and indented display on patient record.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds support for scheduled follow-ups that are billable and attached to a schedule, complementing the existing annotation-based follow-ups. The feature introduces follow-up subtypes ('annotation' and 'scheduled'), allows follow-ups to reference a parent encounter, and implements comprehensive UI/UX changes to support the new workflow.

Changes:

  • Renamed isFollowupEncounter() to isAnnotationFollowupEncounter() across the codebase to distinguish annotation follow-ups from scheduled follow-ups
  • Added new types and utilities for handling follow-up subtypes (FollowupSubtype, FOLLOWUP_SUBTYPE_SYSTEM, isScheduledFollowupEncounter, getFollowupSubtype)
  • Implemented support for creating scheduled follow-ups with parent encounter references (partOf field) and preventing nesting
  • Added UI components for selecting follow-up type (annotation vs. scheduled) and parent encounter selection
  • Extended appointment and encounter data structures to track follow-up relationships and navigate appropriately
  • Updated navigation logic to use parent appointment ID for scheduled follow-ups while preserving specific encounter context

Reviewed changes

Copilot reviewed 51 out of 51 changed files in this pull request and generated no comments.

Show a summary per file
File Description
packages/utils/lib/fhir/encounter.ts New types and helper functions for follow-up subtypes
packages/utils/lib/fhir/encounter.test.ts Comprehensive test coverage for new encounter functions
packages/zambdas/src/patient/appointment/create-appointment/ Support for creating scheduled follow-ups with parent encounter validation
packages/zambdas/src/ehr/save-followup-encounter/helpers.ts Updated to handle follow-up subtypes during creation/update
packages/zambdas/src/ehr/patient-visit-history/get/index.ts Tracks scheduled follow-ups separately to exclude from top-level rows
apps/ehr/src/features/visits/shared/components/patient/AddPatientFollowup.tsx New UI for selecting follow-up type
apps/ehr/src/features/visits/shared/components/patient/ScheduledFollowupParentSelector.tsx Component for selecting parent encounter for scheduled follow-ups
apps/ehr/src/pages/AddPatient.tsx Integrated support for scheduled follow-up workflow
apps/ehr/src/features/visits/in-person/components/EncounterSwitcher.tsx Updated to handle scheduled follow-up display and interaction modes
apps/ehr/src/components/AppointmentTableRow.tsx Added visual indicator for follow-up appointments
apps/ehr/tests/e2e/specs/in-person/scheduled-followup.spec.ts Comprehensive E2E test for scheduled follow-up workflow
apps/ehr/tests/component/AddPatientFollowup.test.tsx Component tests for follow-up type selection

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread apps/ehr/src/components/AppointmentTableRowMobile.tsx Outdated
Comment thread apps/ehr/src/components/PatientEncountersGrid.tsx
Comment thread apps/ehr/src/features/visits/in-person/components/EncounterSwitcher.tsx Outdated
Comment thread apps/ehr/src/features/visits/in-person/components/Header.tsx Outdated
@bxr1nG bxr1nG requested a review from ValeriyDyachenko April 13, 2026 07:59
@bxr1nG bxr1nG merged commit e14c56e into develop Apr 15, 2026
14 checks passed
@bxr1nG bxr1nG deleted the feature/followup-visit-tracking-board branch April 15, 2026 13:08
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.

3 participants