Class: FHIR::CapabilityStatementRestSecurity

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

Overview

fhir/capability_statement_rest_security.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

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



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

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

  result = self.superclass.transform_json(json_hash, target)
  result['cors'] = PrimitiveBoolean.transform_json(json_hash['cors'], json_hash['_cors']) unless json_hash['cors'].nil?
  result['service'] = json_hash['service'].map { |var| CodeableConcept.transform_json(var) } unless json_hash['service'].nil?
  result['description'] = PrimitiveMarkdown.transform_json(json_hash['description'], json_hash['_description']) unless json_hash['description'].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/capability_statement_rest_security.rb', line 9

def as_json(*args)
  result = super      
  unless self.cors.nil? 
    result['cors'] = self.cors.value
    serialized = Extension.serializePrimitiveExtension(self.cors)            
    result['_cors'] = serialized unless serialized.nil?
  end
  unless self.service.nil?  || !self.service.any? 
    result['service'] = self.service.map{ |x| x.as_json(*args) }
  end
  unless self.description.nil? 
    result['description'] = self.description.value
    serialized = Extension.serializePrimitiveExtension(self.description)            
    result['_description'] = serialized unless serialized.nil?
  end
  result.delete('id')
  unless self.fhirId.nil?
    result['id'] = self.fhirId
    result.delete('fhirId')
  end  
  result
end