Module: Inferno::DSL::FhirpathEvaluation
- Included in:
- Entities::TestGroup, Entities::TestSuite
- Defined in:
- lib/inferno/dsl/fhirpath_evaluation.rb
Overview
the ‘element` field can either be a primitive value (string, boolean, etc.) or a FHIR::Model.
This module contains the methods needed to perform FHIRPath evaluations on FHIR resources/elements. The actual evaluation is typically performed by an external FHIRPath evaluation service.
Tests can leverage the evaluation functionality by calling ‘evaluate_fhirpath` to retrieve results of FHIRPath expressions.
results will be an array representing the result of evaluating the given expression against the given root element. Each “result” in the returned array will be in the form ‘{ “type”: “[FHIR datatype of the result]”, “element”: “[result value of the FHIRPath expression]” }`.
Defined Under Namespace
Modules: ClassMethods Classes: Evaluator
Class Method Summary collapse
Instance Method Summary collapse
-
#evaluate_fhirpath(resource:, path:, url: nil) ⇒ Array<Hash>
Evaluates a fhirpath expression for a given FHIR resource.
Class Method Details
.included(klass) ⇒ Object
20 21 22 |
# File 'lib/inferno/dsl/fhirpath_evaluation.rb', line 20 def self.included(klass) klass.extend ClassMethods end |
Instance Method Details
#evaluate_fhirpath(resource:, path:, url: nil) ⇒ Array<Hash>
Evaluates a fhirpath expression for a given FHIR resource
31 32 33 |
# File 'lib/inferno/dsl/fhirpath_evaluation.rb', line 31 def evaluate_fhirpath(resource:, path:, url: nil) self.class.evaluator(url).evaluate_fhirpath(resource, path, self) end |