Class: CandidApiClient::Encounters::V4::V4Client

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::V4Client

Parameters:



57
58
59
# File 'lib/candidhealth/encounters/v_4/client.rb', line 57

def initialize(request_client:)
  @request_client = request_client
end

Instance Attribute Details

#request_clientCandidApiClient::RequestClient (readonly)



53
54
55
# File 'lib/candidhealth/encounters/v_4/client.rb', line 53

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, 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, 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: { phone_numbers: [{ number: "1234567890", type: HOME }], phone_consent: true, email: "[email protected]", non_insurance_payers: ["d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32"], non_insurance_payers_info: [{ non_insurance_payer_id: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", member_id: "string" }], email_consent: true, external_id: "string", date_of_birth: DateTime.parse(2023-01-15), address: { address_1: "123 Main St", address_2: "Apt 1", city: "New York", state: NY, zip_code: "10001", zip_plus_four_code: "1234" }, first_name: "string", last_name: "string", gender: MALE },
  billing_provider: { address: { address_1: "123 Main St", address_2: "Apt 1", city: "New York", state: NY, zip_code: "10001", zip_plus_four_code: "1234" }, tax_id: "string", npi: "string", taxonomy_code: "string", first_name: "string", last_name: "string", organization_name: "string" },
  rendering_provider: { npi: "string", taxonomy_code: "string", address: { address_1: "123 Main St", address_2: "Apt 1", city: "New York", state: NY, zip_code: "10001", zip_plus_four_code: "1234" }, first_name: "string", last_name: "string", organization_name: "string" },
  referring_provider: { npi: "string", taxonomy_code: "string", address: { address_1: "123 Main St", address_2: "Apt 1", city: "New York", state: NY, zip_code: "10001", zip_plus_four_code: "1234" }, first_name: "string", last_name: "string", organization_name: "string" },
  initial_referring_provider: { npi: "string", taxonomy_code: "string", address: { address_1: "123 Main St", address_2: "Apt 1", city: "New York", state: NY, zip_code: "10001", zip_plus_four_code: "1234" }, qualifier: DQ, first_name: "string", last_name: "string", organization_name: "string" },
  supervising_provider: { npi: "string", taxonomy_code: "string", address: { address_1: "123 Main St", address_2: "Apt 1", city: "New York", state: NY, zip_code: "10001", zip_plus_four_code: "1234" }, first_name: "string", last_name: "string", organization_name: "string" },
  service_facility: { organization_name: "string", npi: "string", address: { address_1: "123 Main St", address_2: "Apt 1", city: "New York", state: NY, zip_code: "10001", zip_plus_four_code: "1234" } },
  subscriber_primary: { insurance_card: { 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: HEALTHIE, group_number: "string", plan_name: "string", plan_type: SELF_PAY, insurance_type: C_01 }, patient_relationship_to_subscriber_code: SPOUSE, date_of_birth: DateTime.parse(2023-01-15), address: { address_1: "123 Main St", address_2: "Apt 1", city: "New York", state: NY, zip_code: "10001", zip_plus_four_code: "1234" }, first_name: "string", last_name: "string", gender: MALE },
  subscriber_secondary: { insurance_card: { 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: HEALTHIE, group_number: "string", plan_name: "string", plan_type: SELF_PAY, insurance_type: C_01 }, patient_relationship_to_subscriber_code: SPOUSE, date_of_birth: DateTime.parse(2023-01-15), address: { address_1: "123 Main St", address_2: "Apt 1", city: "New York", state: NY, zip_code: "10001", zip_plus_four_code: "1234" }, first_name: "string", last_name: "string", gender: MALE },
  prior_authorization_number: "string",
  responsible_party: INSURANCE_PAY,
  diagnoses: [{ name: "string", code_type: ABF, code: "string" }],
  clinical_notes: [{ category: CLINICAL, notes: [{ text: "string", author_name: "string", author_npi: "string", timestamp: DateTime.parse(2024-01-15T09:30:00.000Z) }] }],
  billing_notes: [{ text: "string" }],
  place_of_service_code: PHARMACY,
  patient_histories: [{ category: PRESENT_ILLNESS, questions: [{ id: "6E7FBCE4-A8EA-46D0-A8D8-FF83CA3BB176", text: "Do you have any allergies?", responses: [{ response: "No allergies", follow_ups: [{ id: "4F3D57F9-AC94-49D6-87E4-E804B709917A", text: "Do you have any allergies?", response: "No allergies" }] }] }] }],
  service_lines: [{ modifiers: [TWENTY_TWO], procedure_code: "string", quantity: "string", units: MJ, charge_amount_cents: 1, diagnosis_pointers: [1], drug_identification: { service_id_qualifier: EAN_UCC_13, national_drug_code: "string", national_drug_unit_count: "string", measurement_unit_code: MILLILITERS, link_sequence_number: "string", pharmacy_prescription_number: "string", conversion_formula: "string", drug_description: "string" }, place_of_service_code: PHARMACY, description: "string", date_of_service: DateTime.parse(2023-01-15), end_date_of_service: DateTime.parse(2023-01-15), ordering_provider: { npi: "string", taxonomy_code: "string", address: { address_1: "123 Main St", address_2: "Apt 1", city: "New York", state: NY, zip_code: "10001", zip_plus_four_code: "1234" }, first_name: "string", last_name: "string", organization_name: "string" }, test_results: [{ value: 1.1, result_type: HEMATOCRIT }] }],
  guarantor: { phone_numbers: [{ number: "1234567890", type: HOME }], phone_consent: true, email: "[email protected]", email_consent: true, first_name: "string", last_name: "string", external_id: "string", date_of_birth: DateTime.parse(2023-01-15), address: { address_1: "123 Main St", address_2: "Apt 1", city: "New York", state: NY, zip_code: "10001", zip_plus_four_code: "1234" } },
  external_claim_submission: { claim_created_at: DateTime.parse(2023-01-01T12:00:00.000Z), patient_control_number: "PATIENT_CONTROL_NUMBER", submission_records: [{ submitted_at: DateTime.parse(2023-01-01T13:00:00.000Z), claim_frequency_code: ORIGINAL, payer_responsibility: PRIMARY, intended_submission_medium: ELECTRONIC }, { submitted_at: DateTime.parse(2023-01-04T12:00:00.000Z), claim_frequency_code: REPLACEMENT, payer_responsibility: PRIMARY, intended_submission_medium: PAPER }] },
  tag_ids: ["string"],
  schema_instances: [{ schema_id: "ec096b13-f80a-471d-aaeb-54b021c9d582", content: { "provider_category": "internist", "is_urgent_care": true, "bmi": 24.2, "age": 38 } }],
  referral_number: "string"
)

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)
    * :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)
    
  • 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)
    * :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)

    • :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. Line-level place of service is not currently supported. 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>)
    * :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)

    ***This field is in beta.*** 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.

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

Returns:



562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
# File 'lib/candidhealth/encounters/v_4/client.rb', line 562

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, 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, request_options: nil)
  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,
      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
    }.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

#create_from_pre_encounter_patient(external_id:, patient_authorized_release:, benefits_assigned_to_provider:, provider_accepts_assignment:, billable_status:, pre_encounter_patient_id:, pre_encounter_appointment_ids:, billing_provider:, rendering_provider:, 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, initial_referring_provider: nil, supervising_provider: nil, service_facility: nil, clinical_notes: nil, billing_notes: nil, patient_histories: nil, service_lines: nil, external_claim_submission: nil, tag_ids: nil, schema_instances: nil, 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(
  pre_encounter_patient_id: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32",
  pre_encounter_appointment_ids: ["d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32"],
  billing_provider: { address: { address_1: "123 Main St", address_2: "Apt 1", city: "New York", state: NY, zip_code: "10001", zip_plus_four_code: "1234" }, tax_id: "string", npi: "string", taxonomy_code: "string", first_name: "string", last_name: "string", organization_name: "string" },
  rendering_provider: { npi: "string", taxonomy_code: "string", address: { address_1: "123 Main St", address_2: "Apt 1", city: "New York", state: NY, zip_code: "10001", zip_plus_four_code: "1234" }, first_name: "string", last_name: "string", organization_name: "string" },
  initial_referring_provider: { npi: "string", taxonomy_code: "string", address: { address_1: "123 Main St", address_2: "Apt 1", city: "New York", state: NY, zip_code: "10001", zip_plus_four_code: "1234" }, qualifier: DQ, first_name: "string", last_name: "string", organization_name: "string" },
  supervising_provider: { npi: "string", taxonomy_code: "string", address: { address_1: "123 Main St", address_2: "Apt 1", city: "New York", state: NY, zip_code: "10001", zip_plus_four_code: "1234" }, first_name: "string", last_name: "string", organization_name: "string" },
  service_facility: { organization_name: "string", npi: "string", address: { address_1: "123 Main St", address_2: "Apt 1", city: "New York", state: NY, zip_code: "10001", zip_plus_four_code: "1234" } },
  diagnoses: [{ name: "string", code_type: ABF, code: "string" }],
  clinical_notes: [{ category: CLINICAL, notes: [{ text: "string", author_name: "string", author_npi: "string", timestamp: DateTime.parse(2024-01-15T09:30:00.000Z) }] }],
  billing_notes: [{ text: "string" }],
  place_of_service_code: PHARMACY,
  patient_histories: [{ category: PRESENT_ILLNESS, questions: [{ id: "6E7FBCE4-A8EA-46D0-A8D8-FF83CA3BB176", text: "Do you have any allergies?", responses: [{ response: "No allergies", follow_ups: [{ id: "4F3D57F9-AC94-49D6-87E4-E804B709917A", text: "Do you have any allergies?", response: "No allergies" }] }] }] }],
  service_lines: [{ modifiers: [TWENTY_TWO], procedure_code: "string", quantity: "string", units: MJ, charge_amount_cents: 1, diagnosis_pointers: [1], drug_identification: { service_id_qualifier: EAN_UCC_13, national_drug_code: "string", national_drug_unit_count: "string", measurement_unit_code: MILLILITERS, link_sequence_number: "string", pharmacy_prescription_number: "string", conversion_formula: "string", drug_description: "string" }, place_of_service_code: PHARMACY, description: "string", date_of_service: DateTime.parse(2023-01-15), end_date_of_service: DateTime.parse(2023-01-15), ordering_provider: { npi: "string", taxonomy_code: "string", address: { address_1: "123 Main St", address_2: "Apt 1", city: "New York", state: NY, zip_code: "10001", zip_plus_four_code: "1234" }, first_name: "string", last_name: "string", organization_name: "string" }, test_results: [{ value: 1.1, result_type: HEMATOCRIT }] }],
  external_claim_submission: { claim_created_at: DateTime.parse(2023-01-01T12:00:00.000Z), patient_control_number: "PATIENT_CONTROL_NUMBER", submission_records: [{ submitted_at: DateTime.parse(2023-01-01T13:00:00.000Z), claim_frequency_code: ORIGINAL, payer_responsibility: PRIMARY, intended_submission_medium: ELECTRONIC }, { submitted_at: DateTime.parse(2023-01-04T12:00:00.000Z), claim_frequency_code: REPLACEMENT, payer_responsibility: PRIMARY, intended_submission_medium: PAPER }] },
  tag_ids: ["string"],
  schema_instances: [{ schema_id: "ec096b13-f80a-471d-aaeb-54b021c9d582", content: { "provider_category": "internist", "is_urgent_care": true, "bmi": 24.2, "age": 38 } }]
)

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)
  • pre_encounter_patient_id (String)
  • pre_encounter_appointment_ids (Array<String>)
  • 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)
    * :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)
    
  • 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)
    
  • 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. Line-level place of service is not currently supported. 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>)
    * :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>)
    
  • external_claim_submission (Hash) (defaults to: nil)

    ***This field is in beta.*** 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})
    
  • request_options (CandidApiClient::RequestOptions) (defaults to: nil)

Returns:



932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
# File 'lib/candidhealth/encounters/v_4/client.rb', line 932

def create_from_pre_encounter_patient(external_id:, patient_authorized_release:,
                                      benefits_assigned_to_provider:, provider_accepts_assignment:, billable_status:, pre_encounter_patient_id:, pre_encounter_appointment_ids:, billing_provider:, rendering_provider:, 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, initial_referring_provider: nil, supervising_provider: nil, service_facility: nil, clinical_notes: nil, billing_notes: nil, patient_histories: nil, service_lines: nil, external_claim_submission: nil, tag_ids: nil, schema_instances: nil, request_options: nil)
  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,
      pre_encounter_patient_id: pre_encounter_patient_id,
      pre_encounter_appointment_ids: pre_encounter_appointment_ids,
      billing_provider: billing_provider,
      rendering_provider: rendering_provider,
      initial_referring_provider: initial_referring_provider,
      supervising_provider: supervising_provider,
      service_facility: service_facility,
      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,
      external_claim_submission: external_claim_submission,
      tag_ids: tag_ids,
      schema_instances: schema_instances
    }.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

#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:



143
144
145
146
147
148
149
150
151
152
153
154
155
156
# File 'lib/candidhealth/encounters/v_4/client.rb', line 143

def get(encounter_id:, request_options: nil)
  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

#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:



102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
# File 'lib/candidhealth/encounters/v_4/client.rb', line 102

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)
  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

#update(encounter_id:, prior_authorization_number: nil, external_id: nil, date_of_service: nil, diagnosis_ids: nil, tag_ids: nil, clinical_notes: nil, pay_to_address: nil, billable_status: nil, responsible_party: nil, provider_accepts_assignment: nil, benefits_assigned_to_provider: nil, synchronicity: nil, place_of_service_code: nil, place_of_service_code_as_submitted: nil, appointment_type: nil, end_date_of_service: nil, subscriber_primary: nil, subscriber_secondary: 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: nil, patient_authorized_release: nil, schema_instances: nil, vitals: nil, existing_medications: nil, rendering_provider: nil, service_facility: nil, guarantor: nil, billing_provider: nil, supervising_provider: nil, referring_provider: nil, initial_referring_provider: nil, referral_number: 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",
  prior_authorization_number: "string",
  external_id: "string",
  date_of_service: DateTime.parse(2023-01-15),
  diagnosis_ids: ["d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32"],
  tag_ids: ["string"],
  clinical_notes: [{ category: CLINICAL, notes: [{ text: "string", author_name: "string", author_npi: "string", timestamp: DateTime.parse(2024-01-15T09:30:00.000Z) }] }],
  pay_to_address: { address_1: "123 Main St", address_2: "Apt 1", city: "New York", state: NY, zip_code: "10001", zip_plus_four_code: "1234" },
  billable_status: BILLABLE,
  responsible_party: INSURANCE_PAY,
  provider_accepts_assignment: true,
  benefits_assigned_to_provider: true,
  synchronicity: SYNCHRONOUS,
  place_of_service_code: PHARMACY,
  place_of_service_code_as_submitted: PHARMACY,
  appointment_type: "string",
  end_date_of_service: DateTime.parse(2023-01-15),
  subscriber_primary: { insurance_card: { 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: HEALTHIE, group_number: "string", plan_name: "string", plan_type: SELF_PAY, insurance_type: C_01 }, patient_relationship_to_subscriber_code: SPOUSE, date_of_birth: DateTime.parse(2023-01-15), address: { address_1: "123 Main St", address_2: "Apt 1", city: "New York", state: NY, zip_code: "10001", zip_plus_four_code: "1234" }, first_name: "string", last_name: "string", gender: MALE },
  subscriber_secondary: { insurance_card: { 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: HEALTHIE, group_number: "string", plan_name: "string", plan_type: SELF_PAY, insurance_type: C_01 }, patient_relationship_to_subscriber_code: SPOUSE, date_of_birth: DateTime.parse(2023-01-15), address: { address_1: "123 Main St", address_2: "Apt 1", city: "New York", state: NY, zip_code: "10001", zip_plus_four_code: "1234" }, first_name: "string", last_name: "string", gender: MALE },
  additional_information: "string",
  service_authorization_exception_code: C_1,
  admission_date: DateTime.parse(2023-01-15),
  discharge_date: DateTime.parse(2023-01-15),
  onset_of_current_illness_or_symptom_date: DateTime.parse(2023-01-15),
  last_menstrual_period_date: DateTime.parse(2023-01-15),
  delay_reason_code: C_1,
  patient: { first_name: "string", last_name: "string", gender: MALE, external_id: "string", date_of_birth: DateTime.parse(2023-01-15), address: { address_1: "123 Main St", address_2: "Apt 1", city: "New York", state: NY, zip_code: "10001", zip_plus_four_code: "1234" }, phone_numbers: [{ number: "1234567890", type: HOME }], phone_consent: true, email: "[email protected]", email_consent: true, non_insurance_payers: ["d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32"], non_insurance_payers_info: [{ non_insurance_payer_id: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", member_id: "string" }] },
  patient_authorized_release: true,
  schema_instances: [{ schema_id: "ec096b13-f80a-471d-aaeb-54b021c9d582", content: { "provider_category": "internist", "is_urgent_care": true, "bmi": 24.2, "age": 38 } }],
  vitals: { height_in: 70, weight_lbs: 165, blood_pressure_systolic_mmhg: 115, blood_pressure_diastolic_mmhg: 85, body_temperature_f: 98, hemoglobin_gdl: 15.1, hematocrit_pct: 51.2 },
  existing_medications: [{ name: "Lisinopril", rx_cui: "860975", dosage: "10mg", dosage_form: "Tablet", frequency: "Once Daily", as_needed: true }],
  rendering_provider: { npi: "string", taxonomy_code: "string", address: { address_1: "123 Main St", address_2: "Apt 1", city: "New York", state: NY, zip_code: "10001", zip_plus_four_code: "1234" }, first_name: "string", last_name: "string", organization_name: "string" },
  service_facility: { organization_name: "Test Organization", address: { address_1: "123 Main St", address_2: "Apt 1", city: "New York", state: NY, zip_code: "10001", zip_plus_four_code: "1234" } },
  guarantor: { first_name: "string", last_name: "string", external_id: "string", date_of_birth: DateTime.parse(2023-01-15), address: { address_1: "123 Main St", address_2: "Apt 1", city: "New York", state: NY, zip_code: "10001", zip_plus_four_code: "1234" }, phone_numbers: [{ number: "1234567890", type: HOME }], phone_consent: true, email: "[email protected]", email_consent: true },
  billing_provider: { address: { address_1: "123 Main St", address_2: "Apt 1", city: "New York", state: NY, zip_code: "10001", zip_plus_four_code: "1234" }, tax_id: "string", npi: "string", taxonomy_code: "string", first_name: "string", last_name: "string", organization_name: "string" },
  supervising_provider: { npi: "string", taxonomy_code: "string", address: { address_1: "123 Main St", address_2: "Apt 1", city: "New York", state: NY, zip_code: "10001", zip_plus_four_code: "1234" }, first_name: "string", last_name: "string", organization_name: "string" },
  referring_provider: { npi: "string", taxonomy_code: "string", address: { address_1: "123 Main St", address_2: "Apt 1", city: "New York", state: NY, zip_code: "10001", zip_plus_four_code: "1234" }, first_name: "string", last_name: "string", organization_name: "string" },
  initial_referring_provider: { npi: "string", taxonomy_code: "string", address: { address_1: "123 Main St", address_2: "Apt 1", city: "New York", state: NY, zip_code: "10001", zip_plus_four_code: "1234" }, qualifier: DQ, first_name: "string", last_name: "string", organization_name: "string" },
  referral_number: "string"
)

Parameters:

  • encounter_id (String)
  • 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.

  • 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.

  • 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>)
    
  • 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)

  • 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.

  • 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.

  • 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. Line-level place of service is not currently supported. 02 for telemedicine, 11 for in-person. Full list //www.cms.gov/Medicare/Coding/place-of-service-codes/Place_of_Service_Code_Set).

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

    Box 24B on the CMS-1500 claim form. Line-level place of service is not currently supported. 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)

    • :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)

    • :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.

  • 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 (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>)
    
  • 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)
    
  • 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)
    
  • 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)

  • 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)
    * :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::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)
    
  • 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)
    
  • 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)
    
  • referral_number (String) (defaults to: nil)

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

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

Returns:



1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
# File 'lib/candidhealth/encounters/v_4/client.rb', line 1348

def update(encounter_id:, prior_authorization_number: nil, external_id: nil, date_of_service: nil,
           diagnosis_ids: nil, tag_ids: nil, clinical_notes: nil, pay_to_address: nil, billable_status: nil, responsible_party: nil, provider_accepts_assignment: nil, benefits_assigned_to_provider: nil, synchronicity: nil, place_of_service_code: nil, place_of_service_code_as_submitted: nil, appointment_type: nil, end_date_of_service: nil, subscriber_primary: nil, subscriber_secondary: 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: nil, patient_authorized_release: nil, schema_instances: nil, vitals: nil, existing_medications: nil, rendering_provider: nil, service_facility: nil, guarantor: nil, billing_provider: nil, supervising_provider: nil, referring_provider: nil, initial_referring_provider: nil, referral_number: nil, request_options: nil)
  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 || {}),
      prior_authorization_number: prior_authorization_number,
      external_id: external_id,
      date_of_service: date_of_service,
      diagnosis_ids: diagnosis_ids,
      tag_ids: tag_ids,
      clinical_notes: clinical_notes,
      pay_to_address: pay_to_address,
      billable_status: billable_status,
      responsible_party: responsible_party,
      provider_accepts_assignment: provider_accepts_assignment,
      benefits_assigned_to_provider: benefits_assigned_to_provider,
      synchronicity: synchronicity,
      place_of_service_code: place_of_service_code,
      place_of_service_code_as_submitted: ,
      appointment_type: appointment_type,
      end_date_of_service: end_date_of_service,
      subscriber_primary: subscriber_primary,
      subscriber_secondary: subscriber_secondary,
      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: patient,
      patient_authorized_release: patient_authorized_release,
      schema_instances: schema_instances,
      vitals: vitals,
      existing_medications: existing_medications,
      rendering_provider: rendering_provider,
      service_facility: service_facility,
      guarantor: guarantor,
      billing_provider: billing_provider,
      supervising_provider: supervising_provider,
      referring_provider: referring_provider,
      initial_referring_provider: initial_referring_provider,
      referral_number: referral_number
    }.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