Class: CandidApiClient::ServiceLines::V2::Types::ServiceLineUpdate

Inherits:
Object
  • Object
show all
Defined in:
lib/candidhealth/service_lines/v_2/types/service_line_update.rb

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(edit_reason: OMIT, modifiers: OMIT, charge_amount_cents: OMIT, diagnosis_id_zero: OMIT, diagnosis_id_one: OMIT, diagnosis_id_two: OMIT, diagnosis_id_three: OMIT, drug_identification: OMIT, denial_reason: OMIT, place_of_service_code: OMIT, units: OMIT, procedure_code: OMIT, quantity: OMIT, description: OMIT, date_of_service: OMIT, end_date_of_service: OMIT, test_results: OMIT, additional_properties: nil) ⇒ CandidApiClient::ServiceLines::V2::Types::ServiceLineUpdate

Parameters:

  • edit_reason (String) (defaults to: OMIT)
  • modifiers (Array<CandidApiClient::Commons::Types::ProcedureModifier>) (defaults to: OMIT)
  • charge_amount_cents (Integer) (defaults to: OMIT)
  • diagnosis_id_zero (String) (defaults to: OMIT)
  • diagnosis_id_one (String) (defaults to: OMIT)
  • diagnosis_id_two (String) (defaults to: OMIT)
  • diagnosis_id_three (String) (defaults to: OMIT)
  • drug_identification (CandidApiClient::ServiceLines::V2::Types::DrugIdentification) (defaults to: OMIT)
  • denial_reason (CandidApiClient::ServiceLines::V2::Types::ServiceLineDenialReason) (defaults to: OMIT)
  • place_of_service_code (CandidApiClient::Commons::Types::FacilityTypeCode) (defaults to: OMIT)
  • units (CandidApiClient::Commons::Types::ServiceLineUnits) (defaults to: OMIT)
  • procedure_code (String) (defaults to: OMIT)
  • quantity (String) (defaults to: OMIT)

    String representation of a Decimal that can be parsed by most libraries. A ServiceLine quantity cannot contain more than one digit of precision. Example: 1.1 is valid, 1.11 is not.

  • description (String) (defaults to: OMIT)

    A free-form description to clarify the related data elements and their content. Maps to SV1-01, C003-07 on the 837-P.

  • date_of_service (Date) (defaults to: OMIT)

    date_of_service must be defined on either the encounter or the service lines but not both.

  • end_date_of_service (Date) (defaults to: OMIT)
  • test_results (Array<CandidApiClient::ServiceLines::V2::Types::TestResult>) (defaults to: OMIT)

    Maps to MEA-02 on the 837-P. Updating test results utilizes PUT semantics, so the test results on the service line will be set to whatever inputs are provided. No more than 5 test results may be submitted per service line.

  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
# File 'lib/candidhealth/service_lines/v_2/types/service_line_update.rb', line 93

def initialize(edit_reason: OMIT, modifiers: OMIT, charge_amount_cents: OMIT, diagnosis_id_zero: OMIT,
               diagnosis_id_one: OMIT, diagnosis_id_two: OMIT, diagnosis_id_three: OMIT, drug_identification: OMIT, denial_reason: OMIT, place_of_service_code: OMIT, units: OMIT, procedure_code: OMIT, quantity: OMIT, description: OMIT, date_of_service: OMIT, end_date_of_service: OMIT, test_results: OMIT, additional_properties: nil)
  @edit_reason = edit_reason if edit_reason != OMIT
  @modifiers = modifiers if modifiers != OMIT
  @charge_amount_cents = charge_amount_cents if charge_amount_cents != OMIT
  @diagnosis_id_zero = diagnosis_id_zero if diagnosis_id_zero != OMIT
  @diagnosis_id_one = diagnosis_id_one if diagnosis_id_one != OMIT
  @diagnosis_id_two = diagnosis_id_two if diagnosis_id_two != OMIT
  @diagnosis_id_three = diagnosis_id_three if diagnosis_id_three != OMIT
  @drug_identification = drug_identification if drug_identification != OMIT
  @denial_reason = denial_reason if denial_reason != OMIT
  @place_of_service_code = place_of_service_code if place_of_service_code != OMIT
  @units = units if units != OMIT
  @procedure_code = procedure_code if procedure_code != OMIT
  @quantity = quantity if quantity != OMIT
  @description = description if description != OMIT
  @date_of_service = date_of_service if date_of_service != OMIT
  @end_date_of_service = end_date_of_service if end_date_of_service != OMIT
  @test_results = test_results if test_results != OMIT
  @additional_properties = additional_properties
  @_field_set = {
    "edit_reason": edit_reason,
    "modifiers": modifiers,
    "charge_amount_cents": charge_amount_cents,
    "diagnosis_id_zero": diagnosis_id_zero,
    "diagnosis_id_one": diagnosis_id_one,
    "diagnosis_id_two": diagnosis_id_two,
    "diagnosis_id_three": diagnosis_id_three,
    "drug_identification": drug_identification,
    "denial_reason": denial_reason,
    "place_of_service_code": place_of_service_code,
    "units": units,
    "procedure_code": procedure_code,
    "quantity": quantity,
    "description": description,
    "date_of_service": date_of_service,
    "end_date_of_service": end_date_of_service,
    "test_results": test_results
  }.reject do |_k, v|
    v == OMIT
  end
end

Instance Attribute Details

#additional_propertiesOpenStruct (readonly)

Returns Additional properties unmapped to the current class definition.

Returns:

  • (OpenStruct)

    Additional properties unmapped to the current class definition



60
61
62
# File 'lib/candidhealth/service_lines/v_2/types/service_line_update.rb', line 60

def additional_properties
  @additional_properties
end

#charge_amount_centsInteger (readonly)

Returns:

  • (Integer)


23
24
25
# File 'lib/candidhealth/service_lines/v_2/types/service_line_update.rb', line 23

def charge_amount_cents
  @charge_amount_cents
end

#date_of_serviceDate (readonly)

Returns date_of_service must be defined on either the encounter or the service lines but not both.

Returns:

  • (Date)

    date_of_service must be defined on either the encounter or the service lines but not both.



51
52
53
# File 'lib/candidhealth/service_lines/v_2/types/service_line_update.rb', line 51

def date_of_service
  @date_of_service
end

#denial_reasonCandidApiClient::ServiceLines::V2::Types::ServiceLineDenialReason (readonly)



35
36
37
# File 'lib/candidhealth/service_lines/v_2/types/service_line_update.rb', line 35

def denial_reason
  @denial_reason
end

#descriptionString (readonly)

Returns A free-form description to clarify the related data elements and their content. Maps to SV1-01, C003-07 on the 837-P.

Returns:

  • (String)

    A free-form description to clarify the related data elements and their content. Maps to SV1-01, C003-07 on the 837-P.



48
49
50
# File 'lib/candidhealth/service_lines/v_2/types/service_line_update.rb', line 48

def description
  @description
end

#diagnosis_id_oneString (readonly)

Returns:

  • (String)


27
28
29
# File 'lib/candidhealth/service_lines/v_2/types/service_line_update.rb', line 27

def diagnosis_id_one
  @diagnosis_id_one
end

#diagnosis_id_threeString (readonly)

Returns:

  • (String)


31
32
33
# File 'lib/candidhealth/service_lines/v_2/types/service_line_update.rb', line 31

def diagnosis_id_three
  @diagnosis_id_three
end

#diagnosis_id_twoString (readonly)

Returns:

  • (String)


29
30
31
# File 'lib/candidhealth/service_lines/v_2/types/service_line_update.rb', line 29

def diagnosis_id_two
  @diagnosis_id_two
end

#diagnosis_id_zeroString (readonly)

Returns:

  • (String)


25
26
27
# File 'lib/candidhealth/service_lines/v_2/types/service_line_update.rb', line 25

def diagnosis_id_zero
  @diagnosis_id_zero
end

#drug_identificationCandidApiClient::ServiceLines::V2::Types::DrugIdentification (readonly)



33
34
35
# File 'lib/candidhealth/service_lines/v_2/types/service_line_update.rb', line 33

def drug_identification
  @drug_identification
end

#edit_reasonString (readonly)

Returns:

  • (String)


19
20
21
# File 'lib/candidhealth/service_lines/v_2/types/service_line_update.rb', line 19

def edit_reason
  @edit_reason
end

#end_date_of_serviceDate (readonly)

Returns:

  • (Date)


53
54
55
# File 'lib/candidhealth/service_lines/v_2/types/service_line_update.rb', line 53

def end_date_of_service
  @end_date_of_service
end

#modifiersArray<CandidApiClient::Commons::Types::ProcedureModifier> (readonly)



21
22
23
# File 'lib/candidhealth/service_lines/v_2/types/service_line_update.rb', line 21

def modifiers
  @modifiers
end

#place_of_service_codeCandidApiClient::Commons::Types::FacilityTypeCode (readonly)



37
38
39
# File 'lib/candidhealth/service_lines/v_2/types/service_line_update.rb', line 37

def place_of_service_code
  @place_of_service_code
end

#procedure_codeString (readonly)

Returns:

  • (String)


41
42
43
# File 'lib/candidhealth/service_lines/v_2/types/service_line_update.rb', line 41

def procedure_code
  @procedure_code
end

#quantityString (readonly)

Returns String representation of a Decimal that can be parsed by most libraries. A ServiceLine quantity cannot contain more than one digit of precision. Example: 1.1 is valid, 1.11 is not.

Returns:

  • (String)

    String representation of a Decimal that can be parsed by most libraries. A ServiceLine quantity cannot contain more than one digit of precision. Example: 1.1 is valid, 1.11 is not.



45
46
47
# File 'lib/candidhealth/service_lines/v_2/types/service_line_update.rb', line 45

def quantity
  @quantity
end

#test_resultsArray<CandidApiClient::ServiceLines::V2::Types::TestResult> (readonly)

Returns Maps to MEA-02 on the 837-P. Updating test results utilizes PUT semantics, so the test results on the service line will be set to whatever inputs are provided. No more than 5 test results may be submitted per service line.

Returns:

  • (Array<CandidApiClient::ServiceLines::V2::Types::TestResult>)

    Maps to MEA-02 on the 837-P. Updating test results utilizes PUT semantics, so the test results on the service line will be set to whatever inputs are provided. No more than 5 test results may be submitted per service line.



58
59
60
# File 'lib/candidhealth/service_lines/v_2/types/service_line_update.rb', line 58

def test_results
  @test_results
end

#unitsCandidApiClient::Commons::Types::ServiceLineUnits (readonly)



39
40
41
# File 'lib/candidhealth/service_lines/v_2/types/service_line_update.rb', line 39

def units
  @units
end

Class Method Details

.from_json(json_object:) ⇒ CandidApiClient::ServiceLines::V2::Types::ServiceLineUpdate

Deserialize a JSON object to an instance of ServiceLineUpdate

Parameters:

  • json_object (String)

Returns:



140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
# File 'lib/candidhealth/service_lines/v_2/types/service_line_update.rb', line 140

def self.from_json(json_object:)
  struct = JSON.parse(json_object, object_class: OpenStruct)
  parsed_json = JSON.parse(json_object)
  edit_reason = struct["edit_reason"]
  modifiers = struct["modifiers"]
  charge_amount_cents = struct["charge_amount_cents"]
  diagnosis_id_zero = struct["diagnosis_id_zero"]
  diagnosis_id_one = struct["diagnosis_id_one"]
  diagnosis_id_two = struct["diagnosis_id_two"]
  diagnosis_id_three = struct["diagnosis_id_three"]
  if parsed_json["drug_identification"].nil?
    drug_identification = nil
  else
    drug_identification = parsed_json["drug_identification"].to_json
    drug_identification = CandidApiClient::ServiceLines::V2::Types::DrugIdentification.from_json(json_object: drug_identification)
  end
  if parsed_json["denial_reason"].nil?
    denial_reason = nil
  else
    denial_reason = parsed_json["denial_reason"].to_json
    denial_reason = CandidApiClient::ServiceLines::V2::Types::ServiceLineDenialReason.from_json(json_object: denial_reason)
  end
  place_of_service_code = struct["place_of_service_code"]
  units = struct["units"]
  procedure_code = struct["procedure_code"]
  quantity = struct["quantity"]
  description = struct["description"]
  date_of_service = (Date.parse(parsed_json["date_of_service"]) unless parsed_json["date_of_service"].nil?)
  end_date_of_service = unless parsed_json["end_date_of_service"].nil?
                          Date.parse(parsed_json["end_date_of_service"])
                        end
  test_results = parsed_json["test_results"]&.map do |item|
    item = item.to_json
    CandidApiClient::ServiceLines::V2::Types::TestResult.from_json(json_object: item)
  end
  new(
    edit_reason: edit_reason,
    modifiers: modifiers,
    charge_amount_cents: charge_amount_cents,
    diagnosis_id_zero: diagnosis_id_zero,
    diagnosis_id_one: diagnosis_id_one,
    diagnosis_id_two: diagnosis_id_two,
    diagnosis_id_three: diagnosis_id_three,
    drug_identification: drug_identification,
    denial_reason: denial_reason,
    place_of_service_code: place_of_service_code,
    units: units,
    procedure_code: procedure_code,
    quantity: quantity,
    description: description,
    date_of_service: date_of_service,
    end_date_of_service: end_date_of_service,
    test_results: test_results,
    additional_properties: struct
  )
end

.validate_raw(obj:) ⇒ Void

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.

Parameters:

  • obj (Object)

Returns:

  • (Void)


210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
# File 'lib/candidhealth/service_lines/v_2/types/service_line_update.rb', line 210

def self.validate_raw(obj:)
  obj.edit_reason&.is_a?(String) != false || raise("Passed value for field obj.edit_reason is not the expected type, validation failed.")
  obj.modifiers&.is_a?(Array) != false || raise("Passed value for field obj.modifiers is not the expected type, validation failed.")
  obj.charge_amount_cents&.is_a?(Integer) != false || raise("Passed value for field obj.charge_amount_cents is not the expected type, validation failed.")
  obj.diagnosis_id_zero&.is_a?(String) != false || raise("Passed value for field obj.diagnosis_id_zero is not the expected type, validation failed.")
  obj.diagnosis_id_one&.is_a?(String) != false || raise("Passed value for field obj.diagnosis_id_one is not the expected type, validation failed.")
  obj.diagnosis_id_two&.is_a?(String) != false || raise("Passed value for field obj.diagnosis_id_two is not the expected type, validation failed.")
  obj.diagnosis_id_three&.is_a?(String) != false || raise("Passed value for field obj.diagnosis_id_three is not the expected type, validation failed.")
  obj.drug_identification.nil? || CandidApiClient::ServiceLines::V2::Types::DrugIdentification.validate_raw(obj: obj.drug_identification)
  obj.denial_reason.nil? || CandidApiClient::ServiceLines::V2::Types::ServiceLineDenialReason.validate_raw(obj: obj.denial_reason)
  obj.place_of_service_code&.is_a?(CandidApiClient::Commons::Types::FacilityTypeCode) != false || raise("Passed value for field obj.place_of_service_code is not the expected type, validation failed.")
  obj.units&.is_a?(CandidApiClient::Commons::Types::ServiceLineUnits) != false || raise("Passed value for field obj.units is not the expected type, validation failed.")
  obj.procedure_code&.is_a?(String) != false || raise("Passed value for field obj.procedure_code is not the expected type, validation failed.")
  obj.quantity&.is_a?(String) != false || raise("Passed value for field obj.quantity is not the expected type, validation failed.")
  obj.description&.is_a?(String) != false || raise("Passed value for field obj.description is not the expected type, validation failed.")
  obj.date_of_service&.is_a?(Date) != false || raise("Passed value for field obj.date_of_service is not the expected type, validation failed.")
  obj.end_date_of_service&.is_a?(Date) != false || raise("Passed value for field obj.end_date_of_service is not the expected type, validation failed.")
  obj.test_results&.is_a?(Array) != false || raise("Passed value for field obj.test_results is not the expected type, validation failed.")
end

Instance Method Details

#to_json(*_args) ⇒ String

Serialize an instance of ServiceLineUpdate to a JSON object

Returns:

  • (String)


200
201
202
# File 'lib/candidhealth/service_lines/v_2/types/service_line_update.rb', line 200

def to_json(*_args)
  @_field_set&.to_json
end