Class: FHIR::MedicinalProductIndicationOtherTherapy

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

Overview

fhir/medicinal_product_indication_other_therapy.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

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



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

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

  result = self.superclass.transform_json(json_hash, target)
  result['therapyRelationshipType'] = CodeableConcept.transform_json(json_hash['therapyRelationshipType']) unless json_hash['therapyRelationshipType'].nil?
  result['medicationCodeableConcept'] = CodeableConcept.transform_json(json_hash['medicationCodeableConcept']) unless json_hash['medicationCodeableConcept'].nil?
  result['medicationReference'] = Reference.transform_json(json_hash['medicationReference']) unless json_hash['medicationReference'].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/medicinal_product_indication_other_therapy.rb', line 9

def as_json(*args)
  result = super      
  unless self.therapyRelationshipType.nil? 
    result['therapyRelationshipType'] = self.therapyRelationshipType.as_json(*args)
  end
  unless self.medicationCodeableConcept.nil?
    result['medicationCodeableConcept'] = self.medicationCodeableConcept.as_json(*args)                        
  end          
  unless self.medicationReference.nil?
    result['medicationReference'] = self.medicationReference.as_json(*args)                        
  end          
  result.delete('id')
  unless self.fhirId.nil?
    result['id'] = self.fhirId
    result.delete('fhirId')
  end  
  result
end