File size: 1,392 Bytes
480f467 9855392 56edde7 480f467 56edde7 480f467 fd20bd2 480f467 fd20bd2 480f467 9855392 |
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 40 41 42 43 44 45 46 47 48 |
from pydantic import BaseModel
from typing import List
class ICDCode(BaseModel):
code: str
description: str
explanation: str
class CPTCode(BaseModel):
code: str
description: str
explanation: str
class CodingResponse(BaseModel):
icd_codes: List[ICDCode]
cpt_codes: List[CPTCode]
overall_summary: str
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"
}
}
class FileUploadResponse(BaseModel):
success: bool
filename: str
extracted_text_length: int
pii_removed: bool
pii_count: int
icd_codes: List[ICDCode]
cpt_codes: List[CPTCode]
overall_summary: str |