# 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 .interpretation import Interpretation
from .lab_report_result_type import LabReportResultType
from .loinc_match import LoincMatch


class LabReportResult(UniversalBaseModel):
    test_name: str
    value: str
    type: typing.Optional[LabReportResultType] = None
    units: typing.Optional[str] = None
    max_reference_range: typing.Optional[float] = None
    min_reference_range: typing.Optional[float] = None
    source_panel_name: typing.Optional[str] = None
    loinc_matches: typing.Optional[typing.List[LoincMatch]] = None
    interpretation: typing.Optional[Interpretation] = None
    is_above_max_range: typing.Optional[bool] = None
    is_below_min_range: typing.Optional[bool] = 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
