How farazajmal/gp-ultrahub-api works
GP UltraHub API serves clinic and doctor discovery endpoints alongside a conversational receptionist that turns patient messages into provider and availability results. The primary chat workflow is routed through the AI service, which coordinates intent extraction, follow-up handling, session search state, execution, and response generation; doctor search and ranking supply the matching results. Data is loaded from a remote availability feed, with a local-file fallback. The README provides no capability detail, so the broader endpoint and subsystem map is based on the tree and shown excerpts; some internal links rely on SOURCE INDEX references.
Main entry points: ai_service.py Chat orchestration · doctor_service.py Doctor search · app.py FastAPI app · data_service.py Availability data
Components 19
API routes
- FastAPI app
app.py - Clinic endpoints
routes/clinics.py - Doctor endpoints
routes/doctors.py - Search endpoint
routes/search.py - Chat endpoint
routes/chat.py
Receptionist chat
- Chat orchestration
services/ai_service.py - Intent extraction
services/intent_service.py - Follow-up checks
services/followup_service.py - Conversation memory
services/memory_service.py - Search state
services/search_state_service.py - Search execution
services/execution_service.py
Doctor discovery
- Doctor search
services/doctor_service.py - Medical ranking
services/ranking_service.py
Shared services
- Availability data
services/data_service.py - Date and time parsing
utils/date_parser.py - Conversation formatting
utils/conversation.py
Other components
- Patient
- Availability feed
- OpenAI
Connections 29
- Patient → FastAPI app: sends requests
app.py - FastAPI app → Clinic endpoints: registers routes
app.py - FastAPI app → Doctor endpoints: registers routes
app.py - FastAPI app → Search endpoint: registers routes
app.py - FastAPI app → Chat endpoint: registers routes
app.py - FastAPI app → Availability data: loads data
app.py - Clinic endpoints → Availability data: loads clinic data
routes/clinics.py - Doctor endpoints → Availability data: loads doctor data
routes/doctors.py - Doctor endpoints → Doctor search: requests recommendations
routes/doctors.py - Search endpoint → Doctor search: searches doctors
routes/search.py - Chat endpoint → Chat orchestration: handles chat
routes/chat.py - Chat orchestration → Intent extraction: extracts intent
services/ai_service.py - Chat orchestration → Follow-up checks: checks follow-up
services/ai_service.py - Chat orchestration → Conversation memory: uses memory
services/ai_service.py - Chat orchestration → Search state: updates state
services/ai_service.py - Chat orchestration → Search execution: dispatches search
services/ai_service.py - Chat orchestration → Doctor search: requests matches
services/ai_service.py - Chat orchestration → Availability data: loads data
services/ai_service.py - Chat orchestration → Date and time parsing: parses availability
services/ai_service.py - Intent extraction → Conversation formatting: formats history
services/intent_service.py - Intent extraction → Date and time parsing: normalizes days
services/intent_service.py - Follow-up checks → Conversation formatting: formats history
services/followup_service.py - Search execution → Doctor search: runs search
services/execution_service.py - Doctor search → Availability data: loads records
services/doctor_service.py - Doctor search → Medical ranking: scores matches
services/doctor_service.py - Doctor search → Date and time parsing: filters availability
services/doctor_service.py - Availability data → Availability feed: fetches records
services/data_service.py - Intent extraction → OpenAI: requests extraction
services/intent_service.py - Follow-up checks → OpenAI: requests evaluation
services/followup_service.py