Class: FHIR::InsurancePlanPlan

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

Overview

fhir/insurance_plan_plan.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

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



40
41
42
43
44
45
46
47
48
49
50
51
# File 'app/models/fhir/insurance_plan_plan.rb', line 40

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

  result = self.superclass.transform_json(json_hash, target)
  result['identifier'] = json_hash['identifier'].map { |var| Identifier.transform_json(var) } unless json_hash['identifier'].nil?
  result['type'] = CodeableConcept.transform_json(json_hash['type']) unless json_hash['type'].nil?
  result['coverageArea'] = json_hash['coverageArea'].map { |var| Reference.transform_json(var) } unless json_hash['coverageArea'].nil?
  result['network'] = json_hash['network'].map { |var| Reference.transform_json(var) } unless json_hash['network'].nil?
  result['generalCost'] = json_hash['generalCost'].map { |var| InsurancePlanPlanGeneralCost.transform_json(var) } unless json_hash['generalCost'].nil?
  result['specificCost'] = json_hash['specificCost'].map { |var| InsurancePlanPlanSpecificCost.transform_json(var) } unless json_hash['specificCost'].nil?

  result
end

Instance Method Details

#as_json(*args) ⇒ Object



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'app/models/fhir/insurance_plan_plan.rb', line 12

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