| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- from pydantic import BaseModel, Field
- from typing import List, Optional
- from uuid import UUID
- from datetime import datetime
- class UserAccount(BaseModel):
- id: str = Field(description="Unique identifier for the user.")
- name: str = Field(description="Full name of the employee.")
- department: str = Field(description="Department name.")
- medical_allowance: float = Field(description="Remaining annual medical allowance in MYR.")
- 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.")
- ai_reasoning: str = Field(description="A brief explanation of how the data was identified.")
- receipt_ref_no: Optional[str] = Field(default=None, description="The reference number or invoice number on the receipt.")
- clinic_reg_no: Optional[str] = Field(default=None, description="The clinic's official registration number (SSM/MOH).")
- claim_category: Optional[str] = Field(default=None, description="Category: General, Dental, Optical, Specialist.")
- diagnosis_brief: Optional[str] = Field(default=None, description="A very short summary of the diagnosis or items seen.")
- class ClaimSubmission(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.")
- amount_spent: float = Field(description="The manual or validated total amount spent.")
- currency: str = Field(description="3-letter currency code (e.g. USD, MYR).")
- treatment_type: str = Field(description="Type of treatment (Outpatient, Dental, etc.).")
- cost_center: str = Field(description="Internal cost center code.")
- declaration_signed: bool = Field(description="Whether the user signed the compliance declaration.")
- extraction_data: Optional[ExtractionResponse] = Field(default=None, description="Optional AI extraction data if used.")
- 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.")
- amount_spent: float = Field(description="The raw total amount from the form/receipt.")
- amount_claimed: float = Field(description="The actual amount credited after policy capping.")
- 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.")
- treatment_type: str = Field(description="Type of treatment.")
- cost_center: str = Field(description="Internal cost center code.")
- declaration_signed: bool = Field(description="Whether the user signed the compliance declaration.")
- extraction_data: Optional[ExtractionResponse] = Field(default=None, description="The optional AI-extracted data for this claim.")
|