From Patient Input to Structured Medical Report
Flask web framework receives POST request with JSON payload containing patient information.
Server-side validation ensures all required fields are present and properly formatted before processing.
Advanced prompt engineering creates comprehensive medical analysis instructions with specific output formatting requirements.
Large Language Model analyzes symptoms using medical knowledge to generate comprehensive triage assessment.
Regex-based extraction identifies structured sections from AI response, with intelligent fallback parsing for unstructured content.
Dynamic HTML generation creates professional medical reports with embedded CSS styling and structured content presentation.
Final output includes multiple formats: API response for web integration, HTML for viewing, and optional local file storage for record keeping.