# This file was auto-generated by Fern from our API Definition.

import typing

import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
from .population_monitoring_liver_function_grades import PopulationMonitoringLiverFunctionGrades


class PopulationMonitoring(UniversalBaseModel):
    name: typing.Optional[str] = pydantic.Field(default=None)
    """
    Drug name
    """

    contraindicated: typing.Optional[bool] = pydantic.Field(default=None)
    """
    Whether the drug is contraindicated in this population
    """

    requires_egfr_check: typing.Optional[bool] = pydantic.Field(default=None)
    """
    Whether eGFR monitoring is needed (renal population)
    """

    requires_dialysis_check: typing.Optional[bool] = pydantic.Field(default=None)
    """
    Whether dialysis considerations apply (renal population)
    """

    liver_function_grades: typing.Optional[PopulationMonitoringLiverFunctionGrades] = pydantic.Field(default=None)
    """
    Child-Pugh grade contraindication status (hepatic population)
    """

    severity: typing.Optional[int] = pydantic.Field(default=None)
    """
    Severity in this population (1-5)
    """

    severity_label: typing.Optional[str] = pydantic.Field(default=None)
    """
    Severity label in this population
    """

    if IS_PYDANTIC_V2:
        model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True)  # type: ignore # Pydantic v2
    else:

        class Config:
            frozen = True
            smart_union = True
            extra = pydantic.Extra.allow
