Class: CandidApiClient::ServiceLines::V2::Types::ServiceLineCreate

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

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(procedure_code:, quantity:, units:, diagnosis_pointers:, modifiers: OMIT, has_epsdt_indicator: OMIT, has_family_planning_indicator: OMIT, charge_amount_cents: OMIT, drug_identification: OMIT, place_of_service_code: OMIT, description: OMIT, date_of_service: OMIT, end_date_of_service: OMIT, ordering_provider: OMIT, test_results: OMIT, additional_properties: nil) ⇒ CandidApiClient::ServiceLines::V2::Types::ServiceLineCreate

Parameters:

  • modifiers (Array<CandidApiClient::Commons::Types::ProcedureModifier>) (defaults to: OMIT)
  • has_epsdt_indicator (Boolean) (defaults to: OMIT)

    Maps to SV1-11 on the 837-P and Box 24H on the CMS-1500. If the value is true, the box will be populated with “Y”. Otherwise, the box will not be populated.

  • has_family_planning_indicator (Boolean) (defaults to: OMIT)

    Maps to SV1-12 on the 837-P and Box 24I on the CMS-1500. If the value is true, the box will be populated with “Y”. Otherwise, the box will not be populated.

  • procedure_code (String)
  • quantity (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.

  • units (CandidApiClient::Commons::Types::ServiceLineUnits)
  • charge_amount_cents (Integer) (defaults to: OMIT)

    The total amount charged for this service line taking quantity into account. For example, if a single unit costs 100 cents and 2 units were rendered, the ‘charge_amount_cents` should be

    1. Should be greater than or

    equal to 0.

  • diagnosis_pointers (Array<Integer>)

    Indices (zero-indexed) of all the diagnoses this service line references

  • drug_identification (CandidApiClient::ServiceLines::V2::Types::DrugIdentification) (defaults to: OMIT)
  • place_of_service_code (CandidApiClient::Commons::Types::FacilityTypeCode) (defaults to: OMIT)

    837p Loop2300, SV105. If your organization does not intend to submit claims with a different place of service at the service line level, this field should not be populated. 02 for telemedicine, 11 for in-person. Full list //www.cms.gov/Medicare/Coding/place-of-service-codes/Place_of_Service_Code_Set).

  • 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)
  • end_date_of_service (Date) (defaults to: OMIT)
  • ordering_provider (CandidApiClient::EncounterProviders::V2::Types::OrderingProvider) (defaults to: OMIT)

    Required when the service or supply was ordered by a provider who is different than the rendering provider for this service line. If not required by this implementation guide, do not send.

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

    Contains a list of test results. Test result types may map to MEA-02 on the 837-P (ex: Hemoglobin, Hematocrit). No more than 5 MEA-02 test results may be submitted per service line.

  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



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
135
136
137
138
139
140
141
142
143
144
145
146
# File 'lib/candidhealth/service_lines/v_2/types/service_line_create.rb', line 109

def initialize(procedure_code:, quantity:, units:, diagnosis_pointers:, modifiers: OMIT,
               has_epsdt_indicator: OMIT, has_family_planning_indicator: OMIT, charge_amount_cents: OMIT, drug_identification: OMIT, place_of_service_code: OMIT, description: OMIT, date_of_service: OMIT, end_date_of_service: OMIT, ordering_provider: OMIT, test_results: OMIT, additional_properties: nil)
  @modifiers = modifiers if modifiers != OMIT
  @has_epsdt_indicator = has_epsdt_indicator if has_epsdt_indicator != OMIT
  @has_family_planning_indicator = has_family_planning_indicator if has_family_planning_indicator != OMIT
  @procedure_code = procedure_code
  @quantity = quantity
  @units = units
  @charge_amount_cents = charge_amount_cents if charge_amount_cents != OMIT
  @diagnosis_pointers = diagnosis_pointers
  @drug_identification = drug_identification if drug_identification != OMIT
  @place_of_service_code = place_of_service_code if place_of_service_code != 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
  @ordering_provider = ordering_provider if ordering_provider != OMIT
  @test_results = test_results if test_results != OMIT
  @additional_properties = additional_properties
  @_field_set = {
    "modifiers": modifiers,
    "has_epsdt_indicator": has_epsdt_indicator,
    "has_family_planning_indicator": has_family_planning_indicator,
    "procedure_code": procedure_code,
    "quantity": quantity,
    "units": units,
    "charge_amount_cents": charge_amount_cents,
    "diagnosis_pointers": diagnosis_pointers,
    "drug_identification": drug_identification,
    "place_of_service_code": place_of_service_code,
    "description": description,
    "date_of_service": date_of_service,
    "end_date_of_service": end_date_of_service,
    "ordering_provider": ordering_provider,
    "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



67
68
69
# File 'lib/candidhealth/service_lines/v_2/types/service_line_create.rb', line 67

def additional_properties
  @additional_properties
end

#charge_amount_centsInteger (readonly)

Returns The total amount charged for this service line taking quantity into account. For example, if a single unit costs 100 cents and 2 units were rendered, the ‘charge_amount_cents` should be

  1. Should be greater than or

equal to 0.

Returns:

  • (Integer)

    The total amount charged for this service line taking quantity into account. For example, if a single unit costs 100 cents and 2 units were rendered, the ‘charge_amount_cents` should be

    1. Should be greater than or

    equal to 0.



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

def charge_amount_cents
  @charge_amount_cents
end

#date_of_serviceDate (readonly)

Returns:

  • (Date)


55
56
57
# File 'lib/candidhealth/service_lines/v_2/types/service_line_create.rb', line 55

def date_of_service
  @date_of_service
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.



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

def description
  @description
end

#diagnosis_pointersArray<Integer> (readonly)

Returns Indices (zero-indexed) of all the diagnoses this service line references.

Returns:

  • (Array<Integer>)

    Indices (zero-indexed) of all the diagnoses this service line references



43
44
45
# File 'lib/candidhealth/service_lines/v_2/types/service_line_create.rb', line 43

def diagnosis_pointers
  @diagnosis_pointers
end

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



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

def drug_identification
  @drug_identification
end

#end_date_of_serviceDate (readonly)

Returns:

  • (Date)


57
58
59
# File 'lib/candidhealth/service_lines/v_2/types/service_line_create.rb', line 57

def end_date_of_service
  @end_date_of_service
end

#has_epsdt_indicatorBoolean (readonly)

Returns Maps to SV1-11 on the 837-P and Box 24H on the CMS-1500. If the value is true, the box will be populated with “Y”. Otherwise, the box will not be populated.

Returns:

  • (Boolean)

    Maps to SV1-11 on the 837-P and Box 24H on the CMS-1500. If the value is true, the box will be populated with “Y”. Otherwise, the box will not be populated.



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

def has_epsdt_indicator
  @has_epsdt_indicator
end

#has_family_planning_indicatorBoolean (readonly)

Returns Maps to SV1-12 on the 837-P and Box 24I on the CMS-1500. If the value is true, the box will be populated with “Y”. Otherwise, the box will not be populated.

Returns:

  • (Boolean)

    Maps to SV1-12 on the 837-P and Box 24I on the CMS-1500. If the value is true, the box will be populated with “Y”. Otherwise, the box will not be populated.



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

def has_family_planning_indicator
  @has_family_planning_indicator
end

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



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

def modifiers
  @modifiers
end

#ordering_providerCandidApiClient::EncounterProviders::V2::Types::OrderingProvider (readonly)

Returns Required when the service or supply was ordered by a provider who is different than the rendering provider for this service line. If not required by this implementation guide, do not send.

Returns:



61
62
63
# File 'lib/candidhealth/service_lines/v_2/types/service_line_create.rb', line 61

def ordering_provider
  @ordering_provider
end

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

Returns 837p Loop2300, SV105. If your organization does not intend to submit claims with a different place of service at the service line level, this field should not be populated. 02 for telemedicine, 11 for in-person. Full list //www.cms.gov/Medicare/Coding/place-of-service-codes/Place_of_Service_Code_Set).

Returns:



50
51
52
# File 'lib/candidhealth/service_lines/v_2/types/service_line_create.rb', line 50

def place_of_service_code
  @place_of_service_code
end

#procedure_codeString (readonly)

Returns:

  • (String)


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

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.



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

def quantity
  @quantity
end

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

Returns Contains a list of test results. Test result types may map to MEA-02 on the 837-P (ex: Hemoglobin, Hematocrit). No more than 5 MEA-02 test results may be submitted per service line.

Returns:



65
66
67
# File 'lib/candidhealth/service_lines/v_2/types/service_line_create.rb', line 65

def test_results
  @test_results
end

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



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

def units
  @units
end

Class Method Details

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

Deserialize a JSON object to an instance of ServiceLineCreate

Parameters:

  • json_object (String)

Returns:



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
196
197
198
199
200
201
202
203
# File 'lib/candidhealth/service_lines/v_2/types/service_line_create.rb', line 152

def self.from_json(json_object:)
  struct = JSON.parse(json_object, object_class: OpenStruct)
  parsed_json = JSON.parse(json_object)
  modifiers = struct["modifiers"]
  has_epsdt_indicator = struct["has_epsdt_indicator"]
  has_family_planning_indicator = struct["has_family_planning_indicator"]
  procedure_code = struct["procedure_code"]
  quantity = struct["quantity"]
  units = struct["units"]
  charge_amount_cents = struct["charge_amount_cents"]
  diagnosis_pointers = struct["diagnosis_pointers"]
  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
  place_of_service_code = struct["place_of_service_code"]
  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
  if parsed_json["ordering_provider"].nil?
    ordering_provider = nil
  else
    ordering_provider = parsed_json["ordering_provider"].to_json
    ordering_provider = CandidApiClient::EncounterProviders::V2::Types::OrderingProvider.from_json(json_object: ordering_provider)
  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(
    modifiers: modifiers,
    has_epsdt_indicator: has_epsdt_indicator,
    has_family_planning_indicator: has_family_planning_indicator,
    procedure_code: procedure_code,
    quantity: quantity,
    units: units,
    charge_amount_cents: charge_amount_cents,
    diagnosis_pointers: diagnosis_pointers,
    drug_identification: drug_identification,
    place_of_service_code: place_of_service_code,
    description: description,
    date_of_service: date_of_service,
    end_date_of_service: end_date_of_service,
    ordering_provider: ordering_provider,
    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)


218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
# File 'lib/candidhealth/service_lines/v_2/types/service_line_create.rb', line 218

def self.validate_raw(obj:)
  obj.modifiers&.is_a?(Array) != false || raise("Passed value for field obj.modifiers is not the expected type, validation failed.")
  obj.has_epsdt_indicator&.is_a?(Boolean) != false || raise("Passed value for field obj.has_epsdt_indicator is not the expected type, validation failed.")
  obj.has_family_planning_indicator&.is_a?(Boolean) != false || raise("Passed value for field obj.has_family_planning_indicator 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.units.is_a?(CandidApiClient::Commons::Types::ServiceLineUnits) != false || raise("Passed value for field obj.units 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_pointers.is_a?(Array) != false || raise("Passed value for field obj.diagnosis_pointers is not the expected type, validation failed.")
  obj.drug_identification.nil? || CandidApiClient::ServiceLines::V2::Types::DrugIdentification.validate_raw(obj: obj.drug_identification)
  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.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.ordering_provider.nil? || CandidApiClient::EncounterProviders::V2::Types::OrderingProvider.validate_raw(obj: obj.ordering_provider)
  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 ServiceLineCreate to a JSON object

Returns:

  • (String)


208
209
210
# File 'lib/candidhealth/service_lines/v_2/types/service_line_create.rb', line 208

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