File size: 1,149 Bytes
11102bd
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
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()