Class: FHIR::CommunicationPayload
- Inherits:
-
BackboneElement
- Object
- Type
- Element
- BackboneElement
- FHIR::CommunicationPayload
- Includes:
- Mongoid::Document
- Defined in:
- app/models/fhir/communication_payload.rb
Overview
fhir/communication_payload.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.transform_json(json_hash, target = CommunicationPayload.new) ⇒ Object
30 31 32 33 34 35 36 37 38 |
# File 'app/models/fhir/communication_payload.rb', line 30 def self.transform_json(json_hash, target = CommunicationPayload.new) result = self.superclass.transform_json(json_hash, target) result['contentString'] = PrimitiveString.transform_json(json_hash['contentString'], json_hash['_contentString']) unless json_hash['contentString'].nil? result['contentAttachment'] = Attachment.transform_json(json_hash['contentAttachment']) unless json_hash['contentAttachment'].nil? result['contentReference'] = Reference.transform_json(json_hash['contentReference']) unless json_hash['contentReference'].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 |
# File 'app/models/fhir/communication_payload.rb', line 9 def as_json(*args) result = super unless self.contentString.nil? result['contentString'] = self.contentString.value serialized = Extension.serializePrimitiveExtension(self.contentString) result['_contentString'] = serialized unless serialized.nil? end unless self.contentAttachment.nil? result['contentAttachment'] = self.contentAttachment.as_json(*args) end unless self.contentReference.nil? result['contentReference'] = self.contentReference.as_json(*args) end result.delete('id') unless self.fhirId.nil? result['id'] = self.fhirId result.delete('fhirId') end result end |