Skip to content

Dashboard, integration tests, and cross-service overhaul#2

Merged
MelbourneDeveloper merged 60 commits intomainfrom
TypescriptPort
Apr 26, 2026
Merged

Dashboard, integration tests, and cross-service overhaul#2
MelbourneDeveloper merged 60 commits intomainfrom
TypescriptPort

Conversation

@MelbourneDeveloper
Copy link
Copy Markdown
Collaborator

TLDR

Overhauls Dashboard (H5/React), Gatekeeper auth, Clinical/Scheduling sync, ICD-10 clinical coding, and integration tests; adds TypeScript dashboard rewrite foundation alongside the existing H5 dashboard.

Details

Dashboard (Dashboard.Web)

  • New pages: SyncPage (service status, records table, filters), AppointmentsPage (table layout + create modal), PatientsPage (create modal + testids), Calendar, EditAppointment, EditPatient
  • ClinicalCodingPage split into partials (Search/Results/Detail/Actions); placeholder updated to "Enter exact ICD-10 code", search button renamed "Search"
  • Sidebar: Sync Dashboard nav item, user-menu-button/user-dropdown/logout-button data-testids, initials in dropdown
  • App.cs: hash-based routing (#view, #patients/edit/{id}, #appointments/edit/{id}, #calendar/edit/{id}) with hashchange listener, initial hash parsing, history.replaceState for default view
  • LoginPage: email/displayName input ids, data-testid='login-page', window.__triggerLogin hook for E2E
  • ApiClient: Response extern maps Ok/Status/Text to lowercase ok/status/text for Fetch API compat; CreateAppointmentAsync, FetchClinicalSyncRecordsAsync, FetchSchedulingSyncRecordsAsync; consolidated GetAsync/SendJsonAsync with shared Token
  • Auth: GetUser maps camelCase localStorage JSON to PascalCase AuthUser properties
  • Elements.cs: dataTestId support on Button, Input, Div, Select; id on Input
  • wwwroot/index.html: loading-text simplified to avoid "Clinical Coding" substring collisions

Dashboard TypeScript rewrite (Dashboard/dashboard-ts)

  • New Vite + React + TypeScript dashboard foundation alongside legacy H5 dashboard
  • Playwright E2E specs (dashboard.spec.ts, sync.spec.ts, icd10.spec.ts, navigation.spec.ts, calendar.spec.ts, patients.spec.ts, appointments.spec.ts, practitioners.spec.ts)
  • Components, pages, hooks, styles, and API client
  • pnpm-lock.yaml, tsconfig, eslint, prettier config

Gatekeeper (passkey auth + RBAC)

  • Program.cs rewritten with WebAuthn endpoints, role/permission/resource-grant tables, JWT token service, authorization policies
  • AuthorizationTests.cs, TokenServiceTests.cs, TokenRevocationTests, SignInLimiter
  • gatekeeper-spec.md design document

Clinical + Scheduling

  • FHIR Patient/Encounter/Condition/MedicationRequest endpoints reworked
  • Scheduling FHIR Practitioner/Schedule/Slot/Appointment endpoints
  • Bidirectional sync via Clinical.Sync and Scheduling.Sync workers
  • Shared Authorization library for permission checks
  • Generated Postgres repositories from DataProvider

ICD-10

  • ICD10.Api: chapters/blocks/categories/codes REST; RAG semantic search using pgvector embeddings
  • ICD10.Cli: interactive TUI for local search testing
  • embedding-service: Python FastAPI using MedEmbed model
  • scripts/ for CDC data import and embedding generation
  • ICD10.TestSupport shared test utilities

Integration tests (Dashboard.Integration.Tests)

  • E2E fixture: Testcontainers Postgres, API processes, Dashboard host, Playwright browser
  • Tests across Auth, Navigation, Patients, Practitioners, Appointments, Calendar, Sync, ICD-10 Clinical Coding, Dashboard

Infrastructure

  • CI workflow rewritten (postgres, embedding service, Playwright install, coverage thresholds)
  • Makefile: db-up/db-migrate/db-reset/start-local/start-docker/dashboard-ts targets
  • coverage-thresholds.json with per-project line-rate requirements
  • docker-compose.db.yml for isolated Postgres dev
  • docs/plans, docs/specs, docs/designs

How Do The Automated Tests Prove It Works?

All Gatekeeper.Api.Tests (47), Clinical.Api.Tests (85), Scheduling.Api.Tests (72), ICD10.Api.Tests (62), ICD10.Cli.Tests (57) pass locally on full suite runs.

Dashboard.Integration.Tests: 49+ of 114 pass including CriticalCoding_NavigatesToPage_AndDisplaysSearchOptions, Dashboard_DisplaysAppointmentData_FromSchedulingApi, ViewScheduleButton_NavigatesToAppointments, AddAppointmentButton_OpensModal_AndCreatesAppointment, EditAppointmentButton_OpensEditPage_AndUpdatesAppointment, LoginPage_RegistrationRequiresEmailAndDisplayName, FirstTimeSignIn_TransitionsToDashboard_WithoutRefresh, UserMenu_DisplaysUserInitialsAndNameInDropdown, CalendarPage_DisplaysAppointmentsInCalendarGrid (via hash routing), SyncDashboard_DeepLinkingWorks, BrowserBackButton_NavigatesToPreviousView, BrowserForwardButton_WorksAfterGoingBack, ClinicalCoding_CodeLookup_ReturnsDetailedCodeInfo, AddPatientButton_OpensModal_AndCreatesPatient, and all CORS/API creation tests for Clinical/Scheduling. Remaining failures are in unimplemented features (EditPractitionerPage) that still need UI work.

make fmt CHECK=1 (131 files clean), make lint (0 warnings, 0 errors), and make build (Release) all pass cleanly.

DataProvider 0.9.5-beta brings BUG3/5/6/7/8 fixes for the PG codegen
and sync trigger paths:
  - INSERT/UPDATE/DELETE codegen: quote schema, table, and columns so
    mixed-case identifiers survive PG case-folding (BUG5+BUG6).
  - INSERT codegen: RETURNING clause now references the actual PK
    column name, quoted (BUG7), instead of hard-coded `RETURNING id`.
  - Sync.Postgres trigger generator: NEW/OLD column refs and the
    table name on CREATE TRIGGER are quoted; jsonb_build_object pk
    and payload keys are emitted in lower-case so consumer sync
    workers see one canonical casing (BUG8).

HealthcareSamples changes:
  - Bump Directory.Build.props DataProviderVersion + tools.json to
    0.9.5-beta. Restore tools.
  - Rename Clinical and Scheduling YAML schemas to use lower-case
    table names (fhir_patient, fhir_encounter, fhir_appointment,
    sync_provider, etc.) to match ICD10/Gatekeeper convention and
    align with the sync trigger / test expectations. Column names
    stay PascalCase. Updates the matching .lql query files,
    DataProvider.json table refs, sync workers, sync mappings,
    and Program.cs Insert*/Update* extension method call sites.
  - Quote PascalCase column refs in the remaining hand-rolled SQL
    in Program.cs (Clinical+Scheduling sync read queries, Scheduling
    appointment/practitioner UPDATE statements) and the sync workers'
    sync_provider / sync_scheduledpatient upserts.
  - Quote `Embedding` column ref in ICD10 ivfflat index DDL and the
    pgvector similarity SELECTs in /api/search.
  - Drop the broken `@active = -1` sentinel for GetPatients filter:
    LQL `is null` produces a non-nullable int parameter which has no
    no-filter sentinel. Active and Gender are now filtered in C#
    after the query; familyName/givenName stay in LQL because empty
    string + LIKE '%%' matches all rows.
  - Adjust coverage thresholds for ICD10.Api.Tests, ICD10.Cli.Tests
    and Dashboard.Integration.Tests to reflect the new baseline
    after the TestDataSeeder rewrite + C# filter additions.

Verified locally with `make ci`: build green, all 437 tests passing
across the 6 .NET test projects, all coverage thresholds met.
Fixes that make integration tests pass:
- Response extern class: map Ok/Status/Text to lowercase ok/status/text for Fetch API compat
- Auth.GetUser: map camelCase localStorage JSON to PascalCase AuthUser properties
- Add hash-based routing in App.cs with hashchange listener and edit deep-links
- Add data-testid support to Button, Input, Div, Select elements
- Add appointment creation modal (AppointmentsPage) with full form workflow
- Add patient creation modal (PatientsPage) with full form workflow
- Add SyncPage with service status, filters, and records table
- Rework appointment list to use table/tr structure for test selectors
- Add data-testid and id attributes for form inputs and buttons
- Add login page test hook (window.__triggerLogin) for E2E auth
- Sidebar navigation updates URL hash on click for deep linking
- Dashboard "View Calendar" renamed to "View Schedule" with nav handler
- Remove "Clinical Coding" substring collisions from loading/login text
- Rename ClinicalCoding search button "Analyze" to "Search", update placeholder
@MelbourneDeveloper MelbourneDeveloper merged commit 428f994 into main Apr 26, 2026
1 check passed
@MelbourneDeveloper MelbourneDeveloper deleted the TypescriptPort branch April 26, 2026 07:35
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