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

import typing

from ......core import enum

T_Result = typing.TypeVar("T_Result")


class TypeOfFacilityCode(enum.StrEnum):
    C_1 = "1"
    """
    Hospital
    """

    C_2 = "2"
    """
    Skilled Nursing Facility
    """

    C_3 = "3"
    """
    Home Health
    """

    C_4 = "4"
    """
    Religious Nonmedical (Hospital)
    """

    C_6 = "6"
    """
    Intermediate Care
    """

    C_7 = "7"
    """
    Clinic or Hospital based End Stage Renal Disease (ESRD) facility (requires Special second digit)
    """

    C_8 = "8"
    """
    Special facility or hospital (Critical Access Hospital (CAH)) (Ambulatory Surgical Center (ASC)) surgery (requires special second digit)
    """

    _UNKNOWN = "__TYPEOFFACILITYCODE_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) -> "TypeOfFacilityCode":
        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_6: typing.Callable[[], T_Result],
        c_7: typing.Callable[[], T_Result],
        c_8: typing.Callable[[], T_Result],
        _unknown_member: typing.Callable[[str], T_Result],
    ) -> T_Result:
        if self is TypeOfFacilityCode.C_1:
            return c_1()
        if self is TypeOfFacilityCode.C_2:
            return c_2()
        if self is TypeOfFacilityCode.C_3:
            return c_3()
        if self is TypeOfFacilityCode.C_4:
            return c_4()
        if self is TypeOfFacilityCode.C_6:
            return c_6()
        if self is TypeOfFacilityCode.C_7:
            return c_7()
        if self is TypeOfFacilityCode.C_8:
            return c_8()
        return _unknown_member(self._value_)
