Sha256: 7db1a7a77f540980f470373f7b337f65d9d734ad5d7773b0e1c3149190fbd72f

Contents?: true

Size: 1.01 KB

Versions: 27

Compression:

Stored size: 1.01 KB

Contents

module ONCCertificationG10TestKit
  module ExportKickOffPerformer
    def perform_export_kick_off_request(use_token: true, params: {})
      skip_if use_token && bearer_token.blank?, 'Could not verify this functionality when bearer token is not set'

      headers = { accept: 'application/fhir+json', prefer: 'respond-async' }
      headers.merge!({ authorization: "Bearer #{bearer_token}" }) if use_token

      url = "Group/#{group_id}/$export"
      param_str = params.map { |k, v| URI.encode_www_form(k => v) }.join('&')
      url.concat("?#{param_str}") unless param_str.empty?
      get(url, client: :bulk_server, name: :export, headers:)
    end

    def delete_export_kick_off_request
      polling_url = request&.response_header('content-location')&.value
      assert polling_url.present?, 'Export response header did not include "Content-Location"'

      headers = { accept: 'application/json', authorization: "Bearer #{bearer_token}" }

      delete(polling_url, headers:)
      assert_response_status(202)
    end
  end
end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
onc_certification_g10_test_kit-7.0.3 lib/onc_certification_g10_test_kit/export_kick_off_performer.rb
onc_certification_g10_test_kit-7.0.2 lib/onc_certification_g10_test_kit/export_kick_off_performer.rb
onc_certification_g10_test_kit-7.0.1 lib/onc_certification_g10_test_kit/export_kick_off_performer.rb
onc_certification_g10_test_kit-7.0.0 lib/onc_certification_g10_test_kit/export_kick_off_performer.rb
onc_certification_g10_test_kit-6.0.3 lib/onc_certification_g10_test_kit/export_kick_off_performer.rb
onc_certification_g10_test_kit-6.0.2 lib/onc_certification_g10_test_kit/export_kick_off_performer.rb
onc_certification_g10_test_kit-6.0.1 lib/onc_certification_g10_test_kit/export_kick_off_performer.rb
onc_certification_g10_test_kit-6.0.0 lib/onc_certification_g10_test_kit/export_kick_off_performer.rb
onc_certification_g10_test_kit-5.4.2 lib/onc_certification_g10_test_kit/export_kick_off_performer.rb
onc_certification_g10_test_kit-5.4.1 lib/onc_certification_g10_test_kit/export_kick_off_performer.rb
onc_certification_g10_test_kit-5.3.0 lib/onc_certification_g10_test_kit/export_kick_off_performer.rb
onc_certification_g10_test_kit-5.2.0 lib/onc_certification_g10_test_kit/export_kick_off_performer.rb
onc_certification_g10_test_kit-5.1.0 lib/onc_certification_g10_test_kit/export_kick_off_performer.rb
onc_certification_g10_test_kit-5.0.0 lib/onc_certification_g10_test_kit/export_kick_off_performer.rb
onc_certification_g10_test_kit-4.1.0 lib/onc_certification_g10_test_kit/export_kick_off_performer.rb
onc_certification_g10_test_kit-4.0.0 lib/onc_certification_g10_test_kit/export_kick_off_performer.rb
onc_certification_g10_test_kit-3.8.1 lib/onc_certification_g10_test_kit/export_kick_off_performer.rb
onc_certification_g10_test_kit-3.8.0 lib/onc_certification_g10_test_kit/export_kick_off_performer.rb
onc_certification_g10_test_kit-3.7.2 lib/onc_certification_g10_test_kit/export_kick_off_performer.rb
onc_certification_g10_test_kit-3.7.1 lib/onc_certification_g10_test_kit/export_kick_off_performer.rb