Class: FHIR::MessageHeaderResponse

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

Overview

fhir/message_header_response.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

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



32
33
34
35
36
37
38
39
40
# File 'app/models/fhir/message_header_response.rb', line 32

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

  result = self.superclass.transform_json(json_hash, target)
  result['identifier'] = PrimitiveId.transform_json(json_hash['identifier'], json_hash['_identifier']) unless json_hash['identifier'].nil?
  result['code'] = ResponseType.transform_json(json_hash['code'], json_hash['_code']) unless json_hash['code'].nil?
  result['details'] = Reference.transform_json(json_hash['details']) unless json_hash['details'].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
29
30
# File 'app/models/fhir/message_header_response.rb', line 9

def as_json(*args)
  result = super      
  unless self.identifier.nil? 
    result['identifier'] = self.identifier.value
    serialized = Extension.serializePrimitiveExtension(self.identifier)            
    result['_identifier'] = serialized unless serialized.nil?
  end
  unless self.code.nil? 
    result['code'] = self.code.value
    serialized = Extension.serializePrimitiveExtension(self.code)            
    result['_code'] = serialized unless serialized.nil?
  end
  unless self.details.nil? 
    result['details'] = self.details.as_json(*args)
  end
  result.delete('id')
  unless self.fhirId.nil?
    result['id'] = self.fhirId
    result.delete('fhirId')
  end  
  result
end