Sha256: 472988c12f56277b02474f767471c10163c1bcbfbd1ff325e7334036b36aa9f7

Contents?: true

Size: 1.04 KB

Versions: 9

Compression:

Stored size: 1.04 KB

Contents

module ONCCertificationG10TestKit
  class PatientContextTest < Inferno::Test
    title 'Patient from launch context can be retrieved'
    description %(
      The `patient` field is a String value with a patient id, indicating that
      the app was launched in the context of this FHIR Patient. This test
      verifies that the Patient resource with that id can be retrieved.
    )
    id :g10_patient_context
    input :patient_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 patient_id.blank?, 'Token response did not contain `patient` field'

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

      fhir_read(:patient, patient_id, client: :authenticated)

      assert_response_status(200)
      assert_resource_type(:patient)
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
onc_certification_g10_test_kit-7.0.3 lib/onc_certification_g10_test_kit/patient_context_test.rb
onc_certification_g10_test_kit-7.0.2 lib/onc_certification_g10_test_kit/patient_context_test.rb
onc_certification_g10_test_kit-7.0.1 lib/onc_certification_g10_test_kit/patient_context_test.rb
onc_certification_g10_test_kit-7.0.0 lib/onc_certification_g10_test_kit/patient_context_test.rb
onc_certification_g10_test_kit-6.0.3 lib/onc_certification_g10_test_kit/patient_context_test.rb
onc_certification_g10_test_kit-6.0.2 lib/onc_certification_g10_test_kit/patient_context_test.rb
onc_certification_g10_test_kit-6.0.1 lib/onc_certification_g10_test_kit/patient_context_test.rb
onc_certification_g10_test_kit-6.0.0 lib/onc_certification_g10_test_kit/patient_context_test.rb
onc_certification_g10_test_kit-5.4.2 lib/onc_certification_g10_test_kit/patient_context_test.rb