# 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 .clinical_alert_special_notes import ClinicalAlertSpecialNotes


class ClinicalAlert(UniversalBaseModel):
    """
    Clinical safety alert from cross-drug analysis
    """

    drug_id: typing.Optional[str] = pydantic.Field(default=None)
    """
    sfrx_id of the drug involved
    """

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

    drug_ar: typing.Optional[str] = pydantic.Field(default=None)
    """
    Drug name (Arabic)
    """

    condition: typing.Optional[str] = pydantic.Field(default=None)
    """
    Condition name (for condition alerts)
    """

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

    population: typing.Optional[str] = pydantic.Field(default=None)
    """
    Population name (for population alerts)
    """

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

    severity: typing.Optional[int] = pydantic.Field(default=None)
    """
    Alert severity
    """

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

    severity_label_ar: typing.Optional[str] = pydantic.Field(default=None)
    """
    Severity label (Arabic)
    """

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

    requires_dose_adjustment: typing.Optional[bool] = pydantic.Field(default=None)
    """
    Whether dose adjustment is needed
    """

    monitoring_required: typing.Optional[bool] = pydantic.Field(default=None)
    """
    Whether additional monitoring is needed
    """

    reason: typing.Optional[str] = pydantic.Field(default=None)
    """
    Clinical rationale (English)
    """

    reason_ar: typing.Optional[str] = pydantic.Field(default=None)
    """
    Clinical rationale (Arabic)
    """

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

    special_notes: typing.Optional[ClinicalAlertSpecialNotes] = pydantic.Field(default=None)
    """
    Additional clinical notes
    """

    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
