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

import typing

from ......core import enum

T_Result = typing.TypeVar("T_Result")


class TypeOfCareCode(enum.StrEnum):
    C_1 = "1"
    """
    Except Clinics & Special Facilities - Inpatient Part A; Clinics Only - Rural Health Center (RHC); Special Facilities Only - Hospice (non-hospital based)
    """

    C_2 = "2"
    """
    Except Clinics & Special Facilities - Inpatient (Part B) (includes Home Health Agency (HHA) visits under a Part B plan of treatment); Clinics Only - Hospital based or Independent Renal Dialysis Center; Special Facilities Only - Hospice (hospital based)
    """

    C_3 = "3"
    """
    Except Clinics & Special Facilities - Outpatient (includes HHA visits under a Part A plan of treatment and use of HHA DME under a Part A plan of treatment); Special Facilities Only - ASC Services to Hospital Outpatients
    """

    C_4 = "4"
    """
    Except Clinics & Special Facilities - Other (Part B) (includes HHA medical and other health services not under a plan of treatment, SNF diagnostic clinical laboratory services for 'nonpatients,' and referenced diagnostic services); Clinics Only - Other Rehabilitation Facility (ORF); Special Facilities Only - Free Standing Birthing Center
    """

    C_5 = "5"
    """
    Except Clinics & Special Facilities - Intermediate Care - Level I; Clinics Only - Comprehensive Outpatient Rehabilitation Facility (CORF); Special Facilities Only - CAH
    """

    C_6 = "6"
    """
    Except Clinics & Special Facilities - Intermediate Care - Level II; Clinics Only - Community Mental Health Center (CMHC); Special Facilities Only - Residential Facility (not used for Medicare)
    """

    C_7 = "7"
    """
    Except Clinics & Special Facilities - Subacute Inpatient (Revenue Code 019X required) Eight Swing Beds (used to indicate billing for SNF level of care in a hospital with an approved swing bed agreement.); Clinics Only - Free-standing Provider-based Federally Qualified Health Center (FQHC); Special Facilities Only - Reserved for National Assignment
    """

    C_8 = "8"
    """
    Except Clinics & Special Facilities - NA; Clinics Only - Reserved for National Assignment; Special Facilities Only - Reserved for National Assignment
    """

    C_9 = "9"
    """
    Except Clinics & Special Facilities - Reserved for National Assignment; Clinics Only - Other; Special Facilities Only - Other
    """

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