Sha256: f4c84cce57a30b67412b8cf5647312cddd02e26e100166b172da41377e04b165

Contents?: true

Size: 1.54 KB

Versions: 80

Compression:

Stored size: 1.54 KB

Contents

# Various rake tasks for importing flat file feeds
begin
  namespace :feeds do
    namespace :files do
      # TODO: For some reason this is not showing up doing a rake -T
      # Test file at = "/Users/tim/Downloads/hscorgrefdataxml_data_1.0.1_20170526000001.zip"
      desc "Import Practices from a zip file downloaded from "\
           "https://isd.digital.nhs.uk/trud3/user/authenticated/group/0/pack/5/subpack/341/releases " \
           "Note: if using zsh, you must escape the brackets around the argument when calling "\
           "e.g. "\
           "`$ RAILS_LOG_TO_STDOUT=1 bundle exec rake app:feeds:files:import_practices\[/Users/me/x/w/z.zip\]`"
      task :import_practices, [:absolute_zip_file_path] => [:environment] do |task, args|
        file = Renalware::Feeds::File.build(
          location: args.fetch(:absolute_zip_file_path),
          file_type: :practices
        )
        file.save!
        Renalware::Feeds::Files::Practices::ImportJob.perform_now(file)
      end

      # TEST_ZIP_FILE_PATH = "/Users/tim/Downloads/hscorgrefdataxml_data_1.0.1_20170526000001.zip"
      desc "Import GPs"
      # Test file at "/Users/tim/Downloads/nhs_odsweekly_6.2.0_20170615000001.zip"
      task :import_gps, [:absolute_zip_file_path] => [:environment] do |task, args|
        file = Renalware::Feeds::File.build(
          location: args.fetch(:absolute_zip_file_path),
          file_type: :primary_care_physicians
        )
        file.save!
        Renalware::Feeds::Files::PrimaryCarePhysicians::ImportJob.perform_now(file)
      end
    end
  end
end

Version data entries

80 entries across 80 versions & 1 rubygems

Version Path
renalware-core-2.0.78 lib/tasks/feeds/files.rake
renalware-core-2.0.77 lib/tasks/feeds/files.rake
renalware-core-2.0.76 lib/tasks/feeds/files.rake
renalware-core-2.0.75 lib/tasks/feeds/files.rake
renalware-core-2.0.74 lib/tasks/feeds/files.rake
renalware-core-2.0.73 lib/tasks/feeds/files.rake
renalware-core-2.0.72 lib/tasks/feeds/files.rake
renalware-core-2.0.71 lib/tasks/feeds/files.rake
renalware-core-2.0.70 lib/tasks/feeds/files.rake
renalware-core-2.0.69 lib/tasks/feeds/files.rake
renalware-core-2.0.68 lib/tasks/feeds/files.rake
renalware-core-2.0.67 lib/tasks/feeds/files.rake
renalware-core-2.0.64 lib/tasks/feeds/files.rake
renalware-core-2.0.63 lib/tasks/feeds/files.rake
renalware-core-2.0.62 lib/tasks/feeds/files.rake
renalware-core-2.0.61 lib/tasks/feeds/files.rake
renalware-core-2.0.60 lib/tasks/feeds/files.rake
renalware-core-2.0.58 lib/tasks/feeds/files.rake
renalware-core-2.0.57 lib/tasks/feeds/files.rake
renalware-core-2.0.56 lib/tasks/feeds/files.rake