Class: FHIR::BundleEntrySearch

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

Overview

fhir/bundle_entry_search.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

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



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

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

  result = self.superclass.transform_json(json_hash, target)
  result['mode'] = SearchEntryMode.transform_json(json_hash['mode'], json_hash['_mode']) unless json_hash['mode'].nil?
  result['score'] = PrimitiveDecimal.transform_json(json_hash['score'], json_hash['_score']) unless json_hash['score'].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/bundle_entry_search.rb', line 8

def as_json(*args)
  result = super      
  unless self.mode.nil? 
    result['mode'] = self.mode.value
    serialized = Extension.serializePrimitiveExtension(self.mode)            
    result['_mode'] = serialized unless serialized.nil?
  end
  unless self.score.nil? 
    result['score'] = self.score.value
    serialized = Extension.serializePrimitiveExtension(self.score)            
    result['_score'] = serialized unless serialized.nil?
  end
  result.delete('id')
  unless self.fhirId.nil?
    result['id'] = self.fhirId
    result.delete('fhirId')
  end  
  result
end