# 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 .daily_limit import DailyLimit
from .population_monitoring import PopulationMonitoring


class Monitoring(UniversalBaseModel):
    """
    Recommended monitoring parameters for this drug
    """

    drug: typing.Optional[str] = pydantic.Field(default=None)
    """
    Drug name for context
    """

    parameters: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
    """
    Lab tests and clinical parameters to monitor
    """

    schedule: typing.Optional[str] = pydantic.Field(default=None)
    """
    Recommended monitoring frequency
    """

    contraindications: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
    """
    Contraindication notes
    """

    populations: typing.Optional[typing.Dict[str, PopulationMonitoring]] = pydantic.Field(default=None)
    """
    Population-specific monitoring considerations
    """

    daily_dose_limit: typing.Optional[DailyLimit] = pydantic.Field(default=None)
    """
    Maximum daily dose information, if available
    """

    has_black_box_warning: typing.Optional[bool] = pydantic.Field(default=None)
    """
    Whether this drug has a BBW (duplicated for convenience)
    """

    data_sources: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
    """
    Data sources used for monitoring recommendations
    """

    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
