candidhealth 0.33.1 → 0.34.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -150,7 +150,22 @@ module CandidApiClient
150
150
  # @param external_id [String] A client-specified unique ID to associate with this encounter;
151
151
  # for example, your internal encounter ID or a Dr. Chrono encounter ID.
152
152
  # This field should not contain PHI.
153
- # @param prior_authorization_number [String] Box 23 on the CMS-1500 claim form.
153
+ # @param date_of_service [Date] Date formatted as YYYY-MM-DD; eg: 2019-08-24.
154
+ # This date must be the local date in the timezone where the service occurred.
155
+ # Box 24a on the CMS-1500 claim form.
156
+ # If service occurred over a range of dates, this should be the start date.
157
+ # date_of_service must be defined on either the encounter or the service lines but
158
+ # not both.
159
+ # If there are greater than zero service lines, it is recommended to specify
160
+ # date_of_service on the service_line instead of on the encounter to prepare for
161
+ # future API versions.
162
+ # @param end_date_of_service [Date] Date formatted as YYYY-MM-DD; eg: 2019-08-25.
163
+ # This date must be the local date in the timezone where the service occurred.
164
+ # If omitted, the Encounter is assumed to be for a single day.
165
+ # Must not be temporally before the date_of_service field.
166
+ # If there are greater than zero service lines, it is recommended to specify
167
+ # end_date_of_service on the service_line instead of on the encounter to prepare
168
+ # for future API versions.
154
169
  # @param patient_authorized_release [Boolean] Whether this patient has authorized the release of medical information
155
170
  # for billing purpose.
156
171
  # Box 12 on the CMS-1500 claim form.
@@ -160,8 +175,6 @@ module CandidApiClient
160
175
  # @param provider_accepts_assignment [Boolean] Whether you have accepted the patient's authorization for insurance payments
161
176
  # to be made to you, not them.
162
177
  # Box 27 on the CMS-1500 claim form.
163
- # @param appointment_type [String] Human-readable description of the appointment type (ex: "Acupuncture -
164
- # Headaches").
165
178
  # @param existing_medications [Array<Hash>] Request of type Array<CandidApiClient::Encounters::V4::Types::Medication>, as a Hash
166
179
  # * :name (String)
167
180
  # * :rx_cui (String)
@@ -207,7 +220,6 @@ module CandidApiClient
207
220
  # Examples for when this should be set to NOT_BILLABLE include
208
221
  # if the Encounter has not occurred yet or if there is no intention of ever
209
222
  # billing the responsible_party.
210
- # @param responsible_party [CandidApiClient::Encounters::V4::Types::ResponsiblePartyType] Defines the party to be billed with the initial balance owed on the claim.
211
223
  # @param additional_information [String] Defines additional information on the claim needed by the payer.
212
224
  # Box 19 on the CMS-1500 claim form.
213
225
  # @param service_authorization_exception_code [CandidApiClient::Encounters::V4::Types::ServiceAuthorizationExceptionCode] 837p Loop2300 REF\*4N
@@ -237,22 +249,6 @@ module CandidApiClient
237
249
  # Code indicating the reason why a request was delayed
238
250
  # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
239
251
  # @param _field_set [Object]
240
- # @param date_of_service [Date] Date formatted as YYYY-MM-DD; eg: 2019-08-24.
241
- # This date must be the local date in the timezone where the service occurred.
242
- # Box 24a on the CMS-1500 claim form.
243
- # If service occurred over a range of dates, this should be the start date.
244
- # date_of_service must be defined on either the encounter or the service lines but
245
- # not both.
246
- # If there are greater than zero service lines, it is recommended to specify
247
- # date_of_service on the service_line instead of on the encounter to prepare for
248
- # future API versions.
249
- # @param end_date_of_service [Date] Date formatted as YYYY-MM-DD; eg: 2019-08-25.
250
- # This date must be the local date in the timezone where the service occurred.
251
- # If omitted, the Encounter is assumed to be for a single day.
252
- # Must not be temporally before the date_of_service field.
253
- # If there are greater than zero service lines, it is recommended to specify
254
- # end_date_of_service on the service_line instead of on the encounter to prepare
255
- # for future API versions.
256
252
  # @param patient [Hash] Contains the identification information of the individual receiving medical
257
253
  # services.Request of type CandidApiClient::Individual::Types::PatientCreate, as a Hash
258
254
  # * :phone_numbers (Array<CandidApiClient::Commons::Types::PhoneNumber>)
@@ -435,6 +431,10 @@ module CandidApiClient
435
431
  # * :first_name (String)
436
432
  # * :last_name (String)
437
433
  # * :gender (CandidApiClient::Individual::Types::Gender)
434
+ # @param prior_authorization_number [String] Box 23 on the CMS-1500 claim form.
435
+ # @param appointment_type [String] Human-readable description of the appointment type (ex: "Acupuncture -
436
+ # Headaches").
437
+ # @param responsible_party [CandidApiClient::Encounters::V4::Types::ResponsiblePartyType] Defines the party to be billed with the initial balance owed on the claim.
438
438
  # @param diagnoses [Array<Hash>] Ideally, this field should contain no more than 12 diagnoses. However, more
439
439
  # diagnoses
440
440
  # may be submitted at this time, and coders will later prioritize the 12 that will
@@ -524,8 +524,6 @@ module CandidApiClient
524
524
  # @example
525
525
  # api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
526
526
  # api.encounters.v_4.create(
527
- # date_of_service: DateTime.parse(2023-01-15),
528
- # end_date_of_service: DateTime.parse(2023-01-15),
529
527
  # patient: { phone_numbers: [{ number: "1234567890", type: HOME }], phone_consent: true, email: "johndoe@joincandidhealth.com", non_insurance_payers: ["d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32"], 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 },
530
528
  # 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" },
531
529
  # rendering_provider: { address: { address_1: "123 Main St", address_2: "Apt 1", city: "New York", state: NY, zip_code: "10001", zip_plus_four_code: "1234" }, npi: "string", taxonomy_code: "string", first_name: "string", last_name: "string", organization_name: "string" },
@@ -535,6 +533,9 @@ module CandidApiClient
535
533
  # 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" } },
536
534
  # 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 },
537
535
  # 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 },
536
+ # prior_authorization_number: "string",
537
+ # appointment_type: "string",
538
+ # responsible_party: INSURANCE_PAY,
538
539
  # diagnoses: [{ name: "string", code_type: ABF, code: "string" }],
539
540
  # clinical_notes: [{ category: CLINICAL, notes: [{ text: "string", author_name: "string", author_npi: "string", timestamp: DateTime.parse(2024-01-15T09:30:00.000Z) }] }],
540
541
  # billing_notes: [{ text: "string" }],
@@ -547,7 +548,7 @@ module CandidApiClient
547
548
  # schema_instances: [{ schema_id: "ec096b13-f80a-471d-aaeb-54b021c9d582", content: { "provider_category": "internist", "is_urgent_care": true, "bmi": 24.2, "age": 38 } }]
548
549
  # )
549
550
  def create(external_id:, patient_authorized_release:, benefits_assigned_to_provider:,
550
- provider_accepts_assignment:, billable_status:, responsible_party:, patient:, billing_provider:, rendering_provider:, diagnoses:, place_of_service_code:, prior_authorization_number: 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, date_of_service: nil, end_date_of_service: nil, referring_provider: nil, initial_referring_provider: nil, supervising_provider: nil, service_facility: nil, subscriber_primary: nil, subscriber_secondary: 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, request_options: nil)
551
+ 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, 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, appointment_type: 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, request_options: nil)
551
552
  response = @request_client.conn.post do |req|
552
553
  req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
553
554
  req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
@@ -559,18 +560,17 @@ module CandidApiClient
559
560
  req.body = {
560
561
  **(request_options&.additional_body_parameters || {}),
561
562
  external_id: external_id,
562
- prior_authorization_number: prior_authorization_number,
563
+ date_of_service: date_of_service,
564
+ end_date_of_service: end_date_of_service,
563
565
  patient_authorized_release: patient_authorized_release,
564
566
  benefits_assigned_to_provider: benefits_assigned_to_provider,
565
567
  provider_accepts_assignment: provider_accepts_assignment,
566
- appointment_type: appointment_type,
567
568
  existing_medications: existing_medications,
568
569
  vitals: vitals,
569
570
  interventions: interventions,
570
571
  pay_to_address: pay_to_address,
571
572
  synchronicity: synchronicity,
572
573
  billable_status: billable_status,
573
- responsible_party: responsible_party,
574
574
  additional_information: additional_information,
575
575
  service_authorization_exception_code: service_authorization_exception_code,
576
576
  admission_date: admission_date,
@@ -580,8 +580,6 @@ module CandidApiClient
580
580
  delay_reason_code: delay_reason_code,
581
581
  additional_properties: additional_properties,
582
582
  _field_set: _field_set,
583
- date_of_service: date_of_service,
584
- end_date_of_service: end_date_of_service,
585
583
  patient: patient,
586
584
  billing_provider: billing_provider,
587
585
  rendering_provider: rendering_provider,
@@ -591,6 +589,9 @@ module CandidApiClient
591
589
  service_facility: service_facility,
592
590
  subscriber_primary: subscriber_primary,
593
591
  subscriber_secondary: subscriber_secondary,
592
+ prior_authorization_number: prior_authorization_number,
593
+ appointment_type: appointment_type,
594
+ responsible_party: responsible_party,
594
595
  diagnoses: diagnoses,
595
596
  clinical_notes: clinical_notes,
596
597
  billing_notes: billing_notes,
@@ -608,8 +609,27 @@ module CandidApiClient
608
609
  CandidApiClient::Encounters::V4::Types::Encounter.from_json(json_object: response.body)
609
610
  end
610
611
 
611
- # @param encounter_id [String]
612
- # @param prior_authorization_number [String] Box 23 on the CMS-1500 claim form.
612
+ # Create an encounter from a pre-encounter patient and appointment. This endpoint
613
+ # is intended to be used by consumers who are managing
614
+ # patients and appointments in the pre-encounter service and is currently under
615
+ # development. Consumers who are not taking advantage
616
+ # of the pre-encounter service should use the standard create endpoint.
617
+ # The endpoint will create an encounter from the provided fields, pulling
618
+ # information from the provided patient and appointment objects
619
+ # where applicable. In particular, the following fields are populated from the
620
+ # patient and appointment objects:
621
+ # - Patient
622
+ # - Referring Provider
623
+ # - Subscriber Primary
624
+ # - Subscriber Secondary
625
+ # - Prior Authorization Number
626
+ # - Appointment Type
627
+ # - Responsible Party
628
+ # - Guarantor
629
+ # Utilizing this endpoint opts you into automatic updating of the encounter when
630
+ # the patient or appointment is updated, assuming the
631
+ # encounter has not already been submitted or adjudicated.
632
+ #
613
633
  # @param external_id [String] A client-specified unique ID to associate with this encounter;
614
634
  # for example, your internal encounter ID or a Dr. Chrono encounter ID.
615
635
  # This field should not contain PHI.
@@ -617,21 +637,54 @@ module CandidApiClient
617
637
  # This date must be the local date in the timezone where the service occurred.
618
638
  # Box 24a on the CMS-1500 claim form.
619
639
  # If service occurred over a range of dates, this should be the start date.
620
- # If service lines have distinct date_of_service values, updating the encounter's
621
- # date_of_service will fail. If all service line date_of_service values are the
622
- # same, updating the encounter's date_of_service will update all service line
623
- # date_of_service values.
624
- # @param diagnosis_ids [Array<String>] Ideally, this field should contain no more than 12 diagnoses. However, more
625
- # diagnoses
626
- # may be submitted at this time, and coders will later prioritize the 12 that will
627
- # be
628
- # submitted to the payor.
629
- # @param tag_ids [Array<String>] Names of tags that should be on the encounter. Note all tags on encounter will
630
- # be overriden with this list.
631
- # @param clinical_notes [Array<Hash>] Holds a collection of clinical observations made by healthcare providers during
632
- # patient encounters.Request of type Array<CandidApiClient::Encounters::V4::Types::ClinicalNoteCategoryCreate>, as a Hash
633
- # * :category (CandidApiClient::Encounters::V4::Types::NoteCategory)
634
- # * :notes (Array<CandidApiClient::Encounters::V4::Types::ClinicalNote>)
640
+ # date_of_service must be defined on either the encounter or the service lines but
641
+ # not both.
642
+ # If there are greater than zero service lines, it is recommended to specify
643
+ # date_of_service on the service_line instead of on the encounter to prepare for
644
+ # future API versions.
645
+ # @param end_date_of_service [Date] Date formatted as YYYY-MM-DD; eg: 2019-08-25.
646
+ # This date must be the local date in the timezone where the service occurred.
647
+ # If omitted, the Encounter is assumed to be for a single day.
648
+ # Must not be temporally before the date_of_service field.
649
+ # If there are greater than zero service lines, it is recommended to specify
650
+ # end_date_of_service on the service_line instead of on the encounter to prepare
651
+ # for future API versions.
652
+ # @param patient_authorized_release [Boolean] Whether this patient has authorized the release of medical information
653
+ # for billing purpose.
654
+ # Box 12 on the CMS-1500 claim form.
655
+ # @param benefits_assigned_to_provider [Boolean] Whether this patient has authorized insurance payments to be made to you,
656
+ # not them. If false, patient may receive reimbursement.
657
+ # Box 13 on the CMS-1500 claim form.
658
+ # @param provider_accepts_assignment [Boolean] Whether you have accepted the patient's authorization for insurance payments
659
+ # to be made to you, not them.
660
+ # Box 27 on the CMS-1500 claim form.
661
+ # @param existing_medications [Array<Hash>] Request of type Array<CandidApiClient::Encounters::V4::Types::Medication>, as a Hash
662
+ # * :name (String)
663
+ # * :rx_cui (String)
664
+ # * :dosage (String)
665
+ # * :dosage_form (String)
666
+ # * :frequency (String)
667
+ # * :as_needed (Boolean)
668
+ # @param vitals [Hash] Request of type CandidApiClient::Encounters::V4::Types::Vitals, as a Hash
669
+ # * :height_in (Integer)
670
+ # * :weight_lbs (Integer)
671
+ # * :blood_pressure_systolic_mmhg (Integer)
672
+ # * :blood_pressure_diastolic_mmhg (Integer)
673
+ # * :body_temperature_f (Float)
674
+ # * :hemoglobin_gdl (Float)
675
+ # * :hematocrit_pct (Float)
676
+ # @param interventions [Array<Hash>] Request of type Array<CandidApiClient::Encounters::V4::Types::Intervention>, as a Hash
677
+ # * :name (String)
678
+ # * :category (CandidApiClient::Encounters::V4::Types::InterventionCategory)
679
+ # * :description (String)
680
+ # * :medication (Hash)
681
+ # * :name (String)
682
+ # * :rx_cui (String)
683
+ # * :dosage (String)
684
+ # * :dosage_form (String)
685
+ # * :frequency (String)
686
+ # * :as_needed (Boolean)
687
+ # * :labs (Array<CandidApiClient::Encounters::V4::Types::Lab>)
635
688
  # @param pay_to_address [Hash] Specifies the address to which payments for the claim should be sent.Request of type CandidApiClient::Commons::Types::StreetAddressLongZip, as a Hash
636
689
  # * :zip_plus_four_code (String)
637
690
  # * :address_1 (String)
@@ -639,177 +692,230 @@ module CandidApiClient
639
692
  # * :city (String)
640
693
  # * :state (CandidApiClient::Commons::Types::State)
641
694
  # * :zip_code (String)
695
+ # @param synchronicity [CandidApiClient::Encounters::V4::Types::SynchronicityType] Whether or not this was a synchronous or asynchronous encounter.
696
+ # Asynchronous encounters occur when providers and patients communicate online
697
+ # using
698
+ # forms, instant messaging, or other pre-recorded digital mediums.
699
+ # Synchronous encounters occur in live, real-time settings where the patient
700
+ # interacts
701
+ # directly with the provider, such as over video or a phone call.
642
702
  # @param billable_status [CandidApiClient::Encounters::V4::Types::BillableStatusType] Defines if the Encounter is to be billed by Candid to the responsible_party.
643
- # Examples for when this should be set to NOT_BILLABLE include if the Encounter
644
- # has not occurred yet or if there is no intention of ever billing the
645
- # responsible_party.
646
- # @param responsible_party [CandidApiClient::Encounters::V4::Types::ResponsiblePartyType] Defines the party to be billed with the initial balance owed on the claim. Use
647
- # SELF_PAY if you intend to bill self pay/cash pay.
648
- # @param provider_accepts_assignment [Boolean] Whether you have accepted the patient's authorization for insurance payments to
649
- # be made to you, not them. Box 27 on the CMS-1500 claim form.
650
- # @param benefits_assigned_to_provider [Boolean] Whether this patient has authorized insurance payments to be made to you, not
651
- # them. If false, patient may receive reimbursement. Box 13 on the CMS-1500 claim
652
- # form.
653
- # @param synchronicity [CandidApiClient::Encounters::V4::Types::SynchronicityType] Whether or not this was a synchronous or asynchronous encounter. Asynchronous
654
- # encounters occur when providers and patients communicate online using forms,
655
- # instant messaging, or other pre-recorded digital mediums. Synchronous encounters
656
- # occur in live, real-time settings where the patient interacts directly with the
657
- # provider, such as over video or a phone call.
658
- # @param place_of_service_code [CandidApiClient::Commons::Types::FacilityTypeCode] Box 24B on the CMS-1500 claim form. Line-level place of service is not currently
659
- # supported. 02 for telemedicine, 11 for in-person. Full list
660
- # //www.cms.gov/Medicare/Coding/place-of-service-codes/Place_of_Service_Code_Set).
661
- # @param place_of_service_code_as_submitted [CandidApiClient::Commons::Types::FacilityTypeCode] Box 24B on the CMS-1500 claim form. Line-level place of service is not currently
662
- # supported. 02 for telemedicine, 11 for in-person. Full list
663
- # //www.cms.gov/Medicare/Coding/place-of-service-codes/Place_of_Service_Code_Set).
664
- # @param appointment_type [String] Human-readable description of the appointment type (ex: "Acupuncture -
665
- # Headaches").
666
- # @param end_date_of_service [Date] Date formatted as YYYY-MM-DD; eg: 2019-08-25.
667
- # This date must be the local date in the timezone where the service occurred.
668
- # If omitted, the Encounter is assumed to be for a single day.
669
- # Must not be temporally before the date_of_service field.
670
- # If service lines have distinct end_date_of_service values, updating the
671
- # encounter's end_date_of_service will fail. If all service line
672
- # end_date_of_service values are the same, updating the encounter's
673
- # end_date_of_service will update all service line date_of_service values.
674
- # @param subscriber_primary [Hash] Contains details of the primary insurance subscriber.Request of type CandidApiClient::Individual::Types::SubscriberCreate, as a Hash
675
- # * :insurance_card (Hash)
676
- # * :member_id (String)
677
- # * :payer_name (String)
678
- # * :payer_id (String)
679
- # * :rx_bin (String)
680
- # * :rx_pcn (String)
681
- # * :image_url_front (String)
682
- # * :image_url_back (String)
683
- # * :emr_payer_crosswalk (CandidApiClient::Commons::Types::EmrPayerCrosswalk)
684
- # * :group_number (String)
685
- # * :plan_name (String)
686
- # * :plan_type (CandidApiClient::Commons::Types::SourceOfPaymentCode)
687
- # * :insurance_type (CandidApiClient::Commons::Types::InsuranceTypeCode)
688
- # * :patient_relationship_to_subscriber_code (CandidApiClient::Commons::Types::PatientRelationshipToInsuredCodeAll)
689
- # * :date_of_birth (Date)
690
- # * :address (Hash)
691
- # * :zip_plus_four_code (String)
692
- # * :address_1 (String)
693
- # * :address_2 (String)
694
- # * :city (String)
695
- # * :state (CandidApiClient::Commons::Types::State)
696
- # * :zip_code (String)
697
- # * :first_name (String)
698
- # * :last_name (String)
699
- # * :gender (CandidApiClient::Individual::Types::Gender)
700
- # @param subscriber_secondary [Hash] Contains details of the secondary insurance subscriber.Request of type CandidApiClient::Individual::Types::SubscriberCreate, as a Hash
701
- # * :insurance_card (Hash)
702
- # * :member_id (String)
703
- # * :payer_name (String)
704
- # * :payer_id (String)
705
- # * :rx_bin (String)
706
- # * :rx_pcn (String)
707
- # * :image_url_front (String)
708
- # * :image_url_back (String)
709
- # * :emr_payer_crosswalk (CandidApiClient::Commons::Types::EmrPayerCrosswalk)
710
- # * :group_number (String)
711
- # * :plan_name (String)
712
- # * :plan_type (CandidApiClient::Commons::Types::SourceOfPaymentCode)
713
- # * :insurance_type (CandidApiClient::Commons::Types::InsuranceTypeCode)
714
- # * :patient_relationship_to_subscriber_code (CandidApiClient::Commons::Types::PatientRelationshipToInsuredCodeAll)
715
- # * :date_of_birth (Date)
716
- # * :address (Hash)
717
- # * :zip_plus_four_code (String)
718
- # * :address_1 (String)
719
- # * :address_2 (String)
720
- # * :city (String)
721
- # * :state (CandidApiClient::Commons::Types::State)
722
- # * :zip_code (String)
723
- # * :first_name (String)
724
- # * :last_name (String)
725
- # * :gender (CandidApiClient::Individual::Types::Gender)
703
+ # Examples for when this should be set to NOT_BILLABLE include
704
+ # if the Encounter has not occurred yet or if there is no intention of ever
705
+ # billing the responsible_party.
726
706
  # @param additional_information [String] Defines additional information on the claim needed by the payer.
727
707
  # Box 19 on the CMS-1500 claim form.
728
- # @param service_authorization_exception_code [CandidApiClient::Encounters::V4::Types::ServiceAuthorizationExceptionCode] 837p Loop2300 REF*4N
708
+ # @param service_authorization_exception_code [CandidApiClient::Encounters::V4::Types::ServiceAuthorizationExceptionCode] 837p Loop2300 REF\*4N
729
709
  # Required when mandated by government law or regulation to obtain authorization
730
710
  # for specific service(s) but, for the
731
711
  # reasons listed in one of the enum values of ServiceAuthorizationExceptionCode,
732
712
  # the service was performed without
733
713
  # obtaining the authorization.
734
- # @param admission_date [Date] 837p Loop2300 DTP*435, CMS-1500 Box 18
714
+ # @param admission_date [Date] 837p Loop2300 DTP\*435, CMS-1500 Box 18
735
715
  # Required on all ambulance claims when the patient was known to be admitted to
736
716
  # the hospital.
737
717
  # OR
738
718
  # Required on all claims involving inpatient medical visits.
739
- # @param discharge_date [Date] 837p Loop2300 DTP*096, CMS-1500 Box 18
719
+ # @param discharge_date [Date] 837p Loop2300 DTP\*096, CMS-1500 Box 18
740
720
  # Required for inpatient claims when the patient was discharged from the facility
741
721
  # and the discharge date is known.
742
- # @param onset_of_current_illness_or_symptom_date [Date] 837p Loop2300 DTP*431, CMS-1500 Box 14
722
+ # @param onset_of_current_illness_or_symptom_date [Date] 837p Loop2300 DTP\*431, CMS-1500 Box 14
743
723
  # Required for the initial medical service or visit performed in response to a
744
724
  # medical emergency when the date is available and is different than the date of
745
725
  # service.
746
726
  # OR
747
727
  # This date is the onset of acute symptoms for the current illness or condition.
748
- # @param last_menstrual_period_date [Date] 837p Loop2300 DTP*484, CMS-1500 Box 14
728
+ # @param last_menstrual_period_date [Date] 837p Loop2300 DTP\*484, CMS-1500 Box 14
749
729
  # Required when, in the judgment of the provider, the services on this claim are
750
730
  # related to the patient's pregnancy.
751
731
  # @param delay_reason_code [CandidApiClient::Commons::Types::DelayReasonCode] 837i Loop2300, CLM-1300 Box 20
752
732
  # Code indicating the reason why a request was delayed
753
- # @param patient_authorized_release [Boolean] Whether this patient has authorized the release of medical information
754
- # for billing purpose.
755
- # Box 12 on the CMS-1500 claim form.
756
- # @param schema_instances [Array<Hash>] Key-value pairs that must adhere to a schema created via the Custom Schema API.
757
- # Multiple schema
758
- # instances cannot be created for the same schema on an encounter. Updating schema
759
- # instances utilizes PUT
760
- # semantics, so the schema instances on the encounter will be set to whatever
761
- # inputs are provided. If null
762
- # 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
763
- # * :schema_id (String)
764
- # * :content (Hash{String => Object})
765
- # @param vitals [Hash] If a vitals entity already exists for the encounter, then all values will be
766
- # updated to the provided values.
767
- # Otherwise, a new vitals object will be created for the encounter.Request of type CandidApiClient::Encounters::V4::Types::VitalsUpdate, as a Hash
768
- # * :height_in (Integer)
769
- # * :weight_lbs (Integer)
770
- # * :blood_pressure_systolic_mmhg (Integer)
771
- # * :blood_pressure_diastolic_mmhg (Integer)
772
- # * :body_temperature_f (Float)
773
- # * :hemoglobin_gdl (Float)
774
- # * :hematocrit_pct (Float)
775
- # @param request_options [CandidApiClient::RequestOptions]
776
- # @return [CandidApiClient::Encounters::V4::Types::Encounter]
777
- # @example
778
- # api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
779
- # api.encounters.v_4.update(
780
- # encounter_id: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32",
781
- # prior_authorization_number: "string",
782
- # external_id: "string",
783
- # date_of_service: DateTime.parse(2023-01-15),
784
- # diagnosis_ids: ["d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32"],
785
- # tag_ids: ["string"],
733
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
734
+ # @param _field_set [Object]
735
+ # @param pre_encounter_patient_id [String]
736
+ # @param pre_encounter_appointment_id [String]
737
+ # @param billing_provider [Hash] The billing provider is the provider or business entity submitting the claim.
738
+ # Billing provider may be, but is not necessarily, the same person/NPI as the
739
+ # rendering provider. From a payer's perspective, this represents the person or
740
+ # entity being reimbursed. When a contract exists with the target payer, the
741
+ # billing provider should be the entity contracted with the payer. In some
742
+ # circumstances, this will be an individual provider. In that case, submit that
743
+ # provider's NPI and the tax ID (TIN) that the provider gave to the payer during
744
+ # contracting. In other cases, the billing entity will be a medical group. If so,
745
+ # 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
746
+ # * :address (Hash)
747
+ # * :zip_plus_four_code (String)
748
+ # * :address_1 (String)
749
+ # * :address_2 (String)
750
+ # * :city (String)
751
+ # * :state (CandidApiClient::Commons::Types::State)
752
+ # * :zip_code (String)
753
+ # * :tax_id (String)
754
+ # * :npi (String)
755
+ # * :taxonomy_code (String)
756
+ # * :first_name (String)
757
+ # * :last_name (String)
758
+ # * :organization_name (String)
759
+ # @param rendering_provider [Hash] The rendering provider is the practitioner -- physician, nurse practitioner,
760
+ # etc. -- performing the service.
761
+ # For telehealth services, the rendering provider performs the visit, asynchronous
762
+ # communication, or other service. The rendering provider address should generally
763
+ # be the same as the service facility address.Request of type CandidApiClient::EncounterProviders::V2::Types::RenderingProvider, as a Hash
764
+ # * :address (Hash)
765
+ # * :zip_plus_four_code (String)
766
+ # * :address_1 (String)
767
+ # * :address_2 (String)
768
+ # * :city (String)
769
+ # * :state (CandidApiClient::Commons::Types::State)
770
+ # * :zip_code (String)
771
+ # * :npi (String)
772
+ # * :taxonomy_code (String)
773
+ # * :first_name (String)
774
+ # * :last_name (String)
775
+ # * :organization_name (String)
776
+ # @param initial_referring_provider [Hash] The second iteration of Loop ID-2310. Use code "P3 - Primary Care Provider" in
777
+ # this loop to
778
+ # indicate the initial referral from the primary care provider or whatever
779
+ # provider wrote the initial referral for this patient's episode of care being
780
+ # billed/reported in this transaction.Request of type CandidApiClient::EncounterProviders::V2::Types::InitialReferringProvider, as a Hash
781
+ # * :npi (String)
782
+ # * :taxonomy_code (String)
783
+ # * :address (Hash)
784
+ # * :zip_plus_four_code (String)
785
+ # * :address_1 (String)
786
+ # * :address_2 (String)
787
+ # * :city (String)
788
+ # * :state (CandidApiClient::Commons::Types::State)
789
+ # * :zip_code (String)
790
+ # * :qualifier (CandidApiClient::Commons::Types::QualifierCode)
791
+ # * :first_name (String)
792
+ # * :last_name (String)
793
+ # * :organization_name (String)
794
+ # @param supervising_provider [Hash] Required when the rendering provider is supervised by a physician. If not
795
+ # required by this implementation guide, do not send.Request of type CandidApiClient::EncounterProviders::V2::Types::SupervisingProvider, as a Hash
796
+ # * :npi (String)
797
+ # * :taxonomy_code (String)
798
+ # * :address (Hash)
799
+ # * :zip_plus_four_code (String)
800
+ # * :address_1 (String)
801
+ # * :address_2 (String)
802
+ # * :city (String)
803
+ # * :state (CandidApiClient::Commons::Types::State)
804
+ # * :zip_code (String)
805
+ # * :first_name (String)
806
+ # * :last_name (String)
807
+ # * :organization_name (String)
808
+ # @param service_facility [Hash] Encounter Service facility is typically the location a medical service was
809
+ # rendered, such as a provider office or hospital. For telehealth, service
810
+ # facility can represent the provider's location when the service was delivered
811
+ # (e.g., home), or the location where an in-person visit would have taken place,
812
+ # whichever is easier to identify. If the provider is in-network, service facility
813
+ # may be defined in payer contracts. Box 32 on the CMS-1500 claim form. Note that
814
+ # for an in-network claim to be successfully adjudicated, the service facility
815
+ # address listed on claims must match what was provided to the payer during the
816
+ # credentialing process.Request of type CandidApiClient::ServiceFacility::Types::EncounterServiceFacilityBase, as a Hash
817
+ # * :organization_name (String)
818
+ # * :npi (String)
819
+ # * :address (Hash)
820
+ # * :zip_plus_four_code (String)
821
+ # * :address_1 (String)
822
+ # * :address_2 (String)
823
+ # * :city (String)
824
+ # * :state (CandidApiClient::Commons::Types::State)
825
+ # * :zip_code (String)
826
+ # @param diagnoses [Array<Hash>] Ideally, this field should contain no more than 12 diagnoses. However, more
827
+ # diagnoses
828
+ # may be submitted at this time, and coders will later prioritize the 12 that will
829
+ # be
830
+ # submitted to the payor.Request of type Array<CandidApiClient::Diagnoses::Types::DiagnosisCreate>, as a Hash
831
+ # * :name (String)
832
+ # * :code_type (CandidApiClient::Diagnoses::Types::DiagnosisTypeCode)
833
+ # * :code (String)
834
+ # @param clinical_notes [Array<Hash>] Holds a collection of clinical observations made by healthcare providers during
835
+ # patient encounters.Request of type Array<CandidApiClient::Encounters::V4::Types::ClinicalNoteCategoryCreate>, as a Hash
836
+ # * :category (CandidApiClient::Encounters::V4::Types::NoteCategory)
837
+ # * :notes (Array<CandidApiClient::Encounters::V4::Types::ClinicalNote>)
838
+ # @param billing_notes [Array<Hash>] Spot to store misc, human-readable, notes about this encounter to be used
839
+ # in the billing process.Request of type Array<CandidApiClient::BillingNotes::V2::Types::BillingNoteBase>, as a Hash
840
+ # * :text (String)
841
+ # @param place_of_service_code [CandidApiClient::Commons::Types::FacilityTypeCode] Box 24B on the CMS-1500 claim form. Line-level place of service is not currently
842
+ # supported. 02 for telemedicine, 11 for in-person. Full list
843
+ # //www.cms.gov/Medicare/Coding/place-of-service-codes/Place_of_Service_Code_Set).
844
+ # @param patient_histories [Array<Hash>] Request of type Array<CandidApiClient::Encounters::V4::Types::PatientHistoryCategory>, as a Hash
845
+ # * :category (CandidApiClient::Encounters::V4::Types::PatientHistoryCategoryEnum)
846
+ # * :questions (Array<CandidApiClient::Encounters::V4::Types::IntakeQuestion>)
847
+ # @param service_lines [Array<Hash>] Each service line must be linked to a diagnosis. Concretely,
848
+ # `service_line.diagnosis_pointers`must contain at least one entry which should be
849
+ # in bounds of the diagnoses list field.Request of type Array<CandidApiClient::ServiceLines::V2::Types::ServiceLineCreate>, as a Hash
850
+ # * :modifiers (Array<CandidApiClient::Commons::Types::ProcedureModifier>)
851
+ # * :procedure_code (String)
852
+ # * :quantity (String)
853
+ # * :units (CandidApiClient::Commons::Types::ServiceLineUnits)
854
+ # * :charge_amount_cents (Integer)
855
+ # * :diagnosis_pointers (Array<Integer>)
856
+ # * :drug_identification (Hash)
857
+ # * :service_id_qualifier (CandidApiClient::ServiceLines::V2::Types::ServiceIdQualifier)
858
+ # * :national_drug_code (String)
859
+ # * :national_drug_unit_count (String)
860
+ # * :measurement_unit_code (CandidApiClient::ServiceLines::V2::Types::MeasurementUnitCode)
861
+ # * :link_sequence_number (String)
862
+ # * :pharmacy_prescription_number (String)
863
+ # * :conversion_formula (String)
864
+ # * :place_of_service_code (CandidApiClient::Commons::Types::FacilityTypeCode)
865
+ # * :description (String)
866
+ # * :date_of_service (Date)
867
+ # * :end_date_of_service (Date)
868
+ # * :ordering_provider (Hash)
869
+ # * :npi (String)
870
+ # * :taxonomy_code (String)
871
+ # * :address (Hash)
872
+ # * :zip_plus_four_code (String)
873
+ # * :address_1 (String)
874
+ # * :address_2 (String)
875
+ # * :city (String)
876
+ # * :state (CandidApiClient::Commons::Types::State)
877
+ # * :zip_code (String)
878
+ # * :first_name (String)
879
+ # * :last_name (String)
880
+ # * :organization_name (String)
881
+ # @param external_claim_submission [Hash] ***This field is in beta.***
882
+ # To be included for claims that have been submitted outside of Candid.
883
+ # Candid supports posting remits and payments to these claims and working them
884
+ # in-platform (e.g. editing, resubmitting).Request of type CandidApiClient::ClaimSubmission::V1::Types::ExternalClaimSubmissionCreate, as a Hash
885
+ # * :claim_created_at (DateTime)
886
+ # * :patient_control_number (String)
887
+ # * :submission_records (Array<CandidApiClient::ClaimSubmission::V1::Types::ClaimSubmissionRecordCreate>)
888
+ # @param tag_ids [Array<String>] Names of tags that should be on the encounter.
889
+ # @param schema_instances [Array<Hash>] Key-value pairs that must adhere to a schema created via the Custom Schema API.
890
+ # Multiple schema
891
+ # instances cannot be created for the same schema on an encounter.Request of type Array<CandidApiClient::CustomSchemas::V1::Types::SchemaInstance>, as a Hash
892
+ # * :schema_id (String)
893
+ # * :content (Hash{String => Object})
894
+ # @param request_options [CandidApiClient::RequestOptions]
895
+ # @return [CandidApiClient::Encounters::V4::Types::Encounter]
896
+ # @example
897
+ # api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
898
+ # api.encounters.v_4.create_from_pre_encounter_patient(
899
+ # pre_encounter_patient_id: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32",
900
+ # pre_encounter_appointment_id: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32",
901
+ # 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" },
902
+ # rendering_provider: { address: { address_1: "123 Main St", address_2: "Apt 1", city: "New York", state: NY, zip_code: "10001", zip_plus_four_code: "1234" }, npi: "string", taxonomy_code: "string", first_name: "string", last_name: "string", organization_name: "string" },
903
+ # 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" },
904
+ # 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" },
905
+ # 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" } },
906
+ # diagnoses: [{ name: "string", code_type: ABF, code: "string" }],
786
907
  # clinical_notes: [{ category: CLINICAL, notes: [{ text: "string", author_name: "string", author_npi: "string", timestamp: DateTime.parse(2024-01-15T09:30:00.000Z) }] }],
787
- # 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" },
788
- # billable_status: BILLABLE,
789
- # responsible_party: INSURANCE_PAY,
790
- # provider_accepts_assignment: true,
791
- # benefits_assigned_to_provider: true,
792
- # synchronicity: SYNCHRONOUS,
908
+ # billing_notes: [{ text: "string" }],
793
909
  # place_of_service_code: PHARMACY,
794
- # place_of_service_code_as_submitted: PHARMACY,
795
- # appointment_type: "string",
796
- # end_date_of_service: DateTime.parse(2023-01-15),
797
- # 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 },
798
- # 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 },
799
- # additional_information: "string",
800
- # service_authorization_exception_code: C_1,
801
- # admission_date: DateTime.parse(2023-01-15),
802
- # discharge_date: DateTime.parse(2023-01-15),
803
- # onset_of_current_illness_or_symptom_date: DateTime.parse(2023-01-15),
804
- # last_menstrual_period_date: DateTime.parse(2023-01-15),
805
- # delay_reason_code: C_1,
806
- # patient_authorized_release: true,
807
- # schema_instances: [{ schema_id: "ec096b13-f80a-471d-aaeb-54b021c9d582", content: { "provider_category": "internist", "is_urgent_care": true, "bmi": 24.2, "age": 38 } }],
808
- # 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 }
910
+ # 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" }] }] }] }],
911
+ # 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" }, 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" } }],
912
+ # 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 }] },
913
+ # tag_ids: ["string"],
914
+ # schema_instances: [{ schema_id: "ec096b13-f80a-471d-aaeb-54b021c9d582", content: { "provider_category": "internist", "is_urgent_care": true, "bmi": 24.2, "age": 38 } }]
809
915
  # )
810
- def update(encounter_id:, prior_authorization_number: nil, external_id: nil, date_of_service: nil,
811
- 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_authorized_release: nil, schema_instances: nil, vitals: nil, request_options: nil)
812
- response = @request_client.conn.patch do |req|
916
+ def create_from_pre_encounter_patient(external_id:, patient_authorized_release:,
917
+ benefits_assigned_to_provider:, provider_accepts_assignment:, billable_status:, pre_encounter_patient_id:, pre_encounter_appointment_id:, billing_provider:, rendering_provider:, diagnoses:, place_of_service_code:, date_of_service: nil, end_date_of_service: 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)
918
+ response = @request_client.conn.post do |req|
813
919
  req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
814
920
  req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
815
921
  req.headers = {
@@ -819,24 +925,18 @@ module CandidApiClient
819
925
  }.compact
820
926
  req.body = {
821
927
  **(request_options&.additional_body_parameters || {}),
822
- prior_authorization_number: prior_authorization_number,
823
928
  external_id: external_id,
824
929
  date_of_service: date_of_service,
825
- diagnosis_ids: diagnosis_ids,
826
- tag_ids: tag_ids,
827
- clinical_notes: clinical_notes,
828
- pay_to_address: pay_to_address,
829
- billable_status: billable_status,
830
- responsible_party: responsible_party,
831
- provider_accepts_assignment: provider_accepts_assignment,
930
+ end_date_of_service: end_date_of_service,
931
+ patient_authorized_release: patient_authorized_release,
832
932
  benefits_assigned_to_provider: benefits_assigned_to_provider,
933
+ provider_accepts_assignment: provider_accepts_assignment,
934
+ existing_medications: existing_medications,
935
+ vitals: vitals,
936
+ interventions: interventions,
937
+ pay_to_address: pay_to_address,
833
938
  synchronicity: synchronicity,
834
- place_of_service_code: place_of_service_code,
835
- place_of_service_code_as_submitted: place_of_service_code_as_submitted,
836
- appointment_type: appointment_type,
837
- end_date_of_service: end_date_of_service,
838
- subscriber_primary: subscriber_primary,
839
- subscriber_secondary: subscriber_secondary,
939
+ billable_status: billable_status,
840
940
  additional_information: additional_information,
841
941
  service_authorization_exception_code: service_authorization_exception_code,
842
942
  admission_date: admission_date,
@@ -844,114 +944,793 @@ module CandidApiClient
844
944
  onset_of_current_illness_or_symptom_date: onset_of_current_illness_or_symptom_date,
845
945
  last_menstrual_period_date: last_menstrual_period_date,
846
946
  delay_reason_code: delay_reason_code,
847
- patient_authorized_release: patient_authorized_release,
848
- schema_instances: schema_instances,
849
- vitals: vitals
947
+ additional_properties: additional_properties,
948
+ _field_set: _field_set,
949
+ pre_encounter_patient_id: pre_encounter_patient_id,
950
+ pre_encounter_appointment_id: pre_encounter_appointment_id,
951
+ billing_provider: billing_provider,
952
+ rendering_provider: rendering_provider,
953
+ initial_referring_provider: initial_referring_provider,
954
+ supervising_provider: supervising_provider,
955
+ service_facility: service_facility,
956
+ diagnoses: diagnoses,
957
+ clinical_notes: clinical_notes,
958
+ billing_notes: billing_notes,
959
+ place_of_service_code: place_of_service_code,
960
+ patient_histories: patient_histories,
961
+ service_lines: service_lines,
962
+ external_claim_submission: external_claim_submission,
963
+ tag_ids: tag_ids,
964
+ schema_instances: schema_instances
850
965
  }.compact
851
966
  req.url "#{@request_client.get_url(environment: CandidApi,
852
- request_options: request_options)}/api/encounters/v4/#{encounter_id}"
967
+ request_options: request_options)}/api/encounters/v4/create-from-pre-encounter"
853
968
  end
854
969
  CandidApiClient::Encounters::V4::Types::Encounter.from_json(json_object: response.body)
855
970
  end
856
- end
857
-
858
- class AsyncV4Client
859
- # @return [CandidApiClient::AsyncRequestClient]
860
- attr_reader :request_client
861
-
862
- # @param request_client [CandidApiClient::AsyncRequestClient]
863
- # @return [CandidApiClient::Encounters::V4::AsyncV4Client]
864
- def initialize(request_client:)
865
- @request_client = request_client
866
- end
867
971
 
868
- # @param limit [Integer] Maximum number of entities per page, defaults to 100.
869
- # @param claim_status [CandidApiClient::Claims::Types::ClaimStatus] Indicates the current status of an insurance claim within the billing process.
870
- # @param sort [CandidApiClient::Encounters::V4::Types::EncounterSortOptions] Defaults to created_at:desc.
871
- # @param page_token [String]
872
- # @param date_of_service_min [Date] Date formatted as YYYY-MM-DD; eg: 2019-08-25.
873
- # @param date_of_service_max [Date] Date formatted as YYYY-MM-DD; eg: 2019-08-25.
874
- # @param primary_payer_names [String] Comma delimited string.
875
- # @param search_term [String] Filter by any of the following fields: encounter_id, claim_id, patient
876
- # external_id,
877
- # patient date of birth, patient first name, patient last name,
878
- # or encounter external id.
879
- # @param external_id [String] Filter to an exact match on encounter external_id, if one exists.
880
- # @param diagnoses_updated_since [DateTime] ISO 8601 timestamp; ideally in UTC (although not required):
881
- # 2019-08-24T14:15:22Z.
882
- # @param tag_ids [String] Filter by name of tags on encounters.
883
- # @param work_queue_id [String]
972
+ # @param encounter_id [String]
973
+ # @param prior_authorization_number [String] Box 23 on the CMS-1500 claim form.
974
+ # @param external_id [String] A client-specified unique ID to associate with this encounter;
975
+ # for example, your internal encounter ID or a Dr. Chrono encounter ID.
976
+ # This field should not contain PHI.
977
+ # @param date_of_service [Date] Date formatted as YYYY-MM-DD; eg: 2019-08-24.
978
+ # This date must be the local date in the timezone where the service occurred.
979
+ # Box 24a on the CMS-1500 claim form.
980
+ # If service occurred over a range of dates, this should be the start date.
981
+ # If service lines have distinct date_of_service values, updating the encounter's
982
+ # date_of_service will fail. If all service line date_of_service values are the
983
+ # same, updating the encounter's date_of_service will update all service line
984
+ # date_of_service values.
985
+ # @param diagnosis_ids [Array<String>] Ideally, this field should contain no more than 12 diagnoses. However, more
986
+ # diagnoses
987
+ # may be submitted at this time, and coders will later prioritize the 12 that will
988
+ # be
989
+ # submitted to the payor.
990
+ # @param tag_ids [Array<String>] Names of tags that should be on the encounter. Note all tags on encounter will
991
+ # be overriden with this list.
992
+ # @param clinical_notes [Array<Hash>] Holds a collection of clinical observations made by healthcare providers during
993
+ # patient encounters.Request of type Array<CandidApiClient::Encounters::V4::Types::ClinicalNoteCategoryCreate>, as a Hash
994
+ # * :category (CandidApiClient::Encounters::V4::Types::NoteCategory)
995
+ # * :notes (Array<CandidApiClient::Encounters::V4::Types::ClinicalNote>)
996
+ # @param pay_to_address [Hash] Specifies the address to which payments for the claim should be sent.Request of type CandidApiClient::Commons::Types::StreetAddressLongZip, as a Hash
997
+ # * :zip_plus_four_code (String)
998
+ # * :address_1 (String)
999
+ # * :address_2 (String)
1000
+ # * :city (String)
1001
+ # * :state (CandidApiClient::Commons::Types::State)
1002
+ # * :zip_code (String)
884
1003
  # @param billable_status [CandidApiClient::Encounters::V4::Types::BillableStatusType] Defines if the Encounter is to be billed by Candid to the responsible_party.
885
1004
  # Examples for when this should be set to NOT_BILLABLE include if the Encounter
886
1005
  # has not occurred yet or if there is no intention of ever billing the
887
1006
  # responsible_party.
888
1007
  # @param responsible_party [CandidApiClient::Encounters::V4::Types::ResponsiblePartyType] Defines the party to be billed with the initial balance owed on the claim. Use
889
1008
  # SELF_PAY if you intend to bill self pay/cash pay.
890
- # @param owner_of_next_action [CandidApiClient::Encounters::V4::Types::EncounterOwnerOfNextActionType] The party who is responsible for taking the next action on an Encounter, as
891
- # defined by ownership of open Tasks.
892
- # @param patient_external_id [String] The patient ID from the external EMR platform for the patient
1009
+ # @param provider_accepts_assignment [Boolean] Whether you have accepted the patient's authorization for insurance payments to
1010
+ # be made to you, not them. Box 27 on the CMS-1500 claim form.
1011
+ # @param benefits_assigned_to_provider [Boolean] Whether this patient has authorized insurance payments to be made to you, not
1012
+ # them. If false, patient may receive reimbursement. Box 13 on the CMS-1500 claim
1013
+ # form.
1014
+ # @param synchronicity [CandidApiClient::Encounters::V4::Types::SynchronicityType] Whether or not this was a synchronous or asynchronous encounter. Asynchronous
1015
+ # encounters occur when providers and patients communicate online using forms,
1016
+ # instant messaging, or other pre-recorded digital mediums. Synchronous encounters
1017
+ # occur in live, real-time settings where the patient interacts directly with the
1018
+ # provider, such as over video or a phone call.
1019
+ # @param place_of_service_code [CandidApiClient::Commons::Types::FacilityTypeCode] Box 24B on the CMS-1500 claim form. Line-level place of service is not currently
1020
+ # supported. 02 for telemedicine, 11 for in-person. Full list
1021
+ # //www.cms.gov/Medicare/Coding/place-of-service-codes/Place_of_Service_Code_Set).
1022
+ # @param place_of_service_code_as_submitted [CandidApiClient::Commons::Types::FacilityTypeCode] Box 24B on the CMS-1500 claim form. Line-level place of service is not currently
1023
+ # supported. 02 for telemedicine, 11 for in-person. Full list
1024
+ # //www.cms.gov/Medicare/Coding/place-of-service-codes/Place_of_Service_Code_Set).
1025
+ # @param appointment_type [String] Human-readable description of the appointment type (ex: "Acupuncture -
1026
+ # Headaches").
1027
+ # @param end_date_of_service [Date] Date formatted as YYYY-MM-DD; eg: 2019-08-25.
1028
+ # This date must be the local date in the timezone where the service occurred.
1029
+ # If omitted, the Encounter is assumed to be for a single day.
1030
+ # Must not be temporally before the date_of_service field.
1031
+ # If service lines have distinct end_date_of_service values, updating the
1032
+ # encounter's end_date_of_service will fail. If all service line
1033
+ # end_date_of_service values are the same, updating the encounter's
1034
+ # end_date_of_service will update all service line date_of_service values.
1035
+ # @param subscriber_primary [Hash] Contains details of the primary insurance subscriber.Request of type CandidApiClient::Individual::Types::SubscriberCreate, as a Hash
1036
+ # * :insurance_card (Hash)
1037
+ # * :member_id (String)
1038
+ # * :payer_name (String)
1039
+ # * :payer_id (String)
1040
+ # * :rx_bin (String)
1041
+ # * :rx_pcn (String)
1042
+ # * :image_url_front (String)
1043
+ # * :image_url_back (String)
1044
+ # * :emr_payer_crosswalk (CandidApiClient::Commons::Types::EmrPayerCrosswalk)
1045
+ # * :group_number (String)
1046
+ # * :plan_name (String)
1047
+ # * :plan_type (CandidApiClient::Commons::Types::SourceOfPaymentCode)
1048
+ # * :insurance_type (CandidApiClient::Commons::Types::InsuranceTypeCode)
1049
+ # * :patient_relationship_to_subscriber_code (CandidApiClient::Commons::Types::PatientRelationshipToInsuredCodeAll)
1050
+ # * :date_of_birth (Date)
1051
+ # * :address (Hash)
1052
+ # * :zip_plus_four_code (String)
1053
+ # * :address_1 (String)
1054
+ # * :address_2 (String)
1055
+ # * :city (String)
1056
+ # * :state (CandidApiClient::Commons::Types::State)
1057
+ # * :zip_code (String)
1058
+ # * :first_name (String)
1059
+ # * :last_name (String)
1060
+ # * :gender (CandidApiClient::Individual::Types::Gender)
1061
+ # @param subscriber_secondary [Hash] Contains details of the secondary insurance subscriber.Request of type CandidApiClient::Individual::Types::SubscriberCreate, as a Hash
1062
+ # * :insurance_card (Hash)
1063
+ # * :member_id (String)
1064
+ # * :payer_name (String)
1065
+ # * :payer_id (String)
1066
+ # * :rx_bin (String)
1067
+ # * :rx_pcn (String)
1068
+ # * :image_url_front (String)
1069
+ # * :image_url_back (String)
1070
+ # * :emr_payer_crosswalk (CandidApiClient::Commons::Types::EmrPayerCrosswalk)
1071
+ # * :group_number (String)
1072
+ # * :plan_name (String)
1073
+ # * :plan_type (CandidApiClient::Commons::Types::SourceOfPaymentCode)
1074
+ # * :insurance_type (CandidApiClient::Commons::Types::InsuranceTypeCode)
1075
+ # * :patient_relationship_to_subscriber_code (CandidApiClient::Commons::Types::PatientRelationshipToInsuredCodeAll)
1076
+ # * :date_of_birth (Date)
1077
+ # * :address (Hash)
1078
+ # * :zip_plus_four_code (String)
1079
+ # * :address_1 (String)
1080
+ # * :address_2 (String)
1081
+ # * :city (String)
1082
+ # * :state (CandidApiClient::Commons::Types::State)
1083
+ # * :zip_code (String)
1084
+ # * :first_name (String)
1085
+ # * :last_name (String)
1086
+ # * :gender (CandidApiClient::Individual::Types::Gender)
1087
+ # @param additional_information [String] Defines additional information on the claim needed by the payer.
1088
+ # Box 19 on the CMS-1500 claim form.
1089
+ # @param service_authorization_exception_code [CandidApiClient::Encounters::V4::Types::ServiceAuthorizationExceptionCode] 837p Loop2300 REF*4N
1090
+ # Required when mandated by government law or regulation to obtain authorization
1091
+ # for specific service(s) but, for the
1092
+ # reasons listed in one of the enum values of ServiceAuthorizationExceptionCode,
1093
+ # the service was performed without
1094
+ # obtaining the authorization.
1095
+ # @param admission_date [Date] 837p Loop2300 DTP*435, CMS-1500 Box 18
1096
+ # Required on all ambulance claims when the patient was known to be admitted to
1097
+ # the hospital.
1098
+ # OR
1099
+ # Required on all claims involving inpatient medical visits.
1100
+ # @param discharge_date [Date] 837p Loop2300 DTP*096, CMS-1500 Box 18
1101
+ # Required for inpatient claims when the patient was discharged from the facility
1102
+ # and the discharge date is known.
1103
+ # @param onset_of_current_illness_or_symptom_date [Date] 837p Loop2300 DTP*431, CMS-1500 Box 14
1104
+ # Required for the initial medical service or visit performed in response to a
1105
+ # medical emergency when the date is available and is different than the date of
1106
+ # service.
1107
+ # OR
1108
+ # This date is the onset of acute symptoms for the current illness or condition.
1109
+ # @param last_menstrual_period_date [Date] 837p Loop2300 DTP*484, CMS-1500 Box 14
1110
+ # Required when, in the judgment of the provider, the services on this claim are
1111
+ # related to the patient's pregnancy.
1112
+ # @param delay_reason_code [CandidApiClient::Commons::Types::DelayReasonCode] 837i Loop2300, CLM-1300 Box 20
1113
+ # Code indicating the reason why a request was delayed
1114
+ # @param patient_authorized_release [Boolean] Whether this patient has authorized the release of medical information
1115
+ # for billing purpose.
1116
+ # Box 12 on the CMS-1500 claim form.
1117
+ # @param schema_instances [Array<Hash>] Key-value pairs that must adhere to a schema created via the Custom Schema API.
1118
+ # Multiple schema
1119
+ # instances cannot be created for the same schema on an encounter. Updating schema
1120
+ # instances utilizes PUT
1121
+ # semantics, so the schema instances on the encounter will be set to whatever
1122
+ # inputs are provided. If null
1123
+ # 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
1124
+ # * :schema_id (String)
1125
+ # * :content (Hash{String => Object})
1126
+ # @param vitals [Hash] If a vitals entity already exists for the encounter, then all values will be
1127
+ # updated to the provided values.
1128
+ # Otherwise, a new vitals object will be created for the encounter.Request of type CandidApiClient::Encounters::V4::Types::VitalsUpdate, as a Hash
1129
+ # * :height_in (Integer)
1130
+ # * :weight_lbs (Integer)
1131
+ # * :blood_pressure_systolic_mmhg (Integer)
1132
+ # * :blood_pressure_diastolic_mmhg (Integer)
1133
+ # * :body_temperature_f (Float)
1134
+ # * :hemoglobin_gdl (Float)
1135
+ # * :hematocrit_pct (Float)
893
1136
  # @param request_options [CandidApiClient::RequestOptions]
894
- # @return [CandidApiClient::Encounters::V4::Types::EncounterPage]
1137
+ # @return [CandidApiClient::Encounters::V4::Types::Encounter]
895
1138
  # @example
896
1139
  # api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
897
- # api.encounters.v_4.get_all(
898
- # limit: 100,
899
- # claim_status: BILLER_RECEIVED,
900
- # sort: CREATED_AT_ASC,
901
- # page_token: "eyJ0b2tlbiI6IjEiLCJwYWdlX3Rva2VuIjoiMiJ9",
902
- # date_of_service_min: DateTime.parse(2019-08-24),
903
- # date_of_service_max: DateTime.parse(2019-08-25),
904
- # primary_payer_names: "Medicare,Medicaid",
905
- # search_term: "doe",
906
- # external_id: "123456",
907
- # diagnoses_updated_since: DateTime.parse(2019-08-24T14:15:22.000Z)
1140
+ # api.encounters.v_4.update(
1141
+ # encounter_id: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32",
1142
+ # prior_authorization_number: "string",
1143
+ # external_id: "string",
1144
+ # date_of_service: DateTime.parse(2023-01-15),
1145
+ # diagnosis_ids: ["d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32"],
1146
+ # tag_ids: ["string"],
1147
+ # clinical_notes: [{ category: CLINICAL, notes: [{ text: "string", author_name: "string", author_npi: "string", timestamp: DateTime.parse(2024-01-15T09:30:00.000Z) }] }],
1148
+ # 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" },
1149
+ # billable_status: BILLABLE,
1150
+ # responsible_party: INSURANCE_PAY,
1151
+ # provider_accepts_assignment: true,
1152
+ # benefits_assigned_to_provider: true,
1153
+ # synchronicity: SYNCHRONOUS,
1154
+ # place_of_service_code: PHARMACY,
1155
+ # place_of_service_code_as_submitted: PHARMACY,
1156
+ # appointment_type: "string",
1157
+ # end_date_of_service: DateTime.parse(2023-01-15),
1158
+ # 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 },
1159
+ # 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 },
1160
+ # additional_information: "string",
1161
+ # service_authorization_exception_code: C_1,
1162
+ # admission_date: DateTime.parse(2023-01-15),
1163
+ # discharge_date: DateTime.parse(2023-01-15),
1164
+ # onset_of_current_illness_or_symptom_date: DateTime.parse(2023-01-15),
1165
+ # last_menstrual_period_date: DateTime.parse(2023-01-15),
1166
+ # delay_reason_code: C_1,
1167
+ # patient_authorized_release: true,
1168
+ # schema_instances: [{ schema_id: "ec096b13-f80a-471d-aaeb-54b021c9d582", content: { "provider_category": "internist", "is_urgent_care": true, "bmi": 24.2, "age": 38 } }],
1169
+ # 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 }
908
1170
  # )
909
- def get_all(limit: nil, claim_status: nil, sort: nil, page_token: nil, date_of_service_min: nil,
910
- 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)
911
- Async do
912
- response = @request_client.conn.get do |req|
913
- req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
914
- req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
915
- req.headers = {
916
- **(req.headers || {}),
917
- **@request_client.get_headers,
918
- **(request_options&.additional_headers || {})
919
- }.compact
920
- req.params = {
921
- **(request_options&.additional_query_parameters || {}),
922
- "limit": limit,
923
- "claim_status": claim_status,
924
- "sort": sort,
925
- "page_token": page_token,
926
- "date_of_service_min": date_of_service_min,
927
- "date_of_service_max": date_of_service_max,
928
- "primary_payer_names": primary_payer_names,
929
- "search_term": search_term,
930
- "external_id": external_id,
931
- "diagnoses_updated_since": diagnoses_updated_since,
932
- "tag_ids": tag_ids,
933
- "work_queue_id": work_queue_id,
934
- "billable_status": billable_status,
935
- "responsible_party": responsible_party,
936
- "owner_of_next_action": owner_of_next_action,
937
- "patient_external_id": patient_external_id
938
- }.compact
939
- req.url "#{@request_client.get_url(environment: CandidApi,
940
- request_options: request_options)}/api/encounters/v4"
941
- end
942
- CandidApiClient::Encounters::V4::Types::EncounterPage.from_json(json_object: response.body)
943
- end
944
- end
945
-
946
- # @param encounter_id [String]
1171
+ def update(encounter_id:, prior_authorization_number: nil, external_id: nil, date_of_service: nil,
1172
+ 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_authorized_release: nil, schema_instances: nil, vitals: nil, request_options: nil)
1173
+ response = @request_client.conn.patch do |req|
1174
+ req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
1175
+ req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
1176
+ req.headers = {
1177
+ **(req.headers || {}),
1178
+ **@request_client.get_headers,
1179
+ **(request_options&.additional_headers || {})
1180
+ }.compact
1181
+ req.body = {
1182
+ **(request_options&.additional_body_parameters || {}),
1183
+ prior_authorization_number: prior_authorization_number,
1184
+ external_id: external_id,
1185
+ date_of_service: date_of_service,
1186
+ diagnosis_ids: diagnosis_ids,
1187
+ tag_ids: tag_ids,
1188
+ clinical_notes: clinical_notes,
1189
+ pay_to_address: pay_to_address,
1190
+ billable_status: billable_status,
1191
+ responsible_party: responsible_party,
1192
+ provider_accepts_assignment: provider_accepts_assignment,
1193
+ benefits_assigned_to_provider: benefits_assigned_to_provider,
1194
+ synchronicity: synchronicity,
1195
+ place_of_service_code: place_of_service_code,
1196
+ place_of_service_code_as_submitted: place_of_service_code_as_submitted,
1197
+ appointment_type: appointment_type,
1198
+ end_date_of_service: end_date_of_service,
1199
+ subscriber_primary: subscriber_primary,
1200
+ subscriber_secondary: subscriber_secondary,
1201
+ additional_information: additional_information,
1202
+ service_authorization_exception_code: service_authorization_exception_code,
1203
+ admission_date: admission_date,
1204
+ discharge_date: discharge_date,
1205
+ onset_of_current_illness_or_symptom_date: onset_of_current_illness_or_symptom_date,
1206
+ last_menstrual_period_date: last_menstrual_period_date,
1207
+ delay_reason_code: delay_reason_code,
1208
+ patient_authorized_release: patient_authorized_release,
1209
+ schema_instances: schema_instances,
1210
+ vitals: vitals
1211
+ }.compact
1212
+ req.url "#{@request_client.get_url(environment: CandidApi,
1213
+ request_options: request_options)}/api/encounters/v4/#{encounter_id}"
1214
+ end
1215
+ CandidApiClient::Encounters::V4::Types::Encounter.from_json(json_object: response.body)
1216
+ end
1217
+ end
1218
+
1219
+ class AsyncV4Client
1220
+ # @return [CandidApiClient::AsyncRequestClient]
1221
+ attr_reader :request_client
1222
+
1223
+ # @param request_client [CandidApiClient::AsyncRequestClient]
1224
+ # @return [CandidApiClient::Encounters::V4::AsyncV4Client]
1225
+ def initialize(request_client:)
1226
+ @request_client = request_client
1227
+ end
1228
+
1229
+ # @param limit [Integer] Maximum number of entities per page, defaults to 100.
1230
+ # @param claim_status [CandidApiClient::Claims::Types::ClaimStatus] Indicates the current status of an insurance claim within the billing process.
1231
+ # @param sort [CandidApiClient::Encounters::V4::Types::EncounterSortOptions] Defaults to created_at:desc.
1232
+ # @param page_token [String]
1233
+ # @param date_of_service_min [Date] Date formatted as YYYY-MM-DD; eg: 2019-08-25.
1234
+ # @param date_of_service_max [Date] Date formatted as YYYY-MM-DD; eg: 2019-08-25.
1235
+ # @param primary_payer_names [String] Comma delimited string.
1236
+ # @param search_term [String] Filter by any of the following fields: encounter_id, claim_id, patient
1237
+ # external_id,
1238
+ # patient date of birth, patient first name, patient last name,
1239
+ # or encounter external id.
1240
+ # @param external_id [String] Filter to an exact match on encounter external_id, if one exists.
1241
+ # @param diagnoses_updated_since [DateTime] ISO 8601 timestamp; ideally in UTC (although not required):
1242
+ # 2019-08-24T14:15:22Z.
1243
+ # @param tag_ids [String] Filter by name of tags on encounters.
1244
+ # @param work_queue_id [String]
1245
+ # @param billable_status [CandidApiClient::Encounters::V4::Types::BillableStatusType] Defines if the Encounter is to be billed by Candid to the responsible_party.
1246
+ # Examples for when this should be set to NOT_BILLABLE include if the Encounter
1247
+ # has not occurred yet or if there is no intention of ever billing the
1248
+ # responsible_party.
1249
+ # @param responsible_party [CandidApiClient::Encounters::V4::Types::ResponsiblePartyType] Defines the party to be billed with the initial balance owed on the claim. Use
1250
+ # SELF_PAY if you intend to bill self pay/cash pay.
1251
+ # @param owner_of_next_action [CandidApiClient::Encounters::V4::Types::EncounterOwnerOfNextActionType] The party who is responsible for taking the next action on an Encounter, as
1252
+ # defined by ownership of open Tasks.
1253
+ # @param patient_external_id [String] The patient ID from the external EMR platform for the patient
1254
+ # @param request_options [CandidApiClient::RequestOptions]
1255
+ # @return [CandidApiClient::Encounters::V4::Types::EncounterPage]
1256
+ # @example
1257
+ # api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
1258
+ # api.encounters.v_4.get_all(
1259
+ # limit: 100,
1260
+ # claim_status: BILLER_RECEIVED,
1261
+ # sort: CREATED_AT_ASC,
1262
+ # page_token: "eyJ0b2tlbiI6IjEiLCJwYWdlX3Rva2VuIjoiMiJ9",
1263
+ # date_of_service_min: DateTime.parse(2019-08-24),
1264
+ # date_of_service_max: DateTime.parse(2019-08-25),
1265
+ # primary_payer_names: "Medicare,Medicaid",
1266
+ # search_term: "doe",
1267
+ # external_id: "123456",
1268
+ # diagnoses_updated_since: DateTime.parse(2019-08-24T14:15:22.000Z)
1269
+ # )
1270
+ def get_all(limit: nil, claim_status: nil, sort: nil, page_token: nil, date_of_service_min: nil,
1271
+ 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)
1272
+ Async do
1273
+ response = @request_client.conn.get do |req|
1274
+ req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
1275
+ req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
1276
+ req.headers = {
1277
+ **(req.headers || {}),
1278
+ **@request_client.get_headers,
1279
+ **(request_options&.additional_headers || {})
1280
+ }.compact
1281
+ req.params = {
1282
+ **(request_options&.additional_query_parameters || {}),
1283
+ "limit": limit,
1284
+ "claim_status": claim_status,
1285
+ "sort": sort,
1286
+ "page_token": page_token,
1287
+ "date_of_service_min": date_of_service_min,
1288
+ "date_of_service_max": date_of_service_max,
1289
+ "primary_payer_names": primary_payer_names,
1290
+ "search_term": search_term,
1291
+ "external_id": external_id,
1292
+ "diagnoses_updated_since": diagnoses_updated_since,
1293
+ "tag_ids": tag_ids,
1294
+ "work_queue_id": work_queue_id,
1295
+ "billable_status": billable_status,
1296
+ "responsible_party": responsible_party,
1297
+ "owner_of_next_action": owner_of_next_action,
1298
+ "patient_external_id": patient_external_id
1299
+ }.compact
1300
+ req.url "#{@request_client.get_url(environment: CandidApi,
1301
+ request_options: request_options)}/api/encounters/v4"
1302
+ end
1303
+ CandidApiClient::Encounters::V4::Types::EncounterPage.from_json(json_object: response.body)
1304
+ end
1305
+ end
1306
+
1307
+ # @param encounter_id [String]
1308
+ # @param request_options [CandidApiClient::RequestOptions]
1309
+ # @return [CandidApiClient::Encounters::V4::Types::Encounter]
1310
+ # @example
1311
+ # api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
1312
+ # api.encounters.v_4.get(encounter_id: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32")
1313
+ def get(encounter_id:, request_options: nil)
1314
+ Async do
1315
+ response = @request_client.conn.get do |req|
1316
+ req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
1317
+ req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
1318
+ req.headers = {
1319
+ **(req.headers || {}),
1320
+ **@request_client.get_headers,
1321
+ **(request_options&.additional_headers || {})
1322
+ }.compact
1323
+ req.url "#{@request_client.get_url(environment: CandidApi,
1324
+ request_options: request_options)}/api/encounters/v4/#{encounter_id}"
1325
+ end
1326
+ CandidApiClient::Encounters::V4::Types::Encounter.from_json(json_object: response.body)
1327
+ end
1328
+ end
1329
+
1330
+ # @param external_id [String] A client-specified unique ID to associate with this encounter;
1331
+ # for example, your internal encounter ID or a Dr. Chrono encounter ID.
1332
+ # This field should not contain PHI.
1333
+ # @param date_of_service [Date] Date formatted as YYYY-MM-DD; eg: 2019-08-24.
1334
+ # This date must be the local date in the timezone where the service occurred.
1335
+ # Box 24a on the CMS-1500 claim form.
1336
+ # If service occurred over a range of dates, this should be the start date.
1337
+ # date_of_service must be defined on either the encounter or the service lines but
1338
+ # not both.
1339
+ # If there are greater than zero service lines, it is recommended to specify
1340
+ # date_of_service on the service_line instead of on the encounter to prepare for
1341
+ # future API versions.
1342
+ # @param end_date_of_service [Date] Date formatted as YYYY-MM-DD; eg: 2019-08-25.
1343
+ # This date must be the local date in the timezone where the service occurred.
1344
+ # If omitted, the Encounter is assumed to be for a single day.
1345
+ # Must not be temporally before the date_of_service field.
1346
+ # If there are greater than zero service lines, it is recommended to specify
1347
+ # end_date_of_service on the service_line instead of on the encounter to prepare
1348
+ # for future API versions.
1349
+ # @param patient_authorized_release [Boolean] Whether this patient has authorized the release of medical information
1350
+ # for billing purpose.
1351
+ # Box 12 on the CMS-1500 claim form.
1352
+ # @param benefits_assigned_to_provider [Boolean] Whether this patient has authorized insurance payments to be made to you,
1353
+ # not them. If false, patient may receive reimbursement.
1354
+ # Box 13 on the CMS-1500 claim form.
1355
+ # @param provider_accepts_assignment [Boolean] Whether you have accepted the patient's authorization for insurance payments
1356
+ # to be made to you, not them.
1357
+ # Box 27 on the CMS-1500 claim form.
1358
+ # @param existing_medications [Array<Hash>] Request of type Array<CandidApiClient::Encounters::V4::Types::Medication>, as a Hash
1359
+ # * :name (String)
1360
+ # * :rx_cui (String)
1361
+ # * :dosage (String)
1362
+ # * :dosage_form (String)
1363
+ # * :frequency (String)
1364
+ # * :as_needed (Boolean)
1365
+ # @param vitals [Hash] Request of type CandidApiClient::Encounters::V4::Types::Vitals, as a Hash
1366
+ # * :height_in (Integer)
1367
+ # * :weight_lbs (Integer)
1368
+ # * :blood_pressure_systolic_mmhg (Integer)
1369
+ # * :blood_pressure_diastolic_mmhg (Integer)
1370
+ # * :body_temperature_f (Float)
1371
+ # * :hemoglobin_gdl (Float)
1372
+ # * :hematocrit_pct (Float)
1373
+ # @param interventions [Array<Hash>] Request of type Array<CandidApiClient::Encounters::V4::Types::Intervention>, as a Hash
1374
+ # * :name (String)
1375
+ # * :category (CandidApiClient::Encounters::V4::Types::InterventionCategory)
1376
+ # * :description (String)
1377
+ # * :medication (Hash)
1378
+ # * :name (String)
1379
+ # * :rx_cui (String)
1380
+ # * :dosage (String)
1381
+ # * :dosage_form (String)
1382
+ # * :frequency (String)
1383
+ # * :as_needed (Boolean)
1384
+ # * :labs (Array<CandidApiClient::Encounters::V4::Types::Lab>)
1385
+ # @param pay_to_address [Hash] Specifies the address to which payments for the claim should be sent.Request of type CandidApiClient::Commons::Types::StreetAddressLongZip, as a Hash
1386
+ # * :zip_plus_four_code (String)
1387
+ # * :address_1 (String)
1388
+ # * :address_2 (String)
1389
+ # * :city (String)
1390
+ # * :state (CandidApiClient::Commons::Types::State)
1391
+ # * :zip_code (String)
1392
+ # @param synchronicity [CandidApiClient::Encounters::V4::Types::SynchronicityType] Whether or not this was a synchronous or asynchronous encounter.
1393
+ # Asynchronous encounters occur when providers and patients communicate online
1394
+ # using
1395
+ # forms, instant messaging, or other pre-recorded digital mediums.
1396
+ # Synchronous encounters occur in live, real-time settings where the patient
1397
+ # interacts
1398
+ # directly with the provider, such as over video or a phone call.
1399
+ # @param billable_status [CandidApiClient::Encounters::V4::Types::BillableStatusType] Defines if the Encounter is to be billed by Candid to the responsible_party.
1400
+ # Examples for when this should be set to NOT_BILLABLE include
1401
+ # if the Encounter has not occurred yet or if there is no intention of ever
1402
+ # billing the responsible_party.
1403
+ # @param additional_information [String] Defines additional information on the claim needed by the payer.
1404
+ # Box 19 on the CMS-1500 claim form.
1405
+ # @param service_authorization_exception_code [CandidApiClient::Encounters::V4::Types::ServiceAuthorizationExceptionCode] 837p Loop2300 REF\*4N
1406
+ # Required when mandated by government law or regulation to obtain authorization
1407
+ # for specific service(s) but, for the
1408
+ # reasons listed in one of the enum values of ServiceAuthorizationExceptionCode,
1409
+ # the service was performed without
1410
+ # obtaining the authorization.
1411
+ # @param admission_date [Date] 837p Loop2300 DTP\*435, CMS-1500 Box 18
1412
+ # Required on all ambulance claims when the patient was known to be admitted to
1413
+ # the hospital.
1414
+ # OR
1415
+ # Required on all claims involving inpatient medical visits.
1416
+ # @param discharge_date [Date] 837p Loop2300 DTP\*096, CMS-1500 Box 18
1417
+ # Required for inpatient claims when the patient was discharged from the facility
1418
+ # and the discharge date is known.
1419
+ # @param onset_of_current_illness_or_symptom_date [Date] 837p Loop2300 DTP\*431, CMS-1500 Box 14
1420
+ # Required for the initial medical service or visit performed in response to a
1421
+ # medical emergency when the date is available and is different than the date of
1422
+ # service.
1423
+ # OR
1424
+ # This date is the onset of acute symptoms for the current illness or condition.
1425
+ # @param last_menstrual_period_date [Date] 837p Loop2300 DTP\*484, CMS-1500 Box 14
1426
+ # Required when, in the judgment of the provider, the services on this claim are
1427
+ # related to the patient's pregnancy.
1428
+ # @param delay_reason_code [CandidApiClient::Commons::Types::DelayReasonCode] 837i Loop2300, CLM-1300 Box 20
1429
+ # Code indicating the reason why a request was delayed
1430
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
1431
+ # @param _field_set [Object]
1432
+ # @param patient [Hash] Contains the identification information of the individual receiving medical
1433
+ # services.Request of type CandidApiClient::Individual::Types::PatientCreate, as a Hash
1434
+ # * :phone_numbers (Array<CandidApiClient::Commons::Types::PhoneNumber>)
1435
+ # * :phone_consent (Boolean)
1436
+ # * :email (String)
1437
+ # * :non_insurance_payers (Array<String>)
1438
+ # * :email_consent (Boolean)
1439
+ # * :external_id (String)
1440
+ # * :date_of_birth (Date)
1441
+ # * :address (Hash)
1442
+ # * :zip_plus_four_code (String)
1443
+ # * :address_1 (String)
1444
+ # * :address_2 (String)
1445
+ # * :city (String)
1446
+ # * :state (CandidApiClient::Commons::Types::State)
1447
+ # * :zip_code (String)
1448
+ # * :first_name (String)
1449
+ # * :last_name (String)
1450
+ # * :gender (CandidApiClient::Individual::Types::Gender)
1451
+ # @param billing_provider [Hash] The billing provider is the provider or business entity submitting the claim.
1452
+ # Billing provider may be, but is not necessarily, the same person/NPI as the
1453
+ # rendering provider. From a payer's perspective, this represents the person or
1454
+ # entity being reimbursed. When a contract exists with the target payer, the
1455
+ # billing provider should be the entity contracted with the payer. In some
1456
+ # circumstances, this will be an individual provider. In that case, submit that
1457
+ # provider's NPI and the tax ID (TIN) that the provider gave to the payer during
1458
+ # contracting. In other cases, the billing entity will be a medical group. If so,
1459
+ # 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
1460
+ # * :address (Hash)
1461
+ # * :zip_plus_four_code (String)
1462
+ # * :address_1 (String)
1463
+ # * :address_2 (String)
1464
+ # * :city (String)
1465
+ # * :state (CandidApiClient::Commons::Types::State)
1466
+ # * :zip_code (String)
1467
+ # * :tax_id (String)
1468
+ # * :npi (String)
1469
+ # * :taxonomy_code (String)
1470
+ # * :first_name (String)
1471
+ # * :last_name (String)
1472
+ # * :organization_name (String)
1473
+ # @param rendering_provider [Hash] The rendering provider is the practitioner -- physician, nurse practitioner,
1474
+ # etc. -- performing the service.
1475
+ # For telehealth services, the rendering provider performs the visit, asynchronous
1476
+ # communication, or other service. The rendering provider address should generally
1477
+ # be the same as the service facility address.Request of type CandidApiClient::EncounterProviders::V2::Types::RenderingProvider, as a Hash
1478
+ # * :address (Hash)
1479
+ # * :zip_plus_four_code (String)
1480
+ # * :address_1 (String)
1481
+ # * :address_2 (String)
1482
+ # * :city (String)
1483
+ # * :state (CandidApiClient::Commons::Types::State)
1484
+ # * :zip_code (String)
1485
+ # * :npi (String)
1486
+ # * :taxonomy_code (String)
1487
+ # * :first_name (String)
1488
+ # * :last_name (String)
1489
+ # * :organization_name (String)
1490
+ # @param referring_provider [Hash] The final provider who referred the services that were rendered.
1491
+ # All physicians who order services or refer Medicare beneficiaries must
1492
+ # report this data.Request of type CandidApiClient::EncounterProviders::V2::Types::ReferringProvider, as a Hash
1493
+ # * :npi (String)
1494
+ # * :taxonomy_code (String)
1495
+ # * :address (Hash)
1496
+ # * :zip_plus_four_code (String)
1497
+ # * :address_1 (String)
1498
+ # * :address_2 (String)
1499
+ # * :city (String)
1500
+ # * :state (CandidApiClient::Commons::Types::State)
1501
+ # * :zip_code (String)
1502
+ # * :first_name (String)
1503
+ # * :last_name (String)
1504
+ # * :organization_name (String)
1505
+ # @param initial_referring_provider [Hash] The second iteration of Loop ID-2310. Use code "P3 - Primary Care Provider" in
1506
+ # this loop to
1507
+ # indicate the initial referral from the primary care provider or whatever
1508
+ # provider wrote the initial referral for this patient's episode of care being
1509
+ # billed/reported in this transaction.Request of type CandidApiClient::EncounterProviders::V2::Types::InitialReferringProvider, as a Hash
1510
+ # * :npi (String)
1511
+ # * :taxonomy_code (String)
1512
+ # * :address (Hash)
1513
+ # * :zip_plus_four_code (String)
1514
+ # * :address_1 (String)
1515
+ # * :address_2 (String)
1516
+ # * :city (String)
1517
+ # * :state (CandidApiClient::Commons::Types::State)
1518
+ # * :zip_code (String)
1519
+ # * :qualifier (CandidApiClient::Commons::Types::QualifierCode)
1520
+ # * :first_name (String)
1521
+ # * :last_name (String)
1522
+ # * :organization_name (String)
1523
+ # @param supervising_provider [Hash] Required when the rendering provider is supervised by a physician. If not
1524
+ # required by this implementation guide, do not send.Request of type CandidApiClient::EncounterProviders::V2::Types::SupervisingProvider, as a Hash
1525
+ # * :npi (String)
1526
+ # * :taxonomy_code (String)
1527
+ # * :address (Hash)
1528
+ # * :zip_plus_four_code (String)
1529
+ # * :address_1 (String)
1530
+ # * :address_2 (String)
1531
+ # * :city (String)
1532
+ # * :state (CandidApiClient::Commons::Types::State)
1533
+ # * :zip_code (String)
1534
+ # * :first_name (String)
1535
+ # * :last_name (String)
1536
+ # * :organization_name (String)
1537
+ # @param service_facility [Hash] Encounter Service facility is typically the location a medical service was
1538
+ # rendered, such as a provider office or hospital. For telehealth, service
1539
+ # facility can represent the provider's location when the service was delivered
1540
+ # (e.g., home), or the location where an in-person visit would have taken place,
1541
+ # whichever is easier to identify. If the provider is in-network, service facility
1542
+ # may be defined in payer contracts. Box 32 on the CMS-1500 claim form. Note that
1543
+ # for an in-network claim to be successfully adjudicated, the service facility
1544
+ # address listed on claims must match what was provided to the payer during the
1545
+ # credentialing process.Request of type CandidApiClient::ServiceFacility::Types::EncounterServiceFacilityBase, as a Hash
1546
+ # * :organization_name (String)
1547
+ # * :npi (String)
1548
+ # * :address (Hash)
1549
+ # * :zip_plus_four_code (String)
1550
+ # * :address_1 (String)
1551
+ # * :address_2 (String)
1552
+ # * :city (String)
1553
+ # * :state (CandidApiClient::Commons::Types::State)
1554
+ # * :zip_code (String)
1555
+ # @param subscriber_primary [Hash] Subscriber_primary is required when responsible_party is INSURANCE_PAY (i.e.
1556
+ # when the claim should be billed to insurance).
1557
+ # These are not required fields when responsible_party is SELF_PAY (i.e. when the
1558
+ # claim should be billed to the patient).
1559
+ # However, if you collect this for patients, even self-pay, we recommend including
1560
+ # it when sending encounters to Candid.
1561
+ # Note: Cash Pay is no longer a valid payer_id in v4, please use responsible party
1562
+ # to define self-pay claims.Request of type CandidApiClient::Individual::Types::SubscriberCreate, as a Hash
1563
+ # * :insurance_card (Hash)
1564
+ # * :member_id (String)
1565
+ # * :payer_name (String)
1566
+ # * :payer_id (String)
1567
+ # * :rx_bin (String)
1568
+ # * :rx_pcn (String)
1569
+ # * :image_url_front (String)
1570
+ # * :image_url_back (String)
1571
+ # * :emr_payer_crosswalk (CandidApiClient::Commons::Types::EmrPayerCrosswalk)
1572
+ # * :group_number (String)
1573
+ # * :plan_name (String)
1574
+ # * :plan_type (CandidApiClient::Commons::Types::SourceOfPaymentCode)
1575
+ # * :insurance_type (CandidApiClient::Commons::Types::InsuranceTypeCode)
1576
+ # * :patient_relationship_to_subscriber_code (CandidApiClient::Commons::Types::PatientRelationshipToInsuredCodeAll)
1577
+ # * :date_of_birth (Date)
1578
+ # * :address (Hash)
1579
+ # * :zip_plus_four_code (String)
1580
+ # * :address_1 (String)
1581
+ # * :address_2 (String)
1582
+ # * :city (String)
1583
+ # * :state (CandidApiClient::Commons::Types::State)
1584
+ # * :zip_code (String)
1585
+ # * :first_name (String)
1586
+ # * :last_name (String)
1587
+ # * :gender (CandidApiClient::Individual::Types::Gender)
1588
+ # @param subscriber_secondary [Hash] Please always include this when you have it, even for self-pay claims.Request of type CandidApiClient::Individual::Types::SubscriberCreate, as a Hash
1589
+ # * :insurance_card (Hash)
1590
+ # * :member_id (String)
1591
+ # * :payer_name (String)
1592
+ # * :payer_id (String)
1593
+ # * :rx_bin (String)
1594
+ # * :rx_pcn (String)
1595
+ # * :image_url_front (String)
1596
+ # * :image_url_back (String)
1597
+ # * :emr_payer_crosswalk (CandidApiClient::Commons::Types::EmrPayerCrosswalk)
1598
+ # * :group_number (String)
1599
+ # * :plan_name (String)
1600
+ # * :plan_type (CandidApiClient::Commons::Types::SourceOfPaymentCode)
1601
+ # * :insurance_type (CandidApiClient::Commons::Types::InsuranceTypeCode)
1602
+ # * :patient_relationship_to_subscriber_code (CandidApiClient::Commons::Types::PatientRelationshipToInsuredCodeAll)
1603
+ # * :date_of_birth (Date)
1604
+ # * :address (Hash)
1605
+ # * :zip_plus_four_code (String)
1606
+ # * :address_1 (String)
1607
+ # * :address_2 (String)
1608
+ # * :city (String)
1609
+ # * :state (CandidApiClient::Commons::Types::State)
1610
+ # * :zip_code (String)
1611
+ # * :first_name (String)
1612
+ # * :last_name (String)
1613
+ # * :gender (CandidApiClient::Individual::Types::Gender)
1614
+ # @param prior_authorization_number [String] Box 23 on the CMS-1500 claim form.
1615
+ # @param appointment_type [String] Human-readable description of the appointment type (ex: "Acupuncture -
1616
+ # Headaches").
1617
+ # @param responsible_party [CandidApiClient::Encounters::V4::Types::ResponsiblePartyType] Defines the party to be billed with the initial balance owed on the claim.
1618
+ # @param diagnoses [Array<Hash>] Ideally, this field should contain no more than 12 diagnoses. However, more
1619
+ # diagnoses
1620
+ # may be submitted at this time, and coders will later prioritize the 12 that will
1621
+ # be
1622
+ # submitted to the payor.Request of type Array<CandidApiClient::Diagnoses::Types::DiagnosisCreate>, as a Hash
1623
+ # * :name (String)
1624
+ # * :code_type (CandidApiClient::Diagnoses::Types::DiagnosisTypeCode)
1625
+ # * :code (String)
1626
+ # @param clinical_notes [Array<Hash>] Holds a collection of clinical observations made by healthcare providers during
1627
+ # patient encounters.Request of type Array<CandidApiClient::Encounters::V4::Types::ClinicalNoteCategoryCreate>, as a Hash
1628
+ # * :category (CandidApiClient::Encounters::V4::Types::NoteCategory)
1629
+ # * :notes (Array<CandidApiClient::Encounters::V4::Types::ClinicalNote>)
1630
+ # @param billing_notes [Array<Hash>] Spot to store misc, human-readable, notes about this encounter to be used
1631
+ # in the billing process.Request of type Array<CandidApiClient::BillingNotes::V2::Types::BillingNoteBase>, as a Hash
1632
+ # * :text (String)
1633
+ # @param place_of_service_code [CandidApiClient::Commons::Types::FacilityTypeCode] Box 24B on the CMS-1500 claim form. Line-level place of service is not currently
1634
+ # supported. 02 for telemedicine, 11 for in-person. Full list
1635
+ # //www.cms.gov/Medicare/Coding/place-of-service-codes/Place_of_Service_Code_Set).
1636
+ # @param patient_histories [Array<Hash>] Request of type Array<CandidApiClient::Encounters::V4::Types::PatientHistoryCategory>, as a Hash
1637
+ # * :category (CandidApiClient::Encounters::V4::Types::PatientHistoryCategoryEnum)
1638
+ # * :questions (Array<CandidApiClient::Encounters::V4::Types::IntakeQuestion>)
1639
+ # @param service_lines [Array<Hash>] Each service line must be linked to a diagnosis. Concretely,
1640
+ # `service_line.diagnosis_pointers`must contain at least one entry which should be
1641
+ # in bounds of the diagnoses list field.Request of type Array<CandidApiClient::ServiceLines::V2::Types::ServiceLineCreate>, as a Hash
1642
+ # * :modifiers (Array<CandidApiClient::Commons::Types::ProcedureModifier>)
1643
+ # * :procedure_code (String)
1644
+ # * :quantity (String)
1645
+ # * :units (CandidApiClient::Commons::Types::ServiceLineUnits)
1646
+ # * :charge_amount_cents (Integer)
1647
+ # * :diagnosis_pointers (Array<Integer>)
1648
+ # * :drug_identification (Hash)
1649
+ # * :service_id_qualifier (CandidApiClient::ServiceLines::V2::Types::ServiceIdQualifier)
1650
+ # * :national_drug_code (String)
1651
+ # * :national_drug_unit_count (String)
1652
+ # * :measurement_unit_code (CandidApiClient::ServiceLines::V2::Types::MeasurementUnitCode)
1653
+ # * :link_sequence_number (String)
1654
+ # * :pharmacy_prescription_number (String)
1655
+ # * :conversion_formula (String)
1656
+ # * :place_of_service_code (CandidApiClient::Commons::Types::FacilityTypeCode)
1657
+ # * :description (String)
1658
+ # * :date_of_service (Date)
1659
+ # * :end_date_of_service (Date)
1660
+ # * :ordering_provider (Hash)
1661
+ # * :npi (String)
1662
+ # * :taxonomy_code (String)
1663
+ # * :address (Hash)
1664
+ # * :zip_plus_four_code (String)
1665
+ # * :address_1 (String)
1666
+ # * :address_2 (String)
1667
+ # * :city (String)
1668
+ # * :state (CandidApiClient::Commons::Types::State)
1669
+ # * :zip_code (String)
1670
+ # * :first_name (String)
1671
+ # * :last_name (String)
1672
+ # * :organization_name (String)
1673
+ # @param guarantor [Hash] Personal and contact info for the guarantor of the patient responsibility.Request of type CandidApiClient::Guarantor::V1::Types::GuarantorCreate, as a Hash
1674
+ # * :phone_numbers (Array<CandidApiClient::Commons::Types::PhoneNumber>)
1675
+ # * :phone_consent (Boolean)
1676
+ # * :email (String)
1677
+ # * :email_consent (Boolean)
1678
+ # * :first_name (String)
1679
+ # * :last_name (String)
1680
+ # * :external_id (String)
1681
+ # * :date_of_birth (Date)
1682
+ # * :address (Hash)
1683
+ # * :zip_plus_four_code (String)
1684
+ # * :address_1 (String)
1685
+ # * :address_2 (String)
1686
+ # * :city (String)
1687
+ # * :state (CandidApiClient::Commons::Types::State)
1688
+ # * :zip_code (String)
1689
+ # @param external_claim_submission [Hash] ***This field is in beta.***
1690
+ # To be included for claims that have been submitted outside of Candid.
1691
+ # Candid supports posting remits and payments to these claims and working them
1692
+ # in-platform (e.g. editing, resubmitting).Request of type CandidApiClient::ClaimSubmission::V1::Types::ExternalClaimSubmissionCreate, as a Hash
1693
+ # * :claim_created_at (DateTime)
1694
+ # * :patient_control_number (String)
1695
+ # * :submission_records (Array<CandidApiClient::ClaimSubmission::V1::Types::ClaimSubmissionRecordCreate>)
1696
+ # @param tag_ids [Array<String>] Names of tags that should be on the encounter.
1697
+ # @param schema_instances [Array<Hash>] Key-value pairs that must adhere to a schema created via the Custom Schema API.
1698
+ # Multiple schema
1699
+ # instances cannot be created for the same schema on an encounter.Request of type Array<CandidApiClient::CustomSchemas::V1::Types::SchemaInstance>, as a Hash
1700
+ # * :schema_id (String)
1701
+ # * :content (Hash{String => Object})
947
1702
  # @param request_options [CandidApiClient::RequestOptions]
948
1703
  # @return [CandidApiClient::Encounters::V4::Types::Encounter]
949
1704
  # @example
950
1705
  # api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
951
- # api.encounters.v_4.get(encounter_id: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32")
952
- def get(encounter_id:, request_options: nil)
1706
+ # api.encounters.v_4.create(
1707
+ # patient: { phone_numbers: [{ number: "1234567890", type: HOME }], phone_consent: true, email: "johndoe@joincandidhealth.com", non_insurance_payers: ["d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32"], 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 },
1708
+ # 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" },
1709
+ # rendering_provider: { address: { address_1: "123 Main St", address_2: "Apt 1", city: "New York", state: NY, zip_code: "10001", zip_plus_four_code: "1234" }, npi: "string", taxonomy_code: "string", first_name: "string", last_name: "string", organization_name: "string" },
1710
+ # 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" },
1711
+ # 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" },
1712
+ # 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" },
1713
+ # 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" } },
1714
+ # 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 },
1715
+ # 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 },
1716
+ # prior_authorization_number: "string",
1717
+ # appointment_type: "string",
1718
+ # responsible_party: INSURANCE_PAY,
1719
+ # diagnoses: [{ name: "string", code_type: ABF, code: "string" }],
1720
+ # clinical_notes: [{ category: CLINICAL, notes: [{ text: "string", author_name: "string", author_npi: "string", timestamp: DateTime.parse(2024-01-15T09:30:00.000Z) }] }],
1721
+ # billing_notes: [{ text: "string" }],
1722
+ # place_of_service_code: PHARMACY,
1723
+ # 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" }] }] }] }],
1724
+ # 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" }, 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" } }],
1725
+ # guarantor: { phone_numbers: [{ number: "1234567890", type: HOME }], phone_consent: true, email: "johndoe@joincandidhealth.com", 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" } },
1726
+ # 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 }] },
1727
+ # tag_ids: ["string"],
1728
+ # schema_instances: [{ schema_id: "ec096b13-f80a-471d-aaeb-54b021c9d582", content: { "provider_category": "internist", "is_urgent_care": true, "bmi": 24.2, "age": 38 } }]
1729
+ # )
1730
+ def create(external_id:, patient_authorized_release:, benefits_assigned_to_provider:,
1731
+ 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, 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, appointment_type: 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, request_options: nil)
953
1732
  Async do
954
- response = @request_client.conn.get do |req|
1733
+ response = @request_client.conn.post do |req|
955
1734
  req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
956
1735
  req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
957
1736
  req.headers = {
@@ -959,17 +1738,99 @@ module CandidApiClient
959
1738
  **@request_client.get_headers,
960
1739
  **(request_options&.additional_headers || {})
961
1740
  }.compact
1741
+ req.body = {
1742
+ **(request_options&.additional_body_parameters || {}),
1743
+ external_id: external_id,
1744
+ date_of_service: date_of_service,
1745
+ end_date_of_service: end_date_of_service,
1746
+ patient_authorized_release: patient_authorized_release,
1747
+ benefits_assigned_to_provider: benefits_assigned_to_provider,
1748
+ provider_accepts_assignment: provider_accepts_assignment,
1749
+ existing_medications: existing_medications,
1750
+ vitals: vitals,
1751
+ interventions: interventions,
1752
+ pay_to_address: pay_to_address,
1753
+ synchronicity: synchronicity,
1754
+ billable_status: billable_status,
1755
+ additional_information: additional_information,
1756
+ service_authorization_exception_code: service_authorization_exception_code,
1757
+ admission_date: admission_date,
1758
+ discharge_date: discharge_date,
1759
+ onset_of_current_illness_or_symptom_date: onset_of_current_illness_or_symptom_date,
1760
+ last_menstrual_period_date: last_menstrual_period_date,
1761
+ delay_reason_code: delay_reason_code,
1762
+ additional_properties: additional_properties,
1763
+ _field_set: _field_set,
1764
+ patient: patient,
1765
+ billing_provider: billing_provider,
1766
+ rendering_provider: rendering_provider,
1767
+ referring_provider: referring_provider,
1768
+ initial_referring_provider: initial_referring_provider,
1769
+ supervising_provider: supervising_provider,
1770
+ service_facility: service_facility,
1771
+ subscriber_primary: subscriber_primary,
1772
+ subscriber_secondary: subscriber_secondary,
1773
+ prior_authorization_number: prior_authorization_number,
1774
+ appointment_type: appointment_type,
1775
+ responsible_party: responsible_party,
1776
+ diagnoses: diagnoses,
1777
+ clinical_notes: clinical_notes,
1778
+ billing_notes: billing_notes,
1779
+ place_of_service_code: place_of_service_code,
1780
+ patient_histories: patient_histories,
1781
+ service_lines: service_lines,
1782
+ guarantor: guarantor,
1783
+ external_claim_submission: external_claim_submission,
1784
+ tag_ids: tag_ids,
1785
+ schema_instances: schema_instances
1786
+ }.compact
962
1787
  req.url "#{@request_client.get_url(environment: CandidApi,
963
- request_options: request_options)}/api/encounters/v4/#{encounter_id}"
1788
+ request_options: request_options)}/api/encounters/v4"
964
1789
  end
965
1790
  CandidApiClient::Encounters::V4::Types::Encounter.from_json(json_object: response.body)
966
1791
  end
967
1792
  end
968
1793
 
1794
+ # Create an encounter from a pre-encounter patient and appointment. This endpoint
1795
+ # is intended to be used by consumers who are managing
1796
+ # patients and appointments in the pre-encounter service and is currently under
1797
+ # development. Consumers who are not taking advantage
1798
+ # of the pre-encounter service should use the standard create endpoint.
1799
+ # The endpoint will create an encounter from the provided fields, pulling
1800
+ # information from the provided patient and appointment objects
1801
+ # where applicable. In particular, the following fields are populated from the
1802
+ # patient and appointment objects:
1803
+ # - Patient
1804
+ # - Referring Provider
1805
+ # - Subscriber Primary
1806
+ # - Subscriber Secondary
1807
+ # - Prior Authorization Number
1808
+ # - Appointment Type
1809
+ # - Responsible Party
1810
+ # - Guarantor
1811
+ # Utilizing this endpoint opts you into automatic updating of the encounter when
1812
+ # the patient or appointment is updated, assuming the
1813
+ # encounter has not already been submitted or adjudicated.
1814
+ #
969
1815
  # @param external_id [String] A client-specified unique ID to associate with this encounter;
970
1816
  # for example, your internal encounter ID or a Dr. Chrono encounter ID.
971
1817
  # This field should not contain PHI.
972
- # @param prior_authorization_number [String] Box 23 on the CMS-1500 claim form.
1818
+ # @param date_of_service [Date] Date formatted as YYYY-MM-DD; eg: 2019-08-24.
1819
+ # This date must be the local date in the timezone where the service occurred.
1820
+ # Box 24a on the CMS-1500 claim form.
1821
+ # If service occurred over a range of dates, this should be the start date.
1822
+ # date_of_service must be defined on either the encounter or the service lines but
1823
+ # not both.
1824
+ # If there are greater than zero service lines, it is recommended to specify
1825
+ # date_of_service on the service_line instead of on the encounter to prepare for
1826
+ # future API versions.
1827
+ # @param end_date_of_service [Date] Date formatted as YYYY-MM-DD; eg: 2019-08-25.
1828
+ # This date must be the local date in the timezone where the service occurred.
1829
+ # If omitted, the Encounter is assumed to be for a single day.
1830
+ # Must not be temporally before the date_of_service field.
1831
+ # If there are greater than zero service lines, it is recommended to specify
1832
+ # end_date_of_service on the service_line instead of on the encounter to prepare
1833
+ # for future API versions.
973
1834
  # @param patient_authorized_release [Boolean] Whether this patient has authorized the release of medical information
974
1835
  # for billing purpose.
975
1836
  # Box 12 on the CMS-1500 claim form.
@@ -979,8 +1840,6 @@ module CandidApiClient
979
1840
  # @param provider_accepts_assignment [Boolean] Whether you have accepted the patient's authorization for insurance payments
980
1841
  # to be made to you, not them.
981
1842
  # Box 27 on the CMS-1500 claim form.
982
- # @param appointment_type [String] Human-readable description of the appointment type (ex: "Acupuncture -
983
- # Headaches").
984
1843
  # @param existing_medications [Array<Hash>] Request of type Array<CandidApiClient::Encounters::V4::Types::Medication>, as a Hash
985
1844
  # * :name (String)
986
1845
  # * :rx_cui (String)
@@ -1026,7 +1885,6 @@ module CandidApiClient
1026
1885
  # Examples for when this should be set to NOT_BILLABLE include
1027
1886
  # if the Encounter has not occurred yet or if there is no intention of ever
1028
1887
  # billing the responsible_party.
1029
- # @param responsible_party [CandidApiClient::Encounters::V4::Types::ResponsiblePartyType] Defines the party to be billed with the initial balance owed on the claim.
1030
1888
  # @param additional_information [String] Defines additional information on the claim needed by the payer.
1031
1889
  # Box 19 on the CMS-1500 claim form.
1032
1890
  # @param service_authorization_exception_code [CandidApiClient::Encounters::V4::Types::ServiceAuthorizationExceptionCode] 837p Loop2300 REF\*4N
@@ -1056,41 +1914,8 @@ module CandidApiClient
1056
1914
  # Code indicating the reason why a request was delayed
1057
1915
  # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
1058
1916
  # @param _field_set [Object]
1059
- # @param date_of_service [Date] Date formatted as YYYY-MM-DD; eg: 2019-08-24.
1060
- # This date must be the local date in the timezone where the service occurred.
1061
- # Box 24a on the CMS-1500 claim form.
1062
- # If service occurred over a range of dates, this should be the start date.
1063
- # date_of_service must be defined on either the encounter or the service lines but
1064
- # not both.
1065
- # If there are greater than zero service lines, it is recommended to specify
1066
- # date_of_service on the service_line instead of on the encounter to prepare for
1067
- # future API versions.
1068
- # @param end_date_of_service [Date] Date formatted as YYYY-MM-DD; eg: 2019-08-25.
1069
- # This date must be the local date in the timezone where the service occurred.
1070
- # If omitted, the Encounter is assumed to be for a single day.
1071
- # Must not be temporally before the date_of_service field.
1072
- # If there are greater than zero service lines, it is recommended to specify
1073
- # end_date_of_service on the service_line instead of on the encounter to prepare
1074
- # for future API versions.
1075
- # @param patient [Hash] Contains the identification information of the individual receiving medical
1076
- # services.Request of type CandidApiClient::Individual::Types::PatientCreate, as a Hash
1077
- # * :phone_numbers (Array<CandidApiClient::Commons::Types::PhoneNumber>)
1078
- # * :phone_consent (Boolean)
1079
- # * :email (String)
1080
- # * :non_insurance_payers (Array<String>)
1081
- # * :email_consent (Boolean)
1082
- # * :external_id (String)
1083
- # * :date_of_birth (Date)
1084
- # * :address (Hash)
1085
- # * :zip_plus_four_code (String)
1086
- # * :address_1 (String)
1087
- # * :address_2 (String)
1088
- # * :city (String)
1089
- # * :state (CandidApiClient::Commons::Types::State)
1090
- # * :zip_code (String)
1091
- # * :first_name (String)
1092
- # * :last_name (String)
1093
- # * :gender (CandidApiClient::Individual::Types::Gender)
1917
+ # @param pre_encounter_patient_id [String]
1918
+ # @param pre_encounter_appointment_id [String]
1094
1919
  # @param billing_provider [Hash] The billing provider is the provider or business entity submitting the claim.
1095
1920
  # Billing provider may be, but is not necessarily, the same person/NPI as the
1096
1921
  # rendering provider. From a payer's perspective, this represents the person or
@@ -1130,21 +1955,6 @@ module CandidApiClient
1130
1955
  # * :first_name (String)
1131
1956
  # * :last_name (String)
1132
1957
  # * :organization_name (String)
1133
- # @param referring_provider [Hash] The final provider who referred the services that were rendered.
1134
- # All physicians who order services or refer Medicare beneficiaries must
1135
- # report this data.Request of type CandidApiClient::EncounterProviders::V2::Types::ReferringProvider, as a Hash
1136
- # * :npi (String)
1137
- # * :taxonomy_code (String)
1138
- # * :address (Hash)
1139
- # * :zip_plus_four_code (String)
1140
- # * :address_1 (String)
1141
- # * :address_2 (String)
1142
- # * :city (String)
1143
- # * :state (CandidApiClient::Commons::Types::State)
1144
- # * :zip_code (String)
1145
- # * :first_name (String)
1146
- # * :last_name (String)
1147
- # * :organization_name (String)
1148
1958
  # @param initial_referring_provider [Hash] The second iteration of Loop ID-2310. Use code "P3 - Primary Care Provider" in
1149
1959
  # this loop to
1150
1960
  # indicate the initial referral from the primary care provider or whatever
@@ -1195,65 +2005,6 @@ module CandidApiClient
1195
2005
  # * :city (String)
1196
2006
  # * :state (CandidApiClient::Commons::Types::State)
1197
2007
  # * :zip_code (String)
1198
- # @param subscriber_primary [Hash] Subscriber_primary is required when responsible_party is INSURANCE_PAY (i.e.
1199
- # when the claim should be billed to insurance).
1200
- # These are not required fields when responsible_party is SELF_PAY (i.e. when the
1201
- # claim should be billed to the patient).
1202
- # However, if you collect this for patients, even self-pay, we recommend including
1203
- # it when sending encounters to Candid.
1204
- # Note: Cash Pay is no longer a valid payer_id in v4, please use responsible party
1205
- # to define self-pay claims.Request of type CandidApiClient::Individual::Types::SubscriberCreate, as a Hash
1206
- # * :insurance_card (Hash)
1207
- # * :member_id (String)
1208
- # * :payer_name (String)
1209
- # * :payer_id (String)
1210
- # * :rx_bin (String)
1211
- # * :rx_pcn (String)
1212
- # * :image_url_front (String)
1213
- # * :image_url_back (String)
1214
- # * :emr_payer_crosswalk (CandidApiClient::Commons::Types::EmrPayerCrosswalk)
1215
- # * :group_number (String)
1216
- # * :plan_name (String)
1217
- # * :plan_type (CandidApiClient::Commons::Types::SourceOfPaymentCode)
1218
- # * :insurance_type (CandidApiClient::Commons::Types::InsuranceTypeCode)
1219
- # * :patient_relationship_to_subscriber_code (CandidApiClient::Commons::Types::PatientRelationshipToInsuredCodeAll)
1220
- # * :date_of_birth (Date)
1221
- # * :address (Hash)
1222
- # * :zip_plus_four_code (String)
1223
- # * :address_1 (String)
1224
- # * :address_2 (String)
1225
- # * :city (String)
1226
- # * :state (CandidApiClient::Commons::Types::State)
1227
- # * :zip_code (String)
1228
- # * :first_name (String)
1229
- # * :last_name (String)
1230
- # * :gender (CandidApiClient::Individual::Types::Gender)
1231
- # @param subscriber_secondary [Hash] Please always include this when you have it, even for self-pay claims.Request of type CandidApiClient::Individual::Types::SubscriberCreate, as a Hash
1232
- # * :insurance_card (Hash)
1233
- # * :member_id (String)
1234
- # * :payer_name (String)
1235
- # * :payer_id (String)
1236
- # * :rx_bin (String)
1237
- # * :rx_pcn (String)
1238
- # * :image_url_front (String)
1239
- # * :image_url_back (String)
1240
- # * :emr_payer_crosswalk (CandidApiClient::Commons::Types::EmrPayerCrosswalk)
1241
- # * :group_number (String)
1242
- # * :plan_name (String)
1243
- # * :plan_type (CandidApiClient::Commons::Types::SourceOfPaymentCode)
1244
- # * :insurance_type (CandidApiClient::Commons::Types::InsuranceTypeCode)
1245
- # * :patient_relationship_to_subscriber_code (CandidApiClient::Commons::Types::PatientRelationshipToInsuredCodeAll)
1246
- # * :date_of_birth (Date)
1247
- # * :address (Hash)
1248
- # * :zip_plus_four_code (String)
1249
- # * :address_1 (String)
1250
- # * :address_2 (String)
1251
- # * :city (String)
1252
- # * :state (CandidApiClient::Commons::Types::State)
1253
- # * :zip_code (String)
1254
- # * :first_name (String)
1255
- # * :last_name (String)
1256
- # * :gender (CandidApiClient::Individual::Types::Gender)
1257
2008
  # @param diagnoses [Array<Hash>] Ideally, this field should contain no more than 12 diagnoses. However, more
1258
2009
  # diagnoses
1259
2010
  # may be submitted at this time, and coders will later prioritize the 12 that will
@@ -1309,22 +2060,6 @@ module CandidApiClient
1309
2060
  # * :first_name (String)
1310
2061
  # * :last_name (String)
1311
2062
  # * :organization_name (String)
1312
- # @param guarantor [Hash] Personal and contact info for the guarantor of the patient responsibility.Request of type CandidApiClient::Guarantor::V1::Types::GuarantorCreate, as a Hash
1313
- # * :phone_numbers (Array<CandidApiClient::Commons::Types::PhoneNumber>)
1314
- # * :phone_consent (Boolean)
1315
- # * :email (String)
1316
- # * :email_consent (Boolean)
1317
- # * :first_name (String)
1318
- # * :last_name (String)
1319
- # * :external_id (String)
1320
- # * :date_of_birth (Date)
1321
- # * :address (Hash)
1322
- # * :zip_plus_four_code (String)
1323
- # * :address_1 (String)
1324
- # * :address_2 (String)
1325
- # * :city (String)
1326
- # * :state (CandidApiClient::Commons::Types::State)
1327
- # * :zip_code (String)
1328
2063
  # @param external_claim_submission [Hash] ***This field is in beta.***
1329
2064
  # To be included for claims that have been submitted outside of Candid.
1330
2065
  # Candid supports posting remits and payments to these claims and working them
@@ -1342,31 +2077,26 @@ module CandidApiClient
1342
2077
  # @return [CandidApiClient::Encounters::V4::Types::Encounter]
1343
2078
  # @example
1344
2079
  # api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
1345
- # api.encounters.v_4.create(
1346
- # date_of_service: DateTime.parse(2023-01-15),
1347
- # end_date_of_service: DateTime.parse(2023-01-15),
1348
- # patient: { phone_numbers: [{ number: "1234567890", type: HOME }], phone_consent: true, email: "johndoe@joincandidhealth.com", non_insurance_payers: ["d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32"], 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 },
2080
+ # api.encounters.v_4.create_from_pre_encounter_patient(
2081
+ # pre_encounter_patient_id: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32",
2082
+ # pre_encounter_appointment_id: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32",
1349
2083
  # 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" },
1350
2084
  # rendering_provider: { address: { address_1: "123 Main St", address_2: "Apt 1", city: "New York", state: NY, zip_code: "10001", zip_plus_four_code: "1234" }, npi: "string", taxonomy_code: "string", first_name: "string", last_name: "string", organization_name: "string" },
1351
- # 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" },
1352
2085
  # 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" },
1353
2086
  # 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" },
1354
2087
  # 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" } },
1355
- # 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 },
1356
- # 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 },
1357
2088
  # diagnoses: [{ name: "string", code_type: ABF, code: "string" }],
1358
2089
  # clinical_notes: [{ category: CLINICAL, notes: [{ text: "string", author_name: "string", author_npi: "string", timestamp: DateTime.parse(2024-01-15T09:30:00.000Z) }] }],
1359
2090
  # billing_notes: [{ text: "string" }],
1360
2091
  # place_of_service_code: PHARMACY,
1361
2092
  # 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" }] }] }] }],
1362
2093
  # 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" }, 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" } }],
1363
- # guarantor: { phone_numbers: [{ number: "1234567890", type: HOME }], phone_consent: true, email: "johndoe@joincandidhealth.com", 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" } },
1364
2094
  # 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 }] },
1365
2095
  # tag_ids: ["string"],
1366
2096
  # schema_instances: [{ schema_id: "ec096b13-f80a-471d-aaeb-54b021c9d582", content: { "provider_category": "internist", "is_urgent_care": true, "bmi": 24.2, "age": 38 } }]
1367
2097
  # )
1368
- def create(external_id:, patient_authorized_release:, benefits_assigned_to_provider:,
1369
- provider_accepts_assignment:, billable_status:, responsible_party:, patient:, billing_provider:, rendering_provider:, diagnoses:, place_of_service_code:, prior_authorization_number: 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, date_of_service: nil, end_date_of_service: nil, referring_provider: nil, initial_referring_provider: nil, supervising_provider: nil, service_facility: nil, subscriber_primary: nil, subscriber_secondary: 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, request_options: nil)
2098
+ def create_from_pre_encounter_patient(external_id:, patient_authorized_release:,
2099
+ benefits_assigned_to_provider:, provider_accepts_assignment:, billable_status:, pre_encounter_patient_id:, pre_encounter_appointment_id:, billing_provider:, rendering_provider:, diagnoses:, place_of_service_code:, date_of_service: nil, end_date_of_service: 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)
1370
2100
  Async do
1371
2101
  response = @request_client.conn.post do |req|
1372
2102
  req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
@@ -1379,18 +2109,17 @@ module CandidApiClient
1379
2109
  req.body = {
1380
2110
  **(request_options&.additional_body_parameters || {}),
1381
2111
  external_id: external_id,
1382
- prior_authorization_number: prior_authorization_number,
2112
+ date_of_service: date_of_service,
2113
+ end_date_of_service: end_date_of_service,
1383
2114
  patient_authorized_release: patient_authorized_release,
1384
2115
  benefits_assigned_to_provider: benefits_assigned_to_provider,
1385
2116
  provider_accepts_assignment: provider_accepts_assignment,
1386
- appointment_type: appointment_type,
1387
2117
  existing_medications: existing_medications,
1388
2118
  vitals: vitals,
1389
2119
  interventions: interventions,
1390
2120
  pay_to_address: pay_to_address,
1391
2121
  synchronicity: synchronicity,
1392
2122
  billable_status: billable_status,
1393
- responsible_party: responsible_party,
1394
2123
  additional_information: additional_information,
1395
2124
  service_authorization_exception_code: service_authorization_exception_code,
1396
2125
  admission_date: admission_date,
@@ -1400,30 +2129,25 @@ module CandidApiClient
1400
2129
  delay_reason_code: delay_reason_code,
1401
2130
  additional_properties: additional_properties,
1402
2131
  _field_set: _field_set,
1403
- date_of_service: date_of_service,
1404
- end_date_of_service: end_date_of_service,
1405
- patient: patient,
2132
+ pre_encounter_patient_id: pre_encounter_patient_id,
2133
+ pre_encounter_appointment_id: pre_encounter_appointment_id,
1406
2134
  billing_provider: billing_provider,
1407
2135
  rendering_provider: rendering_provider,
1408
- referring_provider: referring_provider,
1409
2136
  initial_referring_provider: initial_referring_provider,
1410
2137
  supervising_provider: supervising_provider,
1411
2138
  service_facility: service_facility,
1412
- subscriber_primary: subscriber_primary,
1413
- subscriber_secondary: subscriber_secondary,
1414
2139
  diagnoses: diagnoses,
1415
2140
  clinical_notes: clinical_notes,
1416
2141
  billing_notes: billing_notes,
1417
2142
  place_of_service_code: place_of_service_code,
1418
2143
  patient_histories: patient_histories,
1419
2144
  service_lines: service_lines,
1420
- guarantor: guarantor,
1421
2145
  external_claim_submission: external_claim_submission,
1422
2146
  tag_ids: tag_ids,
1423
2147
  schema_instances: schema_instances
1424
2148
  }.compact
1425
2149
  req.url "#{@request_client.get_url(environment: CandidApi,
1426
- request_options: request_options)}/api/encounters/v4"
2150
+ request_options: request_options)}/api/encounters/v4/create-from-pre-encounter"
1427
2151
  end
1428
2152
  CandidApiClient::Encounters::V4::Types::Encounter.from_json(json_object: response.body)
1429
2153
  end