Class: FHIR::InsurancePlanCoverage
- Inherits:
-
BackboneElement
- Object
- Type
- Element
- BackboneElement
- FHIR::InsurancePlanCoverage
- Includes:
- Mongoid::Document
- Defined in:
- app/models/fhir/insurance_plan_coverage.rb
Overview
fhir/insurance_plan_coverage.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.transform_json(json_hash, target = InsurancePlanCoverage.new) ⇒ Object
28 29 30 31 32 33 34 35 36 |
# File 'app/models/fhir/insurance_plan_coverage.rb', line 28 def self.transform_json(json_hash, target = InsurancePlanCoverage.new) result = self.superclass.transform_json(json_hash, target) result['type'] = CodeableConcept.transform_json(json_hash['type']) unless json_hash['type'].nil? result['network'] = json_hash['network'].map { |var| Reference.transform_json(var) } unless json_hash['network'].nil? result['benefit'] = json_hash['benefit'].map { |var| InsurancePlanCoverageBenefit.transform_json(var) } unless json_hash['benefit'].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/insurance_plan_coverage.rb', line 9 def as_json(*args) result = super unless self.type.nil? result['type'] = self.type.as_json(*args) end unless self.network.nil? || !self.network.any? result['network'] = self.network.map{ |x| x.as_json(*args) } end unless self.benefit.nil? || !self.benefit.any? result['benefit'] = self.benefit.map{ |x| x.as_json(*args) } end result.delete('id') unless self.fhirId.nil? result['id'] = self.fhirId result.delete('fhirId') end result end |