Class: FHIR::TestReportTest
- Inherits:
-
BackboneElement
- Object
- Type
- Element
- BackboneElement
- FHIR::TestReportTest
- Includes:
- Mongoid::Document
- Defined in:
- app/models/fhir/test_report_test.rb
Overview
fhir/test_report_test.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.transform_json(json_hash, target = TestReportTest.new) ⇒ Object
32 33 34 35 36 37 38 39 40 |
# File 'app/models/fhir/test_report_test.rb', line 32 def self.transform_json(json_hash, target = TestReportTest.new) result = self.superclass.transform_json(json_hash, target) result['name'] = PrimitiveString.transform_json(json_hash['name'], json_hash['_name']) unless json_hash['name'].nil? result['description'] = PrimitiveString.transform_json(json_hash['description'], json_hash['_description']) unless json_hash['description'].nil? result['action'] = json_hash['action'].map { |var| TestReportTestAction.transform_json(var) } unless json_hash['action'].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 29 30 |
# File 'app/models/fhir/test_report_test.rb', line 9 def as_json(*args) result = super unless self.name.nil? result['name'] = self.name.value serialized = Extension.serializePrimitiveExtension(self.name) result['_name'] = serialized unless serialized.nil? end unless self.description.nil? result['description'] = self.description.value serialized = Extension.serializePrimitiveExtension(self.description) result['_description'] = serialized unless serialized.nil? end unless self.action.nil? || !self.action.any? result['action'] = self.action.map{ |x| x.as_json(*args) } end result.delete('id') unless self.fhirId.nil? result['id'] = self.fhirId result.delete('fhirId') end result end |