Class: FHIR::Population
- Inherits:
-
BackboneElement
- Object
- Type
- Element
- BackboneElement
- FHIR::Population
- Includes:
- Mongoid::Document
- Defined in:
- app/models/fhir/population.rb
Overview
fhir/population.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.transform_json(json_hash, target = Population.new) ⇒ Object
36 37 38 39 40 41 42 43 44 45 46 |
# File 'app/models/fhir/population.rb', line 36 def self.transform_json(json_hash, target = Population.new) result = self.superclass.transform_json(json_hash, target) result['ageRange'] = Range.transform_json(json_hash['ageRange']) unless json_hash['ageRange'].nil? result['ageCodeableConcept'] = CodeableConcept.transform_json(json_hash['ageCodeableConcept']) unless json_hash['ageCodeableConcept'].nil? result['gender'] = CodeableConcept.transform_json(json_hash['gender']) unless json_hash['gender'].nil? result['race'] = CodeableConcept.transform_json(json_hash['race']) unless json_hash['race'].nil? result['physiologicalCondition'] = CodeableConcept.transform_json(json_hash['physiologicalCondition']) unless json_hash['physiologicalCondition'].nil? result end |
Instance Method Details
#as_json(*args) ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'app/models/fhir/population.rb', line 11 def as_json(*args) result = super unless self.ageRange.nil? result['ageRange'] = self.ageRange.as_json(*args) end unless self.ageCodeableConcept.nil? result['ageCodeableConcept'] = self.ageCodeableConcept.as_json(*args) end unless self.gender.nil? result['gender'] = self.gender.as_json(*args) end unless self.race.nil? result['race'] = self.race.as_json(*args) end unless self.physiologicalCondition.nil? result['physiologicalCondition'] = self.physiologicalCondition.as_json(*args) end result.delete('id') unless self.fhirId.nil? result['id'] = self.fhirId result.delete('fhirId') end result end |