Sha256: 9b4b37c872b2130625f73a7ffd1f40afc5b564c274fe036a4552173e285cfe55

Contents?: true

Size: 1.49 KB

Versions: 34

Compression:

Stored size: 1.49 KB

Contents

module USCoreTestKit
  class JSONSupportTest < Inferno::Test
    id :us_core_json_support
    title 'FHIR server capability states JSON support'
    description %(
      FHIR provides multiple [representation
      formats](https://www.hl7.org/fhir/formats.html) for resources, including
      JSON and XML. US Core profiles require servers to use the [JSON
      representation](https://www.hl7.org/fhir/json.html):

      [```The US Core Server **SHALL** Support json source formats for all US
      Core
      interactions.```](http://hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html#behavior)

      The FHIR conformance interaction require servers to describe which
      formats are available for clients to use. The server must explicitly
      state that JSON is supported. This is located in the [format
      element](https://www.hl7.org/fhir/capabilitystatement-definitions.html#CapabilityStatement.format)
      of the CapabilityStatement Resource.

      This test checks that one of the following values are located in the
      format field.

      * json
      * application/json
      * application/fhir+json
    )
    uses_request :capability_statement

    run do
      assert_resource_type(:capability_statement)

      json_formats = ['json', 'application/json', 'application/fhir+json']
      server_formats = resource.format

      assert server_formats.any? { |format| json_formats.include? format },
              'CapabilityStatement does not state support for JSON'
    end
  end
end

Version data entries

34 entries across 34 versions & 1 rubygems

Version Path
us_core_test_kit-0.9.3 lib/us_core_test_kit/custom_groups/capability_statement/json_support_test.rb
us_core_test_kit-0.9.2 lib/us_core_test_kit/custom_groups/capability_statement/json_support_test.rb
us_core_test_kit-0.9.1 lib/us_core_test_kit/custom_groups/capability_statement/json_support_test.rb
us_core_test_kit-0.9.0 lib/us_core_test_kit/custom_groups/capability_statement/json_support_test.rb
us_core_test_kit-0.8.2 lib/us_core_test_kit/custom_groups/capability_statement/json_support_test.rb
us_core_test_kit-0.8.1 lib/us_core_test_kit/custom_groups/capability_statement/json_support_test.rb
us_core_test_kit-0.8.0 lib/us_core_test_kit/custom_groups/capability_statement/json_support_test.rb
us_core_test_kit-0.7.2 lib/us_core_test_kit/custom_groups/capability_statement/json_support_test.rb
us_core_test_kit-0.7.1 lib/us_core_test_kit/custom_groups/capability_statement/json_support_test.rb
us_core_test_kit-0.7.0 lib/us_core_test_kit/custom_groups/capability_statement/json_support_test.rb
us_core_test_kit-0.6.5 lib/us_core_test_kit/custom_groups/capability_statement/json_support_test.rb
us_core_test_kit-0.6.4 lib/us_core_test_kit/custom_groups/capability_statement/json_support_test.rb
us_core_test_kit-0.6.3 lib/us_core_test_kit/custom_groups/capability_statement/json_support_test.rb
us_core_test_kit-0.6.2 lib/us_core_test_kit/custom_groups/capability_statement/json_support_test.rb
us_core_test_kit-0.6.1 lib/us_core_test_kit/custom_groups/capability_statement/json_support_test.rb
us_core_test_kit-0.6.0 lib/us_core_test_kit/custom_groups/capability_statement/json_support_test.rb
us_core_test_kit-0.5.0 lib/us_core_test_kit/custom_groups/capability_statement/json_support_test.rb
us_core_test_kit-0.4.7 lib/us_core_test_kit/custom_groups/capability_statement/json_support_test.rb
us_core_test_kit-0.4.6 lib/us_core_test_kit/custom_groups/capability_statement/json_support_test.rb
us_core_test_kit-0.4.5 lib/us_core_test_kit/custom_groups/capability_statement/json_support_test.rb