Spaces:
Sleeping
Sleeping
| from fastapi import FastAPI | |
| from fastapi.middleware.cors import CORSMiddleware | |
| import sys | |
| import os | |
| # Add current directory to path | |
| sys.path.insert(0, os.path.dirname(os.path.abspath(__file__))) | |
| from api.routes import router | |
| app = FastAPI( | |
| title="ICD-10 and CPT Coding API", | |
| description="Analyzes medical provider notes and returns appropriate ICD-10 and CPT codes with explanations", | |
| version="1.0.0", | |
| docs_url="/docs", | |
| redoc_url="/redoc" | |
| ) | |
| # CORS middleware | |
| app.add_middleware( | |
| CORSMiddleware, | |
| allow_origins=["*"], | |
| allow_credentials=True, | |
| allow_methods=["*"], | |
| allow_headers=["*"], | |
| ) | |
| # Include routers | |
| app.include_router(router) | |
| async def root(): | |
| return { | |
| "message": "ICD-10 and CPT Coding API", | |
| "docs": "/docs", | |
| "health": "/api/v1/health" | |
| } | |
| if __name__ == "__main__": | |
| import uvicorn | |
| uvicorn.run(app, host="0.0.0.0", port=7860) |