| 1234567891011121314151617181920 |
- from pydantic import BaseModel, Field
- from typing import List, Optional
- from uuid import UUID
- from datetime import datetime
- class ExtractionResponse(BaseModel):
- provider_name: str = Field(description="The name of the clinic or hospital.")
- visit_date: str = Field(description="The date of service in YYYY-MM-DD format.")
- total_amount: float = Field(description="The total amount paid.")
- currency: str = Field(description="3-letter currency code (e.g. USD, SGD).")
- items: List[str] = Field(description="Simplified list of services (e.g. 'Consultation', 'Medicine').")
- confidence_score: float = Field(description="Model's confidence from 0.0 to 1.0.")
- needs_manual_review: bool = Field(description="Set to true if text is blurry or data is ambiguous.")
- class ClaimRecord(BaseModel):
- id: str = Field(description="Unique identifier for the claim record.")
- timestamp: str = Field(description="ISO format timestamp of submission.")
- submitted_by: str = Field(description="Name of the user who submitted the claim.")
- department: str = Field(description="Department of the user.")
- extraction_data: ExtractionResponse = Field(description="The AI-extracted data for this claim.")
|