from datetime import datetime, date
from typing import Optional

from fastapi import APIRouter
from sqlmodel import Field, SQLModel

router = APIRouter()


class History(SQLModel, table=True):
    id: Optional[int] = Field(default=None, primary_key=True)
    patient_id: int
    hospital_id: Optional[int]
    hospital_node_id: Optional[int]
    hospital_room: str
    discipline_group_id: int
    discipline_id: int
    date: date
    source: str
    created_at: datetime
    updated_at: datetime
    created_by: int
    updated_by: Optional[int] = None


class HistoryDoctor(SQLModel, table=True):
    id: Optional[int] = Field(default=None, primary_key=True)
    history_id: int
    doctor_id: int
    created_at: datetime
    updated_at: datetime
    created_by: int
    updated_by: Optional[int] = None


class HistoryModuleMap(SQLModel, table=True):
    id: Optional[int] = Field(default=None, primary_key=True)
    history_id: int
    module_id: int
    created_at: datetime
    updated_at: datetime
    created_by: int
    updated_by: Optional[int] = None


class HistoryTag(SQLModel, table=True):
    id: Optional[int] = Field(default=None, primary_key=True)
    history_id: int
    tag_id: int
    created_at: datetime
    updated_at: datetime
    created_by: int
    updated_by: Optional[int] = None

fastapi.APIRouter sqlmodel.Field
[((142, 153), 'fastapi.APIRouter', 'APIRouter', ([], {}), '()\n', (151, 153), False, 'from fastapi import APIRouter\n'), ((217, 254), 'sqlmodel.Field', 'Field', ([], {'default': 'None', 'primary_key': '(True)'}), '(default=None, primary_key=True)\n', (222, 254), False, 'from sqlmodel import Field, SQLModel\n'), ((624, 661), 'sqlmodel.Field', 'Field', ([], {'default': 'None', 'primary_key': '(True)'}), '(default=None, primary_key=True)\n', (629, 661), False, 'from sqlmodel import Field, SQLModel\n'), ((880, 917), 'sqlmodel.Field', 'Field', ([], {'default': 'None', 'primary_key': '(True)'}), '(default=None, primary_key=True)\n', (885, 917), False, 'from sqlmodel import Field, SQLModel\n'), ((1130, 1167), 'sqlmodel.Field', 'Field', ([], {'default': 'None', 'primary_key': '(True)'}), '(default=None, primary_key=True)\n', (1135, 1167), False, 'from sqlmodel import Field, SQLModel\n')]