candidhealth 1.0.0 → 1.3.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 (58) hide show
  1. checksums.yaml +4 -4
  2. data/lib/candidhealth/auth/client.rb +7 -7
  3. data/lib/candidhealth/auth/{v_2 → default}/client.rb +39 -13
  4. data/lib/candidhealth/auth/{v_2 → default}/types/auth_get_token_response.rb +3 -3
  5. data/lib/candidhealth/auth/default/types/invalid_content_type_error_type.rb +60 -0
  6. data/lib/candidhealth/auth/{v_2 → default}/types/too_many_requests_error_type.rb +3 -3
  7. data/lib/candidhealth/billing_notes/v_2/types/billing_note_base_optional.rb +62 -0
  8. data/lib/candidhealth/charge_capture/v_1/client.rb +504 -482
  9. data/lib/candidhealth/charge_capture/v_1/types/charge_capture.rb +17 -1
  10. data/lib/candidhealth/charge_capture/v_1/types/charge_capture_data.rb +173 -173
  11. data/lib/candidhealth/charge_capture/v_1/types/charge_capture_error.rb +26 -2
  12. data/lib/candidhealth/charge_capture_bundles/v_1/client.rb +58 -0
  13. data/lib/candidhealth/claim_submission/v_1/types/claim_submission_record_create_optional.rb +100 -0
  14. data/lib/candidhealth/claim_submission/v_1/types/external_claim_submission_create_optional.rb +101 -0
  15. data/lib/candidhealth/commons/types/phone_number_optional.rb +71 -0
  16. data/lib/candidhealth/commons/types/procedure_modifier.rb +2 -0
  17. data/lib/candidhealth/commons/types/street_address_long_zip_optional.rb +107 -0
  18. data/lib/candidhealth/custom_schemas/v_1/types/schema_instance_optional.rb +78 -0
  19. data/lib/candidhealth/diagnoses/client.rb +23 -4
  20. data/lib/candidhealth/diagnoses/types/diagnosis.rb +21 -2
  21. data/lib/candidhealth/diagnoses/types/diagnosis_create.rb +25 -2
  22. data/lib/candidhealth/diagnoses/types/diagnosis_create_optional.rb +126 -0
  23. data/lib/candidhealth/diagnoses/types/standalone_diagnosis_create.rb +22 -2
  24. data/lib/candidhealth/encounter_providers/v_2/types/ordering_provider_optional.rb +123 -0
  25. data/lib/candidhealth/encounters/v_4/client.rb +214 -208
  26. data/lib/candidhealth/encounters/v_4/types/claim_supplemental_information_optional.rb +86 -0
  27. data/lib/candidhealth/encounters/v_4/types/clinical_note_category_create_optional.rb +78 -0
  28. data/lib/candidhealth/encounters/v_4/types/clinical_note_optional.rb +93 -0
  29. data/lib/candidhealth/encounters/v_4/types/encounter.rb +16 -4
  30. data/lib/candidhealth/encounters/v_4/types/encounter_create_from_pre_encounter.rb +4 -2
  31. data/lib/candidhealth/encounters/v_4/types/encounter_deep_optional.rb +780 -0
  32. data/lib/candidhealth/encounters/v_4/types/encounter_optional.rb +1 -139
  33. data/lib/candidhealth/encounters/v_4/types/epsdt_referral_optional.rb +85 -0
  34. data/lib/candidhealth/encounters/v_4/types/intake_question_optional.rb +84 -0
  35. data/lib/candidhealth/encounters/v_4/types/intervention_optional.rb +114 -0
  36. data/lib/candidhealth/encounters/v_4/types/lab_optional.rb +80 -0
  37. data/lib/candidhealth/encounters/v_4/types/medication_optional.rb +108 -0
  38. data/lib/candidhealth/encounters/v_4/types/patient_history_category_optional.rb +78 -0
  39. data/lib/candidhealth/guarantor/v_1/types/guarantor_optional.rb +144 -0
  40. data/lib/candidhealth/individual/types/individual_base_optional.rb +78 -0
  41. data/lib/candidhealth/individual/types/patient_non_insurance_payer_info_create_optional.rb +89 -0
  42. data/lib/candidhealth/individual/types/patient_update_with_optional_address.rb +8 -8
  43. data/lib/candidhealth/individual/types/subscriber_base_optional.rb +118 -0
  44. data/lib/candidhealth/individual/types/subscriber_create_optional.rb +132 -0
  45. data/lib/candidhealth/insurance_adjudications/v_1/client.rb +2 -0
  46. data/lib/candidhealth/insurance_adjudications/v_1/types/insurance_adjudication_create.rb +9 -1
  47. data/lib/candidhealth/insurance_cards/v_2/types/insurance_card_create_optional.rb +167 -0
  48. data/lib/candidhealth/pre_encounter/patients/v_1/types/authorization.rb +13 -1
  49. data/lib/candidhealth/service_lines/v_2/types/drug_identification_optional.rb +126 -0
  50. data/lib/candidhealth/service_lines/v_2/types/service_line_create_optional.rb +239 -0
  51. data/lib/candidhealth/service_lines/v_2/types/test_result_optional.rb +73 -0
  52. data/lib/candidhealth/write_offs/v_1/types/insurance_write_off_reason.rb +1 -0
  53. data/lib/candidhealth/write_offs/v_1/types/patient_write_off_reason.rb +1 -0
  54. data/lib/candidhealth/yes_no_indicator/types/yes_no_indicator.rb +14 -0
  55. data/lib/core/oauth.rb +2 -2
  56. data/lib/requests.rb +2 -2
  57. data/lib/types_export.rb +32 -3
  58. metadata +34 -5
@@ -0,0 +1,78 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "note_category"
4
+ require_relative "clinical_note_optional"
5
+ require "ostruct"
6
+ require "json"
7
+
8
+ module CandidApiClient
9
+ module Encounters
10
+ module V4
11
+ module Types
12
+ class ClinicalNoteCategoryCreateOptional
13
+ # @return [CandidApiClient::Encounters::V4::Types::NoteCategory]
14
+ attr_reader :category
15
+ # @return [Array<CandidApiClient::Encounters::V4::Types::ClinicalNoteOptional>]
16
+ attr_reader :notes
17
+ # @return [OpenStruct] Additional properties unmapped to the current class definition
18
+ attr_reader :additional_properties
19
+ # @return [Object]
20
+ attr_reader :_field_set
21
+ protected :_field_set
22
+
23
+ OMIT = Object.new
24
+
25
+ # @param category [CandidApiClient::Encounters::V4::Types::NoteCategory]
26
+ # @param notes [Array<CandidApiClient::Encounters::V4::Types::ClinicalNoteOptional>]
27
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
28
+ # @return [CandidApiClient::Encounters::V4::Types::ClinicalNoteCategoryCreateOptional]
29
+ def initialize(category: OMIT, notes: OMIT, additional_properties: nil)
30
+ @category = category if category != OMIT
31
+ @notes = notes if notes != OMIT
32
+ @additional_properties = additional_properties
33
+ @_field_set = { "category": category, "notes": notes }.reject do |_k, v|
34
+ v == OMIT
35
+ end
36
+ end
37
+
38
+ # Deserialize a JSON object to an instance of ClinicalNoteCategoryCreateOptional
39
+ #
40
+ # @param json_object [String]
41
+ # @return [CandidApiClient::Encounters::V4::Types::ClinicalNoteCategoryCreateOptional]
42
+ def self.from_json(json_object:)
43
+ struct = JSON.parse(json_object, object_class: OpenStruct)
44
+ parsed_json = JSON.parse(json_object)
45
+ category = struct["category"]
46
+ notes = parsed_json["notes"]&.map do |item|
47
+ item = item.to_json
48
+ CandidApiClient::Encounters::V4::Types::ClinicalNoteOptional.from_json(json_object: item)
49
+ end
50
+ new(
51
+ category: category,
52
+ notes: notes,
53
+ additional_properties: struct
54
+ )
55
+ end
56
+
57
+ # Serialize an instance of ClinicalNoteCategoryCreateOptional to a JSON object
58
+ #
59
+ # @return [String]
60
+ def to_json(*_args)
61
+ @_field_set&.to_json
62
+ end
63
+
64
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
65
+ # hash and check each fields type against the current object's property
66
+ # definitions.
67
+ #
68
+ # @param obj [Object]
69
+ # @return [Void]
70
+ def self.validate_raw(obj:)
71
+ obj.category&.is_a?(CandidApiClient::Encounters::V4::Types::NoteCategory) != false || raise("Passed value for field obj.category is not the expected type, validation failed.")
72
+ obj.notes&.is_a?(Array) != false || raise("Passed value for field obj.notes is not the expected type, validation failed.")
73
+ end
74
+ end
75
+ end
76
+ end
77
+ end
78
+ end
@@ -0,0 +1,93 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "date"
4
+ require "ostruct"
5
+ require "json"
6
+
7
+ module CandidApiClient
8
+ module Encounters
9
+ module V4
10
+ module Types
11
+ class ClinicalNoteOptional
12
+ # @return [String]
13
+ attr_reader :text
14
+ # @return [String]
15
+ attr_reader :author_name
16
+ # @return [String]
17
+ attr_reader :author_npi
18
+ # @return [DateTime]
19
+ attr_reader :timestamp
20
+ # @return [OpenStruct] Additional properties unmapped to the current class definition
21
+ attr_reader :additional_properties
22
+ # @return [Object]
23
+ attr_reader :_field_set
24
+ protected :_field_set
25
+
26
+ OMIT = Object.new
27
+
28
+ # @param text [String]
29
+ # @param author_name [String]
30
+ # @param author_npi [String]
31
+ # @param timestamp [DateTime]
32
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
33
+ # @return [CandidApiClient::Encounters::V4::Types::ClinicalNoteOptional]
34
+ def initialize(text: OMIT, author_name: OMIT, author_npi: OMIT, timestamp: OMIT, additional_properties: nil)
35
+ @text = text if text != OMIT
36
+ @author_name = author_name if author_name != OMIT
37
+ @author_npi = author_npi if author_npi != OMIT
38
+ @timestamp = timestamp if timestamp != OMIT
39
+ @additional_properties = additional_properties
40
+ @_field_set = {
41
+ "text": text,
42
+ "author_name": author_name,
43
+ "author_npi": author_npi,
44
+ "timestamp": timestamp
45
+ }.reject do |_k, v|
46
+ v == OMIT
47
+ end
48
+ end
49
+
50
+ # Deserialize a JSON object to an instance of ClinicalNoteOptional
51
+ #
52
+ # @param json_object [String]
53
+ # @return [CandidApiClient::Encounters::V4::Types::ClinicalNoteOptional]
54
+ def self.from_json(json_object:)
55
+ struct = JSON.parse(json_object, object_class: OpenStruct)
56
+ parsed_json = JSON.parse(json_object)
57
+ text = struct["text"]
58
+ author_name = struct["author_name"]
59
+ author_npi = struct["author_npi"]
60
+ timestamp = (DateTime.parse(parsed_json["timestamp"]) unless parsed_json["timestamp"].nil?)
61
+ new(
62
+ text: text,
63
+ author_name: author_name,
64
+ author_npi: author_npi,
65
+ timestamp: timestamp,
66
+ additional_properties: struct
67
+ )
68
+ end
69
+
70
+ # Serialize an instance of ClinicalNoteOptional to a JSON object
71
+ #
72
+ # @return [String]
73
+ def to_json(*_args)
74
+ @_field_set&.to_json
75
+ end
76
+
77
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
78
+ # hash and check each fields type against the current object's property
79
+ # definitions.
80
+ #
81
+ # @param obj [Object]
82
+ # @return [Void]
83
+ def self.validate_raw(obj:)
84
+ obj.text&.is_a?(String) != false || raise("Passed value for field obj.text is not the expected type, validation failed.")
85
+ obj.author_name&.is_a?(String) != false || raise("Passed value for field obj.author_name is not the expected type, validation failed.")
86
+ obj.author_npi&.is_a?(String) != false || raise("Passed value for field obj.author_npi is not the expected type, validation failed.")
87
+ obj.timestamp&.is_a?(DateTime) != false || raise("Passed value for field obj.timestamp is not the expected type, validation failed.")
88
+ end
89
+ end
90
+ end
91
+ end
92
+ end
93
+ end
@@ -37,6 +37,9 @@ module CandidApiClient
37
37
  module V4
38
38
  module Types
39
39
  class Encounter
40
+ # @return [String] If the encounter was created from ingested charge captures, this is the
41
+ # associated Charge Capture Claim Creation Id.
42
+ attr_reader :claim_creation_id
40
43
  # @return [String] A patient control number (PCN) is a unique identifier assigned to a patient
41
44
  # within a healthcare system or facility.
42
45
  # It's used to track and manage a patient's medical records, treatments, and other
@@ -107,7 +110,8 @@ module CandidApiClient
107
110
  # that will be submitted to the payor.
108
111
  attr_reader :diagnoses
109
112
  # @return [Array<CandidApiClient::Encounters::V4::Types::ClinicalNoteCategory>] Holds a collection of clinical observations made by healthcare providers during
110
- # patient encounters.
113
+ # patient encounters. Please note that medical records for appeals should be sent
114
+ # using the Encounter Attachments API.
111
115
  attr_reader :clinical_notes
112
116
  # @return [Array<CandidApiClient::BillingNotes::V2::Types::BillingNote>] Spot to store misc, human-readable, notes about this encounter to be
113
117
  # used in the billing process.
@@ -260,6 +264,8 @@ module CandidApiClient
260
264
 
261
265
  OMIT = Object.new
262
266
 
267
+ # @param claim_creation_id [String] If the encounter was created from ingested charge captures, this is the
268
+ # associated Charge Capture Claim Creation Id.
263
269
  # @param patient_control_number [String] A patient control number (PCN) is a unique identifier assigned to a patient
264
270
  # within a healthcare system or facility.
265
271
  # It's used to track and manage a patient's medical records, treatments, and other
@@ -312,7 +318,8 @@ module CandidApiClient
312
318
  # diagnoses may be submitted at this time, and coders will later prioritize the 12
313
319
  # that will be submitted to the payor.
314
320
  # @param clinical_notes [Array<CandidApiClient::Encounters::V4::Types::ClinicalNoteCategory>] Holds a collection of clinical observations made by healthcare providers during
315
- # patient encounters.
321
+ # patient encounters. Please note that medical records for appeals should be sent
322
+ # using the Encounter Attachments API.
316
323
  # @param billing_notes [Array<CandidApiClient::BillingNotes::V2::Types::BillingNote>] Spot to store misc, human-readable, notes about this encounter to be
317
324
  # used in the billing process.
318
325
  # @param place_of_service_code [CandidApiClient::Commons::Types::FacilityTypeCode] Box 24B on the CMS-1500 claim form. 837p Loop2300, CLM-05-1. 02 for
@@ -420,8 +427,9 @@ module CandidApiClient
420
427
  # Code indicating the reason why a request was delayed
421
428
  # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
422
429
  # @return [CandidApiClient::Encounters::V4::Types::Encounter]
423
- def initialize(encounter_id:, claims:, patient:, billing_provider:, rendering_provider:, service_facility:,
424
- responsible_party:, url:, diagnoses:, clinical_notes:, patient_histories:, patient_payments:, tags:, owner_of_next_action:, submission_origin:, schema_instances:, created_at:, external_id:, patient_authorized_release:, benefits_assigned_to_provider:, provider_accepts_assignment:, billable_status:, patient_control_number: OMIT, guarantor: OMIT, referring_provider: OMIT, initial_referring_provider: OMIT, supervising_provider: OMIT, subscriber_primary: OMIT, subscriber_secondary: OMIT, subscriber_tertiary: OMIT, prior_authorization_number: OMIT, billing_notes: OMIT, place_of_service_code: OMIT, place_of_service_code_as_submitted: OMIT, coding_attribution: OMIT, work_queue_id: OMIT, work_queue_membership_activated_at: OMIT, referral_number: OMIT, epsdt_referral: OMIT, claim_supplemental_information: OMIT, secondary_payer_carrier_code: OMIT, last_submitted_at: OMIT, date_of_service: OMIT, end_date_of_service: OMIT, appointment_type: OMIT, existing_medications: OMIT, vitals: OMIT, interventions: OMIT, pay_to_address: OMIT, synchronicity: OMIT, additional_information: OMIT, service_authorization_exception_code: OMIT, admission_date: OMIT, discharge_date: OMIT, onset_of_current_illness_or_symptom_date: OMIT, last_menstrual_period_date: OMIT, delay_reason_code: OMIT, additional_properties: nil)
430
+ def initialize(encounter_id:, claims:, patient:, billing_provider:, rendering_provider:, service_facility:, responsible_party:, url:, diagnoses:, clinical_notes:, patient_histories:, patient_payments:, tags:, owner_of_next_action:, submission_origin:, schema_instances:, created_at:, external_id:, patient_authorized_release:, benefits_assigned_to_provider:, provider_accepts_assignment:, billable_status:, claim_creation_id: OMIT, patient_control_number: OMIT,
431
+ guarantor: OMIT, referring_provider: OMIT, initial_referring_provider: OMIT, supervising_provider: OMIT, subscriber_primary: OMIT, subscriber_secondary: OMIT, subscriber_tertiary: OMIT, prior_authorization_number: OMIT, billing_notes: OMIT, place_of_service_code: OMIT, place_of_service_code_as_submitted: OMIT, coding_attribution: OMIT, work_queue_id: OMIT, work_queue_membership_activated_at: OMIT, referral_number: OMIT, epsdt_referral: OMIT, claim_supplemental_information: OMIT, secondary_payer_carrier_code: OMIT, last_submitted_at: OMIT, date_of_service: OMIT, end_date_of_service: OMIT, appointment_type: OMIT, existing_medications: OMIT, vitals: OMIT, interventions: OMIT, pay_to_address: OMIT, synchronicity: OMIT, additional_information: OMIT, service_authorization_exception_code: OMIT, admission_date: OMIT, discharge_date: OMIT, onset_of_current_illness_or_symptom_date: OMIT, last_menstrual_period_date: OMIT, delay_reason_code: OMIT, additional_properties: nil)
432
+ @claim_creation_id = claim_creation_id if claim_creation_id != OMIT
425
433
  @patient_control_number = patient_control_number if patient_control_number != OMIT
426
434
  @encounter_id = encounter_id
427
435
  @claims = claims
@@ -489,6 +497,7 @@ module CandidApiClient
489
497
  @delay_reason_code = delay_reason_code if delay_reason_code != OMIT
490
498
  @additional_properties = additional_properties
491
499
  @_field_set = {
500
+ "claim_creation_id": claim_creation_id,
492
501
  "patient_control_number": patient_control_number,
493
502
  "encounter_id": encounter_id,
494
503
  "claims": claims,
@@ -558,6 +567,7 @@ module CandidApiClient
558
567
  def self.from_json(json_object:)
559
568
  struct = JSON.parse(json_object, object_class: OpenStruct)
560
569
  parsed_json = JSON.parse(json_object)
570
+ claim_creation_id = struct["claim_creation_id"]
561
571
  patient_control_number = struct["patient_control_number"]
562
572
  encounter_id = struct["encounter_id"]
563
573
  claims = parsed_json["claims"]&.map do |item|
@@ -729,6 +739,7 @@ module CandidApiClient
729
739
  end
730
740
  delay_reason_code = struct["delay_reason_code"]
731
741
  new(
742
+ claim_creation_id: claim_creation_id,
732
743
  patient_control_number: patient_control_number,
733
744
  encounter_id: encounter_id,
734
745
  claims: claims,
@@ -804,6 +815,7 @@ module CandidApiClient
804
815
  # @param obj [Object]
805
816
  # @return [Void]
806
817
  def self.validate_raw(obj:)
818
+ obj.claim_creation_id&.is_a?(String) != false || raise("Passed value for field obj.claim_creation_id is not the expected type, validation failed.")
807
819
  obj.patient_control_number&.is_a?(String) != false || raise("Passed value for field obj.patient_control_number is not the expected type, validation failed.")
808
820
  obj.encounter_id.is_a?(String) != false || raise("Passed value for field obj.encounter_id is not the expected type, validation failed.")
809
821
  obj.claims.is_a?(Array) != false || raise("Passed value for field obj.claims is not the expected type, validation failed.")
@@ -76,7 +76,8 @@ module CandidApiClient
76
76
  # submitted to the payor.
77
77
  attr_reader :diagnoses
78
78
  # @return [Array<CandidApiClient::Encounters::V4::Types::ClinicalNoteCategoryCreate>] Holds a collection of clinical observations made by healthcare providers during
79
- # patient encounters.
79
+ # patient encounters. Please note that medical records for appeals should be sent
80
+ # using the Encounter Attachments API.
80
81
  attr_reader :clinical_notes
81
82
  # @return [Array<CandidApiClient::BillingNotes::V2::Types::BillingNoteBase>] Spot to store misc, human-readable, notes about this encounter to be used
82
83
  # in the billing process.
@@ -239,7 +240,8 @@ module CandidApiClient
239
240
  # be
240
241
  # submitted to the payor.
241
242
  # @param clinical_notes [Array<CandidApiClient::Encounters::V4::Types::ClinicalNoteCategoryCreate>] Holds a collection of clinical observations made by healthcare providers during
242
- # patient encounters.
243
+ # patient encounters. Please note that medical records for appeals should be sent
244
+ # using the Encounter Attachments API.
243
245
  # @param billing_notes [Array<CandidApiClient::BillingNotes::V2::Types::BillingNoteBase>] Spot to store misc, human-readable, notes about this encounter to be used
244
246
  # in the billing process.
245
247
  # @param place_of_service_code [CandidApiClient::Commons::Types::FacilityTypeCode] Box 24B on the CMS-1500 claim form. 837p Loop2300, CLM-05-1. 02 for