fidocure_note_extractor_2 / structures.py
Kevin Wu
updates
9d23c0f
from typing import Dict, Optional, List
from typing_extensions import Literal
from pydantic import BaseModel, Field as FieldInfo
class Name(BaseModel):
reasoning: str
first_name: str
last_name: str
class DateInfo(BaseModel):
reasoning: str
date: str
class SexInfo(BaseModel):
reasoning: str
sex: str
class ChemoInfo(BaseModel):
reasoning: str
drug: str
date: Optional[str] = None
class TreatmentInfo(BaseModel):
reasoning: str
treatment: str
date: Optional[str] = None
class MedicationInfo(BaseModel):
reasoning: str
medication: str
date: Optional[str] = None
class SurgeryInfo(BaseModel):
reasoning: str
resection: str
class SurgeryOutcomeInfo(BaseModel):
reasoning: str
outcome: str
class MetastasisInfo(BaseModel):
reasoning: str
metastasis: str
class PharmacyInfo(BaseModel):
reasoning: str
pharmacy: str
class AdverseEffectInfo(BaseModel):
reasoning: str
medication: str
dosage: Optional[str] = None
date: Optional[str] = None
description: str
class WeightInfo(BaseModel):
reasoning: str
weight: str
class ClinicalInfo(BaseModel):
patient_name: Optional[Name] = None
date_of_birth: Optional[DateInfo] = None
sex: Optional[SexInfo] = None
traditional_chemo: Optional[List[ChemoInfo]] = None
other_cancer_treatments: Optional[List[TreatmentInfo]] = None
other_conmeds: Optional[List[MedicationInfo]] = None
surgery: Optional[SurgeryInfo] = None
surgery_outcome: Optional[SurgeryOutcomeInfo] = None
metastasis_at_time_of_diagnosis: Optional[MetastasisInfo] = None
compounding_pharmacy: Optional[PharmacyInfo] = None
adverse_effects: Optional[List[AdverseEffectInfo]] = None
date_of_death: Optional[DateInfo] = None
weight: Optional[WeightInfo] = None