diff --git a/Gemfile.lock b/Gemfile.lock index e3483f35..43c12c43 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -2,7 +2,7 @@ PATH remote: . specs: davinci_pas_test_kit (0.14.0) - inferno_core (~> 1.0, >= 1.0.2) + inferno_core (~> 1.0, >= 1.1.2) smart_app_launch_test_kit (~> 1.0) subscriptions_test_kit (~> 0.12.0) udap_security_test_kit (~> 0.12.0) @@ -16,22 +16,23 @@ GEM minitest (>= 5.1) tzinfo (~> 2.0) zeitwerk (~> 2.3) - addressable (2.8.7) - public_suffix (>= 2.0.2, < 7.0) + addressable (2.8.9) + public_suffix (>= 2.0.2, < 8.0) aes_key_wrap (1.1.0) ast (2.4.3) base62-rb (0.3.1) base64 (0.3.0) bcp47 (0.3.3) i18n - bigdecimal (3.2.2) + bigdecimal (3.3.1) bindata (2.5.1) blueprinter (0.25.2) - byebug (12.0.0) + byebug (13.0.0) + reline (>= 0.6.0) coderay (1.1.3) concurrent-ruby (1.3.4) - connection_pool (2.5.3) - crack (1.0.0) + connection_pool (3.0.2) + crack (1.0.1) bigdecimal rexml csv (3.3.5) @@ -39,14 +40,15 @@ GEM database_cleaner-sequel (1.99.0) database_cleaner (~> 1.99.0) sequel - date (3.4.1) + date (3.5.1) date_time_precision (0.8.1) - debug (1.10.0) + debug (1.11.1) irb (~> 1.10) reline (>= 0.3.8) - diff-lcs (1.6.1) + diff-lcs (1.6.2) domain_name (0.6.20240107) dotenv (2.8.1) + drb (2.2.3) dry-auto_inject (1.0.1) dry-core (~> 1.0) zeitwerk (~> 2.6) @@ -64,11 +66,13 @@ GEM dry-configurable (~> 1.0, < 2) dry-core (~> 1.0, < 2) dry-inflector (~> 1.0, < 2) - dry-transformer (1.0.1) + dry-transformer (1.1.0) + bigdecimal zeitwerk (~> 2.6) - factory_bot (6.5.1) + erb (6.0.2) + factory_bot (6.5.6) activesupport (>= 6.1.0) - faraday (1.10.4) + faraday (1.10.5) faraday-em_http (~> 1.0) faraday-em_synchrony (~> 1.0) faraday-excon (~> 1.1) @@ -84,23 +88,23 @@ GEM faraday-em_synchrony (1.0.1) faraday-excon (1.1.0) faraday-httpclient (1.0.1) - faraday-multipart (1.1.1) + faraday-multipart (1.2.0) multipart-post (~> 2.0) faraday-net_http (1.0.2) faraday-net_http_persistent (1.2.0) faraday-patron (1.0.0) faraday-rack (1.0.0) - faraday-retry (1.0.3) + faraday-retry (1.0.4) faraday_middleware (1.2.1) faraday (~> 1.0) - fhir_client (6.0.0) + fhir_client (6.1.0) activesupport (>= 3) addressable (>= 2.3) fhir_dstu2_models (>= 1.1.1) fhir_models (>= 5.0.0) fhir_stu3_models (>= 3.1.1) nokogiri (>= 1.10.4) - oauth2 (~> 1.1) + oauth2 (~> 2.0) rack (>= 1.5) rest-client (~> 2.0) tilt (>= 1.1) @@ -119,7 +123,8 @@ GEM date_time_precision (>= 0.8) mime-types (>= 3.0) nokogiri (>= 1.11.4) - foreman (0.88.1) + foreman (0.90.0) + thor (~> 1.4) hanami-controller (2.0.0) dry-configurable (~> 1.0, < 2) dry-core (~> 1.0) @@ -130,20 +135,23 @@ GEM mustermann (~> 1.0) mustermann-contrib (~> 1.0) rack (~> 2.0) - hanami-utils (2.2.0) + hanami-utils (2.3.0) + bigdecimal (~> 3.1) concurrent-ruby (~> 1.0) dry-core (~> 1.0, < 2) dry-transformer (~> 1.0, < 2) hansi (0.2.1) - hashdiff (1.1.2) + hashdiff (1.2.1) + hashie (5.1.0) + logger http-accept (1.7.0) - http-cookie (1.0.8) + http-cookie (1.1.0) domain_name (~> 0.5) httpclient (2.9.0) mutex_m - i18n (1.14.7) + i18n (1.14.8) concurrent-ruby (~> 1.0) - inferno_core (1.0.3) + inferno_core (1.1.2) activesupport (~> 6.1.7.5) base62-rb (= 0.3.1) blueprinter (= 0.25.2) @@ -174,14 +182,15 @@ GEM sequel (~> 5.42.0) sidekiq (~> 7.2.4) sqlite3 (~> 1.4) - thor (~> 1.2.1) + thor (~> 1.4) tty-markdown (~> 0.7.1) - io-console (0.8.0) - irb (1.15.2) + io-console (0.8.2) + irb (1.17.0) pp (>= 0.6.0) + prism (>= 1.3.0) rdoc (>= 4.0.0) reline (>= 0.4.2) - json (2.11.3) + json (2.19.3) json-jwt (1.15.3.1) activesupport (>= 4.2) aes_key_wrap @@ -189,22 +198,23 @@ GEM httpclient jwt (2.10.2) base64 - kramdown (2.5.1) - rexml (>= 3.3.9) + kramdown (2.5.2) + rexml (>= 3.4.4) kramdown-parser-gfm (1.1.0) kramdown (~> 2.0) - language_server-protocol (3.17.0.4) + language_server-protocol (3.17.0.5) lint_roller (1.1.0) logger (1.7.0) method_source (1.1.0) mime-types (3.7.0) logger mime-types-data (~> 3.2025, >= 3.2025.0507) - mime-types-data (3.2025.0715) - minitest (5.25.5) - multi_json (1.17.0) - multi_xml (0.7.2) - bigdecimal (~> 3.1) + mime-types-data (3.2026.0331) + minitest (6.0.3) + drb (~> 2.0) + prism (~> 1.5) + multi_xml (0.8.1) + bigdecimal (>= 3.1, < 5) multipart-post (2.4.1) mustermann (1.1.2) ruby2_keywords (~> 0.0.1) @@ -213,89 +223,94 @@ GEM mustermann (= 1.1.2) mutex_m (0.3.0) netrc (0.11.0) - nio4r (2.7.4) - nokogiri (1.18.9-aarch64-linux-gnu) + nio4r (2.7.5) + nokogiri (1.19.2-aarch64-linux-gnu) racc (~> 1.4) - nokogiri (1.18.9-aarch64-linux-musl) + nokogiri (1.19.2-aarch64-linux-musl) racc (~> 1.4) - nokogiri (1.18.9-arm-linux-gnu) + nokogiri (1.19.2-arm-linux-gnu) racc (~> 1.4) - nokogiri (1.18.9-arm-linux-musl) + nokogiri (1.19.2-arm-linux-musl) racc (~> 1.4) - nokogiri (1.18.9-arm64-darwin) + nokogiri (1.19.2-arm64-darwin) racc (~> 1.4) - nokogiri (1.18.9-x86_64-darwin) + nokogiri (1.19.2-x86_64-darwin) racc (~> 1.4) - nokogiri (1.18.9-x86_64-linux-gnu) + nokogiri (1.19.2-x86_64-linux-gnu) racc (~> 1.4) - nokogiri (1.18.9-x86_64-linux-musl) + nokogiri (1.19.2-x86_64-linux-musl) racc (~> 1.4) - oauth2 (1.4.11) - faraday (>= 0.17.3, < 3.0) - jwt (>= 1.0, < 3.0) - multi_json (~> 1.3) + oauth2 (2.0.18) + faraday (>= 0.17.3, < 4.0) + jwt (>= 1.0, < 4.0) + logger (~> 1.2) multi_xml (~> 0.5) rack (>= 1.2, < 4) + snaky_hash (~> 2.0, >= 2.0.3) + version_gem (~> 1.1, >= 1.1.9) oj (3.11.0) - parallel (1.27.0) - parser (3.3.8.0) + parallel (1.28.0) + parser (3.3.11.1) ast (~> 2.4.1) racc pastel (0.8.0) tty-color (~> 0.5) - pp (0.6.2) + pp (0.6.3) prettyprint prettyprint (0.2.0) - prism (1.4.0) - pry (0.15.2) + prism (1.9.0) + pry (0.16.0) coderay (~> 1.1) method_source (~> 1.0) - pry-byebug (3.11.0) - byebug (~> 12.0) - pry (>= 0.13, < 0.16) - psych (5.2.4) + reline (>= 0.6.0) + pry-byebug (3.12.0) + byebug (~> 13.0) + pry (>= 0.13, < 0.17) + psych (5.3.1) date stringio - public_suffix (6.0.2) + public_suffix (7.0.5) puma (5.6.9) nio4r (~> 2.0) racc (1.8.1) - rack (2.2.17) + rack (2.2.23) rack-test (2.2.0) rack (>= 1.3) rainbow (3.1.1) - rake (13.3.0) - rdoc (6.13.1) + rake (13.3.1) + rdoc (7.2.0) + erb psych (>= 4.0.0) - redis-client (0.25.1) + tsort + redis-client (0.28.0) connection_pool - regexp_parser (2.10.0) - reline (0.6.1) + regexp_parser (2.11.3) + reline (0.6.3) io-console (~> 0.5) rest-client (2.1.0) http-accept (>= 1.7.0, < 2.0) http-cookie (>= 1.0.2, < 2.0) mime-types (>= 1.16, < 4.0) netrc (~> 0.8) - rexml (3.4.1) + rexml (3.4.4) roo (2.10.1) nokogiri (~> 1) rubyzip (>= 1.3.0, < 3.0.0) - rouge (4.6.0) - rspec (3.13.0) + rouge (4.7.0) + rspec (3.13.2) rspec-core (~> 3.13.0) rspec-expectations (~> 3.13.0) rspec-mocks (~> 3.13.0) - rspec-core (3.13.3) + rspec-core (3.13.6) rspec-support (~> 3.13.0) - rspec-expectations (3.13.4) + rspec-expectations (3.13.5) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.13.0) - rspec-mocks (3.13.3) + rspec-mocks (3.13.8) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.13.0) - rspec-support (3.13.3) - rubocop (1.75.4) + rspec-support (3.13.7) + rubocop (1.86.0) json (~> 2.3) language_server-protocol (~> 3.17.0.2) lint_roller (~> 1.1.0) @@ -303,17 +318,17 @@ GEM parser (>= 3.3.0.2) rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 2.9.3, < 3.0) - rubocop-ast (>= 1.44.0, < 2.0) + rubocop-ast (>= 1.49.0, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 2.4.0, < 4.0) - rubocop-ast (1.44.1) + rubocop-ast (1.49.1) parser (>= 3.3.7.2) - prism (~> 1.4) + prism (~> 1.7) rubocop-rake (0.6.0) rubocop (~> 1.0) - rubocop-rspec (3.6.0) + rubocop-rspec (3.9.0) lint_roller (~> 1.1) - rubocop (~> 1.72, >= 1.72.1) + rubocop (~> 1.81) ruby-progressbar (1.13.0) ruby2_keywords (0.0.5) rubyzip (2.4.1) @@ -328,12 +343,15 @@ GEM json-jwt (~> 1.15.3) jwt (~> 2.6) tls_test_kit (~> 1.0) + snaky_hash (2.0.3) + hashie (>= 0.1.0, < 6) + version_gem (>= 1.1.8, < 3) sqlite3 (1.7.3-aarch64-linux) sqlite3 (1.7.3-arm-linux) sqlite3 (1.7.3-arm64-darwin) sqlite3 (1.7.3-x86_64-darwin) sqlite3 (1.7.3-x86_64-linux) - stringio (3.1.7) + stringio (3.2.0) strings (0.2.1) strings-ansi (~> 0.2) unicode-display_width (>= 1.5, < 3.0) @@ -341,10 +359,11 @@ GEM strings-ansi (0.2.0) subscriptions_test_kit (0.12.0) inferno_core (~> 1.0, >= 1.0.2) - thor (1.2.2) - tilt (2.6.1) + thor (1.5.0) + tilt (2.7.0) tls_test_kit (1.0.0) inferno_core (~> 1.0, >= 1.0.2) + tsort (0.2.0) tty-color (0.6.0) tty-markdown (0.7.2) kramdown (>= 1.16.2, < 3.0) @@ -361,11 +380,12 @@ GEM jwt (~> 2.3) unicode-display_width (2.6.0) unicode_utils (1.4.0) - webmock (3.25.1) + version_gem (1.1.9) + webmock (3.26.2) addressable (>= 2.8.0) crack (>= 0.3.2) hashdiff (>= 0.4.0, < 2.0.0) - zeitwerk (2.7.3) + zeitwerk (2.7.5) PLATFORMS aarch64-linux @@ -376,7 +396,6 @@ PLATFORMS arm-linux-musl arm64-darwin x86_64-darwin - x86_64-linux x86_64-linux-gnu x86_64-linux-musl diff --git a/davinci_pas_test_kit.gemspec b/davinci_pas_test_kit.gemspec index 7177bdc7..43bbb15c 100644 --- a/davinci_pas_test_kit.gemspec +++ b/davinci_pas_test_kit.gemspec @@ -9,7 +9,7 @@ Gem::Specification.new do |spec| spec.description = 'Inferno Test Kit for the Da Vinci Prior Authorization Support IG' spec.homepage = 'https://github.com/inferno-framework/davinci-pas-test-kit' spec.license = 'Apache-2.0' - spec.add_dependency 'inferno_core', '~> 1.0', '>= 1.0.2' + spec.add_dependency 'inferno_core', '~> 1.0', '>= 1.1.2' spec.add_dependency 'smart_app_launch_test_kit', '~> 1.0' spec.add_dependency 'subscriptions_test_kit', '~> 0.12.0' spec.add_dependency 'udap_security_test_kit', '~> 0.12.0' diff --git a/lib/davinci_pas_test_kit/custom_groups/v2.0.1/client_tests/pas_client_inquire_response_bundle_validation_test.rb b/lib/davinci_pas_test_kit/custom_groups/v2.0.1/client_tests/pas_client_inquire_response_bundle_validation_test.rb index 3133b72c..5a81b4d0 100644 --- a/lib/davinci_pas_test_kit/custom_groups/v2.0.1/client_tests/pas_client_inquire_response_bundle_validation_test.rb +++ b/lib/davinci_pas_test_kit/custom_groups/v2.0.1/client_tests/pas_client_inquire_response_bundle_validation_test.rb @@ -10,10 +10,10 @@ class PasClientInquireResponseBundleValidationTest < Inferno::Test include ResponseGenerator id :pas_client_v201_inquire_response_bundle_validation_test - title '[USER INPUT VERIFICATION] Inquire Response Bundle is valid' + title 'Inquire Response Bundle is valid' description %( - **USER INPUT VERIFICATION**: This test verifies input provided by the tester instead of the system under test. - Errors encountered will be treated as a skip instead of a failure. + **USER INPUT VERIFICATION**: This test verifies input provided by the tester instead of + the system under test. Errors encountered will be treated as a skip instead of a failure. This test verifies the conformity of the inquire response sent by Inferno, which will have been either: @@ -44,6 +44,7 @@ class PasClientInquireResponseBundleValidationTest < Inferno::Test issue](https://github.com/inferno-framework/davinci-pas-test-kit/issues/11) for additional details. ) + simulation_verification def request_type 'inquire' diff --git a/lib/davinci_pas_test_kit/custom_groups/v2.0.1/client_tests/pas_client_response_bundle_validation_test.rb b/lib/davinci_pas_test_kit/custom_groups/v2.0.1/client_tests/pas_client_response_bundle_validation_test.rb index 283a4bcb..d758310a 100644 --- a/lib/davinci_pas_test_kit/custom_groups/v2.0.1/client_tests/pas_client_response_bundle_validation_test.rb +++ b/lib/davinci_pas_test_kit/custom_groups/v2.0.1/client_tests/pas_client_response_bundle_validation_test.rb @@ -10,10 +10,10 @@ class PasClientResponseBundleValidationTest < Inferno::Test include ResponseGenerator id :pas_client_v201_response_bundle_validation_test - title '[USER INPUT VERIFICATION] Submit Response Bundle is valid' + title 'Submit Response Bundle is valid' description %( - **USER INPUT VERIFICATION**: This test verifies input provided by the tester instead of the system under test. - Errors encountered will be treated as a skip instead of a failure. + **USER INPUT VERIFICATION**: This test verifies input provided by the tester instead + of the system under test. Errors encountered will be treated as a skip instead of a failure. This test verifies the conformity of the submit response sent by Inferno, which will have been either: @@ -44,6 +44,7 @@ class PasClientResponseBundleValidationTest < Inferno::Test issue](https://github.com/inferno-framework/davinci-pas-test-kit/issues/11) for additional details. ) + simulation_verification def request_type 'submit' diff --git a/lib/davinci_pas_test_kit/custom_groups/v2.0.1/notification/pas_subscription_notification_test.rb b/lib/davinci_pas_test_kit/custom_groups/v2.0.1/notification/pas_subscription_notification_test.rb index a0d28f1e..2999453e 100644 --- a/lib/davinci_pas_test_kit/custom_groups/v2.0.1/notification/pas_subscription_notification_test.rb +++ b/lib/davinci_pas_test_kit/custom_groups/v2.0.1/notification/pas_subscription_notification_test.rb @@ -5,6 +5,7 @@ module DaVinciPASV201 # TODO: none of file name, class name, or ID match class PasUpdateNotificationTest < Inferno::Test include URLs + id :prior_auth_claim_response_update_notification_validation title 'Server notifies the client that the pended claim was updated.' description %( diff --git a/lib/davinci_pas_test_kit/custom_groups/v2.0.1/pas_client_denial_group.rb b/lib/davinci_pas_test_kit/custom_groups/v2.0.1/pas_client_denial_group.rb index c919afbc..1ad58ff4 100644 --- a/lib/davinci_pas_test_kit/custom_groups/v2.0.1/pas_client_denial_group.rb +++ b/lib/davinci_pas_test_kit/custom_groups/v2.0.1/pas_client_denial_group.rb @@ -9,6 +9,7 @@ module DaVinciPASTestKit module DaVinciPASV201 class PASClientDenialGroup < Inferno::TestGroup include UserInputResponse + id :pas_client_v201_denial_group title 'Denial Workflow' description %( diff --git a/lib/davinci_pas_test_kit/custom_groups/v2.0.1/pas_client_pended_group.rb b/lib/davinci_pas_test_kit/custom_groups/v2.0.1/pas_client_pended_group.rb index 09f4f980..a75034e1 100644 --- a/lib/davinci_pas_test_kit/custom_groups/v2.0.1/pas_client_pended_group.rb +++ b/lib/davinci_pas_test_kit/custom_groups/v2.0.1/pas_client_pended_group.rb @@ -11,6 +11,7 @@ module DaVinciPASTestKit module DaVinciPASV201 class PASClientPendedGroup < Inferno::TestGroup include UserInputResponse + id :pas_client_v201_pended_group title 'Pended Workflow' description %( @@ -70,26 +71,29 @@ class PASClientPendedGroup < Inferno::TestGroup title 'Verify notification interaction' test from: :subscriptions_r4_client_notification_input_verification, - title: '[USER INPUT VERIFICATION] Tester-provided event notification Bundle is conformant', + title: 'Tester-provided event notification Bundle is conformant', description: %( - This test checks that the notification Bundle sent to the client, which will be either - the tester-provided notification Bundle in the **Claim updated notification JSON** input - or mocked by Inferno based on details in the Subscription and submitted Claim, is conformant - to Subscription Backport IG requirements. + **USER INPUT VERIFICATION**: This test checks that the notification Bundle sent to the + client, which will be either the tester-provided notification Bundle in the **Claim + updated notification JSON** input or mocked by Inferno based on details in the Subscription + and submitted Claim, is conformant to Subscription Backport IG requirements. ), + simulation_verification: true, config: { inputs: { notification_bundle: { optional: true } # doesn't use the input (bug in Subscriptions) } } test from: :subscriptions_r4_client_notification_input_payload_verification, - title: '[USER INPUT VERIFICATION] Tester-provided event notification Bundle matches the Subscription', + title: 'Tester-provided event notification Bundle matches the Subscription', description: %( - This test checks that the notification Bundle sent to the client, which will be either - the tester-provided notification Bundle in the **Claim updated notification JSON** input - or mocked by Inferno based on details in the Subscription and submitted Claim, matches the details - requested in the Subscription provided during the **2.1** "PAS Subscription Setup" tests. + **USER INPUT VERIFICATION**: This test checks that the notification Bundle sent to the client, + which will be either the tester-provided notification Bundle in the **Claim updated notification + JSON** input or mocked by Inferno based on details in the Subscription and submitted Claim, + matches the details requested in the Subscription provided during the **2.1** "PAS Subscription + Setup" tests. ), + simulation_verification: true, config: { inputs: { notification_bundle: { optional: true } # doesn't use the input (bug in Subscriptions) diff --git a/lib/davinci_pas_test_kit/custom_groups/v2.0.1/pas_server_subscription_input_conformance.rb b/lib/davinci_pas_test_kit/custom_groups/v2.0.1/pas_server_subscription_input_conformance.rb index 8bccc114..bd4fd596 100644 --- a/lib/davinci_pas_test_kit/custom_groups/v2.0.1/pas_server_subscription_input_conformance.rb +++ b/lib/davinci_pas_test_kit/custom_groups/v2.0.1/pas_server_subscription_input_conformance.rb @@ -4,17 +4,19 @@ module DaVinciPASTestKit module DaVinciPASV201 class PASServerSubscriptionInputConformance < Inferno::Test include PASSubscriptionVerification + id :pas_server_subscription_input_conformance - title '[USER INPUT VERIFICATION] Verify Subscription PAS conformance' + title 'Verify Subscription PAS conformance' description %( - This test accepts a Subscription resource as an input and verifies that it is conformant to PAS requirements on - the Subscriptions, including: + **USER INPUT VERIFICATION**: This test accepts a Subscription resource as an input and + verifies that it is conformant to PAS requirements on the Subscriptions, including: - The payload content type must be `id-only` - The use of the [PAS-defined Subscription Topic](https://hl7.org/fhir/us/davinci-pas/STU2/SubscriptionTopic-PASSubscriptionTopic.html), and - Inclusion of filter criteria for the client's organization. ) input :subscription_resource + simulation_verification run do omit_if subscription_resource.blank?, 'Did not input a Subscription resource of this type.' diff --git a/lib/davinci_pas_test_kit/custom_groups/v2.0.1/pas_server_subscription_setup.rb b/lib/davinci_pas_test_kit/custom_groups/v2.0.1/pas_server_subscription_setup.rb index 07868ae3..c294cc6f 100644 --- a/lib/davinci_pas_test_kit/custom_groups/v2.0.1/pas_server_subscription_setup.rb +++ b/lib/davinci_pas_test_kit/custom_groups/v2.0.1/pas_server_subscription_setup.rb @@ -16,7 +16,9 @@ class PASServerSubscriptionSetup < Inferno::TestGroup verifies_requirements 'hl7.fhir.us.davinci-pas_2.0.1@141' run_as_group - test from: :subscriptions_r4_server_subscription_conformance do + test from: :subscriptions_r4_server_subscription_conformance, + title: 'Verify Subscription to Send to Server', + simulation_verification: true do input :subscription_resource, title: 'Pended Prior Authorization Subscription', description: %( diff --git a/lib/davinci_pas_test_kit/generated/v2.0.1/pas_inquiry_request_bundle/server_pas_inquiry_request_bundle_validation_test.rb b/lib/davinci_pas_test_kit/generated/v2.0.1/pas_inquiry_request_bundle/server_pas_inquiry_request_bundle_validation_test.rb index d2ac8382..92aa865a 100644 --- a/lib/davinci_pas_test_kit/generated/v2.0.1/pas_inquiry_request_bundle/server_pas_inquiry_request_bundle_validation_test.rb +++ b/lib/davinci_pas_test_kit/generated/v2.0.1/pas_inquiry_request_bundle/server_pas_inquiry_request_bundle_validation_test.rb @@ -6,7 +6,7 @@ class ServerPasInquiryRequestBundleValidationTest < Inferno::Test include DaVinciPASTestKit::PasBundleValidation id :pas_server_v201_pas_inquiry_request_bundle_validation_test - title '[USER INPUT VALIDATION] Inquiry Request Bundle is valid' + title 'Inquiry Request Bundle is valid' description %( **USER INPUT VALIDATION**: This test validates input provided by the user instead of the system under test. Errors encountered will be treated as a skip instead of a failure. @@ -39,6 +39,7 @@ class ServerPasInquiryRequestBundleValidationTest < Inferno::Test issue](https://github.com/inferno-framework/davinci-pas-test-kit/issues/11) for additional details. ) + simulation_verification input :pa_inquire_request_payload, title: 'PAS Inquire Request Payload', diff --git a/lib/davinci_pas_test_kit/generated/v2.0.1/pas_request_bundle/server_pas_request_bundle_validation_test.rb b/lib/davinci_pas_test_kit/generated/v2.0.1/pas_request_bundle/server_pas_request_bundle_validation_test.rb index 75d42b19..918d57f1 100644 --- a/lib/davinci_pas_test_kit/generated/v2.0.1/pas_request_bundle/server_pas_request_bundle_validation_test.rb +++ b/lib/davinci_pas_test_kit/generated/v2.0.1/pas_request_bundle/server_pas_request_bundle_validation_test.rb @@ -6,7 +6,7 @@ class ServerPasRequestBundleValidationTest < Inferno::Test include DaVinciPASTestKit::PasBundleValidation id :pas_server_v201_pas_request_bundle_validation_test - title '[USER INPUT VALIDATION] Request Bundle is valid' + title 'Request Bundle is valid' description %( **USER INPUT VALIDATION**: This test validates input provided by the user instead of the system under test. Errors encountered will be treated as a skip instead of a failure. @@ -39,6 +39,7 @@ class ServerPasRequestBundleValidationTest < Inferno::Test issue](https://github.com/inferno-framework/davinci-pas-test-kit/issues/11) for additional details. ) + simulation_verification input :pa_submit_request_payload, title: 'PAS Submit Request Payload', diff --git a/lib/davinci_pas_test_kit/generated/v2.0.1/pas_server_must_support_use_case_group.rb b/lib/davinci_pas_test_kit/generated/v2.0.1/pas_server_must_support_use_case_group.rb index fdc06475..473a51f2 100644 --- a/lib/davinci_pas_test_kit/generated/v2.0.1/pas_server_must_support_use_case_group.rb +++ b/lib/davinci_pas_test_kit/generated/v2.0.1/pas_server_must_support_use_case_group.rb @@ -112,7 +112,7 @@ def use_case - [PAS PractitionerRole](https://hl7.org/fhir/us/davinci-pas/STU2/StructureDefinition-profile-practitionerrole.html) ) run_as_group - + group do title 'Submission of claims to the $submit operation for must support validation' @@ -143,8 +143,9 @@ def use_case test from: :pas_server_v201_pas_response_bundle_validation_test end group do - title '[USER INPUT VALIDATION] Submit Request Must Support' + title 'Submit Request Must Support' verifies_requirements 'hl7.fhir.us.davinci-pas_2.0.1@35' + simulation_verification test from: :pas_server_submit_v201_must_support_requirement test from: :pas_server_submit_request_v201_pas_request_bundle_must_support_test @@ -205,7 +206,7 @@ def use_case - [PAS PractitionerRole](https://hl7.org/fhir/us/davinci-pas/STU2/StructureDefinition-profile-practitionerrole.html) ) run_as_group - + group do title 'Submission of claims to the $inquire operation for must support validation' @@ -236,8 +237,9 @@ def use_case test from: :pas_server_v201_pas_inquiry_response_bundle_validation_test end group do - title '[USER INPUT VALIDATION] Inquiry Request Must Support' + title 'Inquiry Request Must Support' verifies_requirements 'hl7.fhir.us.davinci-pas_2.0.1@36' + simulation_verification test from: :pas_server_inquire_request_v201_pas_inquiry_request_bundle_must_support_test test from: :pas_server_inquire_request_v201_claim_inquiry_must_support_test diff --git a/lib/davinci_pas_test_kit/generator/group_generator.rb b/lib/davinci_pas_test_kit/generator/group_generator.rb index b3bfdf16..e3b5ee1c 100644 --- a/lib/davinci_pas_test_kit/generator/group_generator.rb +++ b/lib/davinci_pas_test_kit/generator/group_generator.rb @@ -66,7 +66,7 @@ def title end end - def run_as_group + def run_as_group? return false if use_case.include?('must_support') && system == 'server' true @@ -219,19 +219,27 @@ def grouped_must_support_test_ids inquiry_operation = inquiry_request_validation_test_ids + inquiry_operation_test_ids + inquiry_response_validation_test_ids + submit_request_key = [ + 'Submit Request Must Support', + "#{' ' * 10}verifies_requirements 'hl7.fhir.us.davinci-pas_2.0.1@35'", + "#{' ' * 10}simulation_verification" + ].join("\n") + + inquiry_request_key = [ + 'Inquiry Request Must Support', + "#{' ' * 10}verifies_requirements 'hl7.fhir.us.davinci-pas_2.0.1@36'", + "#{' ' * 10}simulation_verification" + ].join("\n") + { '$submit Element Support' => { 'Submission of claims to the $submit operation for must support validation' => submit_tests, - "[USER INPUT VALIDATION] Submit Request Must Support'" \ - "\n#{' ' * 10}verifies_requirements " \ - "'hl7.fhir.us.davinci-pas_2.0.1@35" => submit_request_must_support_test_ids, + submit_request_key => submit_request_must_support_test_ids, 'Submit Response Must Support' => submit_response_must_support_test_ids }, '$inquire Element Support' => { 'Submission of claims to the $inquire operation for must support validation' => inquiry_operation, - "[USER INPUT VALIDATION] Inquiry Request Must Support'" \ - "\n#{' ' * 10}verifies_requirements " \ - "'hl7.fhir.us.davinci-pas_2.0.1@36" => inquiry_request_must_support_test_ids, + inquiry_request_key => inquiry_request_must_support_test_ids, 'Inquiry Response Must Support' => inquiry_response_must_support_test_ids } } diff --git a/lib/davinci_pas_test_kit/generator/must_support_test_generator.rb b/lib/davinci_pas_test_kit/generator/must_support_test_generator.rb index 051afcea..6cf9d806 100644 --- a/lib/davinci_pas_test_kit/generator/must_support_test_generator.rb +++ b/lib/davinci_pas_test_kit/generator/must_support_test_generator.rb @@ -125,7 +125,7 @@ def build_must_support_list_string(uscdi_only) choice[:extension_ids].each { |id| extension_names.delete(id.to_s) } if choice[:extension_ids].present? element_paths = choice[:paths].map { |path| "#{resource_type}.#{path}" }.join(' or ') - extension_ids = choice[:extension_ids].map(&:to_s).join(' or ') + extension_ids = choice[:extension_ids].join(' or ') element_names << "#{element_paths} or #{extension_ids}" end diff --git a/lib/davinci_pas_test_kit/generator/naming.rb b/lib/davinci_pas_test_kit/generator/naming.rb index 2f3c1c9b..d3054061 100644 --- a/lib/davinci_pas_test_kit/generator/naming.rb +++ b/lib/davinci_pas_test_kit/generator/naming.rb @@ -6,6 +6,7 @@ class Generator module Naming class << self include DaVinciPASTestKit::PASV201::ResourceList + def resources_with_multiple_profiles resources = [] RESOURCE_SUPPORTED_PROFILES.each do |resource, profile_list| diff --git a/lib/davinci_pas_test_kit/generator/operation_test_generator.rb b/lib/davinci_pas_test_kit/generator/operation_test_generator.rb index 4a0a7e74..056fccd8 100644 --- a/lib/davinci_pas_test_kit/generator/operation_test_generator.rb +++ b/lib/davinci_pas_test_kit/generator/operation_test_generator.rb @@ -82,7 +82,7 @@ def conformance_expectation read_interaction[:expectation] end - def skip_if_empty + def skip_if_empty? # Return true if a system must demonstrate at least one example of the resource type. # This drives omit vs. skip result statuses in this test. resource_type != 'Medication' @@ -141,7 +141,7 @@ def description Server SHALL support PAS #{operation_name} requests: a POST interaction to the /Claim/$#{operation} endpoint. This test submits a Prior Authorization #{operation_name} request to the server and verifies that a - response is returned with HTTP status 2XX.#{operation == 'submit' ? "\nThe server SHOULD respond within 15 seconds." : ''} + response is returned with HTTP status 2XX.#{"\nThe server SHOULD respond within 15 seconds." if operation == 'submit'} DESCRIPTION end end diff --git a/lib/davinci_pas_test_kit/generator/templates/group.rb.erb b/lib/davinci_pas_test_kit/generator/templates/group.rb.erb index 3125245f..03ea9579 100644 --- a/lib/davinci_pas_test_kit/generator/templates/group.rb.erb +++ b/lib/davinci_pas_test_kit/generator/templates/group.rb.erb @@ -12,7 +12,7 @@ module DaVinciPASTestKit <%- if verifies_requirements -%> verifies_requirements <%= verifies_requirements.map { |r| "'#{r}'" }.join(', ') %> <%- end -%> - <% if run_as_group %>run_as_group<% end %> + <% if run_as_group? %>run_as_group<% end %> <% if system == 'client'%> <% test_id_list.each do |id| %> test from: :<%= id %><% end %> @@ -112,9 +112,24 @@ module DaVinciPASTestKit - [PAS PractitionerRole](https://hl7.org/fhir/us/davinci-pas/STU2/StructureDefinition-profile-practitionerrole.html) )<% end %> run_as_group - <% subgroup.each do |category, id_list| %> - group do - title '<%= category%>' + <%- subgroup.each do |category, id_list| -%> +<%- + title_lines = category.to_s.split("\n").map(&:strip) + s = " group do\n" + s << " title '#{title_lines.shift.gsub("'","\\\\'")}'\n" + title_lines.each do |extra| + if extra.start_with?("verifies_requirements") + s << " #{extra}\n" + elsif extra == 'simulation_verification' + s << " simulation_verification\n" + else + s << " #{extra}\n" + end + end + s.rstrip! + s << "\n" +-%> +<%= "\n" + s -%> <% id_list.each do |id|%> test from: :<%= id%><% if must_support_rename_input?(id) %> do id :<%= alt_test_id(id, use_case) %> diff --git a/lib/davinci_pas_test_kit/generator/templates/validation.rb.erb b/lib/davinci_pas_test_kit/generator/templates/validation.rb.erb index d9315536..90d8f8ed 100644 --- a/lib/davinci_pas_test_kit/generator/templates/validation.rb.erb +++ b/lib/davinci_pas_test_kit/generator/templates/validation.rb.erb @@ -10,9 +10,12 @@ module DaVinciPASTestKit description %( <%=description.strip.gsub("\n", "\n" + " "*8) %> ) - <%- if verifies_requirements -%> +<% if simulation_verification? -%> + simulation_verification +<% end -%> +<% if verifies_requirements -%> verifies_requirements <%= verifies_requirements.map { |r| "'#{r}'" }.join(', ') %> - <%- end -%> +<% end -%> <% if request_type.include?('request') %> input :pa_<%= request_type %>_payload, title: 'PAS <%= request_type.humanize.titleize%> Payload', diff --git a/lib/davinci_pas_test_kit/generator/validation_test_generator.rb b/lib/davinci_pas_test_kit/generator/validation_test_generator.rb index a4132048..9baa9831 100644 --- a/lib/davinci_pas_test_kit/generator/validation_test_generator.rb +++ b/lib/davinci_pas_test_kit/generator/validation_test_generator.rb @@ -87,7 +87,7 @@ def conformance_expectation read_interaction[:expectation] end - def skip_if_empty + def skip_if_empty? # Return true if a system must demonstrate at least one example of the resource type. # This drives omit vs. skip result statuses in this test. resource_type != 'Medication' @@ -109,14 +109,17 @@ def generate end def title - pref = user_input? ? '[USER INPUT VALIDATION] ' : '' - "#{pref}#{group_metadata.title} is valid" + "#{group_metadata.title} is valid" end def user_input? request_type.include?('request') end + def simulation_verification? + user_input? + end + def verifies_requirements case test_id when 'pas_server_v201_pas_inquiry_response_bundle_validation_test' diff --git a/lib/davinci_pas_test_kit/pas_bundle_validation.rb b/lib/davinci_pas_test_kit/pas_bundle_validation.rb index a68cbfc0..be9dad74 100644 --- a/lib/davinci_pas_test_kit/pas_bundle_validation.rb +++ b/lib/davinci_pas_test_kit/pas_bundle_validation.rb @@ -358,14 +358,14 @@ def add_profile_to_instance(instance, profile_url, bundle_entry, version) def metadata_map(version) @metadata ||= YAML.load_file(File.join(__dir__, "generated/#{version}/metadata.yml"), aliases: true) - @metadata_map ||= @metadata[:groups].each_with_object({}) do |group, obj| - obj[group[:profile_url]] = Generator::GroupMetadata.new(group) + @metadata_map ||= @metadata[:groups].to_h do |group| + [group[:profile_url], Generator::GroupMetadata.new(group)] end end def bundle_entry_map(bundle_entry) - @bundle_entry_map ||= bundle_entry.each_with_object({}) do |entry, obj| - obj[entry.fullUrl] = entry + @bundle_entry_map ||= bundle_entry.to_h do |entry| + [entry.fullUrl, entry] end end @@ -479,7 +479,7 @@ def check_presence_of_referenced_resources(target_resource, base_url, resources_ value = target_resource.send(attr.to_sym) if value.is_a?(FHIR::Model) check_presence_of_referenced_resources(value, base_url, resources_to_match) - elsif value.is_a?(Array) && value.all? { |elmt| elmt.is_a?(FHIR::Model) } + elsif value.is_a?(Array) && value.all?(FHIR::Model) value.each { |elmt| check_presence_of_referenced_resources(elmt, base_url, resources_to_match) } end end diff --git a/lib/davinci_pas_test_kit/response_generator.rb b/lib/davinci_pas_test_kit/response_generator.rb index fd9a8910..c2186c0f 100644 --- a/lib/davinci_pas_test_kit/response_generator.rb +++ b/lib/davinci_pas_test_kit/response_generator.rb @@ -355,7 +355,7 @@ def referenced_entities(resource, entries, root_url) value.reference = match.fullUrl matches.concat([match], referenced_entities(match.resource, entries, root_url)) end - elsif value.is_a?(Array) && value.all? { |elmt| elmt.is_a?(FHIR::Model) } + elsif value.is_a?(Array) && value.all?(FHIR::Model) value.each { |val| matches.concat(referenced_entities(val, entries, root_url)) } end end diff --git a/spec/davinci_pas_test_kit/client/response_generator_spec.rb b/spec/davinci_pas_test_kit/client/response_generator_spec.rb index 121a2753..1f157d17 100644 --- a/spec/davinci_pas_test_kit/client/response_generator_spec.rb +++ b/spec/davinci_pas_test_kit/client/response_generator_spec.rb @@ -38,6 +38,7 @@ Class.new(Inferno::Test) do include DaVinciPASTestKit::ResponseGenerator include SubscriptionsTestKit::NotificationConformanceVerification + fhir_resource_validator do url ENV.fetch('FHIR_RESOURCE_VALIDATOR_URL') diff --git a/spec/davinci_pas_test_kit/v2.0.1/must_support_test_spec.rb b/spec/davinci_pas_test_kit/v2.0.1/must_support_test_spec.rb index 9fcfd251..c5d1616b 100644 --- a/spec/davinci_pas_test_kit/v2.0.1/must_support_test_spec.rb +++ b/spec/davinci_pas_test_kit/v2.0.1/must_support_test_spec.rb @@ -47,14 +47,16 @@ def run_expect_pass(runnable, bundle_resource, scratch_key) describe 'must support test' do context 'when PAS request bundle' do - scratch_key = 'submit_request_resources' + let(:scratch_key) { 'submit_request_resources' } + it 'passes if the request bundle contains all the must support specified in the PAS Request Bundle profile' do run_expect_pass(pas_request_bundle_must_support_test, FHIR.from_contents(json_pas_request_bundle), scratch_key) end end context 'when PAS response bundle' do - scratch_key = 'submit_response_resources' + let(:scratch_key) { 'submit_response_resources' } + it 'passes if the response bundle contains all the must support specified in the PAS Response Bundle profile' do run_expect_pass( pas_response_bundle_must_support_test, FHIR.from_contents(json_pas_response_bundle), scratch_key @@ -63,7 +65,8 @@ def run_expect_pass(runnable, bundle_resource, scratch_key) end context 'when PAS inquiry request bundle' do - scratch_key = 'inquire_request_resources' + let(:scratch_key) { 'inquire_request_resources' } + it 'passes if bundle contains all the must support specified in the PAS Inquiry Request Bundle profile' do run_expect_pass( pas_inquiry_request_bundle_must_support_test, FHIR.from_contents(json_pas_request_bundle), scratch_key @@ -72,7 +75,8 @@ def run_expect_pass(runnable, bundle_resource, scratch_key) end context 'when PAS inquiry response bundle' do - scratch_key = 'inquire_response_resources' + let(:scratch_key) { 'inquire_response_resources' } + it 'passes if bundle contains all the must support specified in the PAS Inquiry Response Bundle profile' do run_expect_pass( pas_inquiry_response_bundle_must_support_test, FHIR.from_contents(json_pas_response_bundle), scratch_key