Class: FHIR::DeviceDefinitionMaterial
- Inherits:
-
BackboneElement
- Object
- Type
- Element
- BackboneElement
- FHIR::DeviceDefinitionMaterial
- Includes:
- Mongoid::Document
- Defined in:
- app/models/fhir/device_definition_material.rb
Overview
fhir/device_definition_material.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.transform_json(json_hash, target = DeviceDefinitionMaterial.new) ⇒ Object
32 33 34 35 36 37 38 39 40 |
# File 'app/models/fhir/device_definition_material.rb', line 32 def self.transform_json(json_hash, target = DeviceDefinitionMaterial.new) result = self.superclass.transform_json(json_hash, target) result['substance'] = CodeableConcept.transform_json(json_hash['substance']) unless json_hash['substance'].nil? result['alternate'] = PrimitiveBoolean.transform_json(json_hash['alternate'], json_hash['_alternate']) unless json_hash['alternate'].nil? result['allergenicIndicator'] = PrimitiveBoolean.transform_json(json_hash['allergenicIndicator'], json_hash['_allergenicIndicator']) unless json_hash['allergenicIndicator'].nil? result end |
Instance Method Details
#as_json(*args) ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'app/models/fhir/device_definition_material.rb', line 9 def as_json(*args) result = super unless self.substance.nil? result['substance'] = self.substance.as_json(*args) end unless self.alternate.nil? result['alternate'] = self.alternate.value serialized = Extension.serializePrimitiveExtension(self.alternate) result['_alternate'] = serialized unless serialized.nil? end unless self.allergenicIndicator.nil? result['allergenicIndicator'] = self.allergenicIndicator.value serialized = Extension.serializePrimitiveExtension(self.allergenicIndicator) result['_allergenicIndicator'] = serialized unless serialized.nil? end result.delete('id') unless self.fhirId.nil? result['id'] = self.fhirId result.delete('fhirId') end result end |