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

import typing

from ......core import enum

T_Result = typing.TypeVar("T_Result")


class TypeOfBillFrequencyCode(enum.StrEnum):
    C_0 = "0"
    """
    NON-PAYMENT/ZERO CLAIM - Use this code when the bill is submitted to a payer for informational purposes, the provider does not anticipate payment to result from submitting the bill; but needs to inform the payer of the non-reimbursable periods of confinement or termination of care.
    """

    C_1 = "1"
    """
    ADMIT THROUGH DISCHARGE CLAIM (A) - Use this code when billing for a confined treatment or inpatient period. This will include bills representing a total confinement or course of treatment, and bills that represent an entire benefit period of the primary third party payer. Note: Use Occurrence Code 42 to indicate the date of discharge when the "Through" date in Form Locator 06 (Statement Covers Period) is not the actual discharge date and the frequency code in Form Locator 04 is that of a final bill, i.e., 1, 4, and 7 (when the replacement is for a prior final claim).
    """

    C_2 = "2"
    """
    INTERIM - FIRST CLAIM - This code is to be used for the first of a series of bills to the same third party payer for the same confinement or course of treatment.
    """

    C_3 = "3"
    """
    INTERIM - CONTINUING CLAIM (B) - This code is to be used when a bill for the same confinement or course of treatment has previously been submitted and it is expected that further bills for the same confinement or course of treatment will be submitted.
    """

    C_4 = "4"
    """
    INTERIM LAST CLAIM (B) - Use this code for the last of a series of bills, for which payment is expected, to the same third party payer for the same confinement or course of treatment. Note: Do not use this code in lieu of a code for Late Charges or Non-Payment/Zero Claims.
    """

    C_5 = "5"
    """
    LATE CHARGE(S) ONLY - Use this code for submitting charges to the payer, which were received by the provider after the Admit Through Discharge, or the Last Interim Claim has been submitted. Note: This code is not intended to be used in lieu of a Replacement Claim.
    """

    C_7 = "7"
    """
    REPLACEMENT OF PRIOR CLAIM (A) - This code is used when a specific bill has been issued for a specific Provider, Patient, Payer, Insured and "Statement Covers Period" and it needs to be restated in its entirety, except for the same identity information. In using this code, the payer is to operate on the principle to void the original bill, and that the information present on this bill represents a complete replacement of the previously issued bill. However, this code is not intended to be used in lieu of a Late Charge(s) Only claim.
    """

    C_8 = "8"
    """
    VOID/CANCEL OF PRIOR CLAIM (A) - This code reflects the elimination in its entirety of a previously submitted bill for a specific Provider, Patient, Payer, Insured and "Statement Covers Period." The provider may wish to follow a Void Bill with a bill containing the correct information when a Payer is unable to process a Replacement to a Prior Claim. The appropriate Frequency Code must be used when submitting the new bill.
    """

    C_9 = "9"
    """
    FINAL CLAIM FOR A HOME HEALTH PPS EPISODE (EFFECTIVE FOR SERVICE DATES PRIOR TO 12/1/21 TO BE DISCONTINUED 1/1/22) FINAL CLAIM FOR A HOME HEALTH PPS PERIOD (EFFECTIVE 1/1/22) - This code indicates the HH bill should be processed as a debit or credit adjustment to the initial home health PPS bill. This code is specific to home health and does not replace Frequency Codes 7 or 8. For claims with service dates on or after January 1, 2023, the HH bill is processed as an original claim, not an adjustment of an initial bill. This code indicates a HH original bill to be processed following the submission of an HH PPS Notice of Admission (NOA-TOB 32A).
    """

    CA = "A"
    """
    ADMISSION/ELECTION NOTICE - This code is used when a hospice, home health agency, CMS Coordinated Care Demonstration entity, Centers of Excellence Demonstration entity, Provider Partnerships Demonstration entity or Religious Non-medical Health Care Institution is submitting the UB-04 as an admission or election notice.
    """

    CB = "B"
    """
    TERMINATION/REVOCATION NOTICE - This code is used when the UB-04 is used as a Termination/Revocation of a hospice, Medicare Coordinated Care Demonstration, Centers of Excellence Demonstration, Provider Partnerships Demonstration or Religious Non-Medical Care Institution election.
    """

    CC = "C"
    """
    HOSPICE CHANGE OF PROVIDER NOTICE - Use when the UB-04 is used as a Notice of Change to the hospice provider.
    """

    CD = "D"
    """
    CANCELLATION OF ELECTION NOTICE - This code is used when the UB-04 is used as a Notice of a Void/Cancel of a hospice, home health agency, CMS Coordinated Care Demonstration entity, Centers of Excellence Demonstration entity, Provider Partnerships Demonstration entity or Religious Non-medical Health Care Institution election.
    """

    CE = "E"
    """
    HOSPICE CHANGE OF OWNERSHIP - This code is used to indicate a Notice of Change in Ownership for the hospice.
    """

    CF = "F"
    """
    BENEFICIARY INITIATED ADJUSTMENT CLAIM - For intermediary use only, use to identify adjustments initiated by the beneficiary.
    """

    CG = "G"
    """
    CWF INITIATED ADJUSTMENT CLAIM - For intermediary use only, to identify adjustments initiated by CWF.
    """

    CH = "H"
    """
    CMS INITIATED ADJUSTMENT - For intermediary use only, to identify adjustments initiated by CMS.
    """

    CI = "I"
    """
    INTERMEDIARY ADJUSTMENT CLAIM (OTHER THAN QIO OR PROVIDER) - For intermediary use only, to identify adjustments initiated by the intermediary.
    """

    CJ = "J"
    """
    INITIATED ADJUSTMENT CLAIM - OTHER - For intermediary use only, to identify adjustments initiated by other entities.
    """

    CK = "K"
    """
    OIG INITIATED ADJUSTMENT CLAIM - For intermediary use only, to identify adjustments initiated by OIG.
    """

    CM = "M"
    """
    MSP INITIATED ADJUSTMENT CLAIM - For intermediary use only, to identify adjustments initiated by MSP. Note: MSP takes precedence over other adjustment sources.
    """

    CO_FREQ = "O"
    """
    NONPAYMENT/ZERO CLAIMS - This code is used when you do not anticipate payment from the payer for the bill, but you are informing the payer about a period of non-payable confinement or termination of care. The "Through" date of this bill (FL 06) is the discharge date for this confinement. Medicare requires "nonpayment" bills only to extend the spell-of-illness in inpatient cases. Other nonpayment bills are not needed and may be returned.
    """

    CP = "P"
    """
    QIO ADJUSTMENT CLAIM - For intermediary use only, to identify an adjustment initiated because of a QIO review.
    """

    CQ = "Q"
    """
    CLAIM SUBMITTED FOR RECONSIDERATION/REOPENING OUTSIDE OF TIMELY LIMITS (EFFECTIVE JANUARY 1, 2016) - This code is used to identify claims submitted for reconsideration that fall outside of the payer's timely filing limits.
    """

    CX = "X"
    """
    VOID/CANCEL A PRIOR ABBREVIATED ENCOUNTER SUBMISSION - This code is used by a Medicare Advantage contractor or other plan required to submit encounter data that indicates that this encounter data submission is an exact duplicate of an incorrect previous encounter data submission using the abbreviated UB-04 format. A code "Y" (Replacement of Prior Abbreviated Encounter Submission) is also submitted by the plan showing corrected information.
    """

    CY_FREQ = "Y"
    """
    REPLACEMENT OF PRIOR ABBREVIATED ENCOUNTER SUBMISSION - This code is used by a Medicare Advantage contractor or other plan required to submit encounter data when it wants to correct a previous encounter submission using the abbreviated UB-04 format. This is the code applied to the corrected or new encounter.
    """

    CZ_FREQ = "Z"
    """
    NEW ABBREVIATED ENCOUNTER SUBMISSION - This code is used by a Medicare Advantage contractor or other plan required to submit encounter data to indicate it is submitting new encounter data using the abbreviated UB-04 format. It is applicable for both inpatient and outpatient services.
    """

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

    def visit(
        self,
        c_0: typing.Callable[[], T_Result],
        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_7: typing.Callable[[], T_Result],
        c_8: typing.Callable[[], T_Result],
        c_9: typing.Callable[[], T_Result],
        ca: typing.Callable[[], T_Result],
        cb: typing.Callable[[], T_Result],
        cc: typing.Callable[[], T_Result],
        cd: typing.Callable[[], T_Result],
        ce: typing.Callable[[], T_Result],
        cf: typing.Callable[[], T_Result],
        cg: typing.Callable[[], T_Result],
        ch: typing.Callable[[], T_Result],
        ci: typing.Callable[[], T_Result],
        cj: typing.Callable[[], T_Result],
        ck: typing.Callable[[], T_Result],
        cm: typing.Callable[[], T_Result],
        co_freq: typing.Callable[[], T_Result],
        cp: typing.Callable[[], T_Result],
        cq: typing.Callable[[], T_Result],
        cx: typing.Callable[[], T_Result],
        cy_freq: typing.Callable[[], T_Result],
        cz_freq: typing.Callable[[], T_Result],
        _unknown_member: typing.Callable[[str], T_Result],
    ) -> T_Result:
        if self is TypeOfBillFrequencyCode.C_0:
            return c_0()
        if self is TypeOfBillFrequencyCode.C_1:
            return c_1()
        if self is TypeOfBillFrequencyCode.C_2:
            return c_2()
        if self is TypeOfBillFrequencyCode.C_3:
            return c_3()
        if self is TypeOfBillFrequencyCode.C_4:
            return c_4()
        if self is TypeOfBillFrequencyCode.C_5:
            return c_5()
        if self is TypeOfBillFrequencyCode.C_7:
            return c_7()
        if self is TypeOfBillFrequencyCode.C_8:
            return c_8()
        if self is TypeOfBillFrequencyCode.C_9:
            return c_9()
        if self is TypeOfBillFrequencyCode.CA:
            return ca()
        if self is TypeOfBillFrequencyCode.CB:
            return cb()
        if self is TypeOfBillFrequencyCode.CC:
            return cc()
        if self is TypeOfBillFrequencyCode.CD:
            return cd()
        if self is TypeOfBillFrequencyCode.CE:
            return ce()
        if self is TypeOfBillFrequencyCode.CF:
            return cf()
        if self is TypeOfBillFrequencyCode.CG:
            return cg()
        if self is TypeOfBillFrequencyCode.CH:
            return ch()
        if self is TypeOfBillFrequencyCode.CI:
            return ci()
        if self is TypeOfBillFrequencyCode.CJ:
            return cj()
        if self is TypeOfBillFrequencyCode.CK:
            return ck()
        if self is TypeOfBillFrequencyCode.CM:
            return cm()
        if self is TypeOfBillFrequencyCode.CO_FREQ:
            return co_freq()
        if self is TypeOfBillFrequencyCode.CP:
            return cp()
        if self is TypeOfBillFrequencyCode.CQ:
            return cq()
        if self is TypeOfBillFrequencyCode.CX:
            return cx()
        if self is TypeOfBillFrequencyCode.CY_FREQ:
            return cy_freq()
        if self is TypeOfBillFrequencyCode.CZ_FREQ:
            return cz_freq()
        return _unknown_member(self._value_)
