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

import typing

from ......core import enum

T_Result = typing.TypeVar("T_Result")


class PointOfOriginForAdmissionOrVisitCode(enum.StrEnum):
    C_1 = "1"
    """
    NON-HEALTH CARE FACILITY POINT OF ORIGIN - Inpatient: The patient was admitted to this facility. Outpatient: The patient presented for outpatient services. Examples: Includes patients coming from home or workplace and patients receiving care at home (such as home health services).
    """

    C_2 = "2"
    """
    CLINIC OR PHYSICIAN'S OFFICE - Inpatient: The patient was admitted to this facility. Outpatient: The patient presented to this facility for outpatient services.
    """

    C_4 = "4"
    """
    TRANSFER FROM A HOSPITAL (DIFFERENT FACILITY) - Inpatient: The patient was admitted to this facility as a hospital transfer from an acute care facility where he or she was an inpatient or outpatient. Outpatient: The patient was transferred to this facility as an outpatient from an acute care facility. Excludes Transfers from Hospital Inpatient in the Same Facility (See Code D).
    """

    C_5 = "5"
    """
    TRANSFER FROM A SKILLED NURSING FACILITY (SNF), ASSISTED LIVING FACILITY (ALF), INTERMEDIATE CARE FACILITY (ICF) OR OTHER NURSING FACILITY (NF). - Inpatient: The patient was admitted to this facility as a transfer from a SNF, ALF, ICF or other NF where he or she was a resident. Outpatient: The patient presented to this facility for outpatient or referenced diagnostic services from a SNF, ALF, ICF or other NF where he or she was a resident.
    """

    C_6 = "6"
    """
    TRANSFER FROM ANOTHER HEALTH CARE FACILITY - Inpatient: The patient was admitted to this facility as a transfer from another type of health care facility not defined elsewhere in this code list. Outpatient: The patient presented to this facility for services from another health care facility not defined elsewhere in this code list.
    """

    C_8 = "8"
    """
    COURT/LAW ENFORCEMENT - Inpatient: The patient was admitted to this facility upon the direction of a court of law, or upon the request of a law enforcement agency representative. Outpatient: The patient presented to this facility upon the direction of a court of law, or upon the request of a law enforcement agency representative for outpatient or referenced diagnostic services. Usage Note: Includes transfers from incarceration facilities.
    """

    C_9 = "9"
    """
    INFORMATION NOT AVAILABLE - Inpatient: The patient's Point of Origin is not known. Outpatient: The patient's Point of Origin is not known.
    """

    CD = "D"
    """
    TRANSFER FROM ONE DISTINCT UNIT OF THE HOSPITAL TO ANOTHER DISTINCT UNIT OF THE SAME HOSPITAL RESULTING IN A SEPARATE CLAIM TO THE PAYER - Inpatient: The patient was admitted to this facility as a transfer from hospital inpatient within this hospital resulting in a separate claim to the payer. Outpatient: The patient received outpatient services in this facility as a transfer from within this hospital resulting in a separate claim to the payer. Usage Note: For purposes of this code, "Distinct Unit" is defined as a unique unit or level of care at the hospital requiring the issuance of a separate claim to the payer. Examples could include observation services, psychiatric units, rehabilitation units, a unit in a critical access hospital, or a swing bed located in an acute hospital.
    """

    CE = "E"
    """
    TRANSFER FROM AMBULATORY SURGERY CENTER - Inpatient: The patient was admitted to this facility as a transfer from an ambulatory surgery center. Outpatient: The patient presented to this facility for outpatient or referenced diagnostic services from an ambulatory surgery center.
    """

    CF = "F"
    """
    TRANSFER FROM A HOSPICE FACILITY - Inpatient: The patient was admitted to this facility as a transfer from a hospice facility. Outpatient: The patient presented to this facility for outpatient or referenced diagnostic services from a hospice facility.
    """

    CG = "G"
    """
    TRANSFER FROM A DESIGNATED DISASTER ALTERNATE CARE SITE (EFFECTIVE 7/1/20) - The patient was transferred to this facility from a Designated Disaster Alternate Care Site for inpatient or outpatient services.
    """

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

    def visit(
        self,
        c_1: typing.Callable[[], T_Result],
        c_2: typing.Callable[[], T_Result],
        c_4: typing.Callable[[], T_Result],
        c_5: typing.Callable[[], T_Result],
        c_6: typing.Callable[[], T_Result],
        c_8: typing.Callable[[], T_Result],
        c_9: typing.Callable[[], T_Result],
        cd: typing.Callable[[], T_Result],
        ce: typing.Callable[[], T_Result],
        cf: typing.Callable[[], T_Result],
        cg: typing.Callable[[], T_Result],
        _unknown_member: typing.Callable[[str], T_Result],
    ) -> T_Result:
        if self is PointOfOriginForAdmissionOrVisitCode.C_1:
            return c_1()
        if self is PointOfOriginForAdmissionOrVisitCode.C_2:
            return c_2()
        if self is PointOfOriginForAdmissionOrVisitCode.C_4:
            return c_4()
        if self is PointOfOriginForAdmissionOrVisitCode.C_5:
            return c_5()
        if self is PointOfOriginForAdmissionOrVisitCode.C_6:
            return c_6()
        if self is PointOfOriginForAdmissionOrVisitCode.C_8:
            return c_8()
        if self is PointOfOriginForAdmissionOrVisitCode.C_9:
            return c_9()
        if self is PointOfOriginForAdmissionOrVisitCode.CD:
            return cd()
        if self is PointOfOriginForAdmissionOrVisitCode.CE:
            return ce()
        if self is PointOfOriginForAdmissionOrVisitCode.CF:
            return cf()
        if self is PointOfOriginForAdmissionOrVisitCode.CG:
            return cg()
        return _unknown_member(self._value_)
