Module: Candid::Internal::Types::Enum

Includes:
Type
Included in:
ChargeCapture::V1::Types::ChargeCaptureSortField, ChargeCapture::V1::Types::ChargeCaptureStatus, ChargeCaptureBundles::V1::Types::ChargeCaptureClaimCreationSortField, ChargeCaptureBundles::V1::Types::ChargeCaptureClaimCreationStatus, Claims::Types::ClaimStatus, ClinicalTrials::V1::Types::ClinicalTrialPhase, Commons::Types::BillingProviderCommercialLicenseType, Commons::Types::ClaimSubmissionPayerResponsibilityType, Commons::Types::Clearinghouse, Commons::Types::DelayReasonCode, Commons::Types::EmrPayerCrosswalk, Commons::Types::EpsdtReferralConditionIndicatorCode, Commons::Types::FacilityTypeCode, Commons::Types::InsuranceTypeCode, Commons::Types::IntendedSubmissionMedium, Commons::Types::NetworkType, Commons::Types::NextResponsibleParty, Commons::Types::PatientRelationshipToInsuredCodeAll, Commons::Types::PhoneNumberType, Commons::Types::Primitive, Commons::Types::ProcedureModifier, Commons::Types::QualifierCode, Commons::Types::ReportTransmissionCode, Commons::Types::ReportTypeCode, Commons::Types::ServiceLineUnits, Commons::Types::SortDirection, Commons::Types::SourceOfPaymentCode, Commons::Types::State, Contracts::V2::Types::ContractSortField, Contracts::V2::Types::ContractStatus, Credentialing::V2::Types::CredentialingSpanStatus, Diagnoses::Types::DiagnosisTypeCode, EncounterAttachments::V1::Types::EncounterAttachmentType, EncounterSupplementalInformation::V1::Types::AttachmentInclusion, Encounters::V4::Types::BillableStatusType, Encounters::V4::Types::CodingAttributionType, Encounters::V4::Types::EncounterOwnerOfNextActionType, Encounters::V4::Types::EncounterSortOptions, Encounters::V4::Types::EncounterSubmissionExpectation, Encounters::V4::Types::EncounterSubmissionOriginType, Encounters::V4::Types::InterventionCategory, Encounters::V4::Types::LabCodeType, Encounters::V4::Types::NoteCategory, Encounters::V4::Types::PatientHistoryCategoryEnum, Encounters::V4::Types::ResponsiblePartyType, Encounters::V4::Types::ServiceAuthorizationExceptionCode, Encounters::V4::Types::SynchronicityType, ExpectedNetworkStatus::V1::Types::ExpectedNetworkStatus, ExpectedNetworkStatus::V2::Types::Explanation, ExpectedNetworkStatus::V2::Types::LineOfBusiness, ExpectedNetworkStatus::V2::Types::ServiceType, FeeSchedules::V3::Types::DimensionName, Financials::Types::AccountType, Financials::Types::PatientTransactionSource, Financials::Types::RefundReason, HealthCareCodeInformation::V1::Types::AdmittingDiagnosisCodeQualifier, HealthCareCodeInformation::V1::Types::ConditionCode, HealthCareCodeInformation::V1::Types::ConditionInformationCodeQualifier, HealthCareCodeInformation::V1::Types::DiagnosisRelatedGroupCodeQualifier, HealthCareCodeInformation::V1::Types::ExternalCauseOfInjuryCodeQualifier, HealthCareCodeInformation::V1::Types::OccurrenceCode, HealthCareCodeInformation::V1::Types::OccurrenceInformationCodeQualifier, HealthCareCodeInformation::V1::Types::OccurrenceSpanCode, HealthCareCodeInformation::V1::Types::OccurrenceSpanCodeQualifier, HealthCareCodeInformation::V1::Types::OtherDiagnosisInformationCodeQualifier, HealthCareCodeInformation::V1::Types::OtherProcedureInformationCodeQualifier, HealthCareCodeInformation::V1::Types::PatientReasonForVisitCodeQualifier, HealthCareCodeInformation::V1::Types::PresentOnAdmissionIndicatorCode, HealthCareCodeInformation::V1::Types::PrincipalDiagnosisCodeQualifier, HealthCareCodeInformation::V1::Types::PrincipalProcedureInformationCodeQualifier, HealthCareCodeInformation::V1::Types::TreatmentCodeQualifier, HealthCareCodeInformation::V1::Types::ValueCode, HealthCareCodeInformation::V1::Types::ValueCodeQualifier, Candid::Identifiers::Types::IdentifierCode, Candid::ImportInvoice::V1::Types::InvoiceItemUpdateType, Candid::Individual::Types::Gender, Candid::InsurancePayments::V1::Types::InsurancePaymentSortField, Candid::InsuranceRefunds::V1::Types::InsuranceRefundSortField, Candid::Invoices::Types::InvoiceStatus, Candid::Invoices::V2::Types::InvoiceDestination, Candid::Invoices::V2::Types::InvoiceSortField, Candid::Invoices::V2::Types::InvoiceStatus, NonInsurancePayerPayments::V1::Types::NonInsurancePayerPaymentSortField, NonInsurancePayerRefunds::V1::Types::NonInsurancePayerRefundSortField, NonInsurancePayers::V1::Types::NonInsurancePayerSortField, OrganizationProviders::V2::Types::AddressType, OrganizationProviders::V2::Types::EmploymentStatus, OrganizationProviders::V2::Types::LicenseType, OrganizationProviders::V2::Types::OrganizationProviderSortOptions, OrganizationProviders::V2::Types::ProviderType, OrganizationServiceFacilities::V2::Types::ServiceFacilityMode, OrganizationServiceFacilities::V2::Types::ServiceFacilityOperationalStatus, OrganizationServiceFacilities::V2::Types::ServiceFacilityPhysicalType, OrganizationServiceFacilities::V2::Types::ServiceFacilityStatus, OrganizationServiceFacilities::V2::Types::ServiceFacilityType, PatientAr::V1::Types::PatientArStatus, PatientPayments::V3::Types::PatientPaymentSource, PatientPayments::V3::Types::PatientPaymentStatus, PatientPayments::V4::Types::PatientPaymentSortField, PatientRefunds::V1::Types::PatientRefundSortField, PayerPlanGroups::V1::Types::PayerPlanGroupSortField, Payers::V4::Types::SupportState, PreEncounter::Appointments::V1::Types::AppointmentStatus, PreEncounter::Appointments::V1::Types::AppointmentWorkQueue, PreEncounter::Appointments::V1::Types::UniversalServiceIdentifier, PreEncounter::Common::Types::AddressUse, PreEncounter::Common::Types::ContactPointUse, PreEncounter::Common::Types::DisabilityStatus, PreEncounter::Common::Types::Ethnicity, PreEncounter::Common::Types::ExternalProviderType, PreEncounter::Common::Types::Gender, PreEncounter::Common::Types::NameUse, PreEncounter::Common::Types::Race, PreEncounter::Common::Types::Relationship, PreEncounter::Common::Types::Sex, PreEncounter::Common::Types::SexualOrientation, PreEncounter::Common::Types::SortDirection, PreEncounter::Coverages::V1::Types::BenefitType, PreEncounter::Coverages::V1::Types::CoverageLevel, PreEncounter::Coverages::V1::Types::CoverageStatus, PreEncounter::Coverages::V1::Types::CoverageValueUnit, PreEncounter::Coverages::V1::Types::InsuranceTypeCode, PreEncounter::Coverages::V1::Types::NetworkType, PreEncounter::Coverages::V1::Types::ServiceTypeCode, PreEncounter::EligibilityChecks::V1::Types::EligibilityCheckErrorSource, PreEncounter::EligibilityChecks::V1::Types::EligibilityCheckStatus, PreEncounter::EligibilityChecks::V1::Types::EligibilityStatus, PreEncounter::Images::V1::Types::CoverageImageSide, PreEncounter::Images::V1::Types::ImageStatus, PreEncounter::Patients::V1::Types::AuthorizationUnit, PreEncounter::Patients::V1::Types::DoNotInvoiceReason, PreEncounter::Patients::V1::Types::MaritalStatus, PreEncounter::Patients::V1::Types::ReferralSource, PreEncounter::Patients::V1::Types::ReferralType, PreEncounter::Patients::V1::Types::ReferralUnit, PreEncounter::Patients::V1::Types::SpecializationCategory, ServiceLines::V2::Types::DenialReasonContent, ServiceLines::V2::Types::MeasurementUnitCode, ServiceLines::V2::Types::ServiceIdQualifier, ServiceLines::V2::Types::TestResultType, Tags::Types::TagColorEnum, Tasks::Commons::Types::TaskCategory, Tasks::Commons::Types::TaskStatus, Tasks::Commons::Types::TaskType, Tasks::V3::Types::TaskActionType, Tasks::V3::Types::TaskSortOptions, WriteOffs::V1::Types::InsuranceWriteOffReason, WriteOffs::V1::Types::PatientWriteOffReason, WriteOffs::V1::Types::WriteOffSortField, X12::V1::Types::PatientDischargeStatusCode, X12::V1::Types::PointOfOriginForAdmissionOrVisitCode, X12::V1::Types::TypeOfAdmissionOrVisitCode, X12::V1::Types::TypeOfBillFrequencyCode, X12::V1::Types::TypeOfCareCode, X12::V1::Types::TypeOfFacilityCode, YesNoIndicator::Types::YesNoIndicator
Defined in:
lib/candid/internal/types/enum.rb

Overview

Module for defining enums

Instance Method Summary collapse

Methods included from JSON::Serializable

#dump, #load

Instance Method Details

#coerce(value, strict: strict?) ) ⇒ Object

Raises:



32
33
34
35
36
37
38
39
40
# File 'lib/candid/internal/types/enum.rb', line 32

def coerce(value, strict: strict?)
  coerced_value = Utils.coerce(Symbol, value)

  return coerced_value if values.include?(coerced_value)

  raise Errors::TypeError, "`#{value}` not in enum #{self}" if strict

  value
end

#finalize!Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



18
19
20
# File 'lib/candid/internal/types/enum.rb', line 18

def finalize!
  values
end

#inspectObject



42
43
44
# File 'lib/candid/internal/types/enum.rb', line 42

def inspect
  "#{name}[#{values.join(", ")}]"
end

#strict!Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



28
29
30
# File 'lib/candid/internal/types/enum.rb', line 28

def strict!
  @strict = true
end

#strict?Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:



23
24
25
# File 'lib/candid/internal/types/enum.rb', line 23

def strict?
  @strict ||= false
end

#valuesArray<Object>

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:



13
14
15
# File 'lib/candid/internal/types/enum.rb', line 13

def values
  @values ||= constants.map { |c| const_get(c) }
end