Class: FHIR::InsurancePlanPlanSpecificCostBenefit

Inherits:
BackboneElement show all
Includes:
Mongoid::Document
Defined in:
app/models/fhir/insurance_plan_plan_specific_cost_benefit.rb

Overview

fhir/insurance_plan_plan_specific_cost_benefit.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.transform_json(json_hash, target = InsurancePlanPlanSpecificCostBenefit.new) ⇒ Object



24
25
26
27
28
29
30
31
# File 'app/models/fhir/insurance_plan_plan_specific_cost_benefit.rb', line 24

def self.transform_json(json_hash, target = InsurancePlanPlanSpecificCostBenefit.new)

  result = self.superclass.transform_json(json_hash, target)
  result['type'] = CodeableConcept.transform_json(json_hash['type']) unless json_hash['type'].nil?
  result['cost'] = json_hash['cost'].map { |var| InsurancePlanPlanSpecificCostBenefitCost.transform_json(var) } unless json_hash['cost'].nil?

  result
end

Instance Method Details

#as_json(*args) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'app/models/fhir/insurance_plan_plan_specific_cost_benefit.rb', line 8

def as_json(*args)
  result = super      
  unless self.type.nil? 
    result['type'] = self.type.as_json(*args)
  end
  unless self.cost.nil?  || !self.cost.any? 
    result['cost'] = self.cost.map{ |x| x.as_json(*args) }
  end
  result.delete('id')
  unless self.fhirId.nil?
    result['id'] = self.fhirId
    result.delete('fhirId')
  end  
  result
end