candidhealth 0.24.6 → 0.25.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.
Files changed (50) hide show
  1. checksums.yaml +4 -4
  2. data/lib/candidhealth/auth/v_2/client.rb +2 -2
  3. data/lib/candidhealth/billing_notes/v_2/client.rb +2 -2
  4. data/lib/candidhealth/contracts/v_2/client.rb +10 -10
  5. data/lib/candidhealth/custom_schemas/v_1/client.rb +8 -8
  6. data/lib/candidhealth/eligibility/v_2/client.rb +6 -6
  7. data/lib/candidhealth/encounters/v_4/client.rb +8 -8
  8. data/lib/candidhealth/expected_network_status/v_1/client.rb +2 -2
  9. data/lib/candidhealth/expected_network_status/v_2/client.rb +4 -4
  10. data/lib/candidhealth/exports/v_3/client.rb +2 -2
  11. data/lib/candidhealth/external_payment_account_config/v_1/client.rb +2 -2
  12. data/lib/candidhealth/fee_schedules/v_3/client.rb +20 -20
  13. data/lib/candidhealth/financials/types/allocation_target.rb +13 -0
  14. data/lib/candidhealth/financials/types/allocation_target_create.rb +12 -0
  15. data/lib/candidhealth/financials/types/appointment_allocation_target.rb +58 -0
  16. data/lib/candidhealth/guarantor/v_1/client.rb +6 -6
  17. data/lib/candidhealth/import_invoice/v_1/client.rb +8 -8
  18. data/lib/candidhealth/insurance_adjudications/v_1/client.rb +6 -6
  19. data/lib/candidhealth/insurance_payments/v_1/client.rb +10 -10
  20. data/lib/candidhealth/insurance_refunds/v_1/client.rb +10 -10
  21. data/lib/candidhealth/organization_providers/v_3/client.rb +8 -8
  22. data/lib/candidhealth/organization_service_facilities/v_2/client.rb +10 -10
  23. data/lib/candidhealth/patient_payments/v_4/client.rb +10 -10
  24. data/lib/candidhealth/patient_refunds/v_1/client.rb +10 -10
  25. data/lib/candidhealth/payers/v_3/client.rb +4 -4
  26. data/lib/candidhealth/pre_encounter/common/types/external_provider.rb +129 -0
  27. data/lib/candidhealth/pre_encounter/common/types/external_provider_type.rb +14 -0
  28. data/lib/candidhealth/pre_encounter/coverages/v_1/client.rb +28 -24
  29. data/lib/candidhealth/pre_encounter/coverages/v_1/types/insurance_plan.rb +13 -4
  30. data/lib/candidhealth/pre_encounter/coverages/v_1/types/insurance_type_code.rb +86 -0
  31. data/lib/candidhealth/pre_encounter/coverages/v_1/types/network_type.rb +5 -0
  32. data/lib/candidhealth/pre_encounter/coverages/v_1/types/subscriber.rb +10 -10
  33. data/lib/candidhealth/pre_encounter/patients/v_1/client.rb +22 -22
  34. data/lib/candidhealth/pre_encounter/patients/v_1/types/contact.rb +1 -11
  35. data/lib/candidhealth/pre_encounter/patients/v_1/types/mutable_patient.rb +14 -10
  36. data/lib/candidhealth/pre_encounter/patients/v_1/types/patient.rb +13 -9
  37. data/lib/candidhealth/service_facility/client.rb +2 -2
  38. data/lib/candidhealth/service_lines/client.rb +30 -0
  39. data/lib/candidhealth/service_lines/v_2/client.rb +229 -0
  40. data/lib/candidhealth/service_lines/v_2/types/service_line_create_standalone.rb +279 -0
  41. data/lib/candidhealth/service_lines/v_2/types/service_line_update.rb +281 -0
  42. data/lib/candidhealth/tasks/v_3/client.rb +10 -10
  43. data/lib/candidhealth/write_offs/v_1/client.rb +8 -8
  44. data/lib/candidhealth/write_offs/v_1/types/patient_write_off.rb +18 -2
  45. data/lib/candidhealth.rb +9 -2
  46. data/lib/environment.rb +8 -0
  47. data/lib/requests.rb +6 -4
  48. data/lib/types_export.rb +6 -1
  49. metadata +10 -3
  50. data/lib/candidhealth/pre_encounter/patients/v_1/types/external_provider.rb +0 -122
@@ -2,7 +2,6 @@
2
2
 
3
3
  require_relative "../../../common/types/relationship"
4
4
  require_relative "../../../common/types/human_name"
5
- require_relative "../../../common/types/gender"
6
5
  require_relative "../../../common/types/contact_point"
7
6
  require_relative "../../../common/types/address"
8
7
  require_relative "../../../common/types/period"
@@ -19,8 +18,6 @@ module CandidApiClient
19
18
  attr_reader :relationship
20
19
  # @return [CandidApiClient::PreEncounter::Common::Types::HumanName]
21
20
  attr_reader :name
22
- # @return [CandidApiClient::PreEncounter::Common::Types::Gender]
23
- attr_reader :gender
24
21
  # @return [Array<CandidApiClient::PreEncounter::Common::Types::ContactPoint>]
25
22
  attr_reader :telecoms
26
23
  # @return [Array<CandidApiClient::PreEncounter::Common::Types::Address>]
@@ -37,17 +34,14 @@ module CandidApiClient
37
34
 
38
35
  # @param relationship [Array<CandidApiClient::PreEncounter::Common::Types::Relationship>]
39
36
  # @param name [CandidApiClient::PreEncounter::Common::Types::HumanName]
40
- # @param gender [CandidApiClient::PreEncounter::Common::Types::Gender]
41
37
  # @param telecoms [Array<CandidApiClient::PreEncounter::Common::Types::ContactPoint>]
42
38
  # @param addresses [Array<CandidApiClient::PreEncounter::Common::Types::Address>]
43
39
  # @param period [CandidApiClient::PreEncounter::Common::Types::Period]
44
40
  # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
45
41
  # @return [CandidApiClient::PreEncounter::Patients::V1::Types::Contact]
46
- def initialize(relationship:, name:, telecoms:, addresses:, gender: OMIT, period: OMIT,
47
- additional_properties: nil)
42
+ def initialize(relationship:, name:, telecoms:, addresses:, period: OMIT, additional_properties: nil)
48
43
  @relationship = relationship
49
44
  @name = name
50
- @gender = gender if gender != OMIT
51
45
  @telecoms = telecoms
52
46
  @addresses = addresses
53
47
  @period = period if period != OMIT
@@ -55,7 +49,6 @@ module CandidApiClient
55
49
  @_field_set = {
56
50
  "relationship": relationship,
57
51
  "name": name,
58
- "gender": gender,
59
52
  "telecoms": telecoms,
60
53
  "addresses": addresses,
61
54
  "period": period
@@ -78,7 +71,6 @@ module CandidApiClient
78
71
  name = parsed_json["name"].to_json
79
72
  name = CandidApiClient::PreEncounter::Common::Types::HumanName.from_json(json_object: name)
80
73
  end
81
- gender = struct["gender"]
82
74
  telecoms = parsed_json["telecoms"]&.map do |item|
83
75
  item = item.to_json
84
76
  CandidApiClient::PreEncounter::Common::Types::ContactPoint.from_json(json_object: item)
@@ -96,7 +88,6 @@ module CandidApiClient
96
88
  new(
97
89
  relationship: relationship,
98
90
  name: name,
99
- gender: gender,
100
91
  telecoms: telecoms,
101
92
  addresses: addresses,
102
93
  period: period,
@@ -120,7 +111,6 @@ module CandidApiClient
120
111
  def self.validate_raw(obj:)
121
112
  obj.relationship.is_a?(Array) != false || raise("Passed value for field obj.relationship is not the expected type, validation failed.")
122
113
  CandidApiClient::PreEncounter::Common::Types::HumanName.validate_raw(obj: obj.name)
123
- obj.gender&.is_a?(CandidApiClient::PreEncounter::Common::Types::Gender) != false || raise("Passed value for field obj.gender is not the expected type, validation failed.")
124
114
  obj.telecoms.is_a?(Array) != false || raise("Passed value for field obj.telecoms is not the expected type, validation failed.")
125
115
  obj.addresses.is_a?(Array) != false || raise("Passed value for field obj.addresses is not the expected type, validation failed.")
126
116
  obj.period.nil? || CandidApiClient::PreEncounter::Common::Types::Period.validate_raw(obj: obj.period)
@@ -13,7 +13,7 @@ require_relative "../../../common/types/address"
13
13
  require_relative "../../../common/types/contact_point"
14
14
  require_relative "external_provenance"
15
15
  require_relative "contact"
16
- require_relative "external_provider"
16
+ require_relative "../../../common/types/external_provider"
17
17
  require_relative "filing_order"
18
18
  require "ostruct"
19
19
  require "json"
@@ -35,7 +35,9 @@ module CandidApiClient
35
35
  attr_reader :birth_date
36
36
  # @return [String]
37
37
  attr_reader :social_security_number
38
- # @return [CandidApiClient::PreEncounter::Common::Types::Sex] The biological sex of the patient.
38
+ # @return [CandidApiClient::PreEncounter::Common::Types::Sex] The biological sex of the patient. This corresponds to the HL7
39
+ # AdministrativeGender
40
+ # https://www.hl7.org/fhir/valueset-administrative-gender.html
39
41
  attr_reader :biological_sex
40
42
  # @return [CandidApiClient::PreEncounter::Common::Types::SexualOrientation] The sexual orientation of the patient.
41
43
  attr_reader :sexual_orientation
@@ -73,7 +75,7 @@ module CandidApiClient
73
75
  attr_reader :external_provenance
74
76
  # @return [Array<CandidApiClient::PreEncounter::Patients::V1::Types::Contact>] Contacts for the patient.
75
77
  attr_reader :contacts
76
- # @return [Array<CandidApiClient::PreEncounter::Patients::V1::Types::ExternalProvider>]
78
+ # @return [Array<CandidApiClient::PreEncounter::Common::Types::ExternalProvider>]
77
79
  attr_reader :general_practitioners
78
80
  # @return [CandidApiClient::PreEncounter::Patients::V1::Types::FilingOrder]
79
81
  attr_reader :filing_order
@@ -90,7 +92,9 @@ module CandidApiClient
90
92
  # @param gender [CandidApiClient::PreEncounter::Common::Types::Gender]
91
93
  # @param birth_date [Date]
92
94
  # @param social_security_number [String]
93
- # @param biological_sex [CandidApiClient::PreEncounter::Common::Types::Sex] The biological sex of the patient.
95
+ # @param biological_sex [CandidApiClient::PreEncounter::Common::Types::Sex] The biological sex of the patient. This corresponds to the HL7
96
+ # AdministrativeGender
97
+ # https://www.hl7.org/fhir/valueset-administrative-gender.html
94
98
  # @param sexual_orientation [CandidApiClient::PreEncounter::Common::Types::SexualOrientation] The sexual orientation of the patient.
95
99
  # @param race [CandidApiClient::PreEncounter::Common::Types::Race]
96
100
  # @param ethnicity [CandidApiClient::PreEncounter::Common::Types::Ethnicity]
@@ -110,18 +114,18 @@ module CandidApiClient
110
114
  # @param external_provenance [CandidApiClient::PreEncounter::Patients::V1::Types::ExternalProvenance] Information about the upstream system that owns this patient data. Leave unset
111
115
  # if Candid owns patient data.
112
116
  # @param contacts [Array<CandidApiClient::PreEncounter::Patients::V1::Types::Contact>] Contacts for the patient.
113
- # @param general_practitioners [Array<CandidApiClient::PreEncounter::Patients::V1::Types::ExternalProvider>]
117
+ # @param general_practitioners [Array<CandidApiClient::PreEncounter::Common::Types::ExternalProvider>]
114
118
  # @param filing_order [CandidApiClient::PreEncounter::Patients::V1::Types::FilingOrder]
115
119
  # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
116
120
  # @return [CandidApiClient::PreEncounter::Patients::V1::Types::MutablePatient]
117
- def initialize(name:, other_names:, birth_date:, primary_address:, other_addresses:, primary_telecom:, other_telecoms:, contacts:, general_practitioners:, filing_order:, gender: OMIT, social_security_number: OMIT,
118
- biological_sex: OMIT, sexual_orientation: OMIT, race: OMIT, ethnicity: OMIT, disability_status: OMIT, marital_status: OMIT, deceased: OMIT, multiple_birth: OMIT, email: OMIT, electronic_communication_opt_in: OMIT, photo: OMIT, language: OMIT, external_provenance: OMIT, additional_properties: nil)
121
+ def initialize(name:, other_names:, birth_date:, biological_sex:, primary_address:, other_addresses:,
122
+ primary_telecom:, other_telecoms:, contacts:, general_practitioners:, filing_order:, gender: OMIT, social_security_number: OMIT, sexual_orientation: OMIT, race: OMIT, ethnicity: OMIT, disability_status: OMIT, marital_status: OMIT, deceased: OMIT, multiple_birth: OMIT, email: OMIT, electronic_communication_opt_in: OMIT, photo: OMIT, language: OMIT, external_provenance: OMIT, additional_properties: nil)
119
123
  @name = name
120
124
  @other_names = other_names
121
125
  @gender = gender if gender != OMIT
122
126
  @birth_date = birth_date
123
127
  @social_security_number = social_security_number if social_security_number != OMIT
124
- @biological_sex = biological_sex if biological_sex != OMIT
128
+ @biological_sex = biological_sex
125
129
  @sexual_orientation = sexual_orientation if sexual_orientation != OMIT
126
130
  @race = race if race != OMIT
127
131
  @ethnicity = ethnicity if ethnicity != OMIT
@@ -239,7 +243,7 @@ module CandidApiClient
239
243
  end
240
244
  general_practitioners = parsed_json["general_practitioners"]&.map do |item|
241
245
  item = item.to_json
242
- CandidApiClient::PreEncounter::Patients::V1::Types::ExternalProvider.from_json(json_object: item)
246
+ CandidApiClient::PreEncounter::Common::Types::ExternalProvider.from_json(json_object: item)
243
247
  end
244
248
  if parsed_json["filing_order"].nil?
245
249
  filing_order = nil
@@ -296,7 +300,7 @@ module CandidApiClient
296
300
  obj.gender&.is_a?(CandidApiClient::PreEncounter::Common::Types::Gender) != false || raise("Passed value for field obj.gender is not the expected type, validation failed.")
297
301
  obj.birth_date.is_a?(Date) != false || raise("Passed value for field obj.birth_date is not the expected type, validation failed.")
298
302
  obj.social_security_number&.is_a?(String) != false || raise("Passed value for field obj.social_security_number is not the expected type, validation failed.")
299
- obj.biological_sex&.is_a?(CandidApiClient::PreEncounter::Common::Types::Sex) != false || raise("Passed value for field obj.biological_sex is not the expected type, validation failed.")
303
+ obj.biological_sex.is_a?(CandidApiClient::PreEncounter::Common::Types::Sex) != false || raise("Passed value for field obj.biological_sex is not the expected type, validation failed.")
300
304
  obj.sexual_orientation&.is_a?(CandidApiClient::PreEncounter::Common::Types::SexualOrientation) != false || raise("Passed value for field obj.sexual_orientation is not the expected type, validation failed.")
301
305
  obj.race&.is_a?(CandidApiClient::PreEncounter::Common::Types::Race) != false || raise("Passed value for field obj.race is not the expected type, validation failed.")
302
306
  obj.ethnicity&.is_a?(CandidApiClient::PreEncounter::Common::Types::Ethnicity) != false || raise("Passed value for field obj.ethnicity is not the expected type, validation failed.")
@@ -13,7 +13,7 @@ require_relative "../../../common/types/address"
13
13
  require_relative "../../../common/types/contact_point"
14
14
  require_relative "external_provenance"
15
15
  require_relative "contact"
16
- require_relative "external_provider"
16
+ require_relative "../../../common/types/external_provider"
17
17
  require_relative "filing_order"
18
18
  require "ostruct"
19
19
  require "json"
@@ -53,7 +53,9 @@ module CandidApiClient
53
53
  attr_reader :birth_date
54
54
  # @return [String]
55
55
  attr_reader :social_security_number
56
- # @return [CandidApiClient::PreEncounter::Common::Types::Sex] The biological sex of the patient.
56
+ # @return [CandidApiClient::PreEncounter::Common::Types::Sex] The biological sex of the patient. This corresponds to the HL7
57
+ # AdministrativeGender
58
+ # https://www.hl7.org/fhir/valueset-administrative-gender.html
57
59
  attr_reader :biological_sex
58
60
  # @return [CandidApiClient::PreEncounter::Common::Types::SexualOrientation] The sexual orientation of the patient.
59
61
  attr_reader :sexual_orientation
@@ -91,7 +93,7 @@ module CandidApiClient
91
93
  attr_reader :external_provenance
92
94
  # @return [Array<CandidApiClient::PreEncounter::Patients::V1::Types::Contact>] Contacts for the patient.
93
95
  attr_reader :contacts
94
- # @return [Array<CandidApiClient::PreEncounter::Patients::V1::Types::ExternalProvider>]
96
+ # @return [Array<CandidApiClient::PreEncounter::Common::Types::ExternalProvider>]
95
97
  attr_reader :general_practitioners
96
98
  # @return [CandidApiClient::PreEncounter::Patients::V1::Types::FilingOrder]
97
99
  attr_reader :filing_order
@@ -119,7 +121,9 @@ module CandidApiClient
119
121
  # @param gender [CandidApiClient::PreEncounter::Common::Types::Gender]
120
122
  # @param birth_date [Date]
121
123
  # @param social_security_number [String]
122
- # @param biological_sex [CandidApiClient::PreEncounter::Common::Types::Sex] The biological sex of the patient.
124
+ # @param biological_sex [CandidApiClient::PreEncounter::Common::Types::Sex] The biological sex of the patient. This corresponds to the HL7
125
+ # AdministrativeGender
126
+ # https://www.hl7.org/fhir/valueset-administrative-gender.html
123
127
  # @param sexual_orientation [CandidApiClient::PreEncounter::Common::Types::SexualOrientation] The sexual orientation of the patient.
124
128
  # @param race [CandidApiClient::PreEncounter::Common::Types::Race]
125
129
  # @param ethnicity [CandidApiClient::PreEncounter::Common::Types::Ethnicity]
@@ -139,12 +143,12 @@ module CandidApiClient
139
143
  # @param external_provenance [CandidApiClient::PreEncounter::Patients::V1::Types::ExternalProvenance] Information about the upstream system that owns this patient data. Leave unset
140
144
  # if Candid owns patient data.
141
145
  # @param contacts [Array<CandidApiClient::PreEncounter::Patients::V1::Types::Contact>] Contacts for the patient.
142
- # @param general_practitioners [Array<CandidApiClient::PreEncounter::Patients::V1::Types::ExternalProvider>]
146
+ # @param general_practitioners [Array<CandidApiClient::PreEncounter::Common::Types::ExternalProvider>]
143
147
  # @param filing_order [CandidApiClient::PreEncounter::Patients::V1::Types::FilingOrder]
144
148
  # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
145
149
  # @return [CandidApiClient::PreEncounter::Patients::V1::Types::Patient]
146
150
  def initialize(id:, mrn:, organization_id:, deactivated:, version:, updated_at:, updating_user_id:, name:,
147
- other_names:, birth_date:, primary_address:, other_addresses:, primary_telecom:, other_telecoms:, contacts:, general_practitioners:, filing_order:, gender: OMIT, social_security_number: OMIT, biological_sex: OMIT, sexual_orientation: OMIT, race: OMIT, ethnicity: OMIT, disability_status: OMIT, marital_status: OMIT, deceased: OMIT, multiple_birth: OMIT, email: OMIT, electronic_communication_opt_in: OMIT, photo: OMIT, language: OMIT, external_provenance: OMIT, additional_properties: nil)
151
+ other_names:, birth_date:, biological_sex:, primary_address:, other_addresses:, primary_telecom:, other_telecoms:, contacts:, general_practitioners:, filing_order:, gender: OMIT, social_security_number: OMIT, sexual_orientation: OMIT, race: OMIT, ethnicity: OMIT, disability_status: OMIT, marital_status: OMIT, deceased: OMIT, multiple_birth: OMIT, email: OMIT, electronic_communication_opt_in: OMIT, photo: OMIT, language: OMIT, external_provenance: OMIT, additional_properties: nil)
148
152
  @id = id
149
153
  @mrn = mrn
150
154
  @organization_id = organization_id
@@ -157,7 +161,7 @@ module CandidApiClient
157
161
  @gender = gender if gender != OMIT
158
162
  @birth_date = birth_date
159
163
  @social_security_number = social_security_number if social_security_number != OMIT
160
- @biological_sex = biological_sex if biological_sex != OMIT
164
+ @biological_sex = biological_sex
161
165
  @sexual_orientation = sexual_orientation if sexual_orientation != OMIT
162
166
  @race = race if race != OMIT
163
167
  @ethnicity = ethnicity if ethnicity != OMIT
@@ -289,7 +293,7 @@ module CandidApiClient
289
293
  end
290
294
  general_practitioners = parsed_json["general_practitioners"]&.map do |item|
291
295
  item = item.to_json
292
- CandidApiClient::PreEncounter::Patients::V1::Types::ExternalProvider.from_json(json_object: item)
296
+ CandidApiClient::PreEncounter::Common::Types::ExternalProvider.from_json(json_object: item)
293
297
  end
294
298
  if parsed_json["filing_order"].nil?
295
299
  filing_order = nil
@@ -360,7 +364,7 @@ module CandidApiClient
360
364
  obj.gender&.is_a?(CandidApiClient::PreEncounter::Common::Types::Gender) != false || raise("Passed value for field obj.gender is not the expected type, validation failed.")
361
365
  obj.birth_date.is_a?(Date) != false || raise("Passed value for field obj.birth_date is not the expected type, validation failed.")
362
366
  obj.social_security_number&.is_a?(String) != false || raise("Passed value for field obj.social_security_number is not the expected type, validation failed.")
363
- obj.biological_sex&.is_a?(CandidApiClient::PreEncounter::Common::Types::Sex) != false || raise("Passed value for field obj.biological_sex is not the expected type, validation failed.")
367
+ obj.biological_sex.is_a?(CandidApiClient::PreEncounter::Common::Types::Sex) != false || raise("Passed value for field obj.biological_sex is not the expected type, validation failed.")
364
368
  obj.sexual_orientation&.is_a?(CandidApiClient::PreEncounter::Common::Types::SexualOrientation) != false || raise("Passed value for field obj.sexual_orientation is not the expected type, validation failed.")
365
369
  obj.race&.is_a?(CandidApiClient::PreEncounter::Common::Types::Race) != false || raise("Passed value for field obj.race is not the expected type, validation failed.")
366
370
  obj.ethnicity&.is_a?(CandidApiClient::PreEncounter::Common::Types::Ethnicity) != false || raise("Passed value for field obj.ethnicity is not the expected type, validation failed.")
@@ -32,7 +32,7 @@ module CandidApiClient
32
32
  # @param request_options [CandidApiClient::RequestOptions]
33
33
  # @return [CandidApiClient::ServiceFacility::Types::EncounterServiceFacility]
34
34
  # @example
35
- # api = CandidApiClient::Client.new(base_url: "https://api.example.com")
35
+ # api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
36
36
  # api.service_facility.update(
37
37
  # service_facility_id: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32",
38
38
  # organization_name: "string",
@@ -87,7 +87,7 @@ module CandidApiClient
87
87
  # @param request_options [CandidApiClient::RequestOptions]
88
88
  # @return [CandidApiClient::ServiceFacility::Types::EncounterServiceFacility]
89
89
  # @example
90
- # api = CandidApiClient::Client.new(base_url: "https://api.example.com")
90
+ # api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
91
91
  # api.service_facility.update(
92
92
  # service_facility_id: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32",
93
93
  # organization_name: "string",
@@ -0,0 +1,30 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "../../requests"
4
+ require_relative "v_2/client"
5
+
6
+ module CandidApiClient
7
+ module ServiceLines
8
+ class Client
9
+ # @return [CandidApiClient::ServiceLines::V2::V2Client]
10
+ attr_reader :v_2
11
+
12
+ # @param request_client [CandidApiClient::RequestClient]
13
+ # @return [CandidApiClient::ServiceLines::Client]
14
+ def initialize(request_client:)
15
+ @v_2 = CandidApiClient::ServiceLines::V2::V2Client.new(request_client: request_client)
16
+ end
17
+ end
18
+
19
+ class AsyncClient
20
+ # @return [CandidApiClient::ServiceLines::V2::AsyncV2Client]
21
+ attr_reader :v_2
22
+
23
+ # @param request_client [CandidApiClient::AsyncRequestClient]
24
+ # @return [CandidApiClient::ServiceLines::AsyncClient]
25
+ def initialize(request_client:)
26
+ @v_2 = CandidApiClient::ServiceLines::V2::AsyncV2Client.new(request_client: request_client)
27
+ end
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,229 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "../../../requests"
4
+ require_relative "types/service_line_create_standalone"
5
+ require_relative "types/service_line"
6
+ require_relative "types/service_line_update"
7
+ require "async"
8
+
9
+ module CandidApiClient
10
+ module ServiceLines
11
+ module V2
12
+ class V2Client
13
+ # @return [CandidApiClient::RequestClient]
14
+ attr_reader :request_client
15
+
16
+ # @param request_client [CandidApiClient::RequestClient]
17
+ # @return [CandidApiClient::ServiceLines::V2::V2Client]
18
+ def initialize(request_client:)
19
+ @request_client = request_client
20
+ end
21
+
22
+ # @param request [Hash] Request of type CandidApiClient::ServiceLines::V2::Types::ServiceLineCreateStandalone, as a Hash
23
+ # * :modifiers (Array<CandidApiClient::Commons::Types::ProcedureModifier>)
24
+ # * :charge_amount_cents (Integer)
25
+ # * :allowed_amount_cents (Integer)
26
+ # * :insurance_balance_cents (Integer)
27
+ # * :patient_balance_cents (Integer)
28
+ # * :primary_paid_amount_cents (Integer)
29
+ # * :secondary_paid_amount_cents (Integer)
30
+ # * :tertiary_paid_amount_cents (Integer)
31
+ # * :patient_responsibility_cents (Integer)
32
+ # * :diagnosis_id_zero (String)
33
+ # * :diagnosis_id_one (String)
34
+ # * :diagnosis_id_two (String)
35
+ # * :diagnosis_id_three (String)
36
+ # * :service_line_manual_adjustments (Array<CandidApiClient::ServiceLines::V2::Types::ServiceLineAdjustment>)
37
+ # * :denial_reason (Hash)
38
+ # * :reason (CandidApiClient::ServiceLines::V2::Types::DenialReasonContent)
39
+ # * :place_of_service_code (CandidApiClient::Commons::Types::FacilityTypeCode)
40
+ # * :place_of_service_code_as_submitted (CandidApiClient::Commons::Types::FacilityTypeCode)
41
+ # * :procedure_code (String)
42
+ # * :quantity (String)
43
+ # * :units (CandidApiClient::Commons::Types::ServiceLineUnits)
44
+ # * :claim_id (String)
45
+ # * :description (String)
46
+ # * :date_of_service (Date)
47
+ # * :end_date_of_service (Date)
48
+ # @param request_options [CandidApiClient::RequestOptions]
49
+ # @return [CandidApiClient::ServiceLines::V2::Types::ServiceLine]
50
+ # @example
51
+ # api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
52
+ # api.service_lines.v_2.create(request: { modifiers: [TWENTY_TWO], charge_amount_cents: 1, allowed_amount_cents: 1, insurance_balance_cents: 1, patient_balance_cents: 1, primary_paid_amount_cents: 1, secondary_paid_amount_cents: 1, tertiary_paid_amount_cents: 1, patient_responsibility_cents: 1, diagnosis_id_zero: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", diagnosis_id_one: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", diagnosis_id_two: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", diagnosis_id_three: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", service_line_manual_adjustments: [{ }], denial_reason: { }, place_of_service_code: PHARMACY, place_of_service_code_as_submitted: PHARMACY, procedure_code: "string", quantity: "string", units: MJ, claim_id: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", description: "string", date_of_service: DateTime.parse(2023-01-15), end_date_of_service: DateTime.parse(2023-01-15) })
53
+ def create(request:, request_options: nil)
54
+ response = @request_client.conn.post do |req|
55
+ req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
56
+ req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
57
+ req.headers = {
58
+ **(req.headers || {}),
59
+ **@request_client.get_headers,
60
+ **(request_options&.additional_headers || {})
61
+ }.compact
62
+ req.body = { **(request || {}), **(request_options&.additional_body_parameters || {}) }.compact
63
+ req.url "#{@request_client.get_url(environment: CandidApi,
64
+ request_options: request_options)}/api/service-lines/v2"
65
+ end
66
+ CandidApiClient::ServiceLines::V2::Types::ServiceLine.from_json(json_object: response.body)
67
+ end
68
+
69
+ # @param service_line_id [String]
70
+ # @param request [Hash] Request of type CandidApiClient::ServiceLines::V2::Types::ServiceLineUpdate, as a Hash
71
+ # * :edit_reason (String)
72
+ # * :modifiers (Array<CandidApiClient::Commons::Types::ProcedureModifier>)
73
+ # * :charge_amount_cents (Integer)
74
+ # * :allowed_amount_cents (Integer)
75
+ # * :insurance_balance_cents (Integer)
76
+ # * :patient_balance_cents (Integer)
77
+ # * :primary_paid_amount_cents (Integer)
78
+ # * :secondary_paid_amount_cents (Integer)
79
+ # * :tertiary_paid_amount_cents (Integer)
80
+ # * :patient_responsibility_cents (Integer)
81
+ # * :diagnosis_id_zero (String)
82
+ # * :diagnosis_id_one (String)
83
+ # * :diagnosis_id_two (String)
84
+ # * :diagnosis_id_three (String)
85
+ # * :service_line_manual_adjustments (Array<CandidApiClient::ServiceLines::V2::Types::ServiceLineAdjustment>)
86
+ # * :denial_reason (Hash)
87
+ # * :reason (CandidApiClient::ServiceLines::V2::Types::DenialReasonContent)
88
+ # * :place_of_service_code (CandidApiClient::Commons::Types::FacilityTypeCode)
89
+ # * :place_of_service_code_as_submitted (CandidApiClient::Commons::Types::FacilityTypeCode)
90
+ # * :units (CandidApiClient::Commons::Types::ServiceLineUnits)
91
+ # * :procedure_code (String)
92
+ # * :quantity (String)
93
+ # * :description (String)
94
+ # * :date_of_service (Date)
95
+ # * :end_date_of_service (Date)
96
+ # @param request_options [CandidApiClient::RequestOptions]
97
+ # @return [CandidApiClient::ServiceLines::V2::Types::ServiceLine]
98
+ # @example
99
+ # api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
100
+ # api.service_lines.v_2.update(service_line_id: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", request: { edit_reason: "string", modifiers: [TWENTY_TWO], charge_amount_cents: 1, allowed_amount_cents: 1, insurance_balance_cents: 1, patient_balance_cents: 1, primary_paid_amount_cents: 1, secondary_paid_amount_cents: 1, tertiary_paid_amount_cents: 1, patient_responsibility_cents: 1, diagnosis_id_zero: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", diagnosis_id_one: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", diagnosis_id_two: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", diagnosis_id_three: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", service_line_manual_adjustments: [{ }], denial_reason: { }, place_of_service_code: PHARMACY, place_of_service_code_as_submitted: PHARMACY, units: MJ, procedure_code: "string", quantity: "string", description: "string", date_of_service: DateTime.parse(2023-01-15), end_date_of_service: DateTime.parse(2023-01-15) })
101
+ def update(service_line_id:, request:, request_options: nil)
102
+ response = @request_client.conn.patch do |req|
103
+ req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
104
+ req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
105
+ req.headers = {
106
+ **(req.headers || {}),
107
+ **@request_client.get_headers,
108
+ **(request_options&.additional_headers || {})
109
+ }.compact
110
+ req.body = { **(request || {}), **(request_options&.additional_body_parameters || {}) }.compact
111
+ req.url "#{@request_client.get_url(environment: CandidApi,
112
+ request_options: request_options)}/api/service-lines/v2/#{service_line_id}"
113
+ end
114
+ CandidApiClient::ServiceLines::V2::Types::ServiceLine.from_json(json_object: response.body)
115
+ end
116
+ end
117
+
118
+ class AsyncV2Client
119
+ # @return [CandidApiClient::AsyncRequestClient]
120
+ attr_reader :request_client
121
+
122
+ # @param request_client [CandidApiClient::AsyncRequestClient]
123
+ # @return [CandidApiClient::ServiceLines::V2::AsyncV2Client]
124
+ def initialize(request_client:)
125
+ @request_client = request_client
126
+ end
127
+
128
+ # @param request [Hash] Request of type CandidApiClient::ServiceLines::V2::Types::ServiceLineCreateStandalone, as a Hash
129
+ # * :modifiers (Array<CandidApiClient::Commons::Types::ProcedureModifier>)
130
+ # * :charge_amount_cents (Integer)
131
+ # * :allowed_amount_cents (Integer)
132
+ # * :insurance_balance_cents (Integer)
133
+ # * :patient_balance_cents (Integer)
134
+ # * :primary_paid_amount_cents (Integer)
135
+ # * :secondary_paid_amount_cents (Integer)
136
+ # * :tertiary_paid_amount_cents (Integer)
137
+ # * :patient_responsibility_cents (Integer)
138
+ # * :diagnosis_id_zero (String)
139
+ # * :diagnosis_id_one (String)
140
+ # * :diagnosis_id_two (String)
141
+ # * :diagnosis_id_three (String)
142
+ # * :service_line_manual_adjustments (Array<CandidApiClient::ServiceLines::V2::Types::ServiceLineAdjustment>)
143
+ # * :denial_reason (Hash)
144
+ # * :reason (CandidApiClient::ServiceLines::V2::Types::DenialReasonContent)
145
+ # * :place_of_service_code (CandidApiClient::Commons::Types::FacilityTypeCode)
146
+ # * :place_of_service_code_as_submitted (CandidApiClient::Commons::Types::FacilityTypeCode)
147
+ # * :procedure_code (String)
148
+ # * :quantity (String)
149
+ # * :units (CandidApiClient::Commons::Types::ServiceLineUnits)
150
+ # * :claim_id (String)
151
+ # * :description (String)
152
+ # * :date_of_service (Date)
153
+ # * :end_date_of_service (Date)
154
+ # @param request_options [CandidApiClient::RequestOptions]
155
+ # @return [CandidApiClient::ServiceLines::V2::Types::ServiceLine]
156
+ # @example
157
+ # api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
158
+ # api.service_lines.v_2.create(request: { modifiers: [TWENTY_TWO], charge_amount_cents: 1, allowed_amount_cents: 1, insurance_balance_cents: 1, patient_balance_cents: 1, primary_paid_amount_cents: 1, secondary_paid_amount_cents: 1, tertiary_paid_amount_cents: 1, patient_responsibility_cents: 1, diagnosis_id_zero: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", diagnosis_id_one: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", diagnosis_id_two: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", diagnosis_id_three: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", service_line_manual_adjustments: [{ }], denial_reason: { }, place_of_service_code: PHARMACY, place_of_service_code_as_submitted: PHARMACY, procedure_code: "string", quantity: "string", units: MJ, claim_id: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", description: "string", date_of_service: DateTime.parse(2023-01-15), end_date_of_service: DateTime.parse(2023-01-15) })
159
+ def create(request:, request_options: nil)
160
+ Async do
161
+ response = @request_client.conn.post do |req|
162
+ req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
163
+ req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
164
+ req.headers = {
165
+ **(req.headers || {}),
166
+ **@request_client.get_headers,
167
+ **(request_options&.additional_headers || {})
168
+ }.compact
169
+ req.body = { **(request || {}), **(request_options&.additional_body_parameters || {}) }.compact
170
+ req.url "#{@request_client.get_url(environment: CandidApi,
171
+ request_options: request_options)}/api/service-lines/v2"
172
+ end
173
+ CandidApiClient::ServiceLines::V2::Types::ServiceLine.from_json(json_object: response.body)
174
+ end
175
+ end
176
+
177
+ # @param service_line_id [String]
178
+ # @param request [Hash] Request of type CandidApiClient::ServiceLines::V2::Types::ServiceLineUpdate, as a Hash
179
+ # * :edit_reason (String)
180
+ # * :modifiers (Array<CandidApiClient::Commons::Types::ProcedureModifier>)
181
+ # * :charge_amount_cents (Integer)
182
+ # * :allowed_amount_cents (Integer)
183
+ # * :insurance_balance_cents (Integer)
184
+ # * :patient_balance_cents (Integer)
185
+ # * :primary_paid_amount_cents (Integer)
186
+ # * :secondary_paid_amount_cents (Integer)
187
+ # * :tertiary_paid_amount_cents (Integer)
188
+ # * :patient_responsibility_cents (Integer)
189
+ # * :diagnosis_id_zero (String)
190
+ # * :diagnosis_id_one (String)
191
+ # * :diagnosis_id_two (String)
192
+ # * :diagnosis_id_three (String)
193
+ # * :service_line_manual_adjustments (Array<CandidApiClient::ServiceLines::V2::Types::ServiceLineAdjustment>)
194
+ # * :denial_reason (Hash)
195
+ # * :reason (CandidApiClient::ServiceLines::V2::Types::DenialReasonContent)
196
+ # * :place_of_service_code (CandidApiClient::Commons::Types::FacilityTypeCode)
197
+ # * :place_of_service_code_as_submitted (CandidApiClient::Commons::Types::FacilityTypeCode)
198
+ # * :units (CandidApiClient::Commons::Types::ServiceLineUnits)
199
+ # * :procedure_code (String)
200
+ # * :quantity (String)
201
+ # * :description (String)
202
+ # * :date_of_service (Date)
203
+ # * :end_date_of_service (Date)
204
+ # @param request_options [CandidApiClient::RequestOptions]
205
+ # @return [CandidApiClient::ServiceLines::V2::Types::ServiceLine]
206
+ # @example
207
+ # api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
208
+ # api.service_lines.v_2.update(service_line_id: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", request: { edit_reason: "string", modifiers: [TWENTY_TWO], charge_amount_cents: 1, allowed_amount_cents: 1, insurance_balance_cents: 1, patient_balance_cents: 1, primary_paid_amount_cents: 1, secondary_paid_amount_cents: 1, tertiary_paid_amount_cents: 1, patient_responsibility_cents: 1, diagnosis_id_zero: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", diagnosis_id_one: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", diagnosis_id_two: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", diagnosis_id_three: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", service_line_manual_adjustments: [{ }], denial_reason: { }, place_of_service_code: PHARMACY, place_of_service_code_as_submitted: PHARMACY, units: MJ, procedure_code: "string", quantity: "string", description: "string", date_of_service: DateTime.parse(2023-01-15), end_date_of_service: DateTime.parse(2023-01-15) })
209
+ def update(service_line_id:, request:, request_options: nil)
210
+ Async do
211
+ response = @request_client.conn.patch do |req|
212
+ req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
213
+ req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
214
+ req.headers = {
215
+ **(req.headers || {}),
216
+ **@request_client.get_headers,
217
+ **(request_options&.additional_headers || {})
218
+ }.compact
219
+ req.body = { **(request || {}), **(request_options&.additional_body_parameters || {}) }.compact
220
+ req.url "#{@request_client.get_url(environment: CandidApi,
221
+ request_options: request_options)}/api/service-lines/v2/#{service_line_id}"
222
+ end
223
+ CandidApiClient::ServiceLines::V2::Types::ServiceLine.from_json(json_object: response.body)
224
+ end
225
+ end
226
+ end
227
+ end
228
+ end
229
+ end