Module: InfernoFHIRModelExtensions

Included in:
FHIR::Model
Defined in:
lib/inferno/ext/fhir_models.rb

Overview

Extension to FHIR::Model. Prepending this into FHIR::Model (done below) allows us to call super() on initialize when we overriding it, while also defining new methods and attributes

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#source_hashObject

Returns the value of attribute source_hash.



7
8
9
# File 'lib/inferno/ext/fhir_models.rb', line 7

def source_hash
  @source_hash
end

#source_textObject

Returns the value of attribute source_text.



7
8
9
# File 'lib/inferno/ext/fhir_models.rb', line 7

def source_text
  @source_text
end

Instance Method Details

#initialize(hash = {}) ⇒ Object



9
10
11
12
# File 'lib/inferno/ext/fhir_models.rb', line 9

def initialize(hash = {})
  super
  @source_hash = hash
end

#source_contentsObject



14
15
16
# File 'lib/inferno/ext/fhir_models.rb', line 14

def source_contents
  @source_text || JSON.generate(@source_hash)
end