Class: FHIR::TaskRestriction
- Inherits:
-
BackboneElement
- Object
- Type
- Element
- BackboneElement
- FHIR::TaskRestriction
- Includes:
- Mongoid::Document
- Defined in:
- app/models/fhir/task_restriction.rb
Overview
fhir/task_restriction.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.transform_json(json_hash, target = TaskRestriction.new) ⇒ Object
30 31 32 33 34 35 36 37 38 |
# File 'app/models/fhir/task_restriction.rb', line 30 def self.transform_json(json_hash, target = TaskRestriction.new) result = self.superclass.transform_json(json_hash, target) result['repetitions'] = PrimitivePositiveInt.transform_json(json_hash['repetitions'], json_hash['_repetitions']) unless json_hash['repetitions'].nil? result['period'] = Period.transform_json(json_hash['period']) unless json_hash['period'].nil? result['recipient'] = json_hash['recipient'].map { |var| Reference.transform_json(var) } unless json_hash['recipient'].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 27 28 |
# File 'app/models/fhir/task_restriction.rb', line 9 def as_json(*args) result = super unless self.repetitions.nil? result['repetitions'] = self.repetitions.value serialized = Extension.serializePrimitiveExtension(self.repetitions) result['_repetitions'] = serialized unless serialized.nil? end unless self.period.nil? result['period'] = self.period.as_json(*args) end unless self.recipient.nil? || !self.recipient.any? result['recipient'] = self.recipient.map{ |x| x.as_json(*args) } end result.delete('id') unless self.fhirId.nil? result['id'] = self.fhirId result.delete('fhirId') end result end |