Class: CandidApiClient::ServiceLines::V2::Types::ServiceLine
- Inherits:
-
Object
- Object
- CandidApiClient::ServiceLines::V2::Types::ServiceLine
- Defined in:
- lib/candidhealth/service_lines/v_2/types/service_line.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
- #allowed_amount_cents ⇒ Integer readonly
- #charge_amount_cents ⇒ Integer readonly
- #claim_id ⇒ String readonly
- #coinsurance_cents ⇒ Integer readonly
- #copay_cents ⇒ Integer readonly
- #created_at ⇒ DateTime readonly
- #date_of_service ⇒ Date readonly
-
#date_of_service_range ⇒ CandidApiClient::Commons::Types::DateRangeOptionalEnd
readonly
A range of dates of service for this service line.
- #deductible_cents ⇒ Integer readonly
- #denial_reason ⇒ CandidApiClient::ServiceLines::V2::Types::ServiceLineDenialReason readonly
-
#description ⇒ String
readonly
A free-form description to clarify the related data elements and their content.
- #diagnosis_id_one ⇒ String readonly
- #diagnosis_id_three ⇒ String readonly
- #diagnosis_id_two ⇒ String readonly
- #diagnosis_id_zero ⇒ String readonly
- #drug_identification ⇒ CandidApiClient::ServiceLines::V2::Types::DrugIdentification readonly
- #end_date_of_service ⇒ Date readonly
-
#has_epsdt_indicator ⇒ Boolean
readonly
Maps to SV1-11 on the 837-P and Box 24H on the CMS-1500.
-
#has_family_planning_indicator ⇒ Boolean
readonly
Maps to SV1-12 on the 837-P and Box 24I on the CMS-1500.
- #insurance_balance_cents ⇒ Integer readonly
- #modifiers ⇒ Array<CandidApiClient::Commons::Types::ProcedureModifier> readonly
-
#note ⇒ String
readonly
Maps to NTE02 loop 2400 on the EDI 837.
- #ordering_provider ⇒ CandidApiClient::EncounterProviders::V2::Types::EncounterProvider readonly
- #paid_amount_cents ⇒ Integer readonly
- #patient_balance_cents ⇒ Integer readonly
- #patient_responsibility_cents ⇒ Integer readonly
-
#place_of_service_code ⇒ CandidApiClient::Commons::Types::FacilityTypeCode
readonly
837p Loop2300, SV105.
-
#place_of_service_code_as_submitted ⇒ CandidApiClient::Commons::Types::FacilityTypeCode
readonly
837p Loop2300, SV105.
- #primary_paid_amount_cents ⇒ Integer readonly
- #procedure_code ⇒ String readonly
-
#quantity ⇒ String
readonly
String representation of a Decimal that can be parsed by most libraries.
- #related_invoice_info ⇒ Array<CandidApiClient::Invoices::V2::Types::InvoiceInfo> readonly
- #related_invoices ⇒ Array<CandidApiClient::Invoices::Types::Invoice> readonly
-
#revenue_code ⇒ String
readonly
A 4 digit code that specifies facility department or type of service arrangement for institutional service line items (837i).
- #secondary_paid_amount_cents ⇒ Integer readonly
- #service_line_era_data ⇒ CandidApiClient::ServiceLines::V2::Types::ServiceLineEraData readonly
- #service_line_id ⇒ String readonly
- #service_line_manual_adjustments ⇒ Array<CandidApiClient::ServiceLines::V2::Types::ServiceLineAdjustment> readonly
- #tertiary_paid_amount_cents ⇒ Integer readonly
-
#test_results ⇒ Array<CandidApiClient::ServiceLines::V2::Types::TestResult>
readonly
Contains a list of test results.
- #units ⇒ CandidApiClient::Commons::Types::ServiceLineUnits readonly
Class Method Summary collapse
-
.from_json(json_object:) ⇒ CandidApiClient::ServiceLines::V2::Types::ServiceLine
Deserialize a JSON object to an instance of ServiceLine.
-
.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.
Instance Method Summary collapse
- #initialize(created_at:, service_line_id:, procedure_code:, quantity:, units:, claim_id:, date_of_service_range:, date_of_service:, modifiers: OMIT, charge_amount_cents: OMIT, allowed_amount_cents: OMIT, insurance_balance_cents: OMIT, patient_balance_cents: OMIT, paid_amount_cents: OMIT, primary_paid_amount_cents: OMIT, secondary_paid_amount_cents: OMIT, tertiary_paid_amount_cents: OMIT, patient_responsibility_cents: OMIT, copay_cents: OMIT, coinsurance_cents: OMIT, deductible_cents: OMIT, diagnosis_id_zero: OMIT, diagnosis_id_one: OMIT, diagnosis_id_two: OMIT, diagnosis_id_three: OMIT, drug_identification: OMIT, service_line_era_data: OMIT, service_line_manual_adjustments: OMIT, related_invoices: OMIT, related_invoice_info: OMIT, denial_reason: OMIT, place_of_service_code: OMIT, place_of_service_code_as_submitted: OMIT, ordering_provider: OMIT, revenue_code: OMIT, description: OMIT, end_date_of_service: OMIT, test_results: OMIT, has_epsdt_indicator: OMIT, has_family_planning_indicator: OMIT, note: OMIT, additional_properties: nil) ⇒ CandidApiClient::ServiceLines::V2::Types::ServiceLine constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of ServiceLine to a JSON object.
Constructor Details
#initialize(created_at:, service_line_id:, procedure_code:, quantity:, units:, claim_id:, date_of_service_range:, date_of_service:, modifiers: OMIT, charge_amount_cents: OMIT, allowed_amount_cents: OMIT, insurance_balance_cents: OMIT, patient_balance_cents: OMIT, paid_amount_cents: OMIT, primary_paid_amount_cents: OMIT, secondary_paid_amount_cents: OMIT, tertiary_paid_amount_cents: OMIT, patient_responsibility_cents: OMIT, copay_cents: OMIT, coinsurance_cents: OMIT, deductible_cents: OMIT, diagnosis_id_zero: OMIT, diagnosis_id_one: OMIT, diagnosis_id_two: OMIT, diagnosis_id_three: OMIT, drug_identification: OMIT, service_line_era_data: OMIT, service_line_manual_adjustments: OMIT, related_invoices: OMIT, related_invoice_info: OMIT, denial_reason: OMIT, place_of_service_code: OMIT, place_of_service_code_as_submitted: OMIT, ordering_provider: OMIT, revenue_code: OMIT, description: OMIT, end_date_of_service: OMIT, test_results: OMIT, has_epsdt_indicator: OMIT, has_family_planning_indicator: OMIT, note: OMIT, additional_properties: nil) ⇒ CandidApiClient::ServiceLines::V2::Types::ServiceLine
201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 |
# File 'lib/candidhealth/service_lines/v_2/types/service_line.rb', line 201 def initialize(created_at:, service_line_id:, procedure_code:, quantity:, units:, claim_id:, date_of_service_range:, date_of_service:, modifiers: OMIT, charge_amount_cents: OMIT, allowed_amount_cents: OMIT, insurance_balance_cents: OMIT, patient_balance_cents: OMIT, paid_amount_cents: OMIT, primary_paid_amount_cents: OMIT, secondary_paid_amount_cents: OMIT, tertiary_paid_amount_cents: OMIT, patient_responsibility_cents: OMIT, copay_cents: OMIT, coinsurance_cents: OMIT, deductible_cents: OMIT, diagnosis_id_zero: OMIT, diagnosis_id_one: OMIT, diagnosis_id_two: OMIT, diagnosis_id_three: OMIT, drug_identification: OMIT, service_line_era_data: OMIT, service_line_manual_adjustments: OMIT, related_invoices: OMIT, related_invoice_info: OMIT, denial_reason: OMIT, place_of_service_code: OMIT, place_of_service_code_as_submitted: OMIT, ordering_provider: OMIT, revenue_code: OMIT, description: OMIT, end_date_of_service: OMIT, test_results: OMIT, has_epsdt_indicator: OMIT, has_family_planning_indicator: OMIT, note: OMIT, additional_properties: nil) @created_at = created_at @modifiers = modifiers if modifiers != OMIT @charge_amount_cents = charge_amount_cents if charge_amount_cents != OMIT @allowed_amount_cents = allowed_amount_cents if allowed_amount_cents != OMIT @insurance_balance_cents = insurance_balance_cents if insurance_balance_cents != OMIT @patient_balance_cents = patient_balance_cents if patient_balance_cents != OMIT @paid_amount_cents = paid_amount_cents if paid_amount_cents != OMIT @primary_paid_amount_cents = primary_paid_amount_cents if primary_paid_amount_cents != OMIT @secondary_paid_amount_cents = secondary_paid_amount_cents if secondary_paid_amount_cents != OMIT @tertiary_paid_amount_cents = tertiary_paid_amount_cents if tertiary_paid_amount_cents != OMIT @patient_responsibility_cents = patient_responsibility_cents if patient_responsibility_cents != OMIT @copay_cents = copay_cents if copay_cents != OMIT @coinsurance_cents = coinsurance_cents if coinsurance_cents != OMIT @deductible_cents = deductible_cents if deductible_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 @service_line_era_data = service_line_era_data if service_line_era_data != OMIT if service_line_manual_adjustments != OMIT @service_line_manual_adjustments = service_line_manual_adjustments end = if != OMIT = if != OMIT @denial_reason = denial_reason if denial_reason != OMIT @place_of_service_code = place_of_service_code if place_of_service_code != OMIT if place_of_service_code_as_submitted != OMIT @place_of_service_code_as_submitted = place_of_service_code_as_submitted end @service_line_id = service_line_id @procedure_code = procedure_code @ordering_provider = ordering_provider if ordering_provider != OMIT @revenue_code = revenue_code if revenue_code != OMIT @quantity = quantity @units = units @claim_id = claim_id @date_of_service_range = date_of_service_range @description = description if description != OMIT @date_of_service = date_of_service @end_date_of_service = end_date_of_service if end_date_of_service != OMIT @test_results = test_results if test_results != 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 @note = note if note != OMIT @additional_properties = additional_properties @_field_set = { "created_at": created_at, "modifiers": modifiers, "charge_amount_cents": charge_amount_cents, "allowed_amount_cents": allowed_amount_cents, "insurance_balance_cents": insurance_balance_cents, "patient_balance_cents": patient_balance_cents, "paid_amount_cents": paid_amount_cents, "primary_paid_amount_cents": primary_paid_amount_cents, "secondary_paid_amount_cents": secondary_paid_amount_cents, "tertiary_paid_amount_cents": tertiary_paid_amount_cents, "patient_responsibility_cents": patient_responsibility_cents, "copay_cents": copay_cents, "coinsurance_cents": coinsurance_cents, "deductible_cents": deductible_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, "service_line_era_data": service_line_era_data, "service_line_manual_adjustments": service_line_manual_adjustments, "related_invoices": , "related_invoice_info": , "denial_reason": denial_reason, "place_of_service_code": place_of_service_code, "place_of_service_code_as_submitted": place_of_service_code_as_submitted, "service_line_id": service_line_id, "procedure_code": procedure_code, "ordering_provider": ordering_provider, "revenue_code": revenue_code, "quantity": quantity, "units": units, "claim_id": claim_id, "date_of_service_range": date_of_service_range, "description": description, "date_of_service": date_of_service, "end_date_of_service": end_date_of_service, "test_results": test_results, "has_epsdt_indicator": has_epsdt_indicator, "has_family_planning_indicator": has_family_planning_indicator, "note": note }.reject do |_k, v| v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
129 130 131 |
# File 'lib/candidhealth/service_lines/v_2/types/service_line.rb', line 129 def additional_properties @additional_properties end |
#allowed_amount_cents ⇒ Integer (readonly)
31 32 33 |
# File 'lib/candidhealth/service_lines/v_2/types/service_line.rb', line 31 def allowed_amount_cents @allowed_amount_cents end |
#charge_amount_cents ⇒ Integer (readonly)
29 30 31 |
# File 'lib/candidhealth/service_lines/v_2/types/service_line.rb', line 29 def charge_amount_cents @charge_amount_cents end |
#claim_id ⇒ String (readonly)
101 102 103 |
# File 'lib/candidhealth/service_lines/v_2/types/service_line.rb', line 101 def claim_id @claim_id end |
#coinsurance_cents ⇒ Integer (readonly)
49 50 51 |
# File 'lib/candidhealth/service_lines/v_2/types/service_line.rb', line 49 def coinsurance_cents @coinsurance_cents end |
#copay_cents ⇒ Integer (readonly)
47 48 49 |
# File 'lib/candidhealth/service_lines/v_2/types/service_line.rb', line 47 def copay_cents @copay_cents end |
#created_at ⇒ DateTime (readonly)
25 26 27 |
# File 'lib/candidhealth/service_lines/v_2/types/service_line.rb', line 25 def created_at @created_at end |
#date_of_service ⇒ Date (readonly)
110 111 112 |
# File 'lib/candidhealth/service_lines/v_2/types/service_line.rb', line 110 def date_of_service @date_of_service end |
#date_of_service_range ⇒ CandidApiClient::Commons::Types::DateRangeOptionalEnd (readonly)
Returns A range of dates of service for this service line. If the service line is for a single date, the end date will be empty.
105 106 107 |
# File 'lib/candidhealth/service_lines/v_2/types/service_line.rb', line 105 def date_of_service_range @date_of_service_range end |
#deductible_cents ⇒ Integer (readonly)
51 52 53 |
# File 'lib/candidhealth/service_lines/v_2/types/service_line.rb', line 51 def deductible_cents @deductible_cents end |
#denial_reason ⇒ CandidApiClient::ServiceLines::V2::Types::ServiceLineDenialReason (readonly)
71 72 73 |
# File 'lib/candidhealth/service_lines/v_2/types/service_line.rb', line 71 def denial_reason @denial_reason end |
#description ⇒ String (readonly)
Returns A free-form description to clarify the related data elements and their content. Maps to SV1-01, C003-07 on a 837-P and SV2-02, C003-07 on a 837-I form.
108 109 110 |
# File 'lib/candidhealth/service_lines/v_2/types/service_line.rb', line 108 def description @description end |
#diagnosis_id_one ⇒ String (readonly)
55 56 57 |
# File 'lib/candidhealth/service_lines/v_2/types/service_line.rb', line 55 def diagnosis_id_one @diagnosis_id_one end |
#diagnosis_id_three ⇒ String (readonly)
59 60 61 |
# File 'lib/candidhealth/service_lines/v_2/types/service_line.rb', line 59 def diagnosis_id_three @diagnosis_id_three end |
#diagnosis_id_two ⇒ String (readonly)
57 58 59 |
# File 'lib/candidhealth/service_lines/v_2/types/service_line.rb', line 57 def diagnosis_id_two @diagnosis_id_two end |
#diagnosis_id_zero ⇒ String (readonly)
53 54 55 |
# File 'lib/candidhealth/service_lines/v_2/types/service_line.rb', line 53 def diagnosis_id_zero @diagnosis_id_zero end |
#drug_identification ⇒ CandidApiClient::ServiceLines::V2::Types::DrugIdentification (readonly)
61 62 63 |
# File 'lib/candidhealth/service_lines/v_2/types/service_line.rb', line 61 def drug_identification @drug_identification end |
#end_date_of_service ⇒ Date (readonly)
112 113 114 |
# File 'lib/candidhealth/service_lines/v_2/types/service_line.rb', line 112 def end_date_of_service @end_date_of_service end |
#has_epsdt_indicator ⇒ Boolean (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.
121 122 123 |
# File 'lib/candidhealth/service_lines/v_2/types/service_line.rb', line 121 def has_epsdt_indicator @has_epsdt_indicator end |
#has_family_planning_indicator ⇒ Boolean (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.
125 126 127 |
# File 'lib/candidhealth/service_lines/v_2/types/service_line.rb', line 125 def has_family_planning_indicator @has_family_planning_indicator end |
#insurance_balance_cents ⇒ Integer (readonly)
33 34 35 |
# File 'lib/candidhealth/service_lines/v_2/types/service_line.rb', line 33 def insurance_balance_cents @insurance_balance_cents end |
#modifiers ⇒ Array<CandidApiClient::Commons::Types::ProcedureModifier> (readonly)
27 28 29 |
# File 'lib/candidhealth/service_lines/v_2/types/service_line.rb', line 27 def modifiers @modifiers end |
#note ⇒ String (readonly)
Returns Maps to NTE02 loop 2400 on the EDI 837.
127 128 129 |
# File 'lib/candidhealth/service_lines/v_2/types/service_line.rb', line 127 def note @note end |
#ordering_provider ⇒ CandidApiClient::EncounterProviders::V2::Types::EncounterProvider (readonly)
86 87 88 |
# File 'lib/candidhealth/service_lines/v_2/types/service_line.rb', line 86 def ordering_provider @ordering_provider end |
#paid_amount_cents ⇒ Integer (readonly)
37 38 39 |
# File 'lib/candidhealth/service_lines/v_2/types/service_line.rb', line 37 def paid_amount_cents @paid_amount_cents end |
#patient_balance_cents ⇒ Integer (readonly)
35 36 37 |
# File 'lib/candidhealth/service_lines/v_2/types/service_line.rb', line 35 def patient_balance_cents @patient_balance_cents end |
#patient_responsibility_cents ⇒ Integer (readonly)
45 46 47 |
# File 'lib/candidhealth/service_lines/v_2/types/service_line.rb', line 45 def patient_responsibility_cents @patient_responsibility_cents end |
#place_of_service_code ⇒ CandidApiClient::Commons::Types::FacilityTypeCode (readonly)
Returns 837p Loop2300, SV105. This enum is not used or required in 837i claims. 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).
77 78 79 |
# File 'lib/candidhealth/service_lines/v_2/types/service_line.rb', line 77 def place_of_service_code @place_of_service_code end |
#place_of_service_code_as_submitted ⇒ CandidApiClient::Commons::Types::FacilityTypeCode (readonly)
Returns 837p Loop2300, SV105. 02 for telemedicine, 11 for in-person. Full list //www.cms.gov/Medicare/Coding/place-of-service-codes/Place_of_Service_Code_Set).
80 81 82 |
# File 'lib/candidhealth/service_lines/v_2/types/service_line.rb', line 80 def place_of_service_code_as_submitted @place_of_service_code_as_submitted end |
#primary_paid_amount_cents ⇒ Integer (readonly)
39 40 41 |
# File 'lib/candidhealth/service_lines/v_2/types/service_line.rb', line 39 def primary_paid_amount_cents @primary_paid_amount_cents end |
#procedure_code ⇒ String (readonly)
84 85 86 |
# File 'lib/candidhealth/service_lines/v_2/types/service_line.rb', line 84 def procedure_code @procedure_code end |
#quantity ⇒ String (readonly)
Returns String representation of a Decimal that can be parsed by most libraries. For professional claims, a ServiceLine quantity cannot contain more than one digit of precision (Example: 1.1 is valid, 1.11 is not). For institutional claims, a ServiceLine quantity cannot contain more than three decimal digits of precision.
97 98 99 |
# File 'lib/candidhealth/service_lines/v_2/types/service_line.rb', line 97 def quantity @quantity end |
#related_invoice_info ⇒ Array<CandidApiClient::Invoices::V2::Types::InvoiceInfo> (readonly)
69 70 71 |
# File 'lib/candidhealth/service_lines/v_2/types/service_line.rb', line 69 def end |
#related_invoices ⇒ Array<CandidApiClient::Invoices::Types::Invoice> (readonly)
67 68 69 |
# File 'lib/candidhealth/service_lines/v_2/types/service_line.rb', line 67 def end |
#revenue_code ⇒ String (readonly)
Returns A 4 digit code that specifies facility department or type of service arrangement for institutional service line items (837i). This code is not required for professional claim billing (837p).
90 91 92 |
# File 'lib/candidhealth/service_lines/v_2/types/service_line.rb', line 90 def revenue_code @revenue_code end |
#secondary_paid_amount_cents ⇒ Integer (readonly)
41 42 43 |
# File 'lib/candidhealth/service_lines/v_2/types/service_line.rb', line 41 def secondary_paid_amount_cents @secondary_paid_amount_cents end |
#service_line_era_data ⇒ CandidApiClient::ServiceLines::V2::Types::ServiceLineEraData (readonly)
63 64 65 |
# File 'lib/candidhealth/service_lines/v_2/types/service_line.rb', line 63 def service_line_era_data @service_line_era_data end |
#service_line_id ⇒ String (readonly)
82 83 84 |
# File 'lib/candidhealth/service_lines/v_2/types/service_line.rb', line 82 def service_line_id @service_line_id end |
#service_line_manual_adjustments ⇒ Array<CandidApiClient::ServiceLines::V2::Types::ServiceLineAdjustment> (readonly)
65 66 67 |
# File 'lib/candidhealth/service_lines/v_2/types/service_line.rb', line 65 def service_line_manual_adjustments @service_line_manual_adjustments end |
#tertiary_paid_amount_cents ⇒ Integer (readonly)
43 44 45 |
# File 'lib/candidhealth/service_lines/v_2/types/service_line.rb', line 43 def tertiary_paid_amount_cents @tertiary_paid_amount_cents end |
#test_results ⇒ Array<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). This is unused by 837-i and ignored for institutional service lines. No more than 5 MEA-02 test results may be submitted per service line.
117 118 119 |
# File 'lib/candidhealth/service_lines/v_2/types/service_line.rb', line 117 def test_results @test_results end |
#units ⇒ CandidApiClient::Commons::Types::ServiceLineUnits (readonly)
99 100 101 |
# File 'lib/candidhealth/service_lines/v_2/types/service_line.rb', line 99 def units @units end |
Class Method Details
.from_json(json_object:) ⇒ CandidApiClient::ServiceLines::V2::Types::ServiceLine
Deserialize a JSON object to an instance of ServiceLine
300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 |
# File 'lib/candidhealth/service_lines/v_2/types/service_line.rb', line 300 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) created_at = (DateTime.parse(parsed_json["created_at"]) unless parsed_json["created_at"].nil?) modifiers = struct["modifiers"] charge_amount_cents = struct["charge_amount_cents"] allowed_amount_cents = struct["allowed_amount_cents"] insurance_balance_cents = struct["insurance_balance_cents"] patient_balance_cents = struct["patient_balance_cents"] paid_amount_cents = struct["paid_amount_cents"] primary_paid_amount_cents = struct["primary_paid_amount_cents"] secondary_paid_amount_cents = struct["secondary_paid_amount_cents"] tertiary_paid_amount_cents = struct["tertiary_paid_amount_cents"] patient_responsibility_cents = struct["patient_responsibility_cents"] copay_cents = struct["copay_cents"] coinsurance_cents = struct["coinsurance_cents"] deductible_cents = struct["deductible_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["service_line_era_data"].nil? service_line_era_data = nil else service_line_era_data = parsed_json["service_line_era_data"].to_json service_line_era_data = CandidApiClient::ServiceLines::V2::Types::ServiceLineEraData.from_json(json_object: service_line_era_data) end service_line_manual_adjustments = parsed_json["service_line_manual_adjustments"]&.map do |item| item = item.to_json CandidApiClient::ServiceLines::V2::Types::ServiceLineAdjustment.from_json(json_object: item) end = parsed_json["related_invoices"]&.map do |item| item = item.to_json CandidApiClient::Invoices::Types::Invoice.from_json(json_object: item) end = parsed_json["related_invoice_info"]&.map do |item| item = item.to_json CandidApiClient::Invoices::V2::Types::InvoiceInfo.from_json(json_object: item) 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"] place_of_service_code_as_submitted = struct["place_of_service_code_as_submitted"] service_line_id = struct["service_line_id"] procedure_code = struct["procedure_code"] if parsed_json["ordering_provider"].nil? ordering_provider = nil else ordering_provider = parsed_json["ordering_provider"].to_json ordering_provider = CandidApiClient::EncounterProviders::V2::Types::EncounterProvider.from_json(json_object: ordering_provider) end revenue_code = struct["revenue_code"] quantity = struct["quantity"] units = struct["units"] claim_id = struct["claim_id"] if parsed_json["date_of_service_range"].nil? date_of_service_range = nil else date_of_service_range = parsed_json["date_of_service_range"].to_json date_of_service_range = CandidApiClient::Commons::Types::DateRangeOptionalEnd.from_json(json_object: date_of_service_range) end 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 has_epsdt_indicator = struct["has_epsdt_indicator"] has_family_planning_indicator = struct["has_family_planning_indicator"] note = struct["note"] new( created_at: created_at, modifiers: modifiers, charge_amount_cents: charge_amount_cents, allowed_amount_cents: allowed_amount_cents, insurance_balance_cents: insurance_balance_cents, patient_balance_cents: patient_balance_cents, paid_amount_cents: paid_amount_cents, primary_paid_amount_cents: primary_paid_amount_cents, secondary_paid_amount_cents: secondary_paid_amount_cents, tertiary_paid_amount_cents: tertiary_paid_amount_cents, patient_responsibility_cents: patient_responsibility_cents, copay_cents: copay_cents, coinsurance_cents: coinsurance_cents, deductible_cents: deductible_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, service_line_era_data: service_line_era_data, service_line_manual_adjustments: service_line_manual_adjustments, related_invoices: , related_invoice_info: , denial_reason: denial_reason, place_of_service_code: place_of_service_code, place_of_service_code_as_submitted: place_of_service_code_as_submitted, service_line_id: service_line_id, procedure_code: procedure_code, ordering_provider: ordering_provider, revenue_code: revenue_code, quantity: quantity, units: units, claim_id: claim_id, date_of_service_range: date_of_service_range, description: description, date_of_service: date_of_service, end_date_of_service: end_date_of_service, test_results: test_results, has_epsdt_indicator: has_epsdt_indicator, has_family_planning_indicator: has_family_planning_indicator, note: note, 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.
442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 |
# File 'lib/candidhealth/service_lines/v_2/types/service_line.rb', line 442 def self.validate_raw(obj:) obj.created_at.is_a?(DateTime) != false || raise("Passed value for field obj.created_at 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.allowed_amount_cents&.is_a?(Integer) != false || raise("Passed value for field obj.allowed_amount_cents is not the expected type, validation failed.") obj.insurance_balance_cents&.is_a?(Integer) != false || raise("Passed value for field obj.insurance_balance_cents is not the expected type, validation failed.") obj.patient_balance_cents&.is_a?(Integer) != false || raise("Passed value for field obj.patient_balance_cents is not the expected type, validation failed.") obj.paid_amount_cents&.is_a?(Integer) != false || raise("Passed value for field obj.paid_amount_cents is not the expected type, validation failed.") obj.primary_paid_amount_cents&.is_a?(Integer) != false || raise("Passed value for field obj.primary_paid_amount_cents is not the expected type, validation failed.") obj.secondary_paid_amount_cents&.is_a?(Integer) != false || raise("Passed value for field obj.secondary_paid_amount_cents is not the expected type, validation failed.") obj.tertiary_paid_amount_cents&.is_a?(Integer) != false || raise("Passed value for field obj.tertiary_paid_amount_cents is not the expected type, validation failed.") obj.patient_responsibility_cents&.is_a?(Integer) != false || raise("Passed value for field obj.patient_responsibility_cents is not the expected type, validation failed.") obj.copay_cents&.is_a?(Integer) != false || raise("Passed value for field obj.copay_cents is not the expected type, validation failed.") obj.coinsurance_cents&.is_a?(Integer) != false || raise("Passed value for field obj.coinsurance_cents is not the expected type, validation failed.") obj.deductible_cents&.is_a?(Integer) != false || raise("Passed value for field obj.deductible_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.service_line_era_data.nil? || CandidApiClient::ServiceLines::V2::Types::ServiceLineEraData.validate_raw(obj: obj.service_line_era_data) obj.service_line_manual_adjustments&.is_a?(Array) != false || raise("Passed value for field obj.service_line_manual_adjustments is not the expected type, validation failed.") obj.&.is_a?(Array) != false || raise("Passed value for field obj.related_invoices is not the expected type, validation failed.") obj.&.is_a?(Array) != false || raise("Passed value for field obj.related_invoice_info is not the expected type, validation failed.") 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.place_of_service_code_as_submitted&.is_a?(CandidApiClient::Commons::Types::FacilityTypeCode) != false || raise("Passed value for field obj.place_of_service_code_as_submitted is not the expected type, validation failed.") obj.service_line_id.is_a?(String) != false || raise("Passed value for field obj.service_line_id 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.ordering_provider.nil? || CandidApiClient::EncounterProviders::V2::Types::EncounterProvider.validate_raw(obj: obj.ordering_provider) obj.revenue_code&.is_a?(String) != false || raise("Passed value for field obj.revenue_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.claim_id.is_a?(String) != false || raise("Passed value for field obj.claim_id is not the expected type, validation failed.") CandidApiClient::Commons::Types::DateRangeOptionalEnd.validate_raw(obj: obj.date_of_service_range) 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.") 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.note&.is_a?(String) != false || raise("Passed value for field obj.note is not the expected type, validation failed.") end |
Instance Method Details
#to_json(*_args) ⇒ String
Serialize an instance of ServiceLine to a JSON object
432 433 434 |
# File 'lib/candidhealth/service_lines/v_2/types/service_line.rb', line 432 def to_json(*_args) @_field_set&.to_json end |