Class: FHIR::ExampleScenarioProcessStepAlternative

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

Overview

fhir/example_scenario_process_step_alternative.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

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



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

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

  result = self.superclass.transform_json(json_hash, target)
  result['title'] = PrimitiveString.transform_json(json_hash['title'], json_hash['_title']) unless json_hash['title'].nil?
  result['description'] = PrimitiveMarkdown.transform_json(json_hash['description'], json_hash['_description']) unless json_hash['description'].nil?
  result['step'] = json_hash['step'].map { |var| ExampleScenarioProcessStep.transform_json(var) } unless json_hash['step'].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/example_scenario_process_step_alternative.rb', line 9

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