Class: FHIR::BiologicallyDerivedProductStorage

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

Overview

fhir/biologically_derived_product_storage.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

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



38
39
40
41
42
43
44
45
46
47
# File 'app/models/fhir/biologically_derived_product_storage.rb', line 38

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

  result = self.superclass.transform_json(json_hash, target)
  result['description'] = PrimitiveString.transform_json(json_hash['description'], json_hash['_description']) unless json_hash['description'].nil?
  result['temperature'] = PrimitiveDecimal.transform_json(json_hash['temperature'], json_hash['_temperature']) unless json_hash['temperature'].nil?
  result['scale'] = BiologicallyDerivedProductStorageScale.transform_json(json_hash['scale'], json_hash['_scale']) unless json_hash['scale'].nil?
  result['duration'] = Period.transform_json(json_hash['duration']) unless json_hash['duration'].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
35
36
# File 'app/models/fhir/biologically_derived_product_storage.rb', line 10

def as_json(*args)
  result = super      
  unless self.description.nil? 
    result['description'] = self.description.value
    serialized = Extension.serializePrimitiveExtension(self.description)            
    result['_description'] = serialized unless serialized.nil?
  end
  unless self.temperature.nil? 
    result['temperature'] = self.temperature.value
    serialized = Extension.serializePrimitiveExtension(self.temperature)            
    result['_temperature'] = serialized unless serialized.nil?
  end
  unless self.scale.nil? 
    result['scale'] = self.scale.value
    serialized = Extension.serializePrimitiveExtension(self.scale)            
    result['_scale'] = serialized unless serialized.nil?
  end
  unless self.duration.nil? 
    result['duration'] = self.duration.as_json(*args)
  end
  result.delete('id')
  unless self.fhirId.nil?
    result['id'] = self.fhirId
    result.delete('fhirId')
  end  
  result
end