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

import typing

from ......core import enum

T_Result = typing.TypeVar("T_Result")


class OccurrenceSpanCode(enum.StrEnum):
    C_70 = "70"
    """
    QUALIFYING STAY DATES FOR SNF USE ONLY
    """

    C_71 = "71"
    """
    PRIOR STAY DATES
    """

    C_72 = "72"
    """
    FIRST/LAST VISIT DATES
    """

    C_73 = "73"
    """
    BENEFIT ELIGIBILITY PERIOD
    """

    C_74 = "74"
    """
    NON-COVERED LEVEL OF CARE/LEAVE OF ABSENCE DATES
    """

    C_75 = "75"
    """
    SNF LEVEL OF CARE DATES
    """

    C_76 = "76"
    """
    PATIENT LIABILITY
    """

    C_77 = "77"
    """
    PROVIDER LIABILITY PERIOD
    """

    C_78 = "78"
    """
    SNF PROIR STAY DATES
    """

    C_80 = "80"
    """
    PRIOR SAME-SNF STAY DATES FOR PAYMENT BAN PRUPOSES
    """

    C_81 = "81"
    """
    ANTEPARTUM DAYS AT REDUCED LEVEL OF CARE
    """

    C_82 = "82"
    """
    HOSPITAL AT HOME CARE DATES
    """

    CM_0 = "M0"
    """
    QIO/UR APPROVED STAY DATES - The first and last days that were approved where not all of the stay was approved. (Use when Condition Code C3 is used in Form Locators 18-28.)
    """

    CM_1 = "M1"
    """
    PROVIDER LIABILITY - NO UTILIZATION - Code indicates the from/through dates of a period of noncovered care that is denied due to lack of medical necessity or as custodial care for which the provider is liable. The beneficiary is not charged with utilization. The provider may not collect Part A or Part B deductible or coinsurance from the beneficiary.
    """

    CM_2 = "M2"
    """
    INPATIENT RESPITE DATES - The from/through dates of a period of inpatient respite care.
    """

    CM_3 = "M3"
    """
    ICF LEVEL OF CARE - The from/through dates of a period of intermediate level of care during an inpatient hospital stay.
    """

    CM_4 = "M4"
    """
    RESIDENTIAL LEVEL OF CARE - The from/through dates of a period of residential level of care during an inpatient hospital stay.
    """

    _UNKNOWN = "__OCCURRENCESPANCODE_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) -> "OccurrenceSpanCode":
        unknown = cls._UNKNOWN
        unknown._value_ = value
        return unknown

    def visit(
        self,
        c_70: typing.Callable[[], T_Result],
        c_71: typing.Callable[[], T_Result],
        c_72: typing.Callable[[], T_Result],
        c_73: typing.Callable[[], T_Result],
        c_74: typing.Callable[[], T_Result],
        c_75: typing.Callable[[], T_Result],
        c_76: typing.Callable[[], T_Result],
        c_77: typing.Callable[[], T_Result],
        c_78: typing.Callable[[], T_Result],
        c_80: typing.Callable[[], T_Result],
        c_81: typing.Callable[[], T_Result],
        c_82: typing.Callable[[], T_Result],
        cm_0: typing.Callable[[], T_Result],
        cm_1: typing.Callable[[], T_Result],
        cm_2: typing.Callable[[], T_Result],
        cm_3: typing.Callable[[], T_Result],
        cm_4: typing.Callable[[], T_Result],
        _unknown_member: typing.Callable[[str], T_Result],
    ) -> T_Result:
        if self is OccurrenceSpanCode.C_70:
            return c_70()
        if self is OccurrenceSpanCode.C_71:
            return c_71()
        if self is OccurrenceSpanCode.C_72:
            return c_72()
        if self is OccurrenceSpanCode.C_73:
            return c_73()
        if self is OccurrenceSpanCode.C_74:
            return c_74()
        if self is OccurrenceSpanCode.C_75:
            return c_75()
        if self is OccurrenceSpanCode.C_76:
            return c_76()
        if self is OccurrenceSpanCode.C_77:
            return c_77()
        if self is OccurrenceSpanCode.C_78:
            return c_78()
        if self is OccurrenceSpanCode.C_80:
            return c_80()
        if self is OccurrenceSpanCode.C_81:
            return c_81()
        if self is OccurrenceSpanCode.C_82:
            return c_82()
        if self is OccurrenceSpanCode.CM_0:
            return cm_0()
        if self is OccurrenceSpanCode.CM_1:
            return cm_1()
        if self is OccurrenceSpanCode.CM_2:
            return cm_2()
        if self is OccurrenceSpanCode.CM_3:
            return cm_3()
        if self is OccurrenceSpanCode.CM_4:
            return cm_4()
        return _unknown_member(self._value_)
