lib/health-data-standards/tasks/bundle.rake in health-data-standards-3.0.3 vs lib/health-data-standards/tasks/bundle.rake in health-data-standards-3.0.4

- old
+ new

@@ -4,18 +4,21 @@ namespace :bundle do desc 'Import a quality bundle into the database.' task :import, [:bundle_path, :delete_existing, :update_measures, :type] => [:environment] do |task, args| raise "The path to the measures zip file must be specified" unless args.bundle_path - options = {:clear_db => (args.delete_existing == "true"), + options = {:delete_existing => (args.delete_existing == "true"), :type => args.type , :update_measures => (args.update_measures == "true") } bundle = File.open(args.bundle_path) importer = HealthDataStandards::Import::Bundle::Importer bundle_contents = importer.import(bundle, options) + ::Rails.application.eager_load! + ::Rails::Mongoid.create_indexes + puts "Successfully imported bundle at: #{args.bundle_path}" puts "\t Imported into environment: #{Rails.env.upcase}" if defined? Rails puts "\t Loaded #{args.type || 'all'} measures" puts "\t Measures Loaded: #{bundle_contents.measures.count}" puts "\t Test Patients Loaded: #{bundle_contents.records.count}"