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

import typing

import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel


class MealTiming(UniversalBaseModel):
    """
    Meal timing recommendation
    """

    category: typing.Optional[str] = pydantic.Field(default=None)
    """
    Timing category code.
    Common values: `WITH_FOOD`, `EMPTY_STOMACH`, `WITH_OR_WITHOUT_FOOD`,
    `NO_RESTRICTION`, `BEFORE_MEALS`, `AFTER_MEALS`
    """

    importance: typing.Optional[str] = pydantic.Field(default=None)
    """
    How important is adherence to this timing.
    Values: `MUST`, `PREFERRED`, `OPTIONAL`, `NO_RESTRICTION`
    """

    recommendation: typing.Optional[str] = pydantic.Field(default=None)
    """
    Full recommendation text (English)
    """

    recommendation_ar: typing.Optional[str] = pydantic.Field(default=None)
    """
    Full recommendation text (Arabic)
    """

    evidence_level: typing.Optional[str] = pydantic.Field(default=None)
    """
    Evidence source for this recommendation
    """

    severity: typing.Optional[int] = pydantic.Field(default=None)
    """
    Severity of non-adherence consequences (1-5)
    """

    rationale: typing.Optional[str] = pydantic.Field(default=None)
    """
    Clinical rationale for the timing recommendation
    """

    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
