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

import typing

import pydantic
from ......core.pydantic_utilities import IS_PYDANTIC_V2
from .external_cause_of_injury_code_qualifier import ExternalCauseOfInjuryCodeQualifier
from .health_care_code_information_new import HealthCareCodeInformationNew
from .icd_code import IcdCode
from .present_on_admission_indicator_code import PresentOnAdmissionIndicatorCode


class ExternalCauseOfInjuryNew(HealthCareCodeInformationNew):
    """
    This corresponds to BN or ABN code qualifier values.
    """

    external_cause_of_injury_code_qualifier: ExternalCauseOfInjuryCodeQualifier
    external_cause_of_injury_code: IcdCode
    present_on_admission_indicator: typing.Optional[PresentOnAdmissionIndicatorCode] = 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
