{ "openapi": "3.1.0", "info": { "title": "AI Medical Assistant API", "description": "A comprehensive API for AI-powered medical imaging analysis, prescription generation, treatment planning, drug interaction analysis, medical chat conversations, and intelligent appointment booking with smart doctor matching. This API integrates with OpenAI's GPT models and external Lords backend APIs to provide intelligent medical assistance tools for healthcare professionals.", "version": "2.2.0" }, "servers": [ { "url": "http://localhost:3000", "description": "Development server" }, { "url": "https://api.digiboard.appstrice.cloud", "description": "Production server" } ], "tags": [ { "name": "Health", "description": "Health check and system status endpoints" }, { "name": "AI Settings", "description": "Manage AI configuration settings including API keys, models, and preferences" }, { "name": "AI Chat", "description": "AI-powered medical chat conversations with support for patient consultations and doctor collaboration" }, { "name": "AI Imaging", "description": "Medical imaging analysis using AI vision models for automated analysis with detailed radiological reports" }, { "name": "AI Prescription", "description": "AI-powered prescription generation based on medical records analysis" }, { "name": "AI Treatment", "description": "Comprehensive treatment plan generation based on symptoms and patient history" }, { "name": "AI Drug Interaction", "description": "AI-powered drug interaction analysis to identify potential drug-drug interactions and contraindications" }, { "name": "AI Scribe", "description": "AI-powered medical scribe for clinical note generation and documentation" }, { "name": "AI Appointments", "description": "AI-powered appointment booking and management system" }, { "name": "AI Health Analytics", "description": "Comprehensive AI-powered health analytics dashboard providing insights and trend analysis" } ], "paths": { "/health": { "get": { "tags": ["Health"], "summary": "API Health Check", "description": "Basic health check endpoint to verify API is running", "security": [], "responses": { "200": { "description": "API is running successfully", "content": { "application/json": { "schema": { "type": "object", "properties": { "status": { "type": "string", "example": "ok" }, "timestamp": { "type": "string", "format": "date-time", "example": "2024-06-01T12:00:00Z" } } } } } } } } }, "/db-test": { "get": { "tags": ["Health"], "summary": "Database Connection Test", "description": "Test database connection and return status", "security": [], "responses": { "200": { "description": "Database connection successful", "content": { "application/json": { "schema": { "type": "object", "properties": { "ok": { "type": "integer", "example": 1 } } } } } }, "500": { "description": "Database connection failed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/api/ai/settings": { "get": { "tags": ["AI Settings"], "summary": "Get AI Settings", "description": "Retrieve current AI configuration settings", "responses": { "200": { "description": "AI settings retrieved successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AISettings" } } } }, "500": { "description": "Failed to fetch settings", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } }, "post": { "tags": ["AI Settings"], "summary": "Update AI Settings", "description": "Update AI configuration settings", "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AISettingsUpdate" } } } }, "responses": { "200": { "description": "AI settings updated successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AISettings" } } } }, "400": { "description": "Invalid request data", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "500": { "description": "Failed to update settings", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/api/ai/chat": { "post": { "tags": ["AI Chat"], "summary": "Send AI Chat Message", "description": "Send a message to AI chat and get response with support for file uploads and vision analysis", "requestBody": { "required": true, "content": { "multipart/form-data": { "schema": { "$ref": "#/components/schemas/ChatRequest" } } } }, "responses": { "200": { "description": "Chat response generated successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ChatResponse" } } } }, "400": { "description": "Invalid request data", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "500": { "description": "Failed to process chat request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/api/ai/conversations/all": { "get": { "tags": ["AI Chat"], "summary": "Get All Conversations", "description": "Retrieve all AI conversations (admin access)", "responses": { "200": { "description": "Conversations retrieved successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ConversationsList" } } } }, "500": { "description": "Failed to fetch conversations", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/api/ai/conversations/{userId}": { "get": { "tags": ["AI Chat"], "summary": "Get User Conversations", "description": "Retrieve all conversations for a specific user", "parameters": [ { "name": "userId", "in": "path", "required": true, "schema": { "type": "integer" }, "description": "User ID" } ], "responses": { "200": { "description": "User conversations retrieved successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ConversationsList" } } } }, "500": { "description": "Failed to fetch conversations", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/api/ai/conversations/{conversationId}/messages": { "get": { "tags": ["AI Chat"], "summary": "Get Conversation Messages", "description": "Retrieve all messages for a specific conversation", "parameters": [ { "name": "conversationId", "in": "path", "required": true, "schema": { "type": "integer" }, "description": "Conversation ID" } ], "responses": { "200": { "description": "Conversation messages retrieved successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MessagesList" } } } }, "404": { "description": "Conversation not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "500": { "description": "Failed to fetch messages", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/api/ai/imaging/analyze": { "post": { "tags": ["AI Imaging"], "summary": "Analyze Medical Images", "description": "Upload and analyze medical images using AI vision models", "requestBody": { "required": true, "content": { "multipart/form-data": { "schema": { "$ref": "#/components/schemas/ImageAnalysisRequest" } } } }, "responses": { "200": { "description": "Image analysis completed successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ImageAnalysisResponse" } } } }, "400": { "description": "Invalid request data or file format", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "500": { "description": "Failed to analyze images", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/api/ai/imaging/history/all": { "get": { "tags": ["AI Imaging"], "summary": "Get All Imaging Analyses", "description": "Retrieve all medical imaging analyses (admin access)", "responses": { "200": { "description": "Imaging analyses retrieved successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ImagingHistoryList" } } } }, "500": { "description": "Failed to fetch imaging history", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/api/ai/imaging/history/{userId}": { "get": { "tags": ["AI Imaging"], "summary": "Get User Imaging History", "description": "Retrieve medical imaging analysis history for a specific user", "parameters": [ { "name": "userId", "in": "path", "required": true, "schema": { "type": "integer" }, "description": "User ID" } ], "responses": { "200": { "description": "User imaging history retrieved successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ImagingHistoryList" } } } }, "500": { "description": "Failed to fetch imaging history", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/api/ai/imaging/{id}": { "get": { "tags": ["AI Imaging"], "summary": "Get Imaging Analysis", "description": "Retrieve a specific medical imaging analysis by ID", "parameters": [ { "name": "id", "in": "path", "required": true, "schema": { "type": "integer" }, "description": "Imaging analysis ID" } ], "responses": { "200": { "description": "Imaging analysis retrieved successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ImageAnalysisResponse" } } } }, "404": { "description": "Imaging analysis not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "500": { "description": "Failed to fetch imaging analysis", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/api/ai/prescription/analyze": { "post": { "tags": ["AI Prescription"], "summary": "Analyze Medical Records for Prescription", "description": "Upload and analyze medical records and images to generate AI-powered prescription recommendations", "requestBody": { "required": true, "content": { "multipart/form-data": { "schema": { "type": "object", "properties": { "patientId": { "type": "integer", "description": "Patient ID" }, "doctorId": { "type": "integer", "description": "Doctor ID" }, "files": { "type": "array", "items": { "type": "string", "format": "binary", "description": "Medical record files to analyze" }, "description": "Array of medical record files" } }, "required": ["patientId", "doctorId", "files"] } } } }, "responses": { "200": { "description": "Prescription analysis completed successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PrescriptionAnalysisResponse" } } } }, "400": { "description": "Bad request - missing files or invalid parameters", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "500": { "description": "Prescription analysis failed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/api/ai/prescription/history/all": { "get": { "tags": ["AI Prescription"], "summary": "Get All Prescriptions", "description": "Retrieve all AI-generated prescriptions (admin access)", "responses": { "200": { "description": "Prescriptions retrieved successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PrescriptionHistoryList" } } } }, "500": { "description": "Failed to fetch prescriptions", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/api/ai/prescription/history/{userId}": { "get": { "tags": ["AI Prescription"], "summary": "Get User Prescription History", "description": "Retrieve prescription history for a specific user", "parameters": [ { "name": "userId", "in": "path", "required": true, "schema": { "type": "integer" }, "description": "User ID" } ], "responses": { "200": { "description": "User prescription history retrieved successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PrescriptionHistoryList" } } } }, "500": { "description": "Failed to fetch prescription history", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/api/ai/prescription/{id}": { "get": { "tags": ["AI Prescription"], "summary": "Get Prescription", "description": "Retrieve a specific AI-generated prescription by ID", "parameters": [ { "name": "id", "in": "path", "required": true, "schema": { "type": "integer" }, "description": "Prescription ID" } ], "responses": { "200": { "description": "Prescription retrieved successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PrescriptionResponse" } } } }, "404": { "description": "Prescription not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "500": { "description": "Failed to fetch prescription", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/api/ai/treatment/plan": { "post": { "tags": ["AI Treatment"], "summary": "Generate Treatment Plan", "description": "Generate a comprehensive treatment plan based on patient symptoms and history", "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TreatmentPlanRequest" } } } }, "responses": { "200": { "description": "Treatment plan generated successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TreatmentPlanResponse" } } } }, "400": { "description": "Invalid request data", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "500": { "description": "Failed to generate treatment plan", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/api/ai/treatment/history/all": { "get": { "tags": ["AI Treatment"], "summary": "Get All Treatment Plans", "description": "Retrieve all AI-generated treatment plans (admin access)", "responses": { "200": { "description": "Treatment plans retrieved successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TreatmentHistoryList" } } } }, "500": { "description": "Failed to fetch treatment history", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/api/ai/treatment/history/{userId}": { "get": { "tags": ["AI Treatment"], "summary": "Get User Treatment History", "description": "Retrieve treatment plan history for a specific user", "parameters": [ { "name": "userId", "in": "path", "required": true, "schema": { "type": "integer" }, "description": "User ID" } ], "responses": { "200": { "description": "User treatment history retrieved successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TreatmentHistoryList" } } } }, "500": { "description": "Failed to fetch treatment history", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/api/ai/treatment/{id}": { "get": { "tags": ["AI Treatment"], "summary": "Get Treatment Plan", "description": "Retrieve a specific AI-generated treatment plan by ID", "parameters": [ { "name": "id", "in": "path", "required": true, "schema": { "type": "integer" }, "description": "Treatment plan ID" } ], "responses": { "200": { "description": "Treatment plan retrieved successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TreatmentPlanResponse" } } } }, "404": { "description": "Treatment plan not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "500": { "description": "Failed to fetch treatment plan", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/api/ai/drug-interaction/analyze": { "post": { "tags": ["AI Drug Interaction"], "summary": "Analyze Drug Interactions", "description": "Analyze potential drug-drug interactions and provide safety recommendations", "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DrugInteractionRequest" } } } }, "responses": { "200": { "description": "Drug interaction analysis completed successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DrugInteractionResponse" } } } }, "400": { "description": "Invalid request data", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "500": { "description": "Failed to analyze drug interactions", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/api/ai/drug-interaction/history/all": { "get": { "tags": ["AI Drug Interaction"], "summary": "Get All Drug Interaction Analyses", "description": "Retrieve all drug interaction analyses (admin access)", "responses": { "200": { "description": "Drug interaction analyses retrieved successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DrugInteractionHistoryList" } } } }, "500": { "description": "Failed to fetch drug interaction history", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/api/ai/drug-interaction/history/{userId}": { "get": { "tags": ["AI Drug Interaction"], "summary": "Get User Drug Interaction History", "description": "Retrieve drug interaction analysis history for a specific user", "parameters": [ { "name": "userId", "in": "path", "required": true, "schema": { "type": "integer" }, "description": "User ID" } ], "responses": { "200": { "description": "User drug interaction history retrieved successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DrugInteractionHistoryList" } } } }, "500": { "description": "Failed to fetch drug interaction history", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/api/ai/drug-interaction/{id}": { "get": { "tags": ["AI Drug Interaction"], "summary": "Get Drug Interaction Analysis", "description": "Retrieve a specific drug interaction analysis by ID", "parameters": [ { "name": "id", "in": "path", "required": true, "schema": { "type": "integer" }, "description": "Drug interaction analysis ID" } ], "responses": { "200": { "description": "Drug interaction analysis retrieved successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DrugInteractionResponse" } } } }, "404": { "description": "Drug interaction analysis not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "500": { "description": "Failed to fetch drug interaction analysis", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/api/ai/scribe/analyze": { "post": { "tags": ["AI Scribe"], "summary": "Analyze Clinical Notes", "description": "Generate clinical notes from conversation or medical data", "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ScribeAnalysisRequest" } } } }, "responses": { "200": { "description": "Clinical notes generated successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ScribeAnalysisResponse" } } } }, "400": { "description": "Invalid request data", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "500": { "description": "Failed to generate clinical notes", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/api/ai/scribe/save": { "post": { "tags": ["AI Scribe"], "summary": "Save Clinical Notes", "description": "Save generated clinical notes to the database", "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ScribeSaveRequest" } } } }, "responses": { "200": { "description": "Clinical notes saved successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ScribeSaveResponse" } } } }, "400": { "description": "Invalid request data", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "500": { "description": "Failed to save clinical notes", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/api/ai/scribe/history/all": { "get": { "tags": ["AI Scribe"], "summary": "Get All Clinical Notes", "description": "Retrieve all AI-generated clinical notes (admin access)", "responses": { "200": { "description": "Clinical notes retrieved successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ScribeHistoryList" } } } }, "500": { "description": "Failed to fetch clinical notes", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/api/ai/scribe/history/{userId}": { "get": { "tags": ["AI Scribe"], "summary": "Get User Clinical Notes History", "description": "Retrieve clinical notes history for a specific user", "parameters": [ { "name": "userId", "in": "path", "required": true, "schema": { "type": "integer" }, "description": "User ID" } ], "responses": { "200": { "description": "User clinical notes history retrieved successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ScribeHistoryList" } } } }, "500": { "description": "Failed to fetch clinical notes history", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/api/ai/scribe/{id}": { "get": { "tags": ["AI Scribe"], "summary": "Get Clinical Notes", "description": "Retrieve specific clinical notes by ID", "parameters": [ { "name": "id", "in": "path", "required": true, "schema": { "type": "integer" }, "description": "Clinical notes ID" } ], "responses": { "200": { "description": "Clinical notes retrieved successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ScribeAnalysisResponse" } } } }, "404": { "description": "Clinical notes not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "500": { "description": "Failed to fetch clinical notes", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } }, "put": { "tags": ["AI Scribe"], "summary": "Update Clinical Notes", "description": "Update existing clinical notes", "parameters": [ { "name": "id", "in": "path", "required": true, "schema": { "type": "integer" }, "description": "Clinical notes ID" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ScribeUpdateRequest" } } } }, "responses": { "200": { "description": "Clinical notes updated successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ScribeAnalysisResponse" } } } }, "404": { "description": "Clinical notes not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "500": { "description": "Failed to update clinical notes", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/api/ai/appointment-chat": { "post": { "tags": ["AI Appointments"], "summary": "AI Appointment Chat", "description": "Handle AI-powered appointment booking conversation", "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AppointmentChatRequest" } } } }, "responses": { "200": { "description": "Appointment chat processed successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AppointmentChatResponse" } } } }, "400": { "description": "Invalid request data", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "500": { "description": "Failed to process appointment chat", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/api/appointments": { "post": { "tags": ["AI Appointments"], "summary": "Create Appointment", "description": "Create a new appointment through AI booking system", "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateAppointmentRequest" } } } }, "responses": { "200": { "description": "Appointment created successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateAppointmentResponse" } } } }, "400": { "description": "Invalid request data", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "500": { "description": "Failed to create appointment", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/api/appointments/history/{userId}": { "get": { "tags": ["AI Appointments"], "summary": "Get User Appointments", "description": "Retrieve all appointments for a specific user", "parameters": [ { "name": "userId", "in": "path", "required": true, "schema": { "type": "integer" }, "description": "User ID" } ], "responses": { "200": { "description": "User appointments retrieved successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AppointmentsList" } } } }, "500": { "description": "Failed to fetch appointments", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/api/admin/ai-booking-conversations": { "get": { "tags": ["AI Appointments"], "summary": "Get All Booking Conversations (Admin)", "description": "Retrieve all AI booking conversations (admin access)", "responses": { "200": { "description": "Booking conversations retrieved successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BookingConversationsList" } } } }, "500": { "description": "Failed to fetch booking conversations", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/api/admin/ai-booking-conversations/{id}": { "get": { "tags": ["AI Appointments"], "summary": "Get Booking Conversation (Admin)", "description": "Retrieve a specific booking conversation by ID (admin access)", "parameters": [ { "name": "id", "in": "path", "required": true, "schema": { "type": "integer" }, "description": "Conversation ID" } ], "responses": { "200": { "description": "Booking conversation retrieved successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BookingConversationDetail" } } } }, "404": { "description": "Booking conversation not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "500": { "description": "Failed to fetch booking conversation", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/api/admin/ai-booking-conversations/{id}/booking": { "get": { "tags": ["AI Appointments"], "summary": "Get Booking Details (Admin)", "description": "Retrieve booking details for a specific conversation (admin access)", "parameters": [ { "name": "id", "in": "path", "required": true, "schema": { "type": "integer" }, "description": "Conversation ID" } ], "responses": { "200": { "description": "Booking details retrieved successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BookingDetails" } } } }, "404": { "description": "Booking not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "500": { "description": "Failed to fetch booking details", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/api/user/ai-booking-conversations": { "get": { "tags": ["AI Appointments"], "summary": "Get User Booking Conversations", "description": "Retrieve booking conversations for the authenticated user", "responses": { "200": { "description": "User booking conversations retrieved successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BookingConversationsList" } } } }, "500": { "description": "Failed to fetch booking conversations", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/api/user/ai-booking-conversations/{id}": { "get": { "tags": ["AI Appointments"], "summary": "Get User Booking Conversation", "description": "Retrieve a specific booking conversation for the authenticated user", "parameters": [ { "name": "id", "in": "path", "required": true, "schema": { "type": "integer" }, "description": "Conversation ID" } ], "responses": { "200": { "description": "Booking conversation retrieved successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BookingConversationDetail" } } } }, "404": { "description": "Booking conversation not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "500": { "description": "Failed to fetch booking conversation", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/api/user/ai-booking-conversations/{id}/booking": { "get": { "tags": ["AI Appointments"], "summary": "Get User Booking Details", "description": "Retrieve booking details for a specific conversation for the authenticated user", "parameters": [ { "name": "id", "in": "path", "required": true, "schema": { "type": "integer" }, "description": "Conversation ID" } ], "responses": { "200": { "description": "Booking details retrieved successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BookingDetails" } } } }, "404": { "description": "Booking not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "500": { "description": "Failed to fetch booking details", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/api/ai/health-analytics/overview/{userId}": { "get": { "tags": ["AI Health Analytics"], "summary": "Get Health Analytics Overview", "description": "Retrieve health analytics overview for a specific user", "parameters": [ { "name": "userId", "in": "path", "required": true, "schema": { "type": "integer" }, "description": "User ID" } ], "responses": { "200": { "description": "Health analytics overview retrieved successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HealthAnalyticsOverview" } } } }, "500": { "description": "Failed to fetch health analytics overview", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/api/ai/health-analytics/user-data/{userId}": { "get": { "tags": ["AI Health Analytics"], "summary": "Get User Health Data", "description": "Retrieve comprehensive health data for a specific user", "parameters": [ { "name": "userId", "in": "path", "required": true, "schema": { "type": "integer" }, "description": "User ID" } ], "responses": { "200": { "description": "User health data retrieved successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UserHealthData" } } } }, "500": { "description": "Failed to fetch user health data", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/api/ai/health-analytics/insights": { "post": { "tags": ["AI Health Analytics"], "summary": "Generate Health Insights", "description": "Generate AI-powered health insights based on user data", "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HealthInsightsRequest" } } } }, "responses": { "200": { "description": "Health insights generated successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HealthInsightsResponse" } } } }, "400": { "description": "Invalid request data", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "500": { "description": "Failed to generate health insights", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/api/ai/health-analytics/trends": { "post": { "tags": ["AI Health Analytics"], "summary": "Analyze Health Trends", "description": "Analyze health trends and patterns from user data", "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HealthTrendsRequest" } } } }, "responses": { "200": { "description": "Health trends analyzed successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HealthTrendsResponse" } } } }, "400": { "description": "Invalid request data", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "500": { "description": "Failed to analyze health trends", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/api/ai/health-analytics/predictions": { "post": { "tags": ["AI Health Analytics"], "summary": "Generate Health Predictions", "description": "Generate predictive health risk assessments", "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HealthPredictionsRequest" } } } }, "responses": { "200": { "description": "Health predictions generated successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HealthPredictionsResponse" } } } }, "400": { "description": "Invalid request data", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "500": { "description": "Failed to generate health predictions", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/api/ai/health-analytics/history/{userId}": { "get": { "tags": ["AI Health Analytics"], "summary": "Get Health Analytics History", "description": "Retrieve health analytics history for a specific user", "parameters": [ { "name": "userId", "in": "path", "required": true, "schema": { "type": "integer" }, "description": "User ID" } ], "responses": { "200": { "description": "Health analytics history retrieved successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HealthAnalyticsHistory" } } } }, "500": { "description": "Failed to fetch health analytics history", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } } }, "components": { "schemas": { "Error": { "type": "object", "properties": { "error": { "type": "string", "description": "Error message" } }, "required": ["error"] }, "AISettings": { "type": "object", "properties": { "openai_api_key": { "type": "string", "description": "OpenAI API key" }, "model": { "type": "string", "description": "AI model to use", "example": "gpt-5-mini" }, "temperature": { "type": "number", "description": "AI temperature setting", "minimum": 0, "maximum": 2 }, "max_tokens": { "type": "integer", "description": "Maximum tokens for AI responses" } } }, "AISettingsUpdate": { "type": "object", "properties": { "openai_api_key": { "type": "string", "description": "OpenAI API key" }, "model": { "type": "string", "description": "AI model to use" }, "temperature": { "type": "number", "description": "AI temperature setting", "minimum": 0, "maximum": 2 }, "max_tokens": { "type": "integer", "description": "Maximum tokens for AI responses" } } }, "ChatRequest": { "type": "object", "properties": { "userId": { "type": "string", "description": "Patient ID for user_ai conversations (optional for doctor_ai)" }, "doctorId": { "type": "string", "description": "Doctor ID for doctor_ai conversations (optional for user_ai)" }, "conversationType": { "type": "string", "enum": ["user_ai", "doctor_ai"], "description": "Type of conversation: user_ai for patient chat, doctor_ai for doctor collaboration" }, "messages": { "type": "string", "description": "JSON stringified array of message objects, each with role and content" }, "systemPrompt": { "type": "string", "description": "Custom system prompt override (optional, uses default if not provided)" }, "maxTokens": { "type": "integer", "default": 1000, "description": "Maximum tokens for AI response (default: 1000)" }, "files": { "type": "array", "items": { "type": "string", "format": "binary" }, "description": "Optional file uploads for vision analysis (images, documents)" } }, "required": ["messages", "conversationType"] }, "ChatResponse": { "type": "object", "properties": { "response": { "type": "string", "description": "AI response message" }, "conversation_id": { "type": "integer", "description": "Conversation ID" }, "tokens_used": { "type": "integer", "description": "Tokens used in the response" } } }, "ConversationsList": { "type": "object", "properties": { "conversations": { "type": "array", "items": { "$ref": "#/components/schemas/Conversation" } } } }, "Conversation": { "type": "object", "properties": { "id": { "type": "integer", "description": "Conversation ID" }, "uuid": { "type": "string", "description": "Conversation UUID" }, "title": { "type": "string", "description": "Conversation title" }, "user_id": { "type": "integer", "description": "User ID" }, "conversation_type": { "type": "string", "enum": ["user_ai", "doctor_ai", "booking_ai"], "description": "Type of conversation" }, "created_at": { "type": "string", "format": "date-time", "description": "Creation timestamp" }, "updated_at": { "type": "string", "format": "date-time", "description": "Last update timestamp" } } }, "MessagesList": { "type": "object", "properties": { "messages": { "type": "array", "items": { "$ref": "#/components/schemas/Message" } } } }, "Message": { "type": "object", "properties": { "id": { "type": "integer", "description": "Message ID" }, "conversation_id": { "type": "integer", "description": "Conversation ID" }, "role": { "type": "string", "enum": ["system", "user", "assistant"], "description": "Message role" }, "content": { "type": "string", "description": "Message content" }, "created_at": { "type": "string", "format": "date-time", "description": "Creation timestamp" } } }, "ImageAnalysisRequest": { "type": "object", "properties": { "files": { "type": "array", "items": { "type": "string", "format": "binary", "description": "Medical image files" }, "description": "Medical image files to analyze" }, "patientId": { "type": "integer", "description": "Patient ID" }, "doctorId": { "type": "integer", "description": "Doctor ID" } }, "required": ["files", "patientId", "doctorId"] }, "ImageAnalysisResponse": { "type": "object", "properties": { "analysisId": { "type": "integer", "description": "Analysis ID" }, "analysisUuid": { "type": "string", "description": "Analysis UUID" }, "imageType": { "type": "string", "description": "Type of medical image" }, "clinicalFindings": { "type": "string", "description": "Clinical findings from analysis" }, "analysis": { "type": "string", "description": "Detailed analysis" }, "recommendations": { "type": "string", "description": "Recommendations based on analysis" }, "notes": { "type": "string", "description": "Additional notes" }, "disclaimer": { "type": "string", "description": "Medical disclaimer" }, "probableCondition": { "type": "string", "description": "Probable medical condition" }, "confidenceScore": { "type": "number", "description": "Confidence score of the analysis (0-100)" }, "files": { "type": "array", "items": { "$ref": "#/components/schemas/FileInfo" }, "description": "Uploaded file information" } } }, "ImagingHistoryList": { "type": "array", "items": { "$ref": "#/components/schemas/ImageAnalysisResponse" } }, "FileInfo": { "type": "object", "properties": { "id": { "type": "string", "description": "File ID" }, "url": { "type": "string", "description": "File URL" }, "filename": { "type": "string", "description": "Original filename" }, "mimeType": { "type": "string", "description": "MIME type" }, "size": { "type": "integer", "description": "File size in bytes" } } }, "PrescriptionHistoryList": { "type": "object", "properties": { "prescriptions": { "type": "array", "items": { "$ref": "#/components/schemas/PrescriptionResponse" } } } }, "PrescriptionResponse": { "type": "object", "properties": { "id": { "type": "integer", "description": "Prescription ID" }, "prescription_uuid": { "type": "string", "description": "Prescription UUID" }, "patient_id": { "type": "integer", "description": "Patient ID" }, "clinical_findings": { "type": "string", "description": "Clinical findings" }, "analysis": { "type": "string", "description": "Analysis" }, "recommendations": { "type": "string", "description": "Recommendations" }, "notes": { "type": "string", "description": "Additional notes" }, "disclaimer": { "type": "string", "description": "Medical disclaimer" }, "date": { "type": "string", "format": "date", "description": "Prescription date" }, "created_at": { "type": "string", "format": "date-time", "description": "Creation timestamp" } } }, "TreatmentPlanRequest": { "type": "object", "properties": { "patientId": { "type": "integer", "description": "Patient ID (required)" }, "doctorId": { "type": "integer", "description": "Doctor ID (required)" }, "symptoms": { "type": "array", "items": { "type": "object", "properties": { "symptom": { "type": "string", "description": "Symptom name" }, "severity": { "type": "number", "minimum": 0, "maximum": 100, "description": "Severity percentage (0-100)" } }, "required": ["symptom", "severity"] }, "description": "Array of symptom objects with severity levels" } }, "required": ["patientId", "doctorId", "symptoms"] }, "TreatmentPlanResponse": { "type": "object", "properties": { "id": { "type": "integer", "description": "Treatment plan ID" }, "treatment_uuid": { "type": "string", "description": "Treatment plan UUID" }, "patient_id": { "type": "integer", "description": "Patient ID" }, "diagnosis": { "type": "string", "description": "Diagnosis" }, "treatment_plan": { "type": "string", "description": "Comprehensive treatment plan" }, "medications": { "type": "string", "description": "Recommended medications" }, "lifestyle_recommendations": { "type": "string", "description": "Lifestyle recommendations" }, "follow_up": { "type": "string", "description": "Follow-up instructions" }, "created_at": { "type": "string", "format": "date-time", "description": "Creation timestamp" } } }, "TreatmentHistoryList": { "type": "object", "properties": { "treatment_plans": { "type": "array", "items": { "$ref": "#/components/schemas/TreatmentPlanResponse" } } } }, "DrugInteractionRequest": { "type": "object", "properties": { "patientId": { "type": "integer", "description": "Patient ID (required)" }, "doctorId": { "type": "integer", "description": "Doctor ID (required)" }, "medications": { "type": "array", "items": { "type": "string" }, "description": "List of medication names to check for interactions (required)" }, "patientConditions": { "type": "array", "items": { "type": "string" }, "description": "Patient medical conditions (optional)" } }, "required": ["patientId", "doctorId", "medications"] }, "DrugInteractionResponse": { "type": "object", "properties": { "id": { "type": "integer", "description": "Analysis ID" }, "analysis_uuid": { "type": "string", "description": "Analysis UUID" }, "patient_id": { "type": "integer", "description": "Patient ID" }, "drug_interactions": { "type": "string", "description": "Drug interaction analysis" }, "severity_assessment": { "type": "string", "description": "Severity assessment" }, "recommendations": { "type": "string", "description": "Recommendations" }, "alternative_medications": { "type": "string", "description": "Alternative medication suggestions" }, "created_at": { "type": "string", "format": "date-time", "description": "Creation timestamp" } } }, "DrugInteractionHistoryList": { "type": "object", "properties": { "analyses": { "type": "array", "items": { "$ref": "#/components/schemas/DrugInteractionResponse" } } } }, "ScribeAnalysisRequest": { "type": "object", "properties": { "patientId": { "type": "integer", "description": "Patient ID (optional)" }, "doctorId": { "type": "integer", "description": "Doctor ID (optional)" }, "sessionContent": { "description": "Clinical session content - can be string or JSON object (required)" } }, "required": ["sessionContent"] }, "ScribeAnalysisResponse": { "type": "object", "properties": { "id": { "type": "integer", "description": "Clinical notes ID" }, "notes_uuid": { "type": "string", "description": "Clinical notes UUID" }, "patient_id": { "type": "integer", "description": "Patient ID" }, "subjective": { "type": "string", "description": "Subjective assessment" }, "objective": { "type": "string", "description": "Objective findings" }, "assessment": { "type": "string", "description": "Assessment" }, "plan": { "type": "string", "description": "Treatment plan" }, "created_at": { "type": "string", "format": "date-time", "description": "Creation timestamp" } } }, "ScribeSaveRequest": { "type": "object", "properties": { "patient_id": { "type": "integer", "description": "Patient ID" }, "subjective": { "type": "string", "description": "Subjective assessment" }, "objective": { "type": "string", "description": "Objective findings" }, "assessment": { "type": "string", "description": "Assessment" }, "plan": { "type": "string", "description": "Treatment plan" } }, "required": [ "patient_id", "subjective", "objective", "assessment", "plan" ] }, "ScribeSaveResponse": { "type": "object", "properties": { "id": { "type": "integer", "description": "Clinical notes ID" }, "notes_uuid": { "type": "string", "description": "Clinical notes UUID" }, "message": { "type": "string", "description": "Success message" } } }, "ScribeUpdateRequest": { "type": "object", "properties": { "subjective": { "type": "string", "description": "Subjective assessment" }, "objective": { "type": "string", "description": "Objective findings" }, "assessment": { "type": "string", "description": "Assessment" }, "plan": { "type": "string", "description": "Treatment plan" } } }, "ScribeHistoryList": { "type": "object", "properties": { "clinical_notes": { "type": "array", "items": { "$ref": "#/components/schemas/ScribeAnalysisResponse" } } } }, "AppointmentHistoryList": { "type": "object", "properties": { "appointments": { "type": "array", "items": { "$ref": "#/components/schemas/Appointment" } } } }, "Appointment": { "type": "object", "properties": { "id": { "type": "integer", "description": "Appointment ID" }, "patient_id": { "type": "integer", "description": "Patient ID" }, "doctor_id": { "type": "integer", "description": "Doctor ID" }, "appointment_type": { "type": "string", "enum": ["online", "offline"], "description": "Appointment type" }, "date": { "type": "string", "format": "date", "description": "Appointment date" }, "time": { "type": "string", "description": "Appointment time" }, "problem": { "type": "string", "description": "Patient problem/symptoms" }, "status": { "type": "string", "enum": ["pending", "accepted", "cancelled", "completed"], "description": "Appointment status" }, "created_at": { "type": "string", "format": "date-time", "description": "Creation timestamp" }, "updated_at": { "type": "string", "format": "date-time", "description": "Last update timestamp" } } }, "AppointmentChatRequest": { "type": "object", "properties": { "userId": { "type": "integer", "description": "Patient/User ID (required)" }, "message": { "type": "string", "description": "User message for appointment booking assistant (required)" }, "conversationHistory": { "type": "array", "items": { "type": "object", "properties": { "role": { "type": "string", "enum": ["user", "assistant"] }, "content": { "type": "string" } } }, "description": "Previous conversation messages (optional)" } }, "required": ["userId", "message"] }, "AppointmentChatResponse": { "type": "object", "properties": { "response": { "type": "string", "description": "AI response for appointment booking" }, "conversation_id": { "type": "integer", "description": "Conversation ID" }, "booking_complete": { "type": "boolean", "description": "Whether booking process is complete" } } }, "CreateAppointmentRequest": { "type": "object", "properties": { "patientId": { "type": "integer", "description": "Patient ID (required)" }, "doctorId": { "type": "integer", "description": "Doctor ID (required)" }, "appointmentType": { "type": "string", "enum": ["online", "in-person", "phone"], "description": "Appointment type (required)" }, "date": { "type": "string", "format": "date", "description": "Appointment date in YYYY-MM-DD format (required)" }, "time": { "type": "string", "description": "Appointment time in HH:MM format (required)" }, "problem": { "type": "string", "description": "Chief complaint/problem description (required)" } }, "required": [ "patientId", "doctorId", "appointmentType", "date", "time", "problem" ] }, "CreateAppointmentResponse": { "type": "object", "properties": { "appointment_id": { "type": "integer", "description": "Created appointment ID" }, "message": { "type": "string", "description": "Success message" } } }, "AppointmentsList": { "type": "object", "properties": { "appointments": { "type": "array", "items": { "$ref": "#/components/schemas/Appointment" } } } }, "BookingConversationsList": { "type": "object", "properties": { "conversations": { "type": "array", "items": { "$ref": "#/components/schemas/BookingConversation" } } } }, "BookingConversation": { "type": "object", "properties": { "id": { "type": "integer", "description": "Conversation ID" }, "uuid": { "type": "string", "description": "Conversation UUID" }, "title": { "type": "string", "description": "Conversation title" }, "user_id": { "type": "integer", "description": "User ID" }, "created_at": { "type": "string", "format": "date-time", "description": "Creation timestamp" }, "appointment_id": { "type": "integer", "description": "Associated appointment ID" } } }, "BookingConversationDetail": { "type": "object", "properties": { "conversation": { "$ref": "#/components/schemas/BookingConversation" }, "messages": { "type": "array", "items": { "$ref": "#/components/schemas/Message" } } } }, "BookingDetails": { "type": "object", "properties": { "appointment": { "$ref": "#/components/schemas/Appointment" }, "conversation_id": { "type": "integer", "description": "Associated conversation ID" } } }, "HealthAnalyticsOverview": { "type": "object", "properties": { "active_appointments": { "type": "integer", "description": "Number of active appointments" }, "medical_documents_analyzed": { "type": "integer", "description": "Number of medical documents analyzed" }, "analysis_reports_generated": { "type": "integer", "description": "Number of analysis reports generated" } } }, "UserHealthData": { "type": "object", "properties": { "user_id": { "type": "integer", "description": "User ID" }, "appointments": { "type": "array", "items": { "$ref": "#/components/schemas/Appointment" } }, "imaging_analyses": { "type": "array", "items": { "$ref": "#/components/schemas/ImageAnalysisResponse" } }, "prescriptions": { "type": "array", "items": { "$ref": "#/components/schemas/PrescriptionResponse" } }, "treatment_plans": { "type": "array", "items": { "$ref": "#/components/schemas/TreatmentPlanResponse" } } } }, "HealthInsightsRequest": { "type": "object", "properties": { "userId": { "type": "integer", "description": "User/Patient ID (required)" }, "timePeriod": { "type": "string", "enum": ["week", "month", "quarter", "year"], "description": "Time period for analysis (optional, default: month)" } }, "required": ["userId"] }, "HealthInsightsResponse": { "type": "object", "properties": { "insights": { "type": "string", "description": "AI-generated health insights" }, "recommendations": { "type": "string", "description": "Health recommendations" }, "risk_factors": { "type": "array", "items": { "type": "string" }, "description": "Identified risk factors" } } }, "HealthTrendsRequest": { "type": "object", "properties": { "userId": { "type": "integer", "description": "User/Patient ID (required)" }, "userData": { "type": "object", "description": "Comprehensive user health data including medical records (required)" }, "metrics": { "type": "array", "items": { "type": "string" }, "description": "Health metrics to analyze (optional, e.g., blood_pressure, weight, glucose)" }, "timeRange": { "type": "object", "properties": { "startDate": { "type": "string", "format": "date", "description": "Start date for analysis (YYYY-MM-DD)" }, "endDate": { "type": "string", "format": "date", "description": "End date for analysis (YYYY-MM-DD)" } }, "description": "Date range for analysis (optional)" } }, "required": ["userId", "userData"] }, "HealthTrendsResponse": { "type": "object", "properties": { "trends": { "type": "string", "description": "Health trends analysis" }, "patterns": { "type": "array", "items": { "type": "string" }, "description": "Identified patterns" }, "correlations": { "type": "string", "description": "Correlations found in data" } } }, "HealthPredictionsRequest": { "type": "object", "properties": { "userId": { "type": "integer", "description": "User/Patient ID (required)" }, "userData": { "type": "object", "description": "Comprehensive user health data for predictions (required)" }, "predictionType": { "type": "string", "enum": [ "disease_risk", "progression_risk", "hospitalization_risk" ], "description": "Type of health prediction to generate (required)" } }, "required": ["userId", "userData", "predictionType"] }, "HealthPredictionsResponse": { "type": "object", "properties": { "predictions": { "type": "string", "description": "Health predictions and risk assessments" }, "confidence_level": { "type": "number", "description": "Confidence level of predictions" }, "preventive_actions": { "type": "array", "items": { "type": "string" }, "description": "Recommended preventive actions" } } }, "HealthAnalyticsHistory": { "type": "object", "properties": { "user_id": { "type": "integer", "description": "User ID" }, "insights_history": { "type": "array", "items": { "$ref": "#/components/schemas/HealthInsightsResponse" } }, "trends_history": { "type": "array", "items": { "$ref": "#/components/schemas/HealthTrendsResponse" } }, "predictions_history": { "type": "array", "items": { "$ref": "#/components/schemas/HealthPredictionsResponse" } } } }, "PrescriptionAnalysisRequest": { "type": "object", "properties": { "patientId": { "type": "integer", "description": "Patient ID" }, "doctorId": { "type": "integer", "description": "Doctor ID" }, "files": { "type": "array", "items": { "type": "string", "format": "binary", "description": "Medical record files to analyze" }, "description": "Array of medical record files" } }, "required": ["patientId", "doctorId", "files"] }, "PrescriptionAnalysisResponse": { "type": "object", "properties": { "prescriptionId": { "type": "integer", "description": "Prescription ID" }, "prescriptionUuid": { "type": "string", "description": "Prescription UUID" }, "clinicalFindings": { "type": "string", "description": "Clinical findings from analysis" }, "analysis": { "type": "string", "description": "Detailed analysis" }, "recommendations": { "type": "string", "description": "Prescription recommendations" }, "notes": { "type": "string", "description": "Additional notes" }, "disclaimer": { "type": "string", "description": "Medical disclaimer" }, "signature": { "type": "string", "description": "Doctor's signature" }, "date": { "type": "string", "description": "Prescription date" }, "hospital": { "type": "object", "properties": { "name": { "type": "string", "description": "Hospital name" }, "address": { "type": "string", "description": "Hospital address" }, "phone": { "type": "string", "description": "Hospital phone" }, "email": { "type": "string", "description": "Hospital email" } }, "description": "Hospital information" } } } } } }