Class: Inferno::DSL::FHIREvaluation::Evaluator
- Inherits:
-
Object
- Object
- Inferno::DSL::FHIREvaluation::Evaluator
- Defined in:
- lib/inferno/dsl/fhir_evaluation/evaluator.rb
Instance Attribute Summary collapse
-
#ig ⇒ Object
Returns the value of attribute ig.
-
#validator ⇒ Object
Returns the value of attribute validator.
Instance Method Summary collapse
-
#evaluate(data, config = Config.new) ⇒ Object
-
#initialize(ig, validator = nil) ⇒ Evaluator
constructor
A new instance of Evaluator.
Constructor Details
#initialize(ig, validator = nil) ⇒ Evaluator
Returns a new instance of Evaluator.
19 20 21 22 |
# File 'lib/inferno/dsl/fhir_evaluation/evaluator.rb', line 19 def initialize(ig, validator = nil) @ig = ig @validator = validator end |
Instance Attribute Details
#ig ⇒ Object
Returns the value of attribute ig.
17 18 19 |
# File 'lib/inferno/dsl/fhir_evaluation/evaluator.rb', line 17 def ig @ig end |
#validator ⇒ Object
Returns the value of attribute validator.
17 18 19 |
# File 'lib/inferno/dsl/fhir_evaluation/evaluator.rb', line 17 def validator @validator end |
Instance Method Details
#evaluate(data, config = Config.new) ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/inferno/dsl/fhir_evaluation/evaluator.rb', line 24 def evaluate(data, config = Config.new) context = EvaluationContext.new(@ig, data, config, validator) config.data['Rule'].each do |rulename, rule_details| next unless rule_details['Enabled'] Rule.descendants.select { |rule| rule.name.demodulize == rulename } .each { |rule| rule.new.check(context) } end context.results end |