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

import typing

from ......core import enum

T_Result = typing.TypeVar("T_Result")


class TypeOfAdmissionOrVisitCode(enum.StrEnum):
    C_1 = "1"
    """
    EMERGENCY - As a result of severe, life threatening or potentially disabling conditions, the patient requires immediate medical intervention.
    """

    C_2 = "2"
    """
    URGENT - The patient requires immediate attention for the care and treatment of a physical or mental disorder.
    """

    C_3 = "3"
    """
    ELECTIVE - The patient's condition permits adequate time to schedule the services.
    """

    C_4 = "4"
    """
    NEWBORN - Use of this code necessitates the use of special Point of Origin Codes (See Form Locator 15 page 5 of 9).
    """

    C_5 = "5"
    """
    TRAUMA - Visit to a trauma center/hospital as licensed or designated by the state or local government authority authorized to do so, or as verified by the American College of Surgeons and involving a trauma activation. (Use Revenue Code 068x capture trauma activation charges involving pre-hospital notification.)
    """

    C_9 = "9"
    """
    INFORMATION NOT AVAILABLE - Information not available.
    """

    _UNKNOWN = "__TYPEOFADMISSIONORVISITCODE_UNKNOWN__"
    """
    This member is used for forward compatibility. If the value is not recognized by the enum, it will be stored here, and the raw value is accessible through `.value`.
    """

    @classmethod
    def _missing_(cls, value: typing.Any) -> "TypeOfAdmissionOrVisitCode":
        unknown = cls._UNKNOWN
        unknown._value_ = value
        return unknown

    def visit(
        self,
        c_1: typing.Callable[[], T_Result],
        c_2: typing.Callable[[], T_Result],
        c_3: typing.Callable[[], T_Result],
        c_4: typing.Callable[[], T_Result],
        c_5: typing.Callable[[], T_Result],
        c_9: typing.Callable[[], T_Result],
        _unknown_member: typing.Callable[[str], T_Result],
    ) -> T_Result:
        if self is TypeOfAdmissionOrVisitCode.C_1:
            return c_1()
        if self is TypeOfAdmissionOrVisitCode.C_2:
            return c_2()
        if self is TypeOfAdmissionOrVisitCode.C_3:
            return c_3()
        if self is TypeOfAdmissionOrVisitCode.C_4:
            return c_4()
        if self is TypeOfAdmissionOrVisitCode.C_5:
            return c_5()
        if self is TypeOfAdmissionOrVisitCode.C_9:
            return c_9()
        return _unknown_member(self._value_)
