Class: CandidApiClient::Encounters::V4::AsyncV4Client

Inherits:
Object
  • Object
show all
Defined in:
lib/candidhealth/encounters/v_4/client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(request_client:) ⇒ CandidApiClient::Encounters::V4::AsyncV4Client

Parameters:



1249
1250
1251
# File 'lib/candidhealth/encounters/v_4/client.rb', line 1249

def initialize(request_client:)
  @request_client = request_client
end

Instance Attribute Details

#request_clientCandidApiClient::AsyncRequestClient (readonly)



1245
1246
1247
# File 'lib/candidhealth/encounters/v_4/client.rb', line 1245

def request_client
  @request_client
end

Instance Method Details

#create(external_id:, patient_authorized_release:, benefits_assigned_to_provider:, provider_accepts_assignment:, billable_status:, patient:, billing_provider:, rendering_provider:, responsible_party:, diagnoses:, place_of_service_code:, date_of_service: nil, end_date_of_service: nil, appointment_type: nil, existing_medications: nil, vitals: nil, interventions: nil, pay_to_address: nil, synchronicity: nil, additional_information: nil, service_authorization_exception_code: nil, admission_date: nil, discharge_date: nil, onset_of_current_illness_or_symptom_date: nil, last_menstrual_period_date: nil, delay_reason_code: nil, additional_properties: nil, _field_set: nil, referring_provider: nil, initial_referring_provider: nil, supervising_provider: nil, service_facility: nil, subscriber_primary: nil, subscriber_secondary: nil, subscriber_tertiary: nil, prior_authorization_number: nil, clinical_notes: nil, billing_notes: nil, patient_histories: nil, service_lines: nil, guarantor: nil, external_claim_submission: nil, tag_ids: nil, schema_instances: nil, referral_number: nil, epsdt_referral: nil, claim_supplemental_information: nil, secondary_payer_carrier_code: nil, request_options: nil) ⇒ CandidApiClient::Encounters::V4::Types::Encounter

Examples:

api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
api.encounters.v_4.create(
  patient: { first_name: "first_name", last_name: "last_name", gender: MALE, external_id: "external_id", date_of_birth: DateTime.parse(2023-01-15), address: { address_1: "address1", city: "city", state: AA, zip_code: "zip_code" } },
  billing_provider: { address: { address_1: "address1", city: "city", state: AA, zip_code: "zip_code", zip_plus_four_code: "zip_plus_four_code" }, tax_id: "tax_id", npi: "npi" },
  rendering_provider: { npi: "npi" },
  responsible_party: INSURANCE_PAY,
  diagnoses: [{ code_type: ABF, code: "code" }, { code_type: ABF, code: "code" }],
  place_of_service_code: PHARMACY
)

Parameters:

  • external_id (String)

    A client-specified unique ID to associate with this encounter; for example, your internal encounter ID or a Dr. Chrono encounter ID. This field should not contain PHI.

  • date_of_service (Date) (defaults to: nil)

    Date formatted as YYYY-MM-DD; eg: 2019-08-24. This date must be the local date in the timezone where the service occurred. Box 24a on the CMS-1500 claim form. If service occurred over a range of dates, this should be the start date. date_of_service must be defined on either the encounter or the service lines but not both. If there are greater than zero service lines, it is recommended to specify date_of_service on the service_line instead of on the encounter to prepare for future API versions.

  • end_date_of_service (Date) (defaults to: nil)

    Date formatted as YYYY-MM-DD; eg: 2019-08-25. This date must be the local date in the timezone where the service occurred. If omitted, the Encounter is assumed to be for a single day. Must not be temporally before the date_of_service field. If there are greater than zero service lines, it is recommended to specify end_date_of_service on the service_line instead of on the encounter to prepare for future API versions.

  • patient_authorized_release (Boolean)

    Whether this patient has authorized the release of medical information for billing purpose. Box 12 on the CMS-1500 claim form.

  • benefits_assigned_to_provider (Boolean)

    Whether this patient has authorized insurance payments to be made to you, not them. If false, patient may receive reimbursement. Box 13 on the CMS-1500 claim form.

  • provider_accepts_assignment (Boolean)

    Whether you have accepted the patient’s authorization for insurance payments to be made to you, not them. Box 27 on the CMS-1500 claim form.

  • appointment_type (String) (defaults to: nil)

    Human-readable description of the appointment type (ex: “Acupuncture - Headaches”).

  • existing_medications (Array<Hash>) (defaults to: nil)

    Request of type Array<CandidApiClient::Encounters::V4::Types::Medication>, as a Hash

    • :name (String)

    • :rx_cui (String)

    • :dosage (String)

    • :dosage_form (String)

    • :frequency (String)

    • :as_needed (Boolean)

  • vitals (Hash) (defaults to: nil)

    Request of type CandidApiClient::Encounters::V4::Types::Vitals, as a Hash

    • :height_in (Integer)

    • :weight_lbs (Integer)

    • :blood_pressure_systolic_mmhg (Integer)

    • :blood_pressure_diastolic_mmhg (Integer)

    • :body_temperature_f (Float)

    • :hemoglobin_gdl (Float)

    • :hematocrit_pct (Float)

  • interventions (Array<Hash>) (defaults to: nil)

    Request of type Array<CandidApiClient::Encounters::V4::Types::Intervention>, as a Hash

    • :name (String)

    • :category (CandidApiClient::Encounters::V4::Types::InterventionCategory)

    • :description (String)

    • :medication (Hash)

      • :name (String)

      • :rx_cui (String)

      • :dosage (String)

      • :dosage_form (String)

      • :frequency (String)

      • :as_needed (Boolean)

    • :labs (Array<CandidApiClient::Encounters::V4::Types::Lab>)

  • pay_to_address (Hash) (defaults to: nil)

    Specifies the address to which payments for the claim should be sent.Request of type CandidApiClient::Commons::Types::StreetAddressLongZip, as a Hash

    • :zip_plus_four_code (String)

    • :address_1 (String)

    • :address_2 (String)

    • :city (String)

    • :state (CandidApiClient::Commons::Types::State)

    • :zip_code (String)

  • synchronicity (CandidApiClient::Encounters::V4::Types::SynchronicityType) (defaults to: nil)

    Whether or not this was a synchronous or asynchronous encounter. Asynchronous encounters occur when providers and patients communicate online using forms, instant messaging, or other pre-recorded digital mediums. Synchronous encounters occur in live, real-time settings where the patient interacts directly with the provider, such as over video or a phone call.

  • billable_status (CandidApiClient::Encounters::V4::Types::BillableStatusType)

    Defines if the Encounter is to be billed by Candid to the responsible_party. Examples for when this should be set to NOT_BILLABLE include if the Encounter has not occurred yet or if there is no intention of ever billing the responsible_party.

  • additional_information (String) (defaults to: nil)

    Defines additional information on the claim needed by the payer. Box 19 on the CMS-1500 claim form.

  • service_authorization_exception_code (CandidApiClient::Encounters::V4::Types::ServiceAuthorizationExceptionCode) (defaults to: nil)

    837p Loop2300 REF*4N Required when mandated by government law or regulation to obtain authorization for specific service(s) but, for the reasons listed in one of the enum values of ServiceAuthorizationExceptionCode, the service was performed without obtaining the authorization.

  • admission_date (Date) (defaults to: nil)

    837p Loop2300 DTP*435, CMS-1500 Box 18 Required on all ambulance claims when the patient was known to be admitted to the hospital. OR Required on all claims involving inpatient medical visits.

  • discharge_date (Date) (defaults to: nil)

    837p Loop2300 DTP*096, CMS-1500 Box 18 Required for inpatient claims when the patient was discharged from the facility and the discharge date is known.

  • onset_of_current_illness_or_symptom_date (Date) (defaults to: nil)

    837p Loop2300 DTP*431, CMS-1500 Box 14 Required for the initial medical service or visit performed in response to a medical emergency when the date is available and is different than the date of service. OR This date is the onset of acute symptoms for the current illness or condition.

  • last_menstrual_period_date (Date) (defaults to: nil)

    837p Loop2300 DTP*484, CMS-1500 Box 14 Required when, in the judgment of the provider, the services on this claim are related to the patient’s pregnancy.

  • delay_reason_code (CandidApiClient::Commons::Types::DelayReasonCode) (defaults to: nil)

    837i Loop2300, CLM-1300 Box 20 Code indicating the reason why a request was delayed

  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition

  • _field_set (Object) (defaults to: nil)
  • patient (Hash)

    Contains the identification information of the individual receiving medical services.Request of type CandidApiClient::Individual::Types::PatientCreate, as a Hash

    * :phone_numbers (Array<CandidApiClient::Commons::Types::PhoneNumber>)
    * :phone_consent (Boolean)
    * :email (String)
    * :non_insurance_payers (Array<String>)
    * :non_insurance_payers_info (Array<CandidApiClient::Individual::Types::PatientNonInsurancePayerInfoCreate>)
    * :email_consent (Boolean)
    * :external_id (String)
    * :date_of_birth (Date)
    * :address (Hash)
      * :zip_plus_four_code (String)
      * :address_1 (String)
      * :address_2 (String)
      * :city (String)
      * :state (CandidApiClient::Commons::Types::State)
      * :zip_code (String)
    * :first_name (String)
    * :last_name (String)
    * :gender (CandidApiClient::Individual::Types::Gender)
    
  • billing_provider (Hash)

    The billing provider is the provider or business entity submitting the claim. Billing provider may be, but is not necessarily, the same person/NPI as the rendering provider. From a payer’s perspective, this represents the person or entity being reimbursed. When a contract exists with the target payer, the billing provider should be the entity contracted with the payer. In some circumstances, this will be an individual provider. In that case, submit that provider’s NPI and the tax ID (TIN) that the provider gave to the payer during contracting. In other cases, the billing entity will be a medical group. If so, submit the group NPI and the group’s tax ID. Box 33 on the CMS-1500 claim form.Request of type CandidApiClient::EncounterProviders::V2::Types::BillingProvider, as a Hash

    * :address (Hash)
      * :zip_plus_four_code (String)
      * :address_1 (String)
      * :address_2 (String)
      * :city (String)
      * :state (CandidApiClient::Commons::Types::State)
      * :zip_code (String)
    * :tax_id (String)
    * :npi (String)
    * :taxonomy_code (String)
    * :provider_commercial_license_type (CandidApiClient::Commons::Types::BillingProviderCommercialLicenseType)
    * :first_name (String)
    * :last_name (String)
    * :organization_name (String)
    
  • rendering_provider (Hash)

    The rendering provider is the practitioner – physician, nurse practitioner, etc. – performing the service. For telehealth services, the rendering provider performs the visit, asynchronous communication, or other service. The rendering provider address should generally be the same as the service facility address.Request of type CandidApiClient::EncounterProviders::V2::Types::RenderingProvider, as a Hash

    * :npi (String)
    * :taxonomy_code (String)
    * :address (Hash)
      * :zip_plus_four_code (String)
      * :address_1 (String)
      * :address_2 (String)
      * :city (String)
      * :state (CandidApiClient::Commons::Types::State)
      * :zip_code (String)
    * :first_name (String)
    * :last_name (String)
    * :organization_name (String)
    
  • referring_provider (Hash) (defaults to: nil)

    The final provider who referred the services that were rendered. All physicians who order services or refer Medicare beneficiaries must report this data.Request of type CandidApiClient::EncounterProviders::V2::Types::ReferringProvider, as a Hash

    * :npi (String)
    * :taxonomy_code (String)
    * :address (Hash)
      * :zip_plus_four_code (String)
      * :address_1 (String)
      * :address_2 (String)
      * :city (String)
      * :state (CandidApiClient::Commons::Types::State)
      * :zip_code (String)
    * :first_name (String)
    * :last_name (String)
    * :organization_name (String)
    
  • initial_referring_provider (Hash) (defaults to: nil)

    The second iteration of Loop ID-2310. Use code “P3 - Primary Care Provider” in this loop to indicate the initial referral from the primary care provider or whatever provider wrote the initial referral for this patient’s episode of care being billed/reported in this transaction.Request of type CandidApiClient::EncounterProviders::V2::Types::InitialReferringProvider, as a Hash

    * :npi (String)
    * :taxonomy_code (String)
    * :address (Hash)
      * :zip_plus_four_code (String)
      * :address_1 (String)
      * :address_2 (String)
      * :city (String)
      * :state (CandidApiClient::Commons::Types::State)
      * :zip_code (String)
    * :qualifier (CandidApiClient::Commons::Types::QualifierCode)
    * :first_name (String)
    * :last_name (String)
    * :organization_name (String)
    
  • supervising_provider (Hash) (defaults to: nil)

    Required when the rendering provider is supervised by a physician. If not required by this implementation guide, do not send.Request of type CandidApiClient::EncounterProviders::V2::Types::SupervisingProvider, as a Hash

    * :npi (String)
    * :taxonomy_code (String)
    * :address (Hash)
      * :zip_plus_four_code (String)
      * :address_1 (String)
      * :address_2 (String)
      * :city (String)
      * :state (CandidApiClient::Commons::Types::State)
      * :zip_code (String)
    * :first_name (String)
    * :last_name (String)
    * :organization_name (String)
    
  • service_facility (Hash) (defaults to: nil)

    Encounter Service facility is typically the location a medical service was rendered, such as a provider office or hospital. For telehealth, service facility can represent the provider’s location when the service was delivered (e.g., home), or the location where an in-person visit would have taken place, whichever is easier to identify. If the provider is in-network, service facility may be defined in payer contracts. Box 32 on the CMS-1500 claim form. Note that for an in-network claim to be successfully adjudicated, the service facility address listed on claims must match what was provided to the payer during the credentialing process.Request of type CandidApiClient::ServiceFacility::Types::EncounterServiceFacilityBase, as a Hash

    * :organization_name (String)
    * :npi (String)
    * :address (Hash)
      * :zip_plus_four_code (String)
      * :address_1 (String)
      * :address_2 (String)
      * :city (String)
      * :state (CandidApiClient::Commons::Types::State)
      * :zip_code (String)
    * :secondary_identification (String)
    
  • subscriber_primary (Hash) (defaults to: nil)

    Subscriber_primary is required when responsible_party is INSURANCE_PAY (i.e. when the claim should be billed to insurance). These are not required fields when responsible_party is SELF_PAY (i.e. when the claim should be billed to the patient). However, if you collect this for patients, even self-pay, we recommend including it when sending encounters to Candid. Note: Cash Pay is no longer a valid payer_id in v4, please use responsible party to define self-pay claims.Request of type CandidApiClient::Individual::Types::SubscriberCreate, as a Hash

    * :insurance_card (Hash)
      * :member_id (String)
      * :payer_name (String)
      * :payer_id (String)
      * :rx_bin (String)
      * :rx_pcn (String)
      * :image_url_front (String)
      * :image_url_back (String)
      * :emr_payer_crosswalk (CandidApiClient::Commons::Types::EmrPayerCrosswalk)
      * :group_number (String)
      * :plan_name (String)
      * :plan_type (CandidApiClient::Commons::Types::SourceOfPaymentCode)
      * :insurance_type (CandidApiClient::Commons::Types::InsuranceTypeCode)
      * :payer_plan_group_id (String)
    * :patient_relationship_to_subscriber_code (CandidApiClient::Commons::Types::PatientRelationshipToInsuredCodeAll)
    * :date_of_birth (Date)
    * :address (Hash)
      * :zip_plus_four_code (String)
      * :address_1 (String)
      * :address_2 (String)
      * :city (String)
      * :state (CandidApiClient::Commons::Types::State)
      * :zip_code (String)
    * :first_name (String)
    * :last_name (String)
    * :gender (CandidApiClient::Individual::Types::Gender)
    
  • subscriber_secondary (Hash) (defaults to: nil)

    Please always include this when you have it, even for self-pay claims.Request of type CandidApiClient::Individual::Types::SubscriberCreate, as a Hash

    • :insurance_card (Hash)

      • :member_id (String)

      • :payer_name (String)

      • :payer_id (String)

      • :rx_bin (String)

      • :rx_pcn (String)

      • :image_url_front (String)

      • :image_url_back (String)

      • :emr_payer_crosswalk (CandidApiClient::Commons::Types::EmrPayerCrosswalk)

      • :group_number (String)

      • :plan_name (String)

      • :plan_type (CandidApiClient::Commons::Types::SourceOfPaymentCode)

      • :insurance_type (CandidApiClient::Commons::Types::InsuranceTypeCode)

      • :payer_plan_group_id (String)

    • :patient_relationship_to_subscriber_code (CandidApiClient::Commons::Types::PatientRelationshipToInsuredCodeAll)

    • :date_of_birth (Date)

    • :address (Hash)

      • :zip_plus_four_code (String)

      • :address_1 (String)

      • :address_2 (String)

      • :city (String)

      • :state (CandidApiClient::Commons::Types::State)

      • :zip_code (String)

    • :first_name (String)

    • :last_name (String)

    • :gender (CandidApiClient::Individual::Types::Gender)

  • subscriber_tertiary (Hash) (defaults to: nil)

    Please always include this when you have it, even for self-pay claims.Request of type CandidApiClient::Individual::Types::SubscriberCreate, as a Hash

    • :insurance_card (Hash)

      • :member_id (String)

      • :payer_name (String)

      • :payer_id (String)

      • :rx_bin (String)

      • :rx_pcn (String)

      • :image_url_front (String)

      • :image_url_back (String)

      • :emr_payer_crosswalk (CandidApiClient::Commons::Types::EmrPayerCrosswalk)

      • :group_number (String)

      • :plan_name (String)

      • :plan_type (CandidApiClient::Commons::Types::SourceOfPaymentCode)

      • :insurance_type (CandidApiClient::Commons::Types::InsuranceTypeCode)

      • :payer_plan_group_id (String)

    • :patient_relationship_to_subscriber_code (CandidApiClient::Commons::Types::PatientRelationshipToInsuredCodeAll)

    • :date_of_birth (Date)

    • :address (Hash)

      • :zip_plus_four_code (String)

      • :address_1 (String)

      • :address_2 (String)

      • :city (String)

      • :state (CandidApiClient::Commons::Types::State)

      • :zip_code (String)

    • :first_name (String)

    • :last_name (String)

    • :gender (CandidApiClient::Individual::Types::Gender)

  • prior_authorization_number (String) (defaults to: nil)

    Box 23 on the CMS-1500 claim form.

  • responsible_party (CandidApiClient::Encounters::V4::Types::ResponsiblePartyType)

    Defines the party to be billed with the initial balance owed on the claim.

  • diagnoses (Array<Hash>)

    Ideally, this field should contain no more than 12 diagnoses. However, more diagnoses may be submitted at this time, and coders will later prioritize the 12 that will be submitted to the payor.Request of type Array<CandidApiClient::Diagnoses::Types::DiagnosisCreate>, as a Hash

    * :name (String)
    * :code_type (CandidApiClient::Diagnoses::Types::DiagnosisTypeCode)
    * :code (String)
    
  • clinical_notes (Array<Hash>) (defaults to: nil)

    Holds a collection of clinical observations made by healthcare providers during patient encounters.Request of type Array<CandidApiClient::Encounters::V4::Types::ClinicalNoteCategoryCreate>, as a Hash

    * :category (CandidApiClient::Encounters::V4::Types::NoteCategory)
    * :notes (Array<CandidApiClient::Encounters::V4::Types::ClinicalNote>)
    
  • billing_notes (Array<Hash>) (defaults to: nil)

    Spot to store misc, human-readable, notes about this encounter to be used in the billing process.Request of type Array<CandidApiClient::BillingNotes::V2::Types::BillingNoteBase>, as a Hash

    * :text (String)
    
  • place_of_service_code (CandidApiClient::Commons::Types::FacilityTypeCode)

    Box 24B on the CMS-1500 claim form. 837p Loop2300, CLM-05-1. 02 for telemedicine, 11 for in-person. Full list //www.cms.gov/Medicare/Coding/place-of-service-codes/Place_of_Service_Code_Set).

  • patient_histories (Array<Hash>) (defaults to: nil)

    Request of type Array<CandidApiClient::Encounters::V4::Types::PatientHistoryCategory>, as a Hash

    • :category (CandidApiClient::Encounters::V4::Types::PatientHistoryCategoryEnum)

    • :questions (Array<CandidApiClient::Encounters::V4::Types::IntakeQuestion>)

  • service_lines (Array<Hash>) (defaults to: nil)

    Each service line must be linked to a diagnosis. Concretely, ‘service_line.diagnosis_pointers`must contain at least one entry which should be in bounds of the diagnoses list field.Request of type Array<CandidApiClient::ServiceLines::V2::Types::ServiceLineCreate>, as a Hash

    * :modifiers (Array<CandidApiClient::Commons::Types::ProcedureModifier>)
    * :has_epsdt_indicator (Boolean)
    * :has_family_planning_indicator (Boolean)
    * :procedure_code (String)
    * :quantity (String)
    * :units (CandidApiClient::Commons::Types::ServiceLineUnits)
    * :charge_amount_cents (Integer)
    * :diagnosis_pointers (Array<Integer>)
    * :drug_identification (Hash)
      * :service_id_qualifier (CandidApiClient::ServiceLines::V2::Types::ServiceIdQualifier)
      * :national_drug_code (String)
      * :national_drug_unit_count (String)
      * :measurement_unit_code (CandidApiClient::ServiceLines::V2::Types::MeasurementUnitCode)
      * :link_sequence_number (String)
      * :pharmacy_prescription_number (String)
      * :conversion_formula (String)
      * :drug_description (String)
    * :place_of_service_code (CandidApiClient::Commons::Types::FacilityTypeCode)
    * :description (String)
    * :date_of_service (Date)
    * :end_date_of_service (Date)
    * :ordering_provider (Hash)
      * :npi (String)
      * :taxonomy_code (String)
      * :address (Hash)
        * :zip_plus_four_code (String)
        * :address_1 (String)
        * :address_2 (String)
        * :city (String)
        * :state (CandidApiClient::Commons::Types::State)
        * :zip_code (String)
      * :first_name (String)
      * :last_name (String)
      * :organization_name (String)
    * :test_results (Array<CandidApiClient::ServiceLines::V2::Types::TestResult>)
    
  • guarantor (Hash) (defaults to: nil)

    Personal and contact info for the guarantor of the patient responsibility.Request of type CandidApiClient::Guarantor::V1::Types::GuarantorCreate, as a Hash

    • :phone_numbers (Array<CandidApiClient::Commons::Types::PhoneNumber>)

    • :phone_consent (Boolean)

    • :email (String)

    • :email_consent (Boolean)

    • :first_name (String)

    • :last_name (String)

    • :external_id (String)

    • :date_of_birth (Date)

    • :address (Hash)

      • :zip_plus_four_code (String)

      • :address_1 (String)

      • :address_2 (String)

      • :city (String)

      • :state (CandidApiClient::Commons::Types::State)

      • :zip_code (String)

  • external_claim_submission (Hash) (defaults to: nil)

    To be included for claims that have been submitted outside of Candid. Candid supports posting remits and payments to these claims and working them in-platform (e.g. editing, resubmitting).Request of type CandidApiClient::ClaimSubmission::V1::Types::ExternalClaimSubmissionCreate, as a Hash

    * :claim_created_at (DateTime)
    * :patient_control_number (String)
    * :submission_records (Array<CandidApiClient::ClaimSubmission::V1::Types::ClaimSubmissionRecordCreate>)
    
  • tag_ids (Array<String>) (defaults to: nil)

    Names of tags that should be on the encounter.

  • schema_instances (Array<Hash>) (defaults to: nil)

    Key-value pairs that must adhere to a schema created via the Custom Schema API. Multiple schema instances cannot be created for the same schema on an encounter.Request of type Array<CandidApiClient::CustomSchemas::V1::Types::SchemaInstance>, as a Hash

    * :schema_id (String)
    * :content (Hash{String => Object})
    
  • referral_number (String) (defaults to: nil)

    Refers to REF*9F on the 837p. Value cannot be greater than 50 characters.

  • epsdt_referral (Hash) (defaults to: nil)

    Refers Box 24H on the CMS1500 form and Loop 2300 CRC - EPSDT Referral on the 837P formRequest of type CandidApiClient::Encounters::V4::Types::EpsdtReferral, as a Hash

    * :condition_indicator_1 (CandidApiClient::Commons::Types::EpsdtReferralConditionIndicatorCode)
    * :condition_indicator_2 (CandidApiClient::Commons::Types::EpsdtReferralConditionIndicatorCode)
    * :condition_indicator_3 (CandidApiClient::Commons::Types::EpsdtReferralConditionIndicatorCode)
    
  • claim_supplemental_information (Array<Hash>) (defaults to: nil)

    Refers to Loop 2300 - Segment PWK on the 837P form. No more than 10 entries are permitted.Request of type Array<CandidApiClient::Encounters::V4::Types::ClaimSupplementalInformation>, as a Hash

    * :attachment_report_type_code (CandidApiClient::Encounters::V4::Types::ReportTypeCode)
    * :attachment_transmission_code (CandidApiClient::Encounters::V4::Types::ReportTransmissionCode)
    * :attachment_control_number (String)
    
  • secondary_payer_carrier_code (String) (defaults to: nil)

    When Medicaid is billed as the secondary payer the Carrier Code is used to identify the primary payer. This is required for certain states.

  • request_options (CandidApiClient::RequestOptions) (defaults to: nil)

Returns:



1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
# File 'lib/candidhealth/encounters/v_4/client.rb', line 1786

def create(external_id:, patient_authorized_release:, benefits_assigned_to_provider:,
           provider_accepts_assignment:, billable_status:, patient:, billing_provider:, rendering_provider:, responsible_party:, diagnoses:, place_of_service_code:, date_of_service: nil, end_date_of_service: nil, appointment_type: nil, existing_medications: nil, vitals: nil, interventions: nil, pay_to_address: nil, synchronicity: nil, additional_information: nil, service_authorization_exception_code: nil, admission_date: nil, discharge_date: nil, onset_of_current_illness_or_symptom_date: nil, last_menstrual_period_date: nil, delay_reason_code: nil, additional_properties: nil, _field_set: nil, referring_provider: nil, initial_referring_provider: nil, supervising_provider: nil, service_facility: nil, subscriber_primary: nil, subscriber_secondary: nil, subscriber_tertiary: nil, prior_authorization_number: nil, clinical_notes: nil, billing_notes: nil, patient_histories: nil, service_lines: nil, guarantor: nil, external_claim_submission: nil, tag_ids: nil, schema_instances: nil, referral_number: nil, epsdt_referral: nil, claim_supplemental_information: nil, secondary_payer_carrier_code: nil, request_options: nil)
  Async do
    response = @request_client.conn.post do |req|
      req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
      req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
      req.headers = {
    **(req.headers || {}),
    **@request_client.get_headers,
    **(request_options&.additional_headers || {})
      }.compact
      req.body = {
        **(request_options&.additional_body_parameters || {}),
        external_id: external_id,
        date_of_service: date_of_service,
        end_date_of_service: end_date_of_service,
        patient_authorized_release: patient_authorized_release,
        benefits_assigned_to_provider: benefits_assigned_to_provider,
        provider_accepts_assignment: provider_accepts_assignment,
        appointment_type: appointment_type,
        existing_medications: existing_medications,
        vitals: vitals,
        interventions: interventions,
        pay_to_address: pay_to_address,
        synchronicity: synchronicity,
        billable_status: billable_status,
        additional_information: additional_information,
        service_authorization_exception_code: service_authorization_exception_code,
        admission_date: admission_date,
        discharge_date: discharge_date,
        onset_of_current_illness_or_symptom_date: onset_of_current_illness_or_symptom_date,
        last_menstrual_period_date: last_menstrual_period_date,
        delay_reason_code: delay_reason_code,
        additional_properties: additional_properties,
        _field_set: _field_set,
        patient: patient,
        billing_provider: billing_provider,
        rendering_provider: rendering_provider,
        referring_provider: referring_provider,
        initial_referring_provider: initial_referring_provider,
        supervising_provider: supervising_provider,
        service_facility: service_facility,
        subscriber_primary: subscriber_primary,
        subscriber_secondary: subscriber_secondary,
        subscriber_tertiary: subscriber_tertiary,
        prior_authorization_number: prior_authorization_number,
        responsible_party: responsible_party,
        diagnoses: diagnoses,
        clinical_notes: clinical_notes,
        billing_notes: billing_notes,
        place_of_service_code: place_of_service_code,
        patient_histories: patient_histories,
        service_lines: service_lines,
        guarantor: guarantor,
        external_claim_submission: external_claim_submission,
        tag_ids: tag_ids,
        schema_instances: schema_instances,
        referral_number: referral_number,
        epsdt_referral: epsdt_referral,
        claim_supplemental_information: claim_supplemental_information,
        secondary_payer_carrier_code: secondary_payer_carrier_code
      }.compact
      req.url "#{@request_client.get_url(environment: CandidApi,
                                         request_options: request_options)}/api/encounters/v4"
    end
    CandidApiClient::Encounters::V4::Types::Encounter.from_json(json_object: response.body)
  end
end

#create_from_pre_encounter_patient(request:, request_options: nil) ⇒ CandidApiClient::Encounters::V4::Types::Encounter

Create an encounter from a pre-encounter patient and appointment. This endpoint

is intended to be used by consumers who are managing
patients and appointments in the pre-encounter service and is currently under
development. Consumers who are not taking advantage
of the pre-encounter service should use the standard create endpoint.
The endpoint will create an encounter from the provided fields, pulling
information from the provided patient and appointment objects
where applicable. In particular, the following fields are populated from the
patient and appointment objects:
- Patient
- Referring Provider
- Subscriber Primary
- Subscriber Secondary
- Referral Number
- Responsible Party
- Guarantor
Utilizing this endpoint opts you into automatic updating of the encounter when
the patient or appointment is updated, assuming the
encounter has not already been submitted or adjudicated.

Examples:

api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
api.encounters.v_4.create_from_pre_encounter_patient(request: { external_id: "external_id", patient_authorized_release: true, benefits_assigned_to_provider: true, provider_accepts_assignment: true, billable_status: BILLABLE, pre_encounter_patient_id: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", pre_encounter_appointment_ids: ["d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32"], billing_provider: { address: { address_1: "address1", city: "city", state: AA, zip_code: "zip_code", zip_plus_four_code: "zip_plus_four_code" }, tax_id: "tax_id", npi: "npi" }, rendering_provider: { npi: "npi" }, diagnoses: [{ code_type: ABF, code: "code" }, { code_type: ABF, code: "code" }], place_of_service_code: PHARMACY })

Parameters:

  • request (Hash)

    Request of type CandidApiClient::Encounters::V4::Types::EncounterCreateFromPreEncounter, as a Hash

    • :pre_encounter_patient_id (String)

    • :pre_encounter_appointment_ids (Array<String>)

    • :billing_provider (Hash)

      • :address (Hash)

        • :zip_plus_four_code (String)

        • :address_1 (String)

        • :address_2 (String)

        • :city (String)

        • :state (CandidApiClient::Commons::Types::State)

        • :zip_code (String)

      • :tax_id (String)

      • :npi (String)

      • :taxonomy_code (String)

      • :provider_commercial_license_type (CandidApiClient::Commons::Types::BillingProviderCommercialLicenseType)

      • :first_name (String)

      • :last_name (String)

      • :organization_name (String)

    • :rendering_provider (Hash)

      • :npi (String)

      • :taxonomy_code (String)

      • :address (Hash)

        • :zip_plus_four_code (String)

        • :address_1 (String)

        • :address_2 (String)

        • :city (String)

        • :state (CandidApiClient::Commons::Types::State)

        • :zip_code (String)

      • :first_name (String)

      • :last_name (String)

      • :organization_name (String)

    • :initial_referring_provider (Hash)

      • :npi (String)

      • :taxonomy_code (String)

      • :address (Hash)

        • :zip_plus_four_code (String)

        • :address_1 (String)

        • :address_2 (String)

        • :city (String)

        • :state (CandidApiClient::Commons::Types::State)

        • :zip_code (String)

      • :qualifier (CandidApiClient::Commons::Types::QualifierCode)

      • :first_name (String)

      • :last_name (String)

      • :organization_name (String)

    • :supervising_provider (Hash)

      • :npi (String)

      • :taxonomy_code (String)

      • :address (Hash)

        • :zip_plus_four_code (String)

        • :address_1 (String)

        • :address_2 (String)

        • :city (String)

        • :state (CandidApiClient::Commons::Types::State)

        • :zip_code (String)

      • :first_name (String)

      • :last_name (String)

      • :organization_name (String)

    • :service_facility (Hash)

      • :organization_name (String)

      • :npi (String)

      • :address (Hash)

        • :zip_plus_four_code (String)

        • :address_1 (String)

        • :address_2 (String)

        • :city (String)

        • :state (CandidApiClient::Commons::Types::State)

        • :zip_code (String)

      • :secondary_identification (String)

    • :diagnoses (Array<CandidApiClient::Diagnoses::Types::DiagnosisCreate>)

    • :clinical_notes (Array<CandidApiClient::Encounters::V4::Types::ClinicalNoteCategoryCreate>)

    • :billing_notes (Array<CandidApiClient::BillingNotes::V2::Types::BillingNoteBase>)

    • :place_of_service_code (CandidApiClient::Commons::Types::FacilityTypeCode)

    • :patient_histories (Array<CandidApiClient::Encounters::V4::Types::PatientHistoryCategory>)

    • :service_lines (Array<CandidApiClient::ServiceLines::V2::Types::ServiceLineCreate>)

    • :external_claim_submission (Hash)

      • :claim_created_at (DateTime)

      • :patient_control_number (String)

      • :submission_records (Array<CandidApiClient::ClaimSubmission::V1::Types::ClaimSubmissionRecordCreate>)

    • :tag_ids (Array<String>)

    • :schema_instances (Array<CandidApiClient::CustomSchemas::V1::Types::SchemaInstance>)

    • :external_id (String)

    • :date_of_service (Date)

    • :end_date_of_service (Date)

    • :patient_authorized_release (Boolean)

    • :benefits_assigned_to_provider (Boolean)

    • :provider_accepts_assignment (Boolean)

    • :appointment_type (String)

    • :existing_medications (Array<CandidApiClient::Encounters::V4::Types::Medication>)

    • :vitals (Hash)

      • :height_in (Integer)

      • :weight_lbs (Integer)

      • :blood_pressure_systolic_mmhg (Integer)

      • :blood_pressure_diastolic_mmhg (Integer)

      • :body_temperature_f (Float)

      • :hemoglobin_gdl (Float)

      • :hematocrit_pct (Float)

    • :interventions (Array<CandidApiClient::Encounters::V4::Types::Intervention>)

    • :pay_to_address (Hash)

      • :zip_plus_four_code (String)

      • :address_1 (String)

      • :address_2 (String)

      • :city (String)

      • :state (CandidApiClient::Commons::Types::State)

      • :zip_code (String)

    • :synchronicity (CandidApiClient::Encounters::V4::Types::SynchronicityType)

    • :billable_status (CandidApiClient::Encounters::V4::Types::BillableStatusType)

    • :additional_information (String)

    • :service_authorization_exception_code (CandidApiClient::Encounters::V4::Types::ServiceAuthorizationExceptionCode)

    • :admission_date (Date)

    • :discharge_date (Date)

    • :onset_of_current_illness_or_symptom_date (Date)

    • :last_menstrual_period_date (Date)

    • :delay_reason_code (CandidApiClient::Commons::Types::DelayReasonCode)

  • request_options (CandidApiClient::RequestOptions) (defaults to: nil)

Returns:



1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
# File 'lib/candidhealth/encounters/v_4/client.rb', line 1994

def create_from_pre_encounter_patient(request:, request_options: nil)
  Async do
    response = @request_client.conn.post do |req|
      req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
      req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
      req.headers = {
    **(req.headers || {}),
    **@request_client.get_headers,
    **(request_options&.additional_headers || {})
      }.compact
      req.body = { **(request || {}), **(request_options&.additional_body_parameters || {}) }.compact
      req.url "#{@request_client.get_url(environment: CandidApi,
                                         request_options: request_options)}/api/encounters/v4/create-from-pre-encounter"
    end
    CandidApiClient::Encounters::V4::Types::Encounter.from_json(json_object: response.body)
  end
end

#get(encounter_id:, request_options: nil) ⇒ CandidApiClient::Encounters::V4::Types::Encounter

Examples:

api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
api.encounters.v_4.get(encounter_id: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32")

Parameters:

Returns:



1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
# File 'lib/candidhealth/encounters/v_4/client.rb', line 1337

def get(encounter_id:, request_options: nil)
  Async do
    response = @request_client.conn.get do |req|
      req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
      req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
      req.headers = {
    **(req.headers || {}),
    **@request_client.get_headers,
    **(request_options&.additional_headers || {})
      }.compact
      req.url "#{@request_client.get_url(environment: CandidApi,
                                         request_options: request_options)}/api/encounters/v4/#{encounter_id}"
    end
    CandidApiClient::Encounters::V4::Types::Encounter.from_json(json_object: response.body)
  end
end

#get_all(limit: nil, claim_status: nil, sort: nil, page_token: nil, date_of_service_min: nil, date_of_service_max: nil, primary_payer_names: nil, search_term: nil, external_id: nil, diagnoses_updated_since: nil, tag_ids: nil, work_queue_id: nil, billable_status: nil, responsible_party: nil, owner_of_next_action: nil, patient_external_id: nil, request_options: nil) ⇒ CandidApiClient::Encounters::V4::Types::EncounterPage

Examples:

api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
api.encounters.v_4.get_all(
  limit: 100,
  claim_status: BILLER_RECEIVED,
  sort: CREATED_AT_ASC,
  page_token: "eyJ0b2tlbiI6IjEiLCJwYWdlX3Rva2VuIjoiMiJ9",
  date_of_service_min: DateTime.parse(2019-08-24),
  date_of_service_max: DateTime.parse(2019-08-25),
  primary_payer_names: "Medicare,Medicaid",
  search_term: "doe",
  external_id: "123456",
  diagnoses_updated_since: DateTime.parse(2019-08-24T14:15:22.000Z)
)

Parameters:

  • limit (Integer) (defaults to: nil)

    Maximum number of entities per page, defaults to 100.

  • claim_status (CandidApiClient::Claims::Types::ClaimStatus) (defaults to: nil)

    Indicates the current status of an insurance claim within the billing process.

  • sort (CandidApiClient::Encounters::V4::Types::EncounterSortOptions) (defaults to: nil)

    Defaults to created_at:desc.

  • page_token (String) (defaults to: nil)
  • date_of_service_min (Date) (defaults to: nil)

    Date formatted as YYYY-MM-DD; eg: 2019-08-25.

  • date_of_service_max (Date) (defaults to: nil)

    Date formatted as YYYY-MM-DD; eg: 2019-08-25.

  • primary_payer_names (String) (defaults to: nil)

    Comma delimited string.

  • search_term (String) (defaults to: nil)

    Filter by any of the following fields: encounter_id, claim_id, patient external_id, patient date of birth, patient first name, patient last name, or encounter external id.

  • external_id (String) (defaults to: nil)

    Filter to an exact match on encounter external_id, if one exists.

  • diagnoses_updated_since (DateTime) (defaults to: nil)

    ISO 8601 timestamp; ideally in UTC (although not required): 2019-08-24T14:15:22Z.

  • tag_ids (String) (defaults to: nil)

    Filter by name of tags on encounters.

  • work_queue_id (String) (defaults to: nil)
  • billable_status (CandidApiClient::Encounters::V4::Types::BillableStatusType) (defaults to: nil)

    Defines if the Encounter is to be billed by Candid to the responsible_party. Examples for when this should be set to NOT_BILLABLE include if the Encounter has not occurred yet or if there is no intention of ever billing the responsible_party.

  • responsible_party (CandidApiClient::Encounters::V4::Types::ResponsiblePartyType) (defaults to: nil)

    Defines the party to be billed with the initial balance owed on the claim. Use SELF_PAY if you intend to bill self pay/cash pay.

  • owner_of_next_action (CandidApiClient::Encounters::V4::Types::EncounterOwnerOfNextActionType) (defaults to: nil)

    The party who is responsible for taking the next action on an Encounter, as defined by ownership of open Tasks.

  • patient_external_id (String) (defaults to: nil)

    The patient ID from the external EMR platform for the patient

  • request_options (CandidApiClient::RequestOptions) (defaults to: nil)

Returns:



1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
# File 'lib/candidhealth/encounters/v_4/client.rb', line 1294

def get_all(limit: nil, claim_status: nil, sort: nil, page_token: nil, date_of_service_min: nil,
            date_of_service_max: nil, primary_payer_names: nil, search_term: nil, external_id: nil, diagnoses_updated_since: nil, tag_ids: nil, work_queue_id: nil, billable_status: nil, responsible_party: nil, owner_of_next_action: nil, patient_external_id: nil, request_options: nil)
  Async do
    response = @request_client.conn.get do |req|
      req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
      req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
      req.headers = {
    **(req.headers || {}),
    **@request_client.get_headers,
    **(request_options&.additional_headers || {})
      }.compact
      req.params = {
        **(request_options&.additional_query_parameters || {}),
        "limit": limit,
        "claim_status": claim_status,
        "sort": sort,
        "page_token": page_token,
        "date_of_service_min": date_of_service_min,
        "date_of_service_max": date_of_service_max,
        "primary_payer_names": primary_payer_names,
        "search_term": search_term,
        "external_id": external_id,
        "diagnoses_updated_since": diagnoses_updated_since,
        "tag_ids": tag_ids,
        "work_queue_id": work_queue_id,
        "billable_status": billable_status,
        "responsible_party": responsible_party,
        "owner_of_next_action": owner_of_next_action,
        "patient_external_id": patient_external_id
      }.compact
      req.url "#{@request_client.get_url(environment: CandidApi,
                                         request_options: request_options)}/api/encounters/v4"
    end
    CandidApiClient::Encounters::V4::Types::EncounterPage.from_json(json_object: response.body)
  end
end

#update(encounter_id:, benefits_assigned_to_provider: nil, prior_authorization_number: nil, external_id: nil, date_of_service: nil, tag_ids: nil, clinical_notes: nil, billable_status: nil, responsible_party: nil, provider_accepts_assignment: nil, synchronicity: nil, place_of_service_code: nil, appointment_type: nil, end_date_of_service: nil, subscriber_primary: nil, subscriber_secondary: nil, subscriber_tertiary: nil, additional_information: nil, service_authorization_exception_code: nil, admission_date: nil, discharge_date: nil, onset_of_current_illness_or_symptom_date: nil, last_menstrual_period_date: nil, delay_reason_code: nil, patient_authorized_release: nil, schema_instances: nil, vitals: nil, existing_medications: nil, guarantor: nil, referral_number: nil, epsdt_referral: nil, claim_supplemental_information: nil, secondary_payer_carrier_code: nil, additional_properties: nil, _field_set: nil, pay_to_address: nil, diagnosis_ids: nil, initial_referring_provider: nil, referring_provider: nil, patient: nil, rendering_provider: nil, service_facility: nil, supervising_provider: nil, billing_provider: nil, place_of_service_code_as_submitted: nil, request_options: nil) ⇒ CandidApiClient::Encounters::V4::Types::Encounter

Examples:

api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
api.encounters.v_4.update(encounter_id: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32")

Parameters:

  • encounter_id (String)
  • benefits_assigned_to_provider (Boolean) (defaults to: nil)

    Whether this patient has authorized insurance payments to be made to you, not them. If false, patient may receive reimbursement. Box 13 on the CMS-1500 claim form.

  • prior_authorization_number (String) (defaults to: nil)

    Box 23 on the CMS-1500 claim form.

  • external_id (String) (defaults to: nil)

    A client-specified unique ID to associate with this encounter; for example, your internal encounter ID or a Dr. Chrono encounter ID. This field should not contain PHI.

  • date_of_service (Date) (defaults to: nil)

    Date formatted as YYYY-MM-DD; eg: 2019-08-24. This date must be the local date in the timezone where the service occurred. Box 24a on the CMS-1500 claim form. If service occurred over a range of dates, this should be the start date. If service lines have distinct date_of_service values, updating the encounter’s date_of_service will fail. If all service line date_of_service values are the same, updating the encounter’s date_of_service will update all service line date_of_service values.

  • tag_ids (Array<String>) (defaults to: nil)

    Names of tags that should be on the encounter. Note all tags on encounter will be overridden with this list.

  • clinical_notes (Array<Hash>) (defaults to: nil)

    Holds a collection of clinical observations made by healthcare providers during patient encounters.Request of type Array<CandidApiClient::Encounters::V4::Types::ClinicalNoteCategoryCreate>, as a Hash

    * :category (CandidApiClient::Encounters::V4::Types::NoteCategory)
    * :notes (Array<CandidApiClient::Encounters::V4::Types::ClinicalNote>)
    
  • billable_status (CandidApiClient::Encounters::V4::Types::BillableStatusType) (defaults to: nil)

    Defines if the Encounter is to be billed by Candid to the responsible_party. Examples for when this should be set to NOT_BILLABLE include if the Encounter has not occurred yet or if there is no intention of ever billing the responsible_party.

  • responsible_party (CandidApiClient::Encounters::V4::Types::ResponsiblePartyType) (defaults to: nil)

    Defines the party to be billed with the initial balance owed on the claim. Use SELF_PAY if you intend to bill self pay/cash pay.

  • provider_accepts_assignment (Boolean) (defaults to: nil)

    Whether you have accepted the patient’s authorization for insurance payments to be made to you, not them. Box 27 on the CMS-1500 claim form.

  • synchronicity (CandidApiClient::Encounters::V4::Types::SynchronicityType) (defaults to: nil)

    Whether or not this was a synchronous or asynchronous encounter. Asynchronous encounters occur when providers and patients communicate online using forms, instant messaging, or other pre-recorded digital mediums. Synchronous encounters occur in live, real-time settings where the patient interacts directly with the provider, such as over video or a phone call.

  • place_of_service_code (CandidApiClient::Commons::Types::FacilityTypeCode) (defaults to: nil)

    Box 24B on the CMS-1500 claim form. 837p Loop2300, CLM-05-1. 02 for telemedicine, 11 for in-person. Full list //www.cms.gov/Medicare/Coding/place-of-service-codes/Place_of_Service_Code_Set).

  • appointment_type (String) (defaults to: nil)

    Human-readable description of the appointment type (ex: “Acupuncture - Headaches”).

  • end_date_of_service (Date) (defaults to: nil)

    Date formatted as YYYY-MM-DD; eg: 2019-08-25. This date must be the local date in the timezone where the service occurred. If omitted, the Encounter is assumed to be for a single day. Must not be temporally before the date_of_service field. If service lines have distinct end_date_of_service values, updating the encounter’s end_date_of_service will fail. If all service line end_date_of_service values are the same, updating the encounter’s end_date_of_service will update all service line date_of_service values.

  • subscriber_primary (Hash) (defaults to: nil)

    Contains details of the primary insurance subscriber.Request of type CandidApiClient::Individual::Types::SubscriberCreate, as a Hash

    • :insurance_card (Hash)

      • :member_id (String)

      • :payer_name (String)

      • :payer_id (String)

      • :rx_bin (String)

      • :rx_pcn (String)

      • :image_url_front (String)

      • :image_url_back (String)

      • :emr_payer_crosswalk (CandidApiClient::Commons::Types::EmrPayerCrosswalk)

      • :group_number (String)

      • :plan_name (String)

      • :plan_type (CandidApiClient::Commons::Types::SourceOfPaymentCode)

      • :insurance_type (CandidApiClient::Commons::Types::InsuranceTypeCode)

      • :payer_plan_group_id (String)

    • :patient_relationship_to_subscriber_code (CandidApiClient::Commons::Types::PatientRelationshipToInsuredCodeAll)

    • :date_of_birth (Date)

    • :address (Hash)

      • :zip_plus_four_code (String)

      • :address_1 (String)

      • :address_2 (String)

      • :city (String)

      • :state (CandidApiClient::Commons::Types::State)

      • :zip_code (String)

    • :first_name (String)

    • :last_name (String)

    • :gender (CandidApiClient::Individual::Types::Gender)

  • subscriber_secondary (Hash) (defaults to: nil)

    Contains details of the secondary insurance subscriber.Request of type CandidApiClient::Individual::Types::SubscriberCreate, as a Hash

    • :insurance_card (Hash)

      • :member_id (String)

      • :payer_name (String)

      • :payer_id (String)

      • :rx_bin (String)

      • :rx_pcn (String)

      • :image_url_front (String)

      • :image_url_back (String)

      • :emr_payer_crosswalk (CandidApiClient::Commons::Types::EmrPayerCrosswalk)

      • :group_number (String)

      • :plan_name (String)

      • :plan_type (CandidApiClient::Commons::Types::SourceOfPaymentCode)

      • :insurance_type (CandidApiClient::Commons::Types::InsuranceTypeCode)

      • :payer_plan_group_id (String)

    • :patient_relationship_to_subscriber_code (CandidApiClient::Commons::Types::PatientRelationshipToInsuredCodeAll)

    • :date_of_birth (Date)

    • :address (Hash)

      • :zip_plus_four_code (String)

      • :address_1 (String)

      • :address_2 (String)

      • :city (String)

      • :state (CandidApiClient::Commons::Types::State)

      • :zip_code (String)

    • :first_name (String)

    • :last_name (String)

    • :gender (CandidApiClient::Individual::Types::Gender)

  • subscriber_tertiary (Hash) (defaults to: nil)

    Contains details of the tertiary insurance subscriber.Request of type CandidApiClient::Individual::Types::SubscriberCreate, as a Hash

    • :insurance_card (Hash)

      • :member_id (String)

      • :payer_name (String)

      • :payer_id (String)

      • :rx_bin (String)

      • :rx_pcn (String)

      • :image_url_front (String)

      • :image_url_back (String)

      • :emr_payer_crosswalk (CandidApiClient::Commons::Types::EmrPayerCrosswalk)

      • :group_number (String)

      • :plan_name (String)

      • :plan_type (CandidApiClient::Commons::Types::SourceOfPaymentCode)

      • :insurance_type (CandidApiClient::Commons::Types::InsuranceTypeCode)

      • :payer_plan_group_id (String)

    • :patient_relationship_to_subscriber_code (CandidApiClient::Commons::Types::PatientRelationshipToInsuredCodeAll)

    • :date_of_birth (Date)

    • :address (Hash)

      • :zip_plus_four_code (String)

      • :address_1 (String)

      • :address_2 (String)

      • :city (String)

      • :state (CandidApiClient::Commons::Types::State)

      • :zip_code (String)

    • :first_name (String)

    • :last_name (String)

    • :gender (CandidApiClient::Individual::Types::Gender)

  • additional_information (String) (defaults to: nil)

    Defines additional information on the claim needed by the payer. Box 19 on the CMS-1500 claim form.

  • service_authorization_exception_code (CandidApiClient::Encounters::V4::Types::ServiceAuthorizationExceptionCode) (defaults to: nil)

    837p Loop2300 REF*4N Required when mandated by government law or regulation to obtain authorization for specific service(s) but, for the reasons listed in one of the enum values of ServiceAuthorizationExceptionCode, the service was performed without obtaining the authorization.

  • admission_date (Date) (defaults to: nil)

    837p Loop2300 DTP*435, CMS-1500 Box 18 Required on all ambulance claims when the patient was known to be admitted to the hospital. OR Required on all claims involving inpatient medical visits.

  • discharge_date (Date) (defaults to: nil)

    837p Loop2300 DTP*096, CMS-1500 Box 18 Required for inpatient claims when the patient was discharged from the facility and the discharge date is known.

  • onset_of_current_illness_or_symptom_date (Date) (defaults to: nil)

    837p Loop2300 DTP*431, CMS-1500 Box 14 Required for the initial medical service or visit performed in response to a medical emergency when the date is available and is different than the date of service. OR This date is the onset of acute symptoms for the current illness or condition.

  • last_menstrual_period_date (Date) (defaults to: nil)

    837p Loop2300 DTP*484, CMS-1500 Box 14 Required when, in the judgment of the provider, the services on this claim are related to the patient’s pregnancy.de

  • delay_reason_code (CandidApiClient::Commons::Types::DelayReasonCode) (defaults to: nil)

    837i Loop2300, CLM-1300 Box 20 Code indicating the reason why a request was delayed

  • patient_authorized_release (Boolean) (defaults to: nil)

    Whether this patient has authorized the release of medical information for billing purpose. Box 12 on the CMS-1500 claim form.

  • schema_instances (Array<Hash>) (defaults to: nil)

    Key-value pairs that must adhere to a schema created via the Custom Schema API. Multiple schema instances cannot be created for the same schema on an encounter. Updating schema instances utilizes PUT semantics, so the schema instances on the encounter will be set to whatever inputs are provided. If null is provided as an input, then the encounter’s schema instances will be cleared.Request of type Array<CandidApiClient::CustomSchemas::V1::Types::SchemaInstance>, as a Hash

    * :schema_id (String)
    * :content (Hash{String => Object})
    
  • vitals (Hash) (defaults to: nil)

    If a vitals entity already exists for the encounter, then all values will be updated to the provided values. Otherwise, a new vitals object will be created for the encounter.Request of type CandidApiClient::Encounters::V4::Types::VitalsUpdate, as a Hash

    * :height_in (Integer)
    * :weight_lbs (Integer)
    * :blood_pressure_systolic_mmhg (Integer)
    * :blood_pressure_diastolic_mmhg (Integer)
    * :body_temperature_f (Float)
    * :hemoglobin_gdl (Float)
    * :hematocrit_pct (Float)
    
  • existing_medications (Array<Hash>) (defaults to: nil)

    Existing medications that should be on the encounter. Note all current existing medications on encounter will be overridden with this list.Request of type Array<CandidApiClient::Encounters::V4::Types::Medication>, as a Hash

    * :name (String)
    * :rx_cui (String)
    * :dosage (String)
    * :dosage_form (String)
    * :frequency (String)
    * :as_needed (Boolean)
    
  • guarantor (Hash) (defaults to: nil)

    Personal and contact info for the guarantor of the patient responsibility.Request of type CandidApiClient::Guarantor::V1::Types::GuarantorUpdate, as a Hash

    • :first_name (String)

    • :last_name (String)

    • :external_id (String)

    • :date_of_birth (Date)

    • :address (Hash)

      • :zip_plus_four_code (String)

      • :address_1 (String)

      • :address_2 (String)

      • :city (String)

      • :state (CandidApiClient::Commons::Types::State)

      • :zip_code (String)

    • :phone_numbers (Array<CandidApiClient::Commons::Types::PhoneNumber>)

    • :phone_consent (Boolean)

    • :email (String)

    • :email_consent (Boolean)

  • referral_number (String) (defaults to: nil)

    Refers to REF*9F on the 837p. Value cannot be greater than 50 characters.

  • epsdt_referral (Hash) (defaults to: nil)

    Refers Box 24H on the CMS1500 form and Loop 2300 CRC - EPSDT Referral on the 837P formRequest of type CandidApiClient::Encounters::V4::Types::EpsdtReferral, as a Hash

    * :condition_indicator_1 (CandidApiClient::Commons::Types::EpsdtReferralConditionIndicatorCode)
    * :condition_indicator_2 (CandidApiClient::Commons::Types::EpsdtReferralConditionIndicatorCode)
    * :condition_indicator_3 (CandidApiClient::Commons::Types::EpsdtReferralConditionIndicatorCode)
    
  • claim_supplemental_information (Array<Hash>) (defaults to: nil)

    Refers to Loop 2300 - Segment PWK on the 837P form. No more than 10 entries are permitted.Request of type Array<CandidApiClient::Encounters::V4::Types::ClaimSupplementalInformation>, as a Hash

    * :attachment_report_type_code (CandidApiClient::Encounters::V4::Types::ReportTypeCode)
    * :attachment_transmission_code (CandidApiClient::Encounters::V4::Types::ReportTransmissionCode)
    * :attachment_control_number (String)
    
  • secondary_payer_carrier_code (String) (defaults to: nil)

    When Medicaid is billed as the secondary payer the Carrier Code is used to identify the primary payer. This is required for certain states.

  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition

  • _field_set (Object) (defaults to: nil)
  • pay_to_address (Hash) (defaults to: nil)

    Specifies the address to which payments for the claim should be sent.Request of type CandidApiClient::Commons::Types::StreetAddressLongZip, as a Hash

    • :zip_plus_four_code (String)

    • :address_1 (String)

    • :address_2 (String)

    • :city (String)

    • :state (CandidApiClient::Commons::Types::State)

    • :zip_code (String)

  • diagnosis_ids (Array<String>) (defaults to: nil)

    Ideally, this field should contain no more than 12 diagnoses. However, more diagnoses may be submitted at this time, and coders will later prioritize the 12 that will be submitted to the payor.

  • initial_referring_provider (Hash) (defaults to: nil)

    The second iteration of Loop ID-2310. Use code “P3 - Primary Care Provider” in this loop to indicate the initial referral from the primary care provider or whatever provider wrote the initial referral for this patient’s episode of care being billed/reported in this transaction.Request of type CandidApiClient::EncounterProviders::V2::Types::InitialReferringProviderUpdate, as a Hash

    * :npi (String)
    * :taxonomy_code (String)
    * :address (Hash)
      * :zip_plus_four_code (String)
      * :address_1 (String)
      * :address_2 (String)
      * :city (String)
      * :state (CandidApiClient::Commons::Types::State)
      * :zip_code (String)
    * :qualifier (CandidApiClient::Commons::Types::QualifierCode)
    * :first_name (String)
    * :last_name (String)
    * :organization_name (String)
    
  • referring_provider (Hash) (defaults to: nil)

    The final provider who referred the services that were rendered. All physicians who order services or refer Medicare beneficiaries must report this data.Request of type CandidApiClient::EncounterProviders::V2::Types::ReferringProviderUpdate, as a Hash

    * :npi (String)
    * :taxonomy_code (String)
    * :address (Hash)
      * :zip_plus_four_code (String)
      * :address_1 (String)
      * :address_2 (String)
      * :city (String)
      * :state (CandidApiClient::Commons::Types::State)
      * :zip_code (String)
    * :first_name (String)
    * :last_name (String)
    * :organization_name (String)
    
  • patient (Hash) (defaults to: nil)

    Contains the identification information of the individual receiving medical services.Request of type CandidApiClient::Individual::Types::PatientUpdate, as a Hash

    * :first_name (String)
    * :last_name (String)
    * :gender (CandidApiClient::Individual::Types::Gender)
    * :external_id (String)
    * :date_of_birth (Date)
    * :address (Hash)
      * :zip_plus_four_code (String)
      * :address_1 (String)
      * :address_2 (String)
      * :city (String)
      * :state (CandidApiClient::Commons::Types::State)
      * :zip_code (String)
    * :phone_numbers (Array<CandidApiClient::Commons::Types::PhoneNumber>)
    * :phone_consent (Boolean)
    * :email (String)
    * :email_consent (Boolean)
    * :non_insurance_payers (Array<String>)
    * :non_insurance_payers_info (Array<CandidApiClient::Individual::Types::PatientNonInsurancePayerInfoCreate>)
    
  • rendering_provider (Hash) (defaults to: nil)

    The rendering provider is the practitioner – physician, nurse practitioner, etc. – performing the service. For telehealth services, the rendering provider performs the visit, asynchronous communication, or other service. The rendering provider address should generally be the same as the service facility address.Request of type CandidApiClient::EncounterProviders::V2::Types::RenderingProviderUpdate, as a Hash

    * :npi (String)
    * :taxonomy_code (String)
    * :address (Hash)
      * :zip_plus_four_code (String)
      * :address_1 (String)
      * :address_2 (String)
      * :city (String)
      * :state (CandidApiClient::Commons::Types::State)
      * :zip_code (String)
    * :first_name (String)
    * :last_name (String)
    * :organization_name (String)
    
  • service_facility (Hash) (defaults to: nil)

    Encounter Service facility is typically the location a medical service was rendered, such as a provider office or hospital. For telehealth, service facility can represent the provider’s location when the service was delivered (e.g., home), or the location where an in-person visit would have taken place, whichever is easier to identify. If the provider is in-network, service facility may be defined in payer contracts. Box 32 on the CMS-1500 claim form. Note that for an in-network claim to be successfully adjudicated, the service facility address listed on claims must match what was provided to the payer during the credentialing process.Request of type CandidApiClient::ServiceFacility::Types::EncounterServiceFacilityUpdate, as a Hash

    * :organization_name (String)
    * :npi (String)
    * :address (Hash)
      * :zip_plus_four_code (String)
      * :address_1 (String)
      * :address_2 (String)
      * :city (String)
      * :state (CandidApiClient::Commons::Types::State)
      * :zip_code (String)
    * :secondary_identification (String)
    
  • supervising_provider (Hash) (defaults to: nil)

    Required when the rendering provider is supervised by a physician. If not required by this implementation guide, do not send.Request of type CandidApiClient::EncounterProviders::V2::Types::SupervisingProviderUpdate, as a Hash

    * :npi (String)
    * :taxonomy_code (String)
    * :address (Hash)
      * :zip_plus_four_code (String)
      * :address_1 (String)
      * :address_2 (String)
      * :city (String)
      * :state (CandidApiClient::Commons::Types::State)
      * :zip_code (String)
    * :first_name (String)
    * :last_name (String)
    * :organization_name (String)
    
  • billing_provider (Hash) (defaults to: nil)

    The billing provider is the provider or business entity submitting the claim. Billing provider may be, but is not necessarily, the same person/NPI as the rendering provider. From a payer’s perspective, this represents the person or entity being reimbursed. When a contract exists with the target payer, the billing provider should be the entity contracted with the payer. In some circumstances, this will be an individual provider. In that case, submit that provider’s NPI and the tax ID (TIN) that the provider gave to the payer during contracting. In other cases, the billing entity will be a medical group. If so, submit the group NPI and the group’s tax ID. Box 33 on the CMS-1500 claim form.Request of type CandidApiClient::EncounterProviders::V2::Types::BillingProviderUpdate, as a Hash

    * :address (Hash)
      * :zip_plus_four_code (String)
      * :address_1 (String)
      * :address_2 (String)
      * :city (String)
      * :state (CandidApiClient::Commons::Types::State)
      * :zip_code (String)
    * :tax_id (String)
    * :npi (String)
    * :taxonomy_code (String)
    * :provider_commercial_license_type (CandidApiClient::Commons::Types::BillingProviderCommercialLicenseType)
    * :first_name (String)
    * :last_name (String)
    * :organization_name (String)
    
  • place_of_service_code_as_submitted (CandidApiClient::Commons::Types::FacilityTypeCode) (defaults to: nil)

    Box 24B on the CMS-1500 claim form. 837p Loop2300, CLM-05-1. 02 for telemedicine, 11 for in-person. Full list //www.cms.gov/Medicare/Coding/place-of-service-codes/Place_of_Service_Code_Set).

  • request_options (CandidApiClient::RequestOptions) (defaults to: nil)

Returns:



2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
# File 'lib/candidhealth/encounters/v_4/client.rb', line 2376

def update(encounter_id:, benefits_assigned_to_provider: nil, prior_authorization_number: nil,
           external_id: nil, date_of_service: nil, tag_ids: nil, clinical_notes: nil, billable_status: nil, responsible_party: nil, provider_accepts_assignment: nil, synchronicity: nil, place_of_service_code: nil, appointment_type: nil, end_date_of_service: nil, subscriber_primary: nil, subscriber_secondary: nil, subscriber_tertiary: nil, additional_information: nil, service_authorization_exception_code: nil, admission_date: nil, discharge_date: nil, onset_of_current_illness_or_symptom_date: nil, last_menstrual_period_date: nil, delay_reason_code: nil, patient_authorized_release: nil, schema_instances: nil, vitals: nil, existing_medications: nil, guarantor: nil, referral_number: nil, epsdt_referral: nil, claim_supplemental_information: nil, secondary_payer_carrier_code: nil, additional_properties: nil, _field_set: nil, pay_to_address: nil, diagnosis_ids: nil, initial_referring_provider: nil, referring_provider: nil, patient: nil, rendering_provider: nil, service_facility: nil, supervising_provider: nil, billing_provider: nil, place_of_service_code_as_submitted: nil, request_options: nil)
  Async do
    response = @request_client.conn.patch do |req|
      req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
      req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
      req.headers = {
    **(req.headers || {}),
    **@request_client.get_headers,
    **(request_options&.additional_headers || {})
      }.compact
      req.body = {
        **(request_options&.additional_body_parameters || {}),
        benefits_assigned_to_provider: benefits_assigned_to_provider,
        prior_authorization_number: prior_authorization_number,
        external_id: external_id,
        date_of_service: date_of_service,
        tag_ids: tag_ids,
        clinical_notes: clinical_notes,
        billable_status: billable_status,
        responsible_party: responsible_party,
        provider_accepts_assignment: provider_accepts_assignment,
        synchronicity: synchronicity,
        place_of_service_code: place_of_service_code,
        appointment_type: appointment_type,
        end_date_of_service: end_date_of_service,
        subscriber_primary: subscriber_primary,
        subscriber_secondary: subscriber_secondary,
        subscriber_tertiary: subscriber_tertiary,
        additional_information: additional_information,
        service_authorization_exception_code: service_authorization_exception_code,
        admission_date: admission_date,
        discharge_date: discharge_date,
        onset_of_current_illness_or_symptom_date: onset_of_current_illness_or_symptom_date,
        last_menstrual_period_date: last_menstrual_period_date,
        delay_reason_code: delay_reason_code,
        patient_authorized_release: patient_authorized_release,
        schema_instances: schema_instances,
        vitals: vitals,
        existing_medications: existing_medications,
        guarantor: guarantor,
        referral_number: referral_number,
        epsdt_referral: epsdt_referral,
        claim_supplemental_information: claim_supplemental_information,
        secondary_payer_carrier_code: secondary_payer_carrier_code,
        additional_properties: additional_properties,
        _field_set: _field_set,
        pay_to_address: pay_to_address,
        diagnosis_ids: diagnosis_ids,
        initial_referring_provider: initial_referring_provider,
        referring_provider: referring_provider,
        patient: patient,
        rendering_provider: rendering_provider,
        service_facility: service_facility,
        supervising_provider: supervising_provider,
        billing_provider: billing_provider,
        place_of_service_code_as_submitted: 
      }.compact
      req.url "#{@request_client.get_url(environment: CandidApi,
                                         request_options: request_options)}/api/encounters/v4/#{encounter_id}"
    end
    CandidApiClient::Encounters::V4::Types::Encounter.from_json(json_object: response.body)
  end
end