From 6afd0bcc07cef76d6e1dc1fa7c8e19f375b58b84 Mon Sep 17 00:00:00 2001 From: Shaumik-Ashraf Date: Tue, 25 Feb 2025 14:53:08 -0500 Subject: [PATCH] FI-3648 Add metadata and make platform deployable (#40) * impl platform deployment spec wip * impl failing rspecs * debug * rm unnecessary require version * use inferno core >=0.6.4 * gemfile lock --- .github/workflows/ruby.yml | 4 +- .ruby-version | 2 +- .tool-versions | 2 +- Dockerfile | 2 +- Gemfile | 1 + Gemfile.lock | 8 ++- lib/service_base_url_test_kit.rb | 7 +- lib/service_base_url_test_kit/metadata.rb | 79 +++++++++++++++++++++++ lib/service_base_url_test_kit/version.rb | 3 +- service_base_url_test_kit.gemspec | 13 ++-- spec/service_base_url_test_kit_spec.rb | 3 + spec/spec_helper.rb | 2 +- 12 files changed, 106 insertions(+), 20 deletions(-) create mode 100644 lib/service_base_url_test_kit/metadata.rb create mode 100644 spec/service_base_url_test_kit_spec.rb diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml index 5298a7c..73c3865 100644 --- a/.github/workflows/ruby.yml +++ b/.github/workflows/ruby.yml @@ -12,7 +12,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - ruby-version: ['3.1.2'] + ruby-version: ['3.3.6'] steps: - uses: actions/checkout@v2 @@ -27,7 +27,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - ruby-version: ['3.1.2'] + ruby-version: ['3.3.6'] steps: - uses: actions/checkout@v2 - name: Set up Ruby diff --git a/.ruby-version b/.ruby-version index 6ebad14..eedb52b 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -3.1.2 \ No newline at end of file +3.3.6 \ No newline at end of file diff --git a/.tool-versions b/.tool-versions index b8ab7ea..20a18c2 100644 --- a/.tool-versions +++ b/.tool-versions @@ -1 +1 @@ -ruby 3.1.2 \ No newline at end of file +ruby 3.3.6 \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 3ef2574..7104b3e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM ruby:3.1.2 +FROM ruby:3.3.6 ENV INSTALL_PATH=/opt/inferno/ ENV APP_ENV=production diff --git a/Gemfile b/Gemfile index 382378e..83a0f82 100644 --- a/Gemfile +++ b/Gemfile @@ -6,4 +6,5 @@ gemspec group :development, :test do gem 'debug' + gem 'rack-test', '~> 2.2' end diff --git a/Gemfile.lock b/Gemfile.lock index ef7f414..786f117 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -2,7 +2,7 @@ PATH remote: . specs: service_base_url_test_kit (0.11.1) - inferno_core (~> 0.5.0) + inferno_core (>= 0.6.4) GEM remote: https://rubygems.org/ @@ -132,10 +132,11 @@ GEM domain_name (~> 0.5) i18n (1.14.6) concurrent-ruby (~> 1.0) - inferno_core (0.5.0) + inferno_core (0.6.4) activesupport (~> 6.1.7.5) base62-rb (= 0.3.1) blueprinter (= 0.25.2) + concurrent-ruby (= 1.3.4) dotenv (~> 2.7) dry-configurable (= 1.0.0) dry-container (= 0.10.0) @@ -217,6 +218,8 @@ GEM nio4r (~> 2.0) racc (1.8.1) rack (2.2.10) + rack-test (2.2.0) + rack (>= 1.3) rake (13.2.1) rdoc (6.7.0) psych (>= 4.0.0) @@ -294,6 +297,7 @@ DEPENDENCIES database_cleaner-sequel (~> 1.8) debug factory_bot (~> 6.1) + rack-test (~> 2.2) rspec (~> 3.10) service_base_url_test_kit! webmock (~> 3.11) diff --git a/lib/service_base_url_test_kit.rb b/lib/service_base_url_test_kit.rb index b44bb47..c54b5c0 100644 --- a/lib/service_base_url_test_kit.rb +++ b/lib/service_base_url_test_kit.rb @@ -1,4 +1,4 @@ -require_relative 'service_base_url_test_kit/version' +require_relative 'service_base_url_test_kit/metadata' require_relative 'service_base_url_test_kit/service_base_url_test_group' require 'erb' @@ -60,7 +60,6 @@ class ServiceBaseURLTestSuite < Inferno::TestSuite ) - version VERSION input_instructions <<~INSTRUCTIONS For systems that make their Service Base URL Bundle available at a public endpoint, please input @@ -81,6 +80,10 @@ class ServiceBaseURLTestSuite < Inferno::TestSuite label: 'Open Source', url: 'https://github.com/inferno-framework/service-base-url-test-kit' }, + { + label: 'Download', + url: 'https://github.com/inferno-framework/service-base-url-test-kit/releases' + }, { label: 'Service base URL requirements', url: 'https://www.ecfr.gov/current/title-45/subtitle-A/subchapter-D/part-170/subpart-D/section-170.404#p-170.404(b)(2)' diff --git a/lib/service_base_url_test_kit/metadata.rb b/lib/service_base_url_test_kit/metadata.rb new file mode 100644 index 0000000..6c2682d --- /dev/null +++ b/lib/service_base_url_test_kit/metadata.rb @@ -0,0 +1,79 @@ +module ServiceBaseURLTestKit + class Metadata < Inferno::TestKit + id :service_base_url_test_kit + title 'Service Base URL Test Kit' + suite_ids ['service_base_url'] + tags ['Endpoint Publication'] + last_updated ::ServiceBaseURLTestKit::LAST_UPDATED + version ::ServiceBaseURLTestKit::VERSION + maturity 'Medium' + authors ['Inferno Team'] + repo 'https://github.com/inferno-framework/service-base-url-test-kit' + description <<~DESCRIPTION + The Service Base URL Test Kit provides a set of tests that verify + conformance of Service Base URL publications to data format requirements + as described in + [Conditions and Maintenance of Certification - Application programming interfaces](https://www.ecfr.gov/current/title-45/subtitle-A/subchapter-D/part-170/subpart-D/section-170.404#p-170.404(b)(2)) + and the + [ONC HTI-1 Final Rule](https://www.healthit.gov/topic/laws-regulation-and-policy/health-data-technology-and-interoperability-certification-program). + Please review the + [Application Programming Interfaces Certification Companion Guide](https://www.healthit.gov/condition-ccg/application-programming-interfaces) + for additional guidance. This Test Kit is provided as a tool + to help developers identify potential issues or problems with the + structure of their Service Base URL publication. Test failures do not + necessarily indicate non-conformance to the Conditions and Maintenance of + Certification. Use of these tests is not required for participants of the + ONC Health IT Certification Program. Please provide feedback on these + tests by reporting an issue in + [GitHub](https://github.com/inferno-framework/service-base-url-test-kit/issues), + or by reaching out to the team on the + [Inferno FHIR Zulip channel](https://chat.fhir.org/#narrow/stream/179309-inferno). + + This Test Kit specifically targets requirements provided within the Conditions + and Maintenance of Certification. Testing for the related + [SMART User-access Brands and Endpoints](http://hl7.org/fhir/smart-app-launch/STU2.2/brands.html) + specification is provided separately within the + [SMART App Launch Test Kit](https://inferno.healthit.gov/test-kits/smart-app-launch). + + Relevant requirements from the Conditions and Maintenance of + Certification - Application programming interfaces: + + **Service Base URL publication:** + + For all Health IT Modules certified to § 170.315(g)(10), a Certified API + Developer must publish, at no charge, the service base URLs and related + organization details that can be used by patients to access their + electronic health information, by December 31, 2024. This includes all + customers regardless of whether the Health IT Modules certified + to § 170.315(g)(10) are centrally managed by the Certified API Developer + or locally deployed by an API Information Source. These service base URLs + and organization details must conform to the following: + + - Service base URLs must be publicly published in Endpoint resource format + according to the standard adopted in § 170.215(a) (FHIR v4.0.1). + - Organization details for each service base URL must be publicly + published in Organization resource format according to the standard + adopted in § 170.215(a) (FHIR v4.0.1). Each Organization resource must + contain: + + A reference, in the Organization endpoint element, to the Endpoint resources containing service base URLs managed by this organization. + + The organization’s name, location, and facility identifier. + - Endpoint and Organization resources must be: + + Collected into a Bundle resource formatted according to the standard adopted in § 170.215(a) (FHIR v4.0.1) for publication; + + and Reviewed quarterly and, as necessary, updated. + + ## Providing Feedback and Reporting Issues + + We welcome feedback on the tests, including but not limited to the following areas: + + - Validation logic, such as potential bugs, lax checks, and unexpected failures. + - Requirements coverage, such as requirements that have been missed, tests that + necessitate features that the IG does not require, or other issues with the + interpretation of the IG’s requirements. + - User experience, such as confusing or missing information in the test UI. + + Please report any issues with this set of tests in the + [issues section](https://github.com/inferno-framework/service-base-url-test-kit/issues) + of the source code repository. + DESCRIPTION + end +end diff --git a/lib/service_base_url_test_kit/version.rb b/lib/service_base_url_test_kit/version.rb index e3baf76..d67b81b 100644 --- a/lib/service_base_url_test_kit/version.rb +++ b/lib/service_base_url_test_kit/version.rb @@ -1,5 +1,6 @@ # frozen_string_literal: true module ServiceBaseURLTestKit - VERSION = '0.11.1' + VERSION = '0.11.1' # TODO breaking change + LAST_UPDATED = '2024-11-06' end diff --git a/service_base_url_test_kit.gemspec b/service_base_url_test_kit.gemspec index 12b529e..7ed5a8d 100644 --- a/service_base_url_test_kit.gemspec +++ b/service_base_url_test_kit.gemspec @@ -10,20 +10,15 @@ Gem::Specification.new do |spec| spec.description = 'Inferno Service Base URL Test Kit' spec.homepage = 'https://github.com/inferno-framework/service-base-url-test-kit' spec.license = 'Apache-2.0' - spec.add_runtime_dependency 'inferno_core', '~> 0.5.0' + spec.add_runtime_dependency 'inferno_core', '>= 0.6.4' spec.add_development_dependency 'database_cleaner-sequel', '~> 1.8' spec.add_development_dependency 'factory_bot', '~> 6.1' spec.add_development_dependency 'rspec', '~> 3.10' spec.add_development_dependency 'webmock', '~> 3.11' - spec.required_ruby_version = Gem::Requirement.new('>= 3.1.2') + spec.required_ruby_version = Gem::Requirement.new('>= 3.3.6') spec.metadata['homepage_uri'] = spec.homepage spec.metadata['source_code_uri'] = 'https://github.com/inferno-framework/service-base-url-test-kit' - spec.files = [ - Dir['lib/**/*.rb'], - Dir['lib/**/*.json'], - Dir['lib/**/*.erb'], - 'LICENSE' - ].flatten - + spec.files = `[ -d .git ] && git ls-files -z lib config/presets LICENSE`.split("\x0") spec.require_paths = ['lib'] + spec.metadata['inferno_test_kit'] = 'true' end diff --git a/spec/service_base_url_test_kit_spec.rb b/spec/service_base_url_test_kit_spec.rb new file mode 100644 index 0000000..6b02e91 --- /dev/null +++ b/spec/service_base_url_test_kit_spec.rb @@ -0,0 +1,3 @@ +RSpec.describe ServiceBaseURLTestKit, order: :defined do + it_behaves_like 'platform_deployable_test_kit' +end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 5e6d821..c6076df 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -128,7 +128,7 @@ require 'inferno' Inferno::Application.finalize! -require Inferno::SpecSupport::FACTORY_BOT_SUPPORT_PATH +Inferno::SpecSupport.require_helpers FactoryBot.definition_file_paths = [ Inferno::SpecSupport::FACTORY_PATH