Class: FHIR::EffectEvidenceSynthesisCertainty

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

Overview

fhir/effect_evidence_synthesis_certainty.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

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



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

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

  result = self.superclass.transform_json(json_hash, target)
  result['rating'] = json_hash['rating'].map { |var| CodeableConcept.transform_json(var) } unless json_hash['rating'].nil?
  result['note'] = json_hash['note'].map { |var| Annotation.transform_json(var) } unless json_hash['note'].nil?
  result['certaintySubcomponent'] = json_hash['certaintySubcomponent'].map { |var| EffectEvidenceSynthesisCertaintyCertaintySubcomponent.transform_json(var) } unless json_hash['certaintySubcomponent'].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
# File 'app/models/fhir/effect_evidence_synthesis_certainty.rb', line 9

def as_json(*args)
  result = super      
  unless self.rating.nil?  || !self.rating.any? 
    result['rating'] = self.rating.map{ |x| x.as_json(*args) }
  end
  unless self.note.nil?  || !self.note.any? 
    result['note'] = self.note.map{ |x| x.as_json(*args) }
  end
  unless self.certaintySubcomponent.nil?  || !self.certaintySubcomponent.any? 
    result['certaintySubcomponent'] = self.certaintySubcomponent.map{ |x| x.as_json(*args) }
  end
  result.delete('id')
  unless self.fhirId.nil?
    result['id'] = self.fhirId
    result.delete('fhirId')
  end  
  result
end