Class: FHIR::MedicationIngredient
- Inherits:
-
BackboneElement
- Object
- Type
- Element
- BackboneElement
- FHIR::MedicationIngredient
- Includes:
- Mongoid::Document
- Defined in:
- app/models/fhir/medication_ingredient.rb
Overview
fhir/medication_ingredient.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.transform_json(json_hash, target = MedicationIngredient.new) ⇒ Object
34 35 36 37 38 39 40 41 42 43 |
# File 'app/models/fhir/medication_ingredient.rb', line 34 def self.transform_json(json_hash, target = MedicationIngredient.new) result = self.superclass.transform_json(json_hash, target) result['itemCodeableConcept'] = CodeableConcept.transform_json(json_hash['itemCodeableConcept']) unless json_hash['itemCodeableConcept'].nil? result['itemReference'] = Reference.transform_json(json_hash['itemReference']) unless json_hash['itemReference'].nil? result['isActive'] = PrimitiveBoolean.transform_json(json_hash['isActive'], json_hash['_isActive']) unless json_hash['isActive'].nil? result['strength'] = Ratio.transform_json(json_hash['strength']) unless json_hash['strength'].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 |
# File 'app/models/fhir/medication_ingredient.rb', line 10 def as_json(*args) result = super unless self.itemCodeableConcept.nil? result['itemCodeableConcept'] = self.itemCodeableConcept.as_json(*args) end unless self.itemReference.nil? result['itemReference'] = self.itemReference.as_json(*args) end unless self.isActive.nil? result['isActive'] = self.isActive.value serialized = Extension.serializePrimitiveExtension(self.isActive) result['_isActive'] = serialized unless serialized.nil? end unless self.strength.nil? result['strength'] = self.strength.as_json(*args) end result.delete('id') unless self.fhirId.nil? result['id'] = self.fhirId result.delete('fhirId') end result end |