Class: FHIR::TestScriptOrigin

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

Overview

fhir/test_script_origin.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

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



26
27
28
29
30
31
32
33
# File 'app/models/fhir/test_script_origin.rb', line 26

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

  result = self.superclass.transform_json(json_hash, target)
  result['index'] = PrimitiveInteger.transform_json(json_hash['index'], json_hash['_index']) unless json_hash['index'].nil?
  result['profile'] = Coding.transform_json(json_hash['profile']) unless json_hash['profile'].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
# File 'app/models/fhir/test_script_origin.rb', line 8

def as_json(*args)
  result = super      
  unless self.index.nil? 
    result['index'] = self.index.value
    serialized = Extension.serializePrimitiveExtension(self.index)            
    result['_index'] = serialized unless serialized.nil?
  end
  unless self.profile.nil? 
    result['profile'] = self.profile.as_json(*args)
  end
  result.delete('id')
  unless self.fhirId.nil?
    result['id'] = self.fhirId
    result.delete('fhirId')
  end  
  result
end