Class: FHIR::VisionPrescriptionLensSpecificationPrism

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

Overview

fhir/vision_prescription_lens_specification_prism.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

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



28
29
30
31
32
33
34
35
# File 'app/models/fhir/vision_prescription_lens_specification_prism.rb', line 28

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

  result = self.superclass.transform_json(json_hash, target)
  result['amount'] = PrimitiveDecimal.transform_json(json_hash['amount'], json_hash['_amount']) unless json_hash['amount'].nil?
  result['base'] = VisionBase.transform_json(json_hash['base'], json_hash['_base']) unless json_hash['base'].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
23
24
25
26
# File 'app/models/fhir/vision_prescription_lens_specification_prism.rb', line 8

def as_json(*args)
  result = super      
  unless self.amount.nil? 
    result['amount'] = self.amount.value
    serialized = Extension.serializePrimitiveExtension(self.amount)            
    result['_amount'] = serialized unless serialized.nil?
  end
  unless self.base.nil? 
    result['base'] = self.base.value
    serialized = Extension.serializePrimitiveExtension(self.base)            
    result['_base'] = serialized unless serialized.nil?
  end
  result.delete('id')
  unless self.fhirId.nil?
    result['id'] = self.fhirId
    result.delete('fhirId')
  end  
  result
end