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