# 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 import ClinicalAlert
from .drug_clinical_data import DrugClinicalData


class ClinicalData(UniversalBaseModel):
    """
    Clinical safety considerations combining per-drug population/condition
    data with cross-drug clinical alerts. Enhanced when `patient_profile`
    is provided in the request.
    """

    drug_specific: typing.Optional[typing.Dict[str, DrugClinicalData]] = pydantic.Field(default=None)
    """
    Per-drug clinical data keyed by sfrx_id
    """

    condition_alerts: typing.Optional[typing.List[ClinicalAlert]] = pydantic.Field(default=None)
    """
    Cross-drug condition-related alerts (requires `patient_profile.conditions`)
    """

    population_alerts: typing.Optional[typing.List[ClinicalAlert]] = pydantic.Field(default=None)
    """
    Cross-drug population-related alerts (requires `patient_profile.populations`)
    """

    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
