Class: FHIR::ValueSetCompose

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

Overview

fhir/value_set_compose.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

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



36
37
38
39
40
41
42
43
44
45
# File 'app/models/fhir/value_set_compose.rb', line 36

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

  result = self.superclass.transform_json(json_hash, target)
  result['lockedDate'] = PrimitiveDate.transform_json(json_hash['lockedDate'], json_hash['_lockedDate']) unless json_hash['lockedDate'].nil?
  result['inactive'] = PrimitiveBoolean.transform_json(json_hash['inactive'], json_hash['_inactive']) unless json_hash['inactive'].nil?
  result['include'] = json_hash['include'].map { |var| ValueSetComposeInclude.transform_json(var) } unless json_hash['include'].nil?
  result['exclude'] = json_hash['exclude'].map { |var| ValueSetComposeInclude.transform_json(var) } unless json_hash['exclude'].nil?

  result
end

Instance Method Details

#as_json(*args) ⇒ Object



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'app/models/fhir/value_set_compose.rb', line 10

def as_json(*args)
  result = super      
  unless self.lockedDate.nil? 
    result['lockedDate'] = self.lockedDate.value
    serialized = Extension.serializePrimitiveExtension(self.lockedDate)            
    result['_lockedDate'] = serialized unless serialized.nil?
  end
  unless self.inactive.nil? 
    result['inactive'] = self.inactive.value
    serialized = Extension.serializePrimitiveExtension(self.inactive)            
    result['_inactive'] = serialized unless serialized.nil?
  end
  unless self.include.nil?  || !self.include.any? 
    result['include'] = self.include.map{ |x| x.as_json(*args) }
  end
  unless self.exclude.nil?  || !self.exclude.any? 
    result['exclude'] = self.exclude.map{ |x| x.as_json(*args) }
  end
  result.delete('id')
  unless self.fhirId.nil?
    result['id'] = self.fhirId
    result.delete('fhirId')
  end  
  result
end