How bob299-bob/aihealth_services works
This is a FastAPI AI healthcare API. A user reaches registered endpoints through the application, with capabilities for account access, heart-disease prediction, X-ray analysis, healthcare chat, and PDF question answering. The sampled code shows endpoint-owned processing, SQLite-backed accounts, in-memory document indexes, and Groq-backed responses. The README is empty; some model and preprocessing modules are indexed but unsampled, so their internal behavior and connections are not inferred beyond indexed references.
Main entry points: main.py FastAPI application · auth_router.py Account endpoints · chat_router.py Healthcare chat · rag.py PDF question endpoints
Components 20
API and access
- FastAPI application
main.py - Account endpoints
routers/auth_router.py - Token and password auth
auth.py - Request schemas
schemas.py
Clinical analysis
- Heart prediction endpoint
routers/ml_router.py - Heart disease model
Services/ML/DiseasePrediction/modelDP.py - Heart data preprocessing
Services/ML/DiseasePrediction/preprocessing.py - X-ray analysis endpoint
routers/image_router.py - X-ray model loader
Services/model_loader.py
AI assistants
- Healthcare chat
routers/chat_router.py - PDF question endpoints
routers/rag.py - Document retrieval and answers
Services/docBrain.py
Account storage
- SQLite database
database.py - Account record model
models.py
Vision model preparation
- MRI CNN model
Services/CNN/MRI Analysis/modelMRI.py - MRI CNN preprocessing
Services/CNN/MRI Analysis/preprocessingCNN.py - X-ray CNN model
Services/CNN/X-RayAnalysis/modelXray.py - X-ray CNN preprocessing
Services/CNN/X-RayAnalysis/preprocessingCNN.py
Other components
- API user
- Groq API
Connections 24
- API user → FastAPI application: calls API
main.py - FastAPI application → Account endpoints: registers routes
main.py - FastAPI application → Heart prediction endpoint: registers routes
main.py - FastAPI application → X-ray analysis endpoint: registers routes
main.py - FastAPI application → Healthcare chat: registers routes
main.py - FastAPI application → PDF question endpoints: registers routes
main.py - FastAPI application → SQLite database: creates tables
main.py - FastAPI application → Account record model: loads metadata
main.py - Account endpoints → SQLite database: queries and writes
routers/auth_router.py - Account endpoints → Account record model: queries and creates
routers/auth_router.py - Account endpoints → Token and password auth: uses auth functions
routers/auth_router.py - Account endpoints → Request schemas: validates requests
routers/auth_router.py - Heart prediction endpoint → Request schemas: validates input
routers/ml_router.py - X-ray analysis endpoint → X-ray model loader: loads model
routers/image_router.py - Healthcare chat → Token and password auth: checks token
routers/chat_router.py - Healthcare chat → Request schemas: validates request
routers/chat_router.py - Healthcare chat → Groq API: requests completion
routers/chat_router.py - PDF question endpoints → Token and password auth: checks token
routers/rag.py - PDF question endpoints → Request schemas: validates question
routers/rag.py - PDF question endpoints → Document retrieval and answers: processes and answers
routers/rag.py - Document retrieval and answers → Groq API: requests completion
Services/docBrain.py - MRI CNN model → MRI CNN preprocessing: references preprocessing
Services/CNN/MRI Analysis/modelMRI.py - X-ray CNN model → MRI CNN preprocessing: references preprocessing
Services/CNN/X-RayAnalysis/modelXray.py - Heart disease model → Heart data preprocessing: references preprocessing
Services/ML/DiseasePrediction/modelDP.py