Class: FHIR::SupplyRequestParameter
- Inherits:
-
BackboneElement
- Object
- Type
- Element
- BackboneElement
- FHIR::SupplyRequestParameter
- Includes:
- Mongoid::Document
- Defined in:
- app/models/fhir/supply_request_parameter.rb
Overview
fhir/supply_request_parameter.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.transform_json(json_hash, target = SupplyRequestParameter.new) ⇒ Object
38 39 40 41 42 43 44 45 46 47 48 |
# File 'app/models/fhir/supply_request_parameter.rb', line 38 def self.transform_json(json_hash, target = SupplyRequestParameter.new) result = self.superclass.transform_json(json_hash, target) result['code'] = CodeableConcept.transform_json(json_hash['code']) unless json_hash['code'].nil? result['valueCodeableConcept'] = CodeableConcept.transform_json(json_hash['valueCodeableConcept']) unless json_hash['valueCodeableConcept'].nil? result['valueQuantity'] = Quantity.transform_json(json_hash['valueQuantity']) unless json_hash['valueQuantity'].nil? result['valueRange'] = Range.transform_json(json_hash['valueRange']) unless json_hash['valueRange'].nil? result['valueBoolean'] = PrimitiveBoolean.transform_json(json_hash['valueBoolean'], json_hash['_valueBoolean']) unless json_hash['valueBoolean'].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 35 36 |
# File 'app/models/fhir/supply_request_parameter.rb', line 11 def as_json(*args) result = super unless self.code.nil? result['code'] = self.code.as_json(*args) end unless self.valueCodeableConcept.nil? result['valueCodeableConcept'] = self.valueCodeableConcept.as_json(*args) end unless self.valueQuantity.nil? result['valueQuantity'] = self.valueQuantity.as_json(*args) end unless self.valueRange.nil? result['valueRange'] = self.valueRange.as_json(*args) end unless self.valueBoolean.nil? result['valueBoolean'] = self.valueBoolean.value serialized = Extension.serializePrimitiveExtension(self.valueBoolean) result['_valueBoolean'] = serialized unless serialized.nil? end result.delete('id') unless self.fhirId.nil? result['id'] = self.fhirId result.delete('fhirId') end result end |