# 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_frequency_detail import AdverseEffectFrequencyDetail


class AdverseEffect(UniversalBaseModel):
    effect_name: typing.Optional[str] = pydantic.Field(default=None)
    """
    Adverse effect name in English
    """

    name_ar: typing.Optional[str] = pydantic.Field(default=None)
    """
    Effect name in Arabic
    """

    frequency: typing.Optional[float] = pydantic.Field(default=None)
    """
    Frequency as a decimal (0.0 to 1.0)
    """

    frequency_label: typing.Optional[str] = pydantic.Field(default=None)
    """
    Human-readable frequency tier
    """

    frequency_category: typing.Optional[int] = pydantic.Field(default=None)
    """
    Numeric frequency tier (1=very rare, 5=very common)
    """

    frequency_detail: typing.Optional[AdverseEffectFrequencyDetail] = pydantic.Field(default=None)
    """
    Detailed frequency breakdown
    """

    severity: typing.Optional[int] = pydantic.Field(default=None)
    """
    Severity score (1=mild, 5=life-threatening)
    """

    severity_label: typing.Optional[str] = pydantic.Field(default=None)
    """
    Human-readable severity label
    """

    severity_category: typing.Optional[str] = pydantic.Field(default=None)
    """
    Severity category name (mild, moderate, serious,
    severe, life_threatening)
    """

    source: typing.Optional[str] = pydantic.Field(default=None)
    """
    Data source for this effect
    """

    clinical_advice: typing.Optional[str] = pydantic.Field(default=None)
    """
    Brief clinical guidance
    """

    requires_monitoring: typing.Optional[bool] = pydantic.Field(default=None)
    """
    Whether monitoring is recommended
    """

    urgency: typing.Optional[bool] = pydantic.Field(default=None)
    """
    Whether this effect requires urgent attention
    """

    basis: typing.Optional[str] = pydantic.Field(default=None)
    """
    Classification basis for this effect
    """

    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
