The aggregate router is commented out in the backend (main.py lines 89–96) with a # TEMPORARILY DISABLED comment, but the frontend config has ui.aggregate_enabled: true and there are ~280 lines of client code in src/services/aggregateApi.js that call endpoints which don't exist.
This means a contributor could wire up aggregate UI, watch it fail with 404s, and not understand why.
Current state
| Layer |
File |
Status |
| Backend import |
main.py line 5 |
# , aggregate — commented out |
| Backend router |
main.py lines 89–96 |
Entire app.include_router(aggregate.router) block commented out |
| Backend config |
config.yaml → aggregate.enabled |
false |
| Frontend config |
config.yaml → ui.aggregate_enabled |
true ← contradicts backend |
| Frontend API client |
src/services/aggregateApi.js |
280 lines, calls /api/aggregate/... |
| Frontend hook |
src/hooks/useAggregatedData.js |
Ready to use |
| Backend router file |
fhir-backend-dynamic/app/routers/aggregate.py |
Exists, never loaded |
| Backend service file |
fhir-backend-dynamic/app/services/aggregation.py |
Exists, never called |
What to do
Pick one of two approaches — don't leave it in this half-state.
Option A: Re-enable behind the existing feature flag
The guard logic is already written — it just needs uncommenting:
# main.py — uncomment line 5:
from app.routers import resources, health, servers, filters, metadata, aggregate
# main.py — uncomment lines 89-96:
if config.aggregate_enabled:
try:
app.include_router(aggregate.router, prefix="/api")
logging.info("Aggregate endpoints enabled successfully")
except Exception as e:
logging.error(f"Failed to include aggregate router: {e}")
Then align the config: set ui.aggregate_enabled to match aggregate.enabled (both false by default, both true to test).
If there are runtime errors when enabled, file them as separate issues instead of commenting out the whole feature.
Option B: Mark it experimental explicitly
Move the frontend aggregate files into src/experimental/ so they're clearly separated from production code. Add a note in README.md stating the feature is under development.
References
The aggregate router is commented out in the backend (
main.pylines 89–96) with a# TEMPORARILY DISABLEDcomment, but the frontend config hasui.aggregate_enabled: trueand there are ~280 lines of client code insrc/services/aggregateApi.jsthat call endpoints which don't exist.This means a contributor could wire up aggregate UI, watch it fail with 404s, and not understand why.
Current state
main.pyline 5# , aggregate— commented outmain.pylines 89–96app.include_router(aggregate.router)block commented outconfig.yaml→aggregate.enabledfalseconfig.yaml→ui.aggregate_enabledtrue← contradicts backendsrc/services/aggregateApi.js/api/aggregate/...src/hooks/useAggregatedData.jsfhir-backend-dynamic/app/routers/aggregate.pyfhir-backend-dynamic/app/services/aggregation.pyWhat to do
Pick one of two approaches — don't leave it in this half-state.
Option A: Re-enable behind the existing feature flag
The guard logic is already written — it just needs uncommenting:
Then align the config: set
ui.aggregate_enabledto matchaggregate.enabled(bothfalseby default, bothtrueto test).If there are runtime errors when enabled, file them as separate issues instead of commenting out the whole feature.
Option B: Mark it experimental explicitly
Move the frontend aggregate files into
src/experimental/so they're clearly separated from production code. Add a note inREADME.mdstating the feature is under development.References
include_routeris used with feature flags