# visual_separation_manager.py """ Visual Separation Manager for Enhanced UI Display. This module provides visual separation and styling management for different content types in the enhanced results display system. Requirements: 7.1, 7.2, 7.3, 7.4, 7.5 """ from typing import Dict, List, Optional from dataclasses import dataclass from enum import Enum class ContentType(Enum): """Types of content for visual styling.""" AI_ANALYSIS = "ai_analysis" PATIENT_MESSAGE = "patient_message" PROVIDER_SUMMARY = "provider_summary" SECTION_SEPARATOR = "section_separator" CONTENT_DIVIDER = "content_divider" @dataclass class VisualStyle: """Visual styling configuration for content types.""" background_color: str border_color: str border_width: str = "2px" border_radius: str = "8px" padding: str = "15px" margin: str = "10px 0" text_color: str = "#333333" icon_color: str = "#666666" class VisualSeparationManager: """ Visual Separation Manager for enhanced content display. Provides consistent visual styling and separation for different types of content in the enhanced results display system. Requirements: 7.1, 7.2, 7.3, 7.4, 7.5 """ def __init__(self): """Initialize the visual separation manager with default styles.""" self._initialize_default_styles() def _initialize_default_styles(self) -> None: """Initialize default visual styles for different content types.""" self.styles = { ContentType.AI_ANALYSIS: VisualStyle( background_color="#fafafa", border_color="#6c757d", text_color="#333333", icon_color="#6c757d" ), ContentType.PATIENT_MESSAGE: VisualStyle( background_color="#f0f7ff", border_color="#4a90e2", text_color="#333333", icon_color="#4a90e2" ), ContentType.PROVIDER_SUMMARY: VisualStyle( background_color="#fff8f0", border_color="#dc3545", text_color="#333333", icon_color="#dc3545" ) } # Classification-specific colors self.classification_colors = { "RED": "#dc3545", "YELLOW": "#ffc107", "GREEN": "#28a745" } # Urgency-specific colors self.urgency_colors = { "IMMEDIATE": "#dc3545", "URGENT": "#fd7e14", "STANDARD": "#28a745" } def create_ai_analysis_styling(self) -> Dict[str, str]: """ Create styling configuration for AI analysis sections. Returns: Dictionary of CSS styling properties Requirements: 7.1, 7.3 """ style = self.styles[ContentType.AI_ANALYSIS] return { "container": f""" border: {style.border_width} solid {style.border_color}; border-radius: {style.border_radius}; padding: {style.padding}; margin: {style.margin}; background-color: {style.background_color}; """, "header": f""" display: flex; align-items: center; margin-bottom: 10px; color: {style.text_color}; font-weight: bold; """, "icon": f""" font-size: 1.2em; margin-right: 8px; color: {style.icon_color}; """, "content": f""" color: {style.text_color}; line-height: 1.4; """ } def create_patient_message_styling(self) -> Dict[str, str]: """ Create styling configuration for patient message sections. Returns: Dictionary of CSS styling properties Requirements: 7.2, 7.3 """ style = self.styles[ContentType.PATIENT_MESSAGE] return { "container": f""" border: {style.border_width} solid {style.border_color}; border-radius: {style.border_radius}; padding: {style.padding}; margin: {style.margin}; background-color: {style.background_color}; """, "header": f""" display: flex; align-items: center; margin-bottom: 10px; color: {style.border_color}; font-weight: bold; """, "icon": f""" font-size: 1.2em; margin-right: 8px; color: {style.icon_color}; """, "message_box": f""" padding: 8px; background-color: white; border-radius: 4px; border-left: 4px solid {style.border_color}; color: {style.text_color}; """ } def create_provider_summary_styling(self) -> Dict[str, str]: """ Create styling configuration for provider summary sections. Returns: Dictionary of CSS styling properties Requirements: 7.1, 7.2, 7.3 """ style = self.styles[ContentType.PROVIDER_SUMMARY] return { "container": f""" border: {style.border_width} solid {style.border_color}; border-radius: {style.border_radius}; padding: {style.padding}; margin: {style.margin}; background-color: {style.background_color}; """, "header": f""" display: flex; align-items: center; margin-bottom: 10px; color: {style.border_color}; font-weight: bold; """, "icon": f""" font-size: 1.2em; margin-right: 8px; color: {style.icon_color}; """, "info_box": f""" margin: 10px 0; padding: 8px; background-color: #f8f9fa; border-radius: 4px; """, "urgency_box": f""" margin: 5px 0; padding: 8px; background-color: #fff3cd; border-radius: 4px; border-left: 4px solid {style.border_color}; """ } def generate_section_separators(self) -> Dict[str, str]: """ Generate different types of section separators. Returns: Dictionary of separator HTML strings Requirements: 7.4, 7.5 """ return { "light": """
""", "medium": """