# 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 .adverse_effect import AdverseEffect
from .black_box_warning import BlackBoxWarning
from .dose_classification import DoseClassification
from .monitoring import Monitoring
from .side_effects_data_risk_level import SideEffectsDataRiskLevel


class SideEffectsData(UniversalBaseModel):
    risk_level: typing.Optional[SideEffectsDataRiskLevel] = pydantic.Field(default=None)
    """
    Overall adverse effect risk level.
    - `HIGH` — has a Black Box Warning
    - `MODERATE` — more than 5 severe effects
    - `LOW` — 5 or fewer severe effects, no BBW
    """

    has_black_box_warning: typing.Optional[bool] = pydantic.Field(default=None)
    """
    Whether this drug has an FDA Black Box Warning
    """

    black_box_warning: typing.Optional[BlackBoxWarning] = pydantic.Field(default=None)
    """
    Black Box Warning details, or null if none exists
    """

    total_count: typing.Optional[int] = pydantic.Field(default=None)
    """
    Total number of known adverse effects
    """

    severe_total: typing.Optional[int] = pydantic.Field(default=None)
    """
    Number of severe adverse effects
    """

    severe: typing.Optional[typing.List[AdverseEffect]] = pydantic.Field(default=None)
    """
    Top 5 most severe adverse effects
    """

    common: typing.Optional[typing.List[AdverseEffect]] = pydantic.Field(default=None)
    """
    Top 5 most common adverse effects
    """

    monitoring: typing.Optional[Monitoring] = None
    dose_classification: typing.Optional[DoseClassification] = None

    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
