# 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 .dose_component_confidence import DoseComponentConfidence


class DoseComponent(UniversalBaseModel):
    """
    Per-ingredient dose data for combination drugs
    """

    value_mg: typing.Optional[float] = pydantic.Field(default=None)
    """
    Maximum daily dose for this ingredient in mg
    """

    original_value: typing.Optional[float] = None
    original_unit: typing.Optional[str] = None
    route: typing.Optional[str] = None
    confidence: typing.Optional[DoseComponentConfidence] = None
    confidence_reason: typing.Optional[str] = None
    usual_range: typing.Optional[str] = pydantic.Field(default=None)
    """
    Typical daily dose range
    """

    max_single_dose_mg: typing.Optional[float] = None
    weight_based: typing.Optional[bool] = pydantic.Field(default=None)
    """
    Whether dosing is weight-based
    """

    weight_dose: typing.Optional[str] = pydantic.Field(default=None)
    """
    Weight-based dosing if applicable
    """

    indication_specific: typing.Optional[bool] = pydantic.Field(default=None)
    """
    Whether max dose varies by indication
    """

    indication_note: typing.Optional[str] = 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
