File size: 1,288 Bytes
f92da22
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/usr/bin/env python3
"""
Pydantic models for medical document processing
"""

from pydantic import BaseModel, Field
from typing import Dict, List, Any, Optional


class TemplateAnalysis(BaseModel):
    """Model for template analysis results."""
    sections: List[Dict[str, Any]] = Field(
        description="List of sections found in template")
    formatting: Dict[str, Any] = Field(description="Formatting information")
    document_info: Dict[str, str] = Field(description="Document metadata")


class MedicalTranscription(BaseModel):
    """Model for medical transcription data."""
    raw_text: str = Field(description="Raw transcription text")
    corrected_text: str = Field(description="Corrected and structured text")
    medical_data: Dict[str, Any] = Field(
        description="Extracted medical information")


class SectionContent(BaseModel):
    """Model for section content."""
    technique: str = Field(description="Technique section content")
    result: str = Field(description="Result section content")
    conclusion: str = Field(description="Conclusion section content")


class InsertSectionsInput(BaseModel):
    """Model for inserting sections into documents."""
    template_path: str
    sections: Dict[str, str]
    output_path: str
    title: str = None