from datetime import datetime
from typing import Optional

from fastapi import APIRouter, Depends
from sqlmodel import Field, SQLModel

from ..db import get_session

from sqlalchemy import select
from sqlalchemy.ext.asyncio import AsyncSession

router = APIRouter()


class Procedure(SQLModel, table=True):
    id: Optional[int] = Field(default=None, primary_key=True)
    procedure_group_id: int
    parent_procedure_id: int
    name: str
    detail: str
    icd_9: str
    icd_10: str


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


class ProcedureDiseaseMap(SQLModel, table=True):
    id: Optional[int] = 