Class: FHIR::InsurancePlanPlanGeneralCost

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

Overview

fhir/insurance_plan_plan_general_cost.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

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



36
37
38
39
40
41
42
43
44
45
# File 'app/models/fhir/insurance_plan_plan_general_cost.rb', line 36

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

  result = self.superclass.transform_json(json_hash, target)
  result['type'] = CodeableConcept.transform_json(json_hash['type']) unless json_hash['type'].nil?
  result['groupSize'] = PrimitivePositiveInt.transform_json(json_hash['groupSize'], json_hash['_groupSize']) unless json_hash['groupSize'].nil?
  result['cost'] = Money.transform_json(json_hash['cost']) unless json_hash['cost'].nil?
  result['comment'] = PrimitiveString.transform_json(json_hash['comment'], json_hash['_comment']) unless json_hash['comment'].nil?

  result
end

Instance Method Details

#as_json(*args) ⇒ Object



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

def as_json(*args)
  result = super      
  unless self.type.nil? 
    result['type'] = self.type.as_json(*args)
  end
  unless self.groupSize.nil? 
    result['groupSize'] = self.groupSize.value
    serialized = Extension.serializePrimitiveExtension(self.groupSize)            
    result['_groupSize'] = serialized unless serialized.nil?
  end
  unless self.cost.nil? 
    result['cost'] = self.cost.as_json(*args)
  end
  unless self.comment.nil? 
    result['comment'] = self.comment.value
    serialized = Extension.serializePrimitiveExtension(self.comment)            
    result['_comment'] = serialized unless serialized.nil?
  end
  result.delete('id')
  unless self.fhirId.nil?
    result['id'] = self.fhirId
    result.delete('fhirId')
  end  
  result
end