Spaces:
Sleeping
Sleeping
| from pydantic import BaseModel, Field | |
| from typing import List | |
| class ICDCode(BaseModel): | |
| code: str = Field(..., description="ICD-10 diagnosis code") | |
| description: str = Field(..., description="Description of the diagnosis") | |
| explanation: str = Field(..., description="Explanation for why this code was selected") | |
| class CPTCode(BaseModel): | |
| code: str = Field(..., description="CPT procedure code") | |
| description: str = Field(..., description="Description of the procedure/service") | |
| explanation: str = Field(..., description="Explanation for why this code was selected") | |
| class CodingResponse(BaseModel): | |
| icd_codes: List[ICDCode] = Field(default_factory=list, description="List of ICD-10 codes") | |
| cpt_codes: List[CPTCode] = Field(default_factory=list, description="List of CPT codes") | |
| overall_summary: str = Field(..., description="Overall summary of coding decisions") | |
| class Config: | |
| json_schema_extra = { | |
| "example": { | |
| "icd_codes": [ | |
| { | |
| "code": "J20.9", | |
| "description": "Acute bronchitis, unspecified", | |
| "explanation": "Patient presents with acute bronchitis as documented in provider notes" | |
| } | |
| ], | |
| "cpt_codes": [ | |
| { | |
| "code": "99213", | |
| "description": "Office visit, established patient", | |
| "explanation": "Comprehensive examination performed as documented" | |
| } | |
| ], | |
| "overall_summary": "Patient encounter for acute bronchitis with examination and treatment" | |
| } | |
| } |