from datetime import datetime
from typing import Optional

from fastapi import APIRouter
from sqlmodel import Field, SQLModel

router = APIRouter()


class Disease(SQLModel, table=True):
    id: Optional[int] = Field(default=None, primary_key=True)
    name: str


class DiseaseGroup(SQLModel, table=True):
    id: Optional[int] = Field(default=None, primary_key=True)
    name: str


class DiseaseGroupMap(SQLModel, table=True):
    id: Optional[int] = Field(default=None, primary_key=True)
    disease_group_id: int
    disease_id: int


class PatientDisease(SQLModel, table=True):
    id: Optional[int] = Field(default=None, primary_key=True)
    patient_id: int
    doctor_id: Optional[int] = None
    cleft: bool
    craniofacial: bool
    syndronic: bool
    non: bool
    comorbidity: bool
    created_at: datetime
    updated_at: datetime
    created_by: int
    updated_by: Optional[int] = None


class PatientDiseaseList(SQLModel, table=True):
    id: Optional[int] = Field(default=None, primary_key=True)
    patient_disease_id: int
    disease_id: int
    detail: str
    created_at: datetime
    updated_at: datetime
    created_by: int
    updated_by: Optional[int] = None


class PatientDiseaseCleft(SQLModel, table=True):
    id: Optional[int] = Field(default=None, primary_key=True)
    patient_disease_id: int
    cleft_type: str
    cleft_lateral: str
    cleft_side: str
    cleft_complete: str
    created_at: datetime
    updated_at: datetime
    created_by: int
    updated_by: Optional[int] = None


class PatientDiseaseCraniofacial(SQLModel, table=True):
    id: Optional[int] = Field(default=None, primary_key=True)
    patient_disease_id: int
    micrognathia_detail: str
    craniofacial_cleft_right: int
    craniofacial_cleft_medial: int
    craniofacial_cleft_left: int
    feem_nasofrontal: bool
    feem_nasofrontal_side: str
    feem_nasoethmoidal: bool
    feem_nasoethmoidal_side: str
    feem_mix: bool
    feem_mix_side: str
    feem_mix_detail: str
    craniofacial_microsomia_side: str
    craniofacial_microsomia_detail: str
    microtia_side: str
    microtia_detail: str
    craniosynostosis_detail: str
    frontonasal_dysplasia_detail: str
    created_at: datetime
    updated_at: datetime
    created_by: int
    updated_by: Optional[int] = None


class PatientDiseaseOther(SQLModel, table=True):
    id: Optional[int] = Field(default=None, primary_key=True)
    patient_disease_id: int
    disease_group_id: int
    name: str
    detail: str
    created_at: datetime
    updated_at: datetime
    created_by: int
    updated_by: Optional[int] = None

sqlmodel.Field fastapi.APIRouter
[((136, 147), 'fastapi.APIRouter', 'APIRouter', ([], {}), '()\n', (145, 147), False, 'from fastapi import APIRouter\n'), ((211, 248), 'sqlmodel.Field', 'Field', ([], {'default': 'None', 'primary_key': '(True)'}), '(default=None, primary_key=True)\n', (216, 248), False, 'from sqlmodel import Field, SQLModel\n'), ((331, 368), 'sqlmodel.Field', 'Field', ([], {'default': 'None', 'primary_key': '(True)'}), '(default=None, primary_key=True)\n', (336, 368), False, 'from sqlmodel import Field, SQLModel\n'), ((454, 491), 'sqlmodel.Field', 'Field', ([], {'default': 'None', 'primary_key': '(True)'}), '(default=None, primary_key=True)\n', (459, 491), False, 'from sqlmodel import Field, SQLModel\n'), ((608, 645), 'sqlmodel.Field', 'Field', ([], {'default': 'None', 'primary_key': '(True)'}), '(default=None, primary_key=True)\n', (613, 645), False, 'from sqlmodel import Field, SQLModel\n'), ((978, 1015), 'sqlmodel.Field', 'Field', ([], {'default': 'None', 'primary_key': '(True)'}), '(default=None, primary_key=True)\n', (983, 1015), False, 'from sqlmodel import Field, SQLModel\n'), ((1262, 1299), 'sqlmodel.Field', 'Field', ([], {'default': 'None', 'primary_key': '(True)'}), '(default=None, primary_key=True)\n', (1267, 1299), False, 'from sqlmodel import Field, SQLModel\n'), ((1604, 1641), 'sqlmodel.Field', 'Field', ([], {'default': 'None', 'primary_key': '(True)'}), '(default=None, primary_key=True)\n', (1609, 1641), False, 'from sqlmodel import Field, SQLModel\n'), ((2367, 2404), 'sqlmodel.Field', 'Field', ([], {'default': 'None', 'primary_key': '(True)'}), '(default=None, primary_key=True)\n', (2372, 2404), False, 'from sqlmodel import Field, SQLModel\n')]