Sha256: 50486ab9c8277cd7c485451d581bb01235b6a06a9f8764b39db5351a8d4bba12

Contents?: true

Size: 1.03 KB

Versions: 31

Compression:

Stored size: 1.03 KB

Contents

module ONCCertificationG10TestKit
  class EncounterContextTest < Inferno::Test
    title 'OAuth token exchange response body contains encounter context and encounter resource can be retrieved'
    description %(
      The `encounter` field is a String value with a encounter id, indicating that
      the app was launched in the context of this FHIR Encounter.
    )
    id :g10_encounter_context
    input :encounter_id, :url
    input :smart_credentials, type: :oauth_credentials

    fhir_client :authenticated do
      url :url
      oauth_credentials :smart_credentials
    end

    run do
      skip_if smart_credentials.access_token.blank?, 'No access token was received during the SMART launch'

      skip_if encounter_id.blank?, 'Token response did not contain `encounter` field'

      skip_if request.status != 200, 'Token was not successfully refreshed' if config.options[:refresh_test]

      fhir_read(:encounter, encounter_id, client: :authenticated)

      assert_response_status(200)
      assert_resource_type(:encounter)
    end
  end
end

Version data entries

31 entries across 31 versions & 1 rubygems

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