candidhealth 0.17.4 → 0.18.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (49) hide show
  1. checksums.yaml +4 -4
  2. data/lib/candidhealth/claim_submission/v_1/types/claim_frequency_type_code.rb +0 -1
  3. data/lib/candidhealth/claim_submission/v_1/types/claim_submission_record_create.rb +15 -4
  4. data/lib/candidhealth/commons/types/entity_conflict_error_message.rb +47 -0
  5. data/lib/candidhealth/commons/types/intended_submission_medium.rb +11 -0
  6. data/lib/candidhealth/commons/types/network_type.rb +27 -0
  7. data/lib/candidhealth/commons/types/rate_id.rb +7 -0
  8. data/lib/candidhealth/commons/types/source_of_payment_code.rb +1 -0
  9. data/lib/candidhealth/contracts/v_2/types/contract.rb +2 -2
  10. data/lib/candidhealth/contracts/v_2/types/contract_with_providers.rb +3 -3
  11. data/lib/candidhealth/eligibility/v_2/client.rb +2 -2
  12. data/lib/candidhealth/encounters/v_4/client.rb +46 -28
  13. data/lib/candidhealth/encounters/v_4/types/encounter.rb +33 -31
  14. data/lib/candidhealth/encounters/v_4/types/encounter_base.rb +7 -31
  15. data/lib/candidhealth/fee_schedules/client.rb +28 -0
  16. data/lib/candidhealth/fee_schedules/v_3/client.rb +499 -0
  17. data/lib/candidhealth/fee_schedules/v_3/types/dimension_match.rb +157 -0
  18. data/lib/candidhealth/fee_schedules/v_3/types/dimension_name.rb +14 -0
  19. data/lib/candidhealth/fee_schedules/v_3/types/dimensions.rb +136 -0
  20. data/lib/candidhealth/fee_schedules/v_3/types/dimensions_page.rb +69 -0
  21. data/lib/candidhealth/fee_schedules/v_3/types/match_cpt_code.rb +60 -0
  22. data/lib/candidhealth/fee_schedules/v_3/types/match_date.rb +61 -0
  23. data/lib/candidhealth/fee_schedules/v_3/types/match_facility_type_code.rb +61 -0
  24. data/lib/candidhealth/fee_schedules/v_3/types/match_geo.rb +66 -0
  25. data/lib/candidhealth/fee_schedules/v_3/types/match_license_type.rb +61 -0
  26. data/lib/candidhealth/fee_schedules/v_3/types/match_modifiers.rb +66 -0
  27. data/lib/candidhealth/fee_schedules/v_3/types/match_network_types.rb +66 -0
  28. data/lib/candidhealth/fee_schedules/v_3/types/match_payer.rb +61 -0
  29. data/lib/candidhealth/fee_schedules/v_3/types/match_provider.rb +61 -0
  30. data/lib/candidhealth/fee_schedules/v_3/types/match_result.rb +61 -0
  31. data/lib/candidhealth/fee_schedules/v_3/types/match_test_result.rb +66 -0
  32. data/lib/candidhealth/fee_schedules/v_3/types/new_rate.rb +64 -0
  33. data/lib/candidhealth/fee_schedules/v_3/types/new_rate_version.rb +64 -0
  34. data/lib/candidhealth/fee_schedules/v_3/types/optional_dimensions.rb +136 -0
  35. data/lib/candidhealth/fee_schedules/v_3/types/overlapping_rate_entries_error.rb +71 -0
  36. data/lib/candidhealth/fee_schedules/v_3/types/payer_threshold.rb +66 -0
  37. data/lib/candidhealth/fee_schedules/v_3/types/payer_thresholds_page.rb +68 -0
  38. data/lib/candidhealth/fee_schedules/v_3/types/rate.rb +96 -0
  39. data/lib/candidhealth/fee_schedules/v_3/types/rate_entry.rb +72 -0
  40. data/lib/candidhealth/fee_schedules/v_3/types/rate_upload.rb +94 -0
  41. data/lib/candidhealth/fee_schedules/v_3/types/rate_upload_with_possible_errors.rb +76 -0
  42. data/lib/candidhealth/fee_schedules/v_3/types/rates_page.rb +65 -0
  43. data/lib/candidhealth/fee_schedules/v_3/types/threshold_match.rb +72 -0
  44. data/lib/candidhealth/fee_schedules/v_3/types/validation_error.rb +129 -0
  45. data/lib/candidhealth/service_lines/v_2/types/service_line.rb +20 -5
  46. data/lib/candidhealth/service_lines/v_2/types/service_line_create.rb +19 -4
  47. data/lib/requests.rb +2 -2
  48. data/lib/types_export.rb +32 -0
  49. metadata +36 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 04de9fe6415bc1c1e88ab54adb59c9fa1e32b01036ce61f7f61d0eb5aad43f56
4
- data.tar.gz: 2a85ca404872f3ceeef2677b30245070678fadcd67f70b2a78b1af6bbf06b8f0
3
+ metadata.gz: add4ff09bdd3c10a36fe961b6e3ff99c29dfeae8685c5f69e4df44212f3624a4
4
+ data.tar.gz: 56d73c13afca1e3a7a7bd76c8502aa08c2f0b81429ddc028f13990fab9a3249e
5
5
  SHA512:
6
- metadata.gz: e6af24187628ee5b5f00ef27807342de623c20961cf851278a415c3da8132d55f0ce2f33e70564376f0608e9ac1fb8206645493cd54c41210e3f18062656f171
7
- data.tar.gz: 8993727c54238cc63ddfd82177a155d22827894e43ef2510bd782609757d0890c8559b6db3100e0971b48e8715cc6c688752b638b6a2f8101359b1337190095d
6
+ metadata.gz: 8b6597c1c014a1bba0a09e43d6b1c2f9893f6cd657d161cb28efe6bd457111720053c916302193a32ccafd1379ce48e932fee4516a3cc29919ad238459c0c6eb
7
+ data.tar.gz: 3f2ab5915a3bd5389a7d913acbc0c5d9af899113589deac233c67a102d56fdf230586c8f9e14ad969245559b87f37262e3364c8871f6c9b7f13a65009075da51
@@ -5,7 +5,6 @@ module CandidApiClient
5
5
  module V1
6
6
  class ClaimFrequencyTypeCode
7
7
  ORIGINAL = "1"
8
- CORRECTED = "6"
9
8
  REPLACEMENT = "7"
10
9
  VOID = "8"
11
10
  end
@@ -3,6 +3,7 @@
3
3
  require "date"
4
4
  require_relative "claim_frequency_type_code"
5
5
  require_relative "../../../commons/types/claim_submission_payer_responsibility_type"
6
+ require_relative "../../../commons/types/intended_submission_medium"
6
7
  require "json"
7
8
 
8
9
  module CandidApiClient
@@ -10,20 +11,27 @@ module CandidApiClient
10
11
  module V1
11
12
  # Data about each external submission.
12
13
  class ClaimSubmissionRecordCreate
13
- attr_reader :submitted_at, :claim_frequency_code, :payer_responsibility, :additional_properties
14
+ attr_reader :submitted_at, :claim_frequency_code, :payer_responsibility, :intended_submission_medium,
15
+ :additional_properties
14
16
 
15
17
  # @param submitted_at [DateTime] When the claim was submitted to the payer.
16
18
  # @param claim_frequency_code [ClaimSubmission::V1::ClaimFrequencyTypeCode]
17
19
  # @param payer_responsibility [Commons::ClaimSubmissionPayerResponsibilityType]
20
+ # @param intended_submission_medium [Commons::IntendedSubmissionMedium] The medium by which the claim was submitted to the payer: paper or electronic.
21
+ # If omitted, defaults to electronic.
18
22
  # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
19
23
  # @return [ClaimSubmission::V1::ClaimSubmissionRecordCreate]
20
- def initialize(submitted_at:, claim_frequency_code: nil, payer_responsibility: nil, additional_properties: nil)
24
+ def initialize(submitted_at:, claim_frequency_code: nil, payer_responsibility: nil,
25
+ intended_submission_medium: nil, additional_properties: nil)
21
26
  # @type [DateTime] When the claim was submitted to the payer.
22
27
  @submitted_at = submitted_at
23
28
  # @type [ClaimSubmission::V1::ClaimFrequencyTypeCode]
24
29
  @claim_frequency_code = claim_frequency_code
25
30
  # @type [Commons::ClaimSubmissionPayerResponsibilityType]
26
31
  @payer_responsibility = payer_responsibility
32
+ # @type [Commons::IntendedSubmissionMedium] The medium by which the claim was submitted to the payer: paper or electronic.
33
+ # If omitted, defaults to electronic.
34
+ @intended_submission_medium = intended_submission_medium
27
35
  # @type [OpenStruct] Additional properties unmapped to the current class definition
28
36
  @additional_properties = additional_properties
29
37
  end
@@ -38,8 +46,9 @@ module CandidApiClient
38
46
  submitted_at = (DateTime.parse(parsed_json["submitted_at"]) unless parsed_json["submitted_at"].nil?)
39
47
  claim_frequency_code = struct.claim_frequency_code
40
48
  payer_responsibility = struct.payer_responsibility
49
+ intended_submission_medium = struct.intended_submission_medium
41
50
  new(submitted_at: submitted_at, claim_frequency_code: claim_frequency_code,
42
- payer_responsibility: payer_responsibility, additional_properties: struct)
51
+ payer_responsibility: payer_responsibility, intended_submission_medium: intended_submission_medium, additional_properties: struct)
43
52
  end
44
53
 
45
54
  # Serialize an instance of ClaimSubmissionRecordCreate to a JSON object
@@ -49,7 +58,8 @@ module CandidApiClient
49
58
  {
50
59
  "submitted_at": @submitted_at,
51
60
  "claim_frequency_code": @claim_frequency_code,
52
- "payer_responsibility": @payer_responsibility
61
+ "payer_responsibility": @payer_responsibility,
62
+ "intended_submission_medium": @intended_submission_medium
53
63
  }.to_json
54
64
  end
55
65
 
@@ -61,6 +71,7 @@ module CandidApiClient
61
71
  obj.submitted_at.is_a?(DateTime) != false || raise("Passed value for field obj.submitted_at is not the expected type, validation failed.")
62
72
  obj.claim_frequency_code&.is_a?(ClaimSubmission::V1::ClaimFrequencyTypeCode) != false || raise("Passed value for field obj.claim_frequency_code is not the expected type, validation failed.")
63
73
  obj.payer_responsibility&.is_a?(Commons::ClaimSubmissionPayerResponsibilityType) != false || raise("Passed value for field obj.payer_responsibility is not the expected type, validation failed.")
74
+ obj.intended_submission_medium&.is_a?(Commons::IntendedSubmissionMedium) != false || raise("Passed value for field obj.intended_submission_medium is not the expected type, validation failed.")
64
75
  end
65
76
  end
66
77
  end
@@ -0,0 +1,47 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "json"
4
+
5
+ module CandidApiClient
6
+ class Commons
7
+ class EntityConflictErrorMessage
8
+ attr_reader :entity_name, :additional_properties
9
+
10
+ # @param entity_name [String]
11
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
12
+ # @return [Commons::EntityConflictErrorMessage]
13
+ def initialize(entity_name:, additional_properties: nil)
14
+ # @type [String]
15
+ @entity_name = entity_name
16
+ # @type [OpenStruct] Additional properties unmapped to the current class definition
17
+ @additional_properties = additional_properties
18
+ end
19
+
20
+ # Deserialize a JSON object to an instance of EntityConflictErrorMessage
21
+ #
22
+ # @param json_object [JSON]
23
+ # @return [Commons::EntityConflictErrorMessage]
24
+ def self.from_json(json_object:)
25
+ struct = JSON.parse(json_object, object_class: OpenStruct)
26
+ JSON.parse(json_object)
27
+ entity_name = struct.entity_name
28
+ new(entity_name: entity_name, additional_properties: struct)
29
+ end
30
+
31
+ # Serialize an instance of EntityConflictErrorMessage to a JSON object
32
+ #
33
+ # @return [JSON]
34
+ def to_json(*_args)
35
+ { "entity_name": @entity_name }.to_json
36
+ end
37
+
38
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given hash and check each fields type against the current object's property definitions.
39
+ #
40
+ # @param obj [Object]
41
+ # @return [Void]
42
+ def self.validate_raw(obj:)
43
+ obj.entity_name.is_a?(String) != false || raise("Passed value for field obj.entity_name is not the expected type, validation failed.")
44
+ end
45
+ end
46
+ end
47
+ end
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ module CandidApiClient
4
+ class Commons
5
+ # The medium (paper or electronic) via which we intended to submit the claim. The clearinghouse to which we sent the claim may use a different medium in certain cases, e.g., if the payer does not support electronic claims.
6
+ class IntendedSubmissionMedium
7
+ PAPER = "paper"
8
+ ELECTRONIC = "electronic"
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,27 @@
1
+ # frozen_string_literal: true
2
+
3
+ module CandidApiClient
4
+ class Commons
5
+ class NetworkType
6
+ PPO = "12"
7
+ POS = "13"
8
+ EPO = "14"
9
+ INDEMNITY_INSURANCE = "15"
10
+ HMO_MEDICARE_RISK = "16"
11
+ DMO = "17"
12
+ AUTO = "AM"
13
+ CHAMPUS = "CH"
14
+ DISABILITY = "DS"
15
+ HMO = "HM"
16
+ LIABILITY = "LM"
17
+ MEDICARE_PART_A = "MA"
18
+ MEDICARE_PART_B = "MB"
19
+ MEDICAID = "MC"
20
+ OTHER_FEDERAL_PROGRAM = "OF"
21
+ TITLE_V = "TV"
22
+ VETERANS_AFFAIRS_PLAN = "VA"
23
+ WORKERS_COMP_HEALTH_CLAIM = "WC"
24
+ MUTUALLY_DEFINED = "ZZ"
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ module CandidApiClient
4
+ class Commons
5
+ RATE_ID = UUID
6
+ end
7
+ end
@@ -26,6 +26,7 @@ module CandidApiClient
26
26
  TITLE_V = "TV"
27
27
  VETERANS_AFFAIRS_PLAN = "VA"
28
28
  WORKERS_COMP_HEALTH_CLAIM = "WC"
29
+ MUTUALLY_DEFINED = "ZZ"
29
30
  end
30
31
  end
31
32
  end
@@ -32,7 +32,7 @@ module CandidApiClient
32
32
  # @param medicaid_insurance_types [Contracts::V2::InsuranceTypes] The Medicaid plan insurance types this contract applies.
33
33
  # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
34
34
  # @return [Contracts::V2::Contract]
35
- def initialize(contract_id:, contracting_provider:, provider_count:, effective_date:, regions:, commercial_insurance_types:, medicare_insurance_types:, medicaid_insurance_types:, payer: nil,
35
+ def initialize(contract_id:, contracting_provider:, provider_count:, payer:, effective_date:, regions:, commercial_insurance_types:, medicare_insurance_types:, medicaid_insurance_types:,
36
36
  expiration_date: nil, contract_status: nil, authorized_signatory: nil, additional_properties: nil)
37
37
  # @type [Contracts::V2::CONTRACT_ID]
38
38
  @contract_id = contract_id
@@ -149,7 +149,7 @@ module CandidApiClient
149
149
  obj.contract_id.is_a?(UUID) != false || raise("Passed value for field obj.contract_id is not the expected type, validation failed.")
150
150
  OrganizationProviders::V2::OrganizationProvider.validate_raw(obj: obj.contracting_provider)
151
151
  obj.provider_count.is_a?(Integer) != false || raise("Passed value for field obj.provider_count is not the expected type, validation failed.")
152
- obj.payer.nil? || Payers::V3::Payer.validate_raw(obj: obj.payer)
152
+ Payers::V3::Payer.validate_raw(obj: obj.payer)
153
153
  obj.effective_date.is_a?(String) != false || raise("Passed value for field obj.effective_date is not the expected type, validation failed.")
154
154
  obj.expiration_date&.is_a?(String) != false || raise("Passed value for field obj.expiration_date is not the expected type, validation failed.")
155
155
  Commons::Regions.validate_raw(obj: obj.regions)
@@ -34,8 +34,8 @@ module CandidApiClient
34
34
  # @param medicaid_insurance_types [Contracts::V2::InsuranceTypes] The Medicaid plan insurance types this contract applies.
35
35
  # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
36
36
  # @return [Contracts::V2::ContractWithProviders]
37
- def initialize(rendering_provider_ids:, contract_id:, contracting_provider:, provider_count:, effective_date:,
38
- regions:, commercial_insurance_types:, medicare_insurance_types:, medicaid_insurance_types:, payer: nil, expiration_date: nil, contract_status: nil, authorized_signatory: nil, additional_properties: nil)
37
+ def initialize(rendering_provider_ids:, contract_id:, contracting_provider:, provider_count:, payer:,
38
+ effective_date:, regions:, commercial_insurance_types:, medicare_insurance_types:, medicaid_insurance_types:, expiration_date: nil, contract_status: nil, authorized_signatory: nil, additional_properties: nil)
39
39
  # @type [Set<UUID>] The providers who can render medical services under the contract
40
40
  @rendering_provider_ids = rendering_provider_ids
41
41
  # @type [Contracts::V2::CONTRACT_ID]
@@ -161,7 +161,7 @@ module CandidApiClient
161
161
  obj.contract_id.is_a?(UUID) != false || raise("Passed value for field obj.contract_id is not the expected type, validation failed.")
162
162
  OrganizationProviders::V2::OrganizationProvider.validate_raw(obj: obj.contracting_provider)
163
163
  obj.provider_count.is_a?(Integer) != false || raise("Passed value for field obj.provider_count is not the expected type, validation failed.")
164
- obj.payer.nil? || Payers::V3::Payer.validate_raw(obj: obj.payer)
164
+ Payers::V3::Payer.validate_raw(obj: obj.payer)
165
165
  obj.effective_date.is_a?(String) != false || raise("Passed value for field obj.effective_date is not the expected type, validation failed.")
166
166
  obj.expiration_date&.is_a?(String) != false || raise("Passed value for field obj.expiration_date is not the expected type, validation failed.")
167
167
  Commons::Regions.validate_raw(obj: obj.regions)
@@ -51,7 +51,7 @@ module CandidApiClient
51
51
  # - [Availity - Coverages 1.0.0 API](https://developer.availity.com/partner/documentation#c_coverages_references)
52
52
  # - [Candid Availity Eligibility Integration Guide](https://support.joincandidhealth.com/hc/en-us/articles/24218441631892--Availity-Eligibility-Integration-Guide)
53
53
  #
54
- # A schema of the response object can be found here: [Availity Docs](https://developer.availity.com/partner/product/191210/api/190898#/Coverages_100/operation/%2Fcoverages/get)
54
+ # A schema of the response object can be found here: [Availity Docs](https://developer.availity.com/partner/product/191210/api/190898#/Coverages_100/operation/%2Fcoverages%2F{id}/get)
55
55
  #
56
56
  # - Note Availity requires a free developer account to access this documentation.
57
57
  #
@@ -114,7 +114,7 @@ module CandidApiClient
114
114
  # - [Availity - Coverages 1.0.0 API](https://developer.availity.com/partner/documentation#c_coverages_references)
115
115
  # - [Candid Availity Eligibility Integration Guide](https://support.joincandidhealth.com/hc/en-us/articles/24218441631892--Availity-Eligibility-Integration-Guide)
116
116
  #
117
- # A schema of the response object can be found here: [Availity Docs](https://developer.availity.com/partner/product/191210/api/190898#/Coverages_100/operation/%2Fcoverages/get)
117
+ # A schema of the response object can be found here: [Availity Docs](https://developer.availity.com/partner/product/191210/api/190898#/Coverages_100/operation/%2Fcoverages%2F{id}/get)
118
118
  #
119
119
  # - Note Availity requires a free developer account to access this documentation.
120
120
  #
@@ -70,10 +70,11 @@ module CandidApiClient
70
70
  # @param billable_status [Encounters::V4::BillableStatusType] Defines if the Encounter is to be billed by Candid to the responsible_party. Examples for when this should be set to NOT_BILLABLE include if the Encounter has not occurred yet or if there is no intention of ever billing the responsible_party.
71
71
  # @param responsible_party [Encounters::V4::ResponsiblePartyType] Defines the party to be billed with the initial balance owed on the claim. Use SELF_PAY if you intend to bill self pay/cash pay.
72
72
  # @param owner_of_next_action [Encounters::V4::EncounterOwnerOfNextActionType] The party who is responsible for taking the next action on an Encounter, as defined by ownership of open Tasks.
73
+ # @param patient_external_id [String] The patient ID from the external EMR platform for the patient
73
74
  # @param request_options [RequestOptions]
74
75
  # @return [Encounters::V4::EncounterPage]
75
76
  def get_all(limit: nil, claim_status: nil, sort: nil, page_token: nil, date_of_service_min: nil,
76
- 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, request_options: nil)
77
+ 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)
77
78
  response = @request_client.conn.get("/api/encounters/v4") do |req|
78
79
  req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
79
80
  req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
@@ -94,7 +95,8 @@ module CandidApiClient
94
95
  "work_queue_id": work_queue_id,
95
96
  "billable_status": billable_status,
96
97
  "responsible_party": responsible_party,
97
- "owner_of_next_action": owner_of_next_action
98
+ "owner_of_next_action": owner_of_next_action,
99
+ "patient_external_id": patient_external_id
98
100
  }.compact
99
101
  end
100
102
  Encounters::V4::EncounterPage.from_json(json_object: response.body)
@@ -115,14 +117,6 @@ module CandidApiClient
115
117
  # @param external_id [Commons::ENCOUNTER_EXTERNAL_ID] A client-specified unique ID to associate with this encounter;
116
118
  # for example, your internal encounter ID or a Dr. Chrono encounter ID.
117
119
  # This field should not contain PHI.
118
- # @param date_of_service [Commons::DATE] Date formatted as YYYY-MM-DD; eg: 2019-08-24.
119
- # This date must be the local date in the timezone where the service occurred.
120
- # Box 24a on the CMS-1500 claim form.
121
- # If service occurred over a range of dates, this should be the start date.
122
- # @param end_date_of_service [Commons::DATE] Date formatted as YYYY-MM-DD; eg: 2019-08-25.
123
- # This date must be the local date in the timezone where the service occurred.
124
- # If omitted, the Encounter is assumed to be for a single day.
125
- # Must not be temporally before the date_of_service field.
126
120
  # @param prior_authorization_number [Encounters::V4::PRIOR_AUTHORIZATION_NUMBER] Box 23 on the CMS-1500 claim form.
127
121
  # @param patient_authorized_release [Boolean] Whether this patient has authorized the release of medical information
128
122
  # for billing purpose.
@@ -196,6 +190,17 @@ module CandidApiClient
196
190
  # @param delay_reason_code [Commons::DelayReasonCode] 837i Loop2300, CLM-1300 Box 20
197
191
  # Code indicating the reason why a request was delayed
198
192
  # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
193
+ # @param date_of_service [Commons::DATE] Date formatted as YYYY-MM-DD; eg: 2019-08-24.
194
+ # This date must be the local date in the timezone where the service occurred.
195
+ # Box 24a on the CMS-1500 claim form.
196
+ # If service occurred over a range of dates, this should be the start date.
197
+ # date_of_service must be defined on either the encounter or the service lines but not both.
198
+ # If there are greater than zero service lines, it is recommended to specify date_of_service on the service_line instead of on the encounter to prepare for future API versions.
199
+ # @param end_date_of_service [Commons::DATE] Date formatted as YYYY-MM-DD; eg: 2019-08-25.
200
+ # This date must be the local date in the timezone where the service occurred.
201
+ # If omitted, the Encounter is assumed to be for a single day.
202
+ # Must not be temporally before the date_of_service field.
203
+ # If there are greater than zero service lines, it is recommended to specify end_date_of_service on the service_line instead of on the encounter to prepare for future API versions.
199
204
  # @param patient [Hash] Contains the identification information of the individual receiving medical services.Request of type Individual::PatientCreate, as a Hash
200
205
  # * :phone_numbers (Array<Commons::PhoneNumber>)
201
206
  # * :phone_consent (Boolean)
@@ -357,6 +362,8 @@ module CandidApiClient
357
362
  # * :pharmacy_prescription_number (String)
358
363
  # * :place_of_service_code (Commons::FacilityTypeCode)
359
364
  # * :description (String)
365
+ # * :date_of_service (Date)
366
+ # * :end_date_of_service (Date)
360
367
  # @param guarantor [Hash] Personal and contact info for the guarantor of the patient responsibility.Request of type Guarantor::V1::GuarantorCreate, as a Hash
361
368
  # * :phone_numbers (Array<Commons::PhoneNumber>)
362
369
  # * :phone_consent (Boolean)
@@ -381,8 +388,8 @@ module CandidApiClient
381
388
  # * :submission_records (Array<ClaimSubmission::V1::ClaimSubmissionRecordCreate>)
382
389
  # @param request_options [RequestOptions]
383
390
  # @return [Encounters::V4::Encounter]
384
- def create(external_id:, date_of_service:, patient_authorized_release:, benefits_assigned_to_provider:,
385
- provider_accepts_assignment:, billable_status:, responsible_party:, patient:, billing_provider:, rendering_provider:, diagnoses:, place_of_service_code:, end_date_of_service: nil, 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, referring_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, request_options: nil)
391
+ def create(external_id:, patient_authorized_release:, benefits_assigned_to_provider:,
392
+ 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, date_of_service: nil, end_date_of_service: nil, referring_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, request_options: nil)
386
393
  response = @request_client.conn.post("/api/encounters/v4") do |req|
387
394
  req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
388
395
  req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
@@ -390,8 +397,6 @@ module CandidApiClient
390
397
  req.body = {
391
398
  **(request_options&.additional_body_parameters || {}),
392
399
  external_id: external_id,
393
- date_of_service: date_of_service,
394
- end_date_of_service: end_date_of_service,
395
400
  prior_authorization_number: prior_authorization_number,
396
401
  patient_authorized_release: patient_authorized_release,
397
402
  benefits_assigned_to_provider: benefits_assigned_to_provider,
@@ -412,6 +417,8 @@ module CandidApiClient
412
417
  last_menstrual_period_date: last_menstrual_period_date,
413
418
  delay_reason_code: delay_reason_code,
414
419
  additional_properties: additional_properties,
420
+ date_of_service: date_of_service,
421
+ end_date_of_service: end_date_of_service,
415
422
  patient: patient,
416
423
  billing_provider: billing_provider,
417
424
  rendering_provider: rendering_provider,
@@ -441,6 +448,7 @@ module CandidApiClient
441
448
  # This date must be the local date in the timezone where the service occurred.
442
449
  # Box 24a on the CMS-1500 claim form.
443
450
  # If service occurred over a range of dates, this should be the start date.
451
+ # If service lines have distinct date_of_service values, updating the encounter's date_of_service will fail. If all service line date_of_service values are the same, updating the encounter's date_of_service will update all service line date_of_service values.
444
452
  # @param diagnosis_ids [Array<Diagnoses::DIAGNOSIS_ID>] Ideally, this field should contain no more than 12 diagnoses. However, more diagnoses
445
453
  # may be submitted at this time, and coders will later prioritize the 12 that will be
446
454
  # submitted to the payor.
@@ -466,6 +474,7 @@ module CandidApiClient
466
474
  # This date must be the local date in the timezone where the service occurred.
467
475
  # If omitted, the Encounter is assumed to be for a single day.
468
476
  # Must not be temporally before the date_of_service field.
477
+ # If service lines have distinct end_date_of_service values, updating the encounter's end_date_of_service will fail. If all service line end_date_of_service values are the same, updating the encounter's end_date_of_service will update all service line date_of_service values.
469
478
  # @param subscriber_primary [Hash] Contains details of the primary insurance subscriber.Request of type Individual::SubscriberCreate, as a Hash
470
479
  # * :insurance_card (Hash)
471
480
  # * :member_id (String)
@@ -605,10 +614,11 @@ module CandidApiClient
605
614
  # @param billable_status [Encounters::V4::BillableStatusType] Defines if the Encounter is to be billed by Candid to the responsible_party. Examples for when this should be set to NOT_BILLABLE include if the Encounter has not occurred yet or if there is no intention of ever billing the responsible_party.
606
615
  # @param responsible_party [Encounters::V4::ResponsiblePartyType] Defines the party to be billed with the initial balance owed on the claim. Use SELF_PAY if you intend to bill self pay/cash pay.
607
616
  # @param owner_of_next_action [Encounters::V4::EncounterOwnerOfNextActionType] The party who is responsible for taking the next action on an Encounter, as defined by ownership of open Tasks.
617
+ # @param patient_external_id [String] The patient ID from the external EMR platform for the patient
608
618
  # @param request_options [RequestOptions]
609
619
  # @return [Encounters::V4::EncounterPage]
610
620
  def get_all(limit: nil, claim_status: nil, sort: nil, page_token: nil, date_of_service_min: nil,
611
- 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, request_options: nil)
621
+ 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)
612
622
  Async do
613
623
  response = @request_client.conn.get("/api/encounters/v4") do |req|
614
624
  req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
@@ -630,7 +640,8 @@ module CandidApiClient
630
640
  "work_queue_id": work_queue_id,
631
641
  "billable_status": billable_status,
632
642
  "responsible_party": responsible_party,
633
- "owner_of_next_action": owner_of_next_action
643
+ "owner_of_next_action": owner_of_next_action,
644
+ "patient_external_id": patient_external_id
634
645
  }.compact
635
646
  end
636
647
  Encounters::V4::EncounterPage.from_json(json_object: response.body)
@@ -654,14 +665,6 @@ module CandidApiClient
654
665
  # @param external_id [Commons::ENCOUNTER_EXTERNAL_ID] A client-specified unique ID to associate with this encounter;
655
666
  # for example, your internal encounter ID or a Dr. Chrono encounter ID.
656
667
  # This field should not contain PHI.
657
- # @param date_of_service [Commons::DATE] Date formatted as YYYY-MM-DD; eg: 2019-08-24.
658
- # This date must be the local date in the timezone where the service occurred.
659
- # Box 24a on the CMS-1500 claim form.
660
- # If service occurred over a range of dates, this should be the start date.
661
- # @param end_date_of_service [Commons::DATE] Date formatted as YYYY-MM-DD; eg: 2019-08-25.
662
- # This date must be the local date in the timezone where the service occurred.
663
- # If omitted, the Encounter is assumed to be for a single day.
664
- # Must not be temporally before the date_of_service field.
665
668
  # @param prior_authorization_number [Encounters::V4::PRIOR_AUTHORIZATION_NUMBER] Box 23 on the CMS-1500 claim form.
666
669
  # @param patient_authorized_release [Boolean] Whether this patient has authorized the release of medical information
667
670
  # for billing purpose.
@@ -735,6 +738,17 @@ module CandidApiClient
735
738
  # @param delay_reason_code [Commons::DelayReasonCode] 837i Loop2300, CLM-1300 Box 20
736
739
  # Code indicating the reason why a request was delayed
737
740
  # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
741
+ # @param date_of_service [Commons::DATE] Date formatted as YYYY-MM-DD; eg: 2019-08-24.
742
+ # This date must be the local date in the timezone where the service occurred.
743
+ # Box 24a on the CMS-1500 claim form.
744
+ # If service occurred over a range of dates, this should be the start date.
745
+ # date_of_service must be defined on either the encounter or the service lines but not both.
746
+ # If there are greater than zero service lines, it is recommended to specify date_of_service on the service_line instead of on the encounter to prepare for future API versions.
747
+ # @param end_date_of_service [Commons::DATE] Date formatted as YYYY-MM-DD; eg: 2019-08-25.
748
+ # This date must be the local date in the timezone where the service occurred.
749
+ # If omitted, the Encounter is assumed to be for a single day.
750
+ # Must not be temporally before the date_of_service field.
751
+ # If there are greater than zero service lines, it is recommended to specify end_date_of_service on the service_line instead of on the encounter to prepare for future API versions.
738
752
  # @param patient [Hash] Contains the identification information of the individual receiving medical services.Request of type Individual::PatientCreate, as a Hash
739
753
  # * :phone_numbers (Array<Commons::PhoneNumber>)
740
754
  # * :phone_consent (Boolean)
@@ -896,6 +910,8 @@ module CandidApiClient
896
910
  # * :pharmacy_prescription_number (String)
897
911
  # * :place_of_service_code (Commons::FacilityTypeCode)
898
912
  # * :description (String)
913
+ # * :date_of_service (Date)
914
+ # * :end_date_of_service (Date)
899
915
  # @param guarantor [Hash] Personal and contact info for the guarantor of the patient responsibility.Request of type Guarantor::V1::GuarantorCreate, as a Hash
900
916
  # * :phone_numbers (Array<Commons::PhoneNumber>)
901
917
  # * :phone_consent (Boolean)
@@ -920,8 +936,8 @@ module CandidApiClient
920
936
  # * :submission_records (Array<ClaimSubmission::V1::ClaimSubmissionRecordCreate>)
921
937
  # @param request_options [RequestOptions]
922
938
  # @return [Encounters::V4::Encounter]
923
- def create(external_id:, date_of_service:, patient_authorized_release:, benefits_assigned_to_provider:,
924
- provider_accepts_assignment:, billable_status:, responsible_party:, patient:, billing_provider:, rendering_provider:, diagnoses:, place_of_service_code:, end_date_of_service: nil, 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, referring_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, request_options: nil)
939
+ def create(external_id:, patient_authorized_release:, benefits_assigned_to_provider:,
940
+ 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, date_of_service: nil, end_date_of_service: nil, referring_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, request_options: nil)
925
941
  Async do
926
942
  response = @request_client.conn.post("/api/encounters/v4") do |req|
927
943
  req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
@@ -930,8 +946,6 @@ module CandidApiClient
930
946
  req.body = {
931
947
  **(request_options&.additional_body_parameters || {}),
932
948
  external_id: external_id,
933
- date_of_service: date_of_service,
934
- end_date_of_service: end_date_of_service,
935
949
  prior_authorization_number: prior_authorization_number,
936
950
  patient_authorized_release: patient_authorized_release,
937
951
  benefits_assigned_to_provider: benefits_assigned_to_provider,
@@ -952,6 +966,8 @@ module CandidApiClient
952
966
  last_menstrual_period_date: last_menstrual_period_date,
953
967
  delay_reason_code: delay_reason_code,
954
968
  additional_properties: additional_properties,
969
+ date_of_service: date_of_service,
970
+ end_date_of_service: end_date_of_service,
955
971
  patient: patient,
956
972
  billing_provider: billing_provider,
957
973
  rendering_provider: rendering_provider,
@@ -982,6 +998,7 @@ module CandidApiClient
982
998
  # This date must be the local date in the timezone where the service occurred.
983
999
  # Box 24a on the CMS-1500 claim form.
984
1000
  # If service occurred over a range of dates, this should be the start date.
1001
+ # If service lines have distinct date_of_service values, updating the encounter's date_of_service will fail. If all service line date_of_service values are the same, updating the encounter's date_of_service will update all service line date_of_service values.
985
1002
  # @param diagnosis_ids [Array<Diagnoses::DIAGNOSIS_ID>] Ideally, this field should contain no more than 12 diagnoses. However, more diagnoses
986
1003
  # may be submitted at this time, and coders will later prioritize the 12 that will be
987
1004
  # submitted to the payor.
@@ -1007,6 +1024,7 @@ module CandidApiClient
1007
1024
  # This date must be the local date in the timezone where the service occurred.
1008
1025
  # If omitted, the Encounter is assumed to be for a single day.
1009
1026
  # Must not be temporally before the date_of_service field.
1027
+ # If service lines have distinct end_date_of_service values, updating the encounter's end_date_of_service will fail. If all service line end_date_of_service values are the same, updating the encounter's end_date_of_service will update all service line date_of_service values.
1010
1028
  # @param subscriber_primary [Hash] Contains details of the primary insurance subscriber.Request of type Individual::SubscriberCreate, as a Hash
1011
1029
  # * :insurance_card (Hash)
1012
1030
  # * :member_id (String)