Spaces:
Sleeping
Sleeping
Update api/routes.py
Browse files- api/routes.py +14 -6
api/routes.py
CHANGED
|
@@ -1,9 +1,17 @@
|
|
| 1 |
from fastapi import APIRouter
|
| 2 |
-
from .routes import auth, patients, pdf
|
| 3 |
|
| 4 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
|
| 6 |
-
#
|
| 7 |
-
|
| 8 |
-
router.include_router(patients.router, prefix="/ehr", tags=["patients"])
|
| 9 |
-
router.include_router(pdf.router, prefix="/ehr/patients", tags=["pdf"])
|
|
|
|
| 1 |
from fastapi import APIRouter
|
|
|
|
| 2 |
|
| 3 |
+
def get_router():
|
| 4 |
+
router = APIRouter()
|
| 5 |
+
|
| 6 |
+
# Defer imports to avoid circular import
|
| 7 |
+
from .routes import auth, patients, pdf
|
| 8 |
+
|
| 9 |
+
# Include sub-routers
|
| 10 |
+
router.include_router(auth.router, prefix="/auth", tags=["auth"])
|
| 11 |
+
router.include_router(patients.router, prefix="/ehr", tags=["patients"])
|
| 12 |
+
router.include_router(pdf.router, prefix="/ehr/patients", tags=["pdf"])
|
| 13 |
+
|
| 14 |
+
return router
|
| 15 |
|
| 16 |
+
# Export the router
|
| 17 |
+
api_router = get_router()
|
|
|
|
|
|