Sha256: 0b064ff30130a6fd98762e74dd7b41d09e6d7350d62e82f36c9d7cd0896acc51

Contents?: true

Size: 654 Bytes

Versions: 4

Compression:

Stored size: 654 Bytes

Contents

module Inferno
  module DSL
    module FHIREvaluation
      module DatasetLoader
        def self.from_contents(source_array)
          dataset = []

          source_array.each do |json|
            resource = FHIR::Json.from_json(json)
            next if resource.nil?

            dataset.push resource
          end

          dataset
        end

        def self.from_path(path)
          dataset = []

          Dir["#{path}/*.json"].each do |f|
            resource = FHIR::Json.from_json(File.read(f))
            next if resource.nil?

            dataset.push resource
          end

          dataset
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
inferno_core-0.6.1 lib/inferno/dsl/fhir_evaluation/dataset_loader.rb
inferno_core-0.6.0 lib/inferno/dsl/fhir_evaluation/dataset_loader.rb
inferno_core-0.5.4 lib/inferno/dsl/fhir_evaluation/dataset_loader.rb
inferno_core-0.5.3 lib/inferno/dsl/fhir_evaluation/dataset_loader.rb