Class: FHIR::AdverseEventSuspectEntityCausality

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

Overview

fhir/adverse_event_suspect_entity_causality.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

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



34
35
36
37
38
39
40
41
42
43
# File 'app/models/fhir/adverse_event_suspect_entity_causality.rb', line 34

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

  result = self.superclass.transform_json(json_hash, target)
  result['assessment'] = CodeableConcept.transform_json(json_hash['assessment']) unless json_hash['assessment'].nil?
  result['productRelatedness'] = PrimitiveString.transform_json(json_hash['productRelatedness'], json_hash['_productRelatedness']) unless json_hash['productRelatedness'].nil?
  result['author'] = Reference.transform_json(json_hash['author']) unless json_hash['author'].nil?
  result['method'] = CodeableConcept.transform_json(json_hash['method']) unless json_hash['method'].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
# File 'app/models/fhir/adverse_event_suspect_entity_causality.rb', line 10

def as_json(*args)
  result = super      
  unless self.assessment.nil? 
    result['assessment'] = self.assessment.as_json(*args)
  end
  unless self.productRelatedness.nil? 
    result['productRelatedness'] = self.productRelatedness.value
    serialized = Extension.serializePrimitiveExtension(self.productRelatedness)            
    result['_productRelatedness'] = serialized unless serialized.nil?
  end
  unless self.author.nil? 
    result['author'] = self.author.as_json(*args)
  end
  unless self.method.nil? 
    result['method'] = self.method.as_json(*args)
  end
  result.delete('id')
  unless self.fhirId.nil?
    result['id'] = self.fhirId
    result.delete('fhirId')
  end  
  result
end