# This file was auto-generated by Fern from our API Definition.

import typing

import pydantic
import typing_extensions
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
from ..core.serialization import FieldMetadata
from .reproductive_warning import ReproductiveWarning


class ReproductiveSafetyData(UniversalBaseModel):
    """
    Pregnancy and lactation safety data for a single drug
    """

    pregnancy_risk_level: typing.Optional[int] = pydantic.Field(default=None)
    """
    Pregnancy risk score on the SafeRx 0-7 scale.
    - `0` — Unknown
    - `1` — Safe
    - `2` — Likely Safe
    - `3` — Possibly Unsafe
    - `4` — Likely Unsafe
    - `5` — Unsafe
    - `6` — Contraindicated
    - `7` — Absolutely Contraindicated
    """

    pregnancy_risk_name: typing.Optional[str] = pydantic.Field(default=None)
    """
    Human-readable pregnancy risk label
    """

    lactation_risk_level: typing.Optional[int] = pydantic.Field(default=None)
    """
    Lactation risk score (same 0-7 scale as pregnancy)
    """

    lactation_risk_name: typing.Optional[str] = pydantic.Field(default=None)
    """
    Human-readable lactation risk label
    """

    pregnancy_rationale: typing.Optional[str] = pydantic.Field(default=None)
    """
    Clinical rationale for the pregnancy risk rating (language depends on `lang` parameter)
    """

    lactation_rationale: typing.Optional[str] = pydantic.Field(default=None)
    """
    Clinical rationale for the lactation risk rating
    """

    pregnancy_warning: typing.Optional[ReproductiveWarning] = None
    lactation_warning: typing.Optional[ReproductiveWarning] = None
    preg_t1risk: typing_extensions.Annotated[
        typing.Optional[str],
        FieldMetadata(alias="preg_t1_risk"),
        pydantic.Field(alias="preg_t1_risk", description="First trimester pregnancy risk classification"),
    ] = None
    preg_t1note: typing_extensions.Annotated[
        typing.Optional[str],
        FieldMetadata(alias="preg_t1_note"),
        pydantic.Field(alias="preg_t1_note", description="First trimester clinical note"),
    ] = None
    preg_t1ar: typing_extensions.Annotated[
        typing.Optional[str],
        FieldMetadata(alias="preg_t1_ar"),
        pydantic.Field(alias="preg_t1_ar", description="First trimester note in Arabic"),
    ] = None
    preg_t2risk: typing_extensions.Annotated[
        typing.Optional[str],
        FieldMetadata(alias="preg_t2_risk"),
        pydantic.Field(alias="preg_t2_risk", description="Second trimester pregnancy risk classification"),
    ] = None
    preg_t2note: typing_extensions.Annotated[
        typing.Optional[str],
        FieldMetadata(alias="preg_t2_note"),
        pydantic.Field(alias="preg_t2_note", description="Second trimester clinical note"),
    ] = None
    preg_t2ar: typing_extensions.Annotated[
        typing.Optional[str],
        FieldMetadata(alias="preg_t2_ar"),
        pydantic.Field(alias="preg_t2_ar", description="Second trimester note in Arabic"),
    ] = None
    preg_t3risk: typing_extensions.Annotated[
        typing.Optional[str],
        FieldMetadata(alias="preg_t3_risk"),
        pydantic.Field(alias="preg_t3_risk", description="Third trimester pregnancy risk classification"),
    ] = None
    preg_t3note: typing_extensions.Annotated[
        typing.Optional[str],
        FieldMetadata(alias="preg_t3_note"),
        pydantic.Field(alias="preg_t3_note", description="Third trimester clinical note"),
    ] = None
    preg_t3ar: typing_extensions.Annotated[
        typing.Optional[str],
        FieldMetadata(alias="preg_t3_ar"),
        pydantic.Field(alias="preg_t3_ar", description="Third trimester note in Arabic"),
    ] = None
    lact_milk_level_mgl: typing.Optional[float] = pydantic.Field(default=None)
    """
    Measured drug concentration in breast milk (mg/L)
    """

    lact_mp_ratio: typing.Optional[float] = pydantic.Field(default=None)
    """
    Milk-to-plasma concentration ratio
    """

    lact_rid: typing.Optional[float] = pydantic.Field(default=None)
    """
    Relative Infant Dose (%) — percentage of maternal dose received by infant
    """

    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
