Class: FHIR::MedicinalProductNameCountryLanguage

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

Overview

fhir/medicinal_product_name_country_language.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

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



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

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

  result = self.superclass.transform_json(json_hash, target)
  result['country'] = CodeableConcept.transform_json(json_hash['country']) unless json_hash['country'].nil?
  result['jurisdiction'] = CodeableConcept.transform_json(json_hash['jurisdiction']) unless json_hash['jurisdiction'].nil?
  result['language'] = CodeableConcept.transform_json(json_hash['language']) unless json_hash['language'].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_name_country_language.rb', line 9

def as_json(*args)
  result = super      
  unless self.country.nil? 
    result['country'] = self.country.as_json(*args)
  end
  unless self.jurisdiction.nil? 
    result['jurisdiction'] = self.jurisdiction.as_json(*args)
  end
  unless self.language.nil? 
    result['language'] = self.language.as_json(*args)
  end
  result.delete('id')
  unless self.fhirId.nil?
    result['id'] = self.fhirId
    result.delete('fhirId')
  end  
  result
end