Class: FHIR::PlanDefinitionGoalTarget
- Inherits:
-
BackboneElement
- Object
- Type
- Element
- BackboneElement
- FHIR::PlanDefinitionGoalTarget
- Includes:
- Mongoid::Document
- Defined in:
- app/models/fhir/plan_definition_goal_target.rb
Overview
fhir/plan_definition_goal_target.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.transform_json(json_hash, target = PlanDefinitionGoalTarget.new) ⇒ Object
36 37 38 39 40 41 42 43 44 45 46 |
# File 'app/models/fhir/plan_definition_goal_target.rb', line 36 def self.transform_json(json_hash, target = PlanDefinitionGoalTarget.new) result = self.superclass.transform_json(json_hash, target) result['measure'] = CodeableConcept.transform_json(json_hash['measure']) unless json_hash['measure'].nil? result['detailQuantity'] = Quantity.transform_json(json_hash['detailQuantity']) unless json_hash['detailQuantity'].nil? result['detailRange'] = Range.transform_json(json_hash['detailRange']) unless json_hash['detailRange'].nil? result['detailCodeableConcept'] = CodeableConcept.transform_json(json_hash['detailCodeableConcept']) unless json_hash['detailCodeableConcept'].nil? result['due'] = Duration.transform_json(json_hash['due']) unless json_hash['due'].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/plan_definition_goal_target.rb', line 11 def as_json(*args) result = super unless self.measure.nil? result['measure'] = self.measure.as_json(*args) end unless self.detailQuantity.nil? result['detailQuantity'] = self.detailQuantity.as_json(*args) end unless self.detailRange.nil? result['detailRange'] = self.detailRange.as_json(*args) end unless self.detailCodeableConcept.nil? result['detailCodeableConcept'] = self.detailCodeableConcept.as_json(*args) end unless self.due.nil? result['due'] = self.due.as_json(*args) end result.delete('id') unless self.fhirId.nil? result['id'] = self.fhirId result.delete('fhirId') end result end |