# 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 ResolvedDrug(UniversalBaseModel):
    input: str = pydantic.Field()
    """
    The original drug name as submitted in the request
    """

    resolved: bool = pydantic.Field()
    """
    Always `true` for drugs in this array
    """

    sfrx_id: str = pydantic.Field()
    """
    SafeRx product identifier. Primary key used across all safety
    domains. Format: `SRX-{category}-{sequence}`.
    """

    parent_sfrx_id: typing.Optional[str] = pydantic.Field(default=None)
    """
    Parent product identifier for strength/pack variants of the same drug.
    Null if this product has no parent.
    """

    brand_name: str = pydantic.Field()
    """
    Registered trade name with strength and pack size
    """

    active_ingredient: str = pydantic.Field()
    """
    Active pharmaceutical ingredient(s), pipe-separated for combinations
    """

    form: str = pydantic.Field()
    """
    Pharmaceutical dosage form
    """

    manufacturer_en: typing.Optional[str] = pydantic.Field(default=None)
    """
    Marketing authorization holder
    """

    therapeutic_class: typing.Optional[str] = pydantic.Field(default=None)
    """
    ATC-based therapeutic classification, pipe-separated hierarchy
    """

    medical_specialty: typing.Optional[str] = pydantic.Field(default=None)
    """
    Primary prescribing specialty
    """

    supplier_en: typing.Optional[str] = pydantic.Field(default=None)
    """
    Distribution/supply company (may be empty)
    """

    barcode: typing.Optional[str] = pydantic.Field(default=None)
    """
    Product barcode (may be empty)
    """

    price_egp: typing.Optional[float] = pydantic.Field(default=None)
    """
    Current price in Egyptian Pounds (EGP)
    """

    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
