Class: FHIR::MessageDefinitionAllowedResponse

Inherits:
BackboneElement show all
Includes:
Mongoid::Document
Defined in:
app/models/fhir/message_definition_allowed_response.rb

Overview

fhir/message_definition_allowed_response.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.transform_json(json_hash, target = MessageDefinitionAllowedResponse.new) ⇒ Object



28
29
30
31
32
33
34
35
# File 'app/models/fhir/message_definition_allowed_response.rb', line 28

def self.transform_json(json_hash, target = MessageDefinitionAllowedResponse.new)

  result = self.superclass.transform_json(json_hash, target)
  result['message'] = PrimitiveCanonical.transform_json(json_hash['message'], json_hash['_message']) unless json_hash['message'].nil?
  result['situation'] = PrimitiveMarkdown.transform_json(json_hash['situation'], json_hash['_situation']) unless json_hash['situation'].nil?

  result
end

Instance Method Details

#as_json(*args) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'app/models/fhir/message_definition_allowed_response.rb', line 8

def as_json(*args)
  result = super      
  unless self.message.nil? 
    result['message'] = self.message.value
    serialized = Extension.serializePrimitiveExtension(self.message)            
    result['_message'] = serialized unless serialized.nil?
  end
  unless self.situation.nil? 
    result['situation'] = self.situation.value
    serialized = Extension.serializePrimitiveExtension(self.situation)            
    result['_situation'] = serialized unless serialized.nil?
  end
  result.delete('id')
  unless self.fhirId.nil?
    result['id'] = self.fhirId
    result.delete('fhirId')
  end  
  result
end