Class: FHIR::AuditEventAgentNetwork

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

Overview

fhir/audit_event_agent_network.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

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



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

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

  result = self.superclass.transform_json(json_hash, target)
  result['address'] = PrimitiveString.transform_json(json_hash['address'], json_hash['_address']) unless json_hash['address'].nil?
  result['type'] = AuditEventAgentNetworkType.transform_json(json_hash['type'], json_hash['_type']) unless json_hash['type'].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/audit_event_agent_network.rb', line 8

def as_json(*args)
  result = super      
  unless self.address.nil? 
    result['address'] = self.address.value
    serialized = Extension.serializePrimitiveExtension(self.address)            
    result['_address'] = serialized unless serialized.nil?
  end
  unless self.type.nil? 
    result['type'] = self.type.value
    serialized = Extension.serializePrimitiveExtension(self.type)            
    result['_type'] = serialized unless serialized.nil?
  end
  result.delete('id')
  unless self.fhirId.nil?
    result['id'] = self.fhirId
    result.delete('fhirId')
  end  
  result
end