Class: FHIR::SubstanceSpecificationStructureIsotope

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

Overview

fhir/substance_specification_structure_isotope.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

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



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

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

  result = self.superclass.transform_json(json_hash, target)
  result['identifier'] = Identifier.transform_json(json_hash['identifier']) unless json_hash['identifier'].nil?
  result['name'] = CodeableConcept.transform_json(json_hash['name']) unless json_hash['name'].nil?
  result['substitution'] = CodeableConcept.transform_json(json_hash['substitution']) unless json_hash['substitution'].nil?
  result['halfLife'] = Quantity.transform_json(json_hash['halfLife']) unless json_hash['halfLife'].nil?
  result['molecularWeight'] = SubstanceSpecificationStructureIsotopeMolecularWeight.transform_json(json_hash['molecularWeight']) unless json_hash['molecularWeight'].nil?

  result
end

Instance Method Details

#as_json(*args) ⇒ Object



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/substance_specification_structure_isotope.rb', line 11

def as_json(*args)
  result = super      
  unless self.identifier.nil? 
    result['identifier'] = self.identifier.as_json(*args)
  end
  unless self.name.nil? 
    result['name'] = self.name.as_json(*args)
  end
  unless self.substitution.nil? 
    result['substitution'] = self.substitution.as_json(*args)
  end
  unless self.halfLife.nil? 
    result['halfLife'] = self.halfLife.as_json(*args)
  end
  unless self.molecularWeight.nil? 
    result['molecularWeight'] = self.molecularWeight.as_json(*args)
  end
  result.delete('id')
  unless self.fhirId.nil?
    result['id'] = self.fhirId
    result.delete('fhirId')
  end  
  result
end