from fastapi import APIRouter import logging # Configure logging logging.basicConfig( level=logging.INFO, format='%(asctime)s - %(levelname)s - %(name)s - %(message)s' ) logger = logging.getLogger(__name__) def get_router(): router = APIRouter() # Import sub-modules from the routes directory from .routes.auth import auth from .routes.patients import patients from .routes.pdf import pdf from .routes.appointments import router as appointments from .routes.messaging import router as messaging from .routes.txagent import router as txagent # Include sub-routers with correct prefixes router.include_router(patients, tags=["patients"]) # Remove prefix since routes already have /patients router.include_router(auth, prefix="/auth", tags=["auth"]) router.include_router(pdf, prefix="/patients", tags=["pdf"]) # Keep prefix for PDF routes router.include_router(appointments, tags=["appointments"]) router.include_router(messaging, tags=["messaging"]) router.include_router(txagent, tags=["txagent"]) return router # Export the router api_router = get_router()