diff --git a/lib/davinci_crd_test_kit/requirements/generated/crd_server_v221_requirements_coverage.csv b/lib/davinci_crd_test_kit/requirements/generated/crd_server_v221_requirements_coverage.csv index 0ff60314..fdff15b3 100644 --- a/lib/davinci_crd_test_kit/requirements/generated/crd_server_v221_requirements_coverage.csv +++ b/lib/davinci_crd_test_kit/requirements/generated/crd_server_v221_requirements_coverage.csv @@ -15,14 +15,14 @@ hl7.fhir.us.davinci-crd_2.2.1,covinfo-1,https://hl7.org/fhir/us/davinci-crd/2.2. hl7.fhir.us.davinci-crd_2.2.1,covinfo-2,https://hl7.org/fhir/us/davinci-crd/2.2.1/en/StructureDefinition-ext-coverage-information.html#ci-c-covinfo-2,"If there are multiple reason repetitions, each repetition **SHOULD** make clear exactly what aspect of the coverage information assertion the reason applies to.",SHOULD,CRD Server,true,,,"","" hl7.fhir.us.davinci-crd_2.2.1,dev-1,https://hl7.org/fhir/us/davinci-crd/2.2.1/en/deviations.html#ci-c-dev-1,CRD servers **SHALL** declare at least one supported CRD version for each supported hook.,SHALL,CRD Server,false,,,1.03,crd_server_v221-crd_v221_server_discovery_group-crd_v221_discovery_services_validation hl7.fhir.us.davinci-crd_2.2.1,dev-2,https://hl7.org/fhir/us/davinci-crd/2.2.1/en/deviations.html#ci-c-dev-2,"If the services endpoint can handle multiple CRD versions, it **SHALL** declare all versions it supports.",SHALL,CRD Server,true,,,"","" -hl7.fhir.us.davinci-crd_2.2.1,dev-4,https://hl7.org/fhir/us/davinci-crd/2.2.1/en/deviations.html#ci-c-dev-4,Each configuration option SHALL include four mandatory elements.,SHALL,CRD Server,false,,,"","" -hl7.fhir.us.davinci-crd_2.2.1,dev-5,https://hl7.org/fhir/us/davinci-crd/2.2.1/en/deviations.html#ci-c-dev-5,"CRD servers **SHALL**, at minimum, offer configuration options for each type of card they support (with a code corresponding to the [CRD Response Types](https://hl7.org/fhir/us/davinci-crd/2.2.1/en/ValueSet-cardType.html) ValueSet and a type of 'boolean', where setting the flag to false will result in the server not returning any cards of the specified type).",SHALL,CRD Server,false,,,"","" +hl7.fhir.us.davinci-crd_2.2.1,dev-4,https://hl7.org/fhir/us/davinci-crd/2.2.1/en/deviations.html#ci-c-dev-4,Each configuration option SHALL include four mandatory elements.,SHALL,CRD Server,false,,,1.04,crd_server_v221-crd_v221_server_discovery_group-crd_v221_discovery_configuration +hl7.fhir.us.davinci-crd_2.2.1,dev-5,https://hl7.org/fhir/us/davinci-crd/2.2.1/en/deviations.html#ci-c-dev-5,"CRD servers **SHALL**, at minimum, offer configuration options for each type of card they support (with a code corresponding to the [CRD Response Types](https://hl7.org/fhir/us/davinci-crd/2.2.1/en/ValueSet-cardType.html) ValueSet and a type of 'boolean', where setting the flag to false will result in the server not returning any cards of the specified type).",SHALL,CRD Server,false,,,1.04,crd_server_v221-crd_v221_server_discovery_group-crd_v221_discovery_configuration hl7.fhir.us.davinci-crd_2.2.1,dev-6,https://hl7.org/fhir/us/davinci-crd/2.2.1/en/deviations.html#ci-c-dev-6,"Guidance can be given about allowed combinations in descriptions, but CRD servers **SHALL** gracefully handle disallowed/nonsensical combinations.",SHALL,CRD Server,false,,,"","" -hl7.fhir.us.davinci-crd_2.2.1,dev-7,https://hl7.org/fhir/us/davinci-crd/2.2.1/en/deviations.html#ci-c-dev-7,Configuration codes **SHALL** be valid JSON property names and **SHALL** come from the [CRD Response Types](https://hl7.org/fhir/us/davinci-crd/2.2.1/en/ValueSet-cardType.html) list if an applicable type is in that list.,SHALL,CRD Server,true,,,"","" -hl7.fhir.us.davinci-crd_2.2.1,dev-8,https://hl7.org/fhir/us/davinci-crd/2.2.1/en/deviations.html#ci-c-dev-8,"Configuration codes, names, and descriptions **SHALL** be unique within a [CDS Service](http://cds-hooks.hl7.org/2026Jan/index.html#response) definition.",SHALL,CRD Server,false,,,"","" +hl7.fhir.us.davinci-crd_2.2.1,dev-7,https://hl7.org/fhir/us/davinci-crd/2.2.1/en/deviations.html#ci-c-dev-7,Configuration codes **SHALL** be valid JSON property names and **SHALL** come from the [CRD Response Types](https://hl7.org/fhir/us/davinci-crd/2.2.1/en/ValueSet-cardType.html) list if an applicable type is in that list.,SHALL,CRD Server,true,,,1.04,crd_server_v221-crd_v221_server_discovery_group-crd_v221_discovery_configuration +hl7.fhir.us.davinci-crd_2.2.1,dev-8,https://hl7.org/fhir/us/davinci-crd/2.2.1/en/deviations.html#ci-c-dev-8,"Configuration codes, names, and descriptions **SHALL** be unique within a [CDS Service](http://cds-hooks.hl7.org/2026Jan/index.html#response) definition.",SHALL,CRD Server,false,,,1.04,crd_server_v221-crd_v221_server_discovery_group-crd_v221_discovery_configuration hl7.fhir.us.davinci-crd_2.2.1,dev-9,https://hl7.org/fhir/us/davinci-crd/2.2.1/en/deviations.html#ci-c-dev-9,"Configuration codes, names, and descriptions **SHOULD** be consistent across different hooks supported by the same payer when dealing with the same types of configuration options.",SHOULD,CRD Server,false,,,"","" hl7.fhir.us.davinci-crd_2.2.1,dev-10,https://hl7.org/fhir/us/davinci-crd/2.2.1/en/deviations.html#ci-c-dev-10,CRD servers providing more than one type of coverage requirement information/guidance **SHOULD** expose configuration options allowing clients to dynamically control what information is returned by the service.,SHOULD,CRD Server,false,,,"","" -hl7.fhir.us.davinci-crd_2.2.1,dev-14,https://hl7.org/fhir/us/davinci-crd/2.2.1/en/deviations.html#ci-c-dev-14,CRD Servers **SHALL** behave in the manner prescribed by any supported configuration information received from the CRD Client.,SHALL,CRD Server,false,,,"","" +hl7.fhir.us.davinci-crd_2.2.1,dev-14,https://hl7.org/fhir/us/davinci-crd/2.2.1/en/deviations.html#ci-c-dev-14,CRD Servers **SHALL** behave in the manner prescribed by any supported configuration information received from the CRD Client.,SHALL,CRD Server,false,,,"3.1.3.11, 3.2.3.10, 3.3.3.10, 3.4.3.12, 3.5.3.11, 3.6.3.13","crd_server_v221-crd_v221_server_hooks-crd_v221_server_appointment_book-Group03-crd_v221_coverage_info_configuration, crd_server_v221-crd_v221_server_hooks-crd_v221_server_encounter_start-Group03-crd_v221_coverage_info_configuration, crd_server_v221-crd_v221_server_hooks-crd_v221_server_encounter_discharge-Group03-crd_v221_coverage_info_configuration, crd_server_v221-crd_v221_server_hooks-crd_v221_server_order_select-Group03-crd_v221_coverage_info_configuration, crd_server_v221-crd_v221_server_hooks-crd_v221_server_order_dispatch-Group03-crd_v221_coverage_info_configuration, crd_server_v221-crd_v221_server_hooks-crd_v221_server_order_sign-Group03-crd_v221_coverage_info_configuration" hl7.fhir.us.davinci-crd_2.2.1,dev-15,https://hl7.org/fhir/us/davinci-crd/2.2.1/en/deviations.html#ci-c-dev-15,CRD Servers **SHALL NOT** require the inclusion of configuration information in a hook call (i.e. no hook invocation is permitted to fail because configuration information was not included).,SHALL NOT,CRD Server,false,,,"","" hl7.fhir.us.davinci-crd_2.2.1,dev-17,https://hl7.org/fhir/us/davinci-crd/2.2.1/en/deviations.html#ci-c-dev-17,CRD Servers **SHALL** ignore unsupported configuration information.,SHALL,CRD Server,false,,,"","" hl7.fhir.us.davinci-crd_2.2.1,dev-19,https://hl7.org/fhir/us/davinci-crd/2.2.1/en/deviations.html#ci-c-dev-19,"When included with a Task, the creation of the Questionnaire needs to be conditional - it **SHOULD** only occur if that specific Questionnaire version does not already exist",SHOULD,CRD Server,false,,,"","" @@ -102,7 +102,7 @@ hl7.fhir.us.davinci-crd_2.2.1,resp-24,https://hl7.org/fhir/us/davinci-crd/2.2.1/ hl7.fhir.us.davinci-crd_2.2.1,resp-25,https://hl7.org/fhir/us/davinci-crd/2.2.1/en/cards.html#ci-c-resp-25,"Regardless of the content, this ""Coverage Information"" response type **SHALL NOT** use a card.",SHALL NOT,CRD Server,false,,,"3.1.3.07, 3.5.3.07, 3.6.3.07","crd_server_v221-crd_v221_server_hooks-crd_v221_server_appointment_book-Group03-crd_v221_coverage_info_system_action_validation, crd_server_v221-crd_v221_server_hooks-crd_v221_server_order_dispatch-Group03-crd_v221_coverage_info_system_action_validation, crd_server_v221-crd_v221_server_hooks-crd_v221_server_order_sign-Group03-crd_v221_coverage_info_system_action_validation" hl7.fhir.us.davinci-crd_2.2.1,resp-26,https://hl7.org/fhir/us/davinci-crd/2.2.1/en/cards.html#ci-c-resp-26,"CRD servers **SHALL** support supplying coverage information for all primary hooks: order-sign, order-dispatch, and appointment-book.",SHALL,CRD Server,false,,,"3.1.3.06, 3.5.3.06, 3.6.3.06","crd_server_v221-crd_v221_server_hooks-crd_v221_server_appointment_book-Group03-crd_v221_coverage_info_system_action_received, crd_server_v221-crd_v221_server_hooks-crd_v221_server_order_dispatch-Group03-crd_v221_coverage_info_system_action_received, crd_server_v221-crd_v221_server_hooks-crd_v221_server_order_sign-Group03-crd_v221_coverage_info_system_action_received" hl7.fhir.us.davinci-crd_2.2.1,resp-27,https://hl7.org/fhir/us/davinci-crd/2.2.1/en/cards.html#ci-c-resp-27,CRD servers **MAY** support supplying coverage information for all other (non-primary) hooks.,MAY,CRD Server,false,,,"","" -hl7.fhir.us.davinci-crd_2.2.1,resp-28,https://hl7.org/fhir/us/davinci-crd/2.2.1/en/cards.html#ci-c-resp-28,CRD servers **SHALL** supply coverage information for all hooks where they support it unless the EHR sends a configuration option asking them not to.,SHALL,CRD Server,true,,,"","" +hl7.fhir.us.davinci-crd_2.2.1,resp-28,https://hl7.org/fhir/us/davinci-crd/2.2.1/en/cards.html#ci-c-resp-28,CRD servers **SHALL** supply coverage information for all hooks where they support it unless the EHR sends a configuration option asking them not to.,SHALL,CRD Server,true,,,"3.1.3.08, 3.1.3.11, 3.2.3.10, 3.3.3.10, 3.4.3.12, 3.5.3.08, 3.5.3.11, 3.6.3.08, 3.6.3.13","crd_server_v221-crd_v221_server_hooks-crd_v221_server_appointment_book-Group03-crd_v221_all_responses_include_coverage_information, crd_server_v221-crd_v221_server_hooks-crd_v221_server_appointment_book-Group03-crd_v221_coverage_info_configuration, crd_server_v221-crd_v221_server_hooks-crd_v221_server_encounter_start-Group03-crd_v221_coverage_info_configuration, crd_server_v221-crd_v221_server_hooks-crd_v221_server_encounter_discharge-Group03-crd_v221_coverage_info_configuration, crd_server_v221-crd_v221_server_hooks-crd_v221_server_order_select-Group03-crd_v221_coverage_info_configuration, crd_server_v221-crd_v221_server_hooks-crd_v221_server_order_dispatch-Group03-crd_v221_order_dispatch_coverage_information, crd_server_v221-crd_v221_server_hooks-crd_v221_server_order_dispatch-Group03-crd_v221_coverage_info_configuration, crd_server_v221-crd_v221_server_hooks-crd_v221_server_order_sign-Group03-crd_v221_all_responses_include_coverage_information, crd_server_v221-crd_v221_server_hooks-crd_v221_server_order_sign-Group03-crd_v221_coverage_info_configuration" hl7.fhir.us.davinci-crd_2.2.1,resp-29,https://hl7.org/fhir/us/davinci-crd/2.2.1/en/cards.html#ci-c-resp-29,"If coverage information is evaluated, a system action **SHALL** be returned for each in-scope request resource unless that request resource already has a coverage-information extension, and the CRD server has no new information to add.",SHALL,CRD Server,true,,,"3.1.3.08, 3.5.3.08, 3.6.3.08","crd_server_v221-crd_v221_server_hooks-crd_v221_server_appointment_book-Group03-crd_v221_all_responses_include_coverage_information, crd_server_v221-crd_v221_server_hooks-crd_v221_server_order_dispatch-Group03-crd_v221_order_dispatch_coverage_information, crd_server_v221-crd_v221_server_hooks-crd_v221_server_order_sign-Group03-crd_v221_all_responses_include_coverage_information" hl7.fhir.us.davinci-crd_2.2.1,resp-30,https://hl7.org/fhir/us/davinci-crd/2.2.1/en/cards.html#ci-c-resp-30,Such qualifiers around when the coverage assertion is considered valid **SHALL** be included as part of the annotation.,SHALL,CRD Server,false,,,"","" hl7.fhir.us.davinci-crd_2.2.1,resp-32,https://hl7.org/fhir/us/davinci-crd/2.2.1/en/cards.html#ci-c-resp-32,"If multiple extension repetitions of the coverage-information extension are present, all repetitions referencing differing insurance (coverage-information.coverage) **SHALL** have distinct coverage-assertion-ids and satisfied-pa-ids, if present.",SHALL,CRD Server,true,,,"3.2.3.07, 3.3.3.07, 3.4.3.07","crd_server_v221-crd_v221_server_hooks-crd_v221_server_encounter_start-Group03-crd_v221_coverage_info_system_action_validation, crd_server_v221-crd_v221_server_hooks-crd_v221_server_encounter_discharge-Group03-crd_v221_coverage_info_system_action_validation, crd_server_v221-crd_v221_server_hooks-crd_v221_server_order_select-Group03-crd_v221_coverage_info_system_action_validation" diff --git a/lib/davinci_crd_test_kit/server/v2.2.1/discovery/discovery_configuration_test.rb b/lib/davinci_crd_test_kit/server/v2.2.1/discovery/discovery_configuration_test.rb index 18f8c032..1ee6eccc 100644 --- a/lib/davinci_crd_test_kit/server/v2.2.1/discovery/discovery_configuration_test.rb +++ b/lib/davinci_crd_test_kit/server/v2.2.1/discovery/discovery_configuration_test.rb @@ -14,6 +14,11 @@ class DiscoveryConfigurationTest < Inferno::Test expected to return cards, so they are ignored in this test. ) + verifies_requirements 'hl7.fhir.us.davinci-crd_2.2.1@dev-4', + 'hl7.fhir.us.davinci-crd_2.2.1@dev-5', + 'hl7.fhir.us.davinci-crd_2.2.1@dev-7', + 'hl7.fhir.us.davinci-crd_2.2.1@dev-8' + input :cds_services input :crd_discovery_service_ignore_list, optional: true @@ -124,12 +129,21 @@ def verify_required_fields(hook, service) end primary_hook_services.each do |service| - coverage_info_config_found = - service.dig('extension', 'davinci-crd.configuration-options')&.any? do |config_option| + coverage_info_config = + service.dig('extension', 'davinci-crd.configuration-options')&.find do |config_option| config_option['code'] == 'coverage-info' end - next if coverage_info_config_found + if coverage_info_config.present? + if coverage_info_config['type'] != 'boolean' + add_message( + 'error', + "Service `#{service['id']}` `coverage-info` configuration option is not of type boolean" + ) + end + + next + end add_message( 'error', diff --git a/lib/davinci_crd_test_kit/server/v2.2.1/server_appointment_book_group.rb b/lib/davinci_crd_test_kit/server/v2.2.1/server_appointment_book_group.rb index 1a28ae3f..79985c6b 100644 --- a/lib/davinci_crd_test_kit/server/v2.2.1/server_appointment_book_group.rb +++ b/lib/davinci_crd_test_kit/server/v2.2.1/server_appointment_book_group.rb @@ -174,6 +174,7 @@ class ServerAppointmentBookGroup < Inferno::TestGroup test from: :crd_v221_all_responses_include_coverage_information, verifies_requirements: [ 'hl7.fhir.us.davinci-crd_2.2.1@hook-16', + 'hl7.fhir.us.davinci-crd_2.2.1@resp-28', 'hl7.fhir.us.davinci-crd_2.2.1@hook-26', 'hl7.fhir.us.davinci-crd_2.2.1@resp-29' ] diff --git a/lib/davinci_crd_test_kit/server/v2.2.1/server_order_dispatch_group.rb b/lib/davinci_crd_test_kit/server/v2.2.1/server_order_dispatch_group.rb index 50a14faa..3d9e3ab6 100644 --- a/lib/davinci_crd_test_kit/server/v2.2.1/server_order_dispatch_group.rb +++ b/lib/davinci_crd_test_kit/server/v2.2.1/server_order_dispatch_group.rb @@ -174,6 +174,7 @@ class ServerOrderDispatchGroup < Inferno::TestGroup test from: :crd_v221_order_dispatch_coverage_information, verifies_requirements: [ 'hl7.fhir.us.davinci-crd_2.2.1@hook-16', + 'hl7.fhir.us.davinci-crd_2.2.1@resp-28', 'hl7.fhir.us.davinci-crd_2.2.1@hook-33', 'hl7.fhir.us.davinci-crd_2.2.1@resp-29' ] diff --git a/lib/davinci_crd_test_kit/server/v2.2.1/server_order_sign_group.rb b/lib/davinci_crd_test_kit/server/v2.2.1/server_order_sign_group.rb index f305907e..5a20bc72 100644 --- a/lib/davinci_crd_test_kit/server/v2.2.1/server_order_sign_group.rb +++ b/lib/davinci_crd_test_kit/server/v2.2.1/server_order_sign_group.rb @@ -180,6 +180,7 @@ class ServerOrderSignGroup < Inferno::TestGroup test from: :crd_v221_all_responses_include_coverage_information, verifies_requirements: [ 'hl7.fhir.us.davinci-crd_2.2.1@hook-16', + 'hl7.fhir.us.davinci-crd_2.2.1@resp-28', # This requirement has a typo. It says 'order-select' but it # should be 'order-sign'. # https://jira.hl7.org/browse/FHIR-56985 diff --git a/lib/davinci_crd_test_kit/server/v2.2.1/verify_response/all_responses_include_coverage_information_test.rb b/lib/davinci_crd_test_kit/server/v2.2.1/verify_response/all_responses_include_coverage_information_test.rb index a30e3cd3..837cce15 100644 --- a/lib/davinci_crd_test_kit/server/v2.2.1/verify_response/all_responses_include_coverage_information_test.rb +++ b/lib/davinci_crd_test_kit/server/v2.2.1/verify_response/all_responses_include_coverage_information_test.rb @@ -31,7 +31,8 @@ class AllResponsesIncludeCoverageInformationTest < Inferno::Test coverage information system action ) - verifies_requirements 'hl7.fhir.us.davinci-crd_2.2.1@hook-16' + verifies_requirements 'hl7.fhir.us.davinci-crd_2.2.1@hook-16', + 'hl7.fhir.us.davinci-crd_2.2.1@resp-28' input :invoked_hook diff --git a/lib/davinci_crd_test_kit/server/v2.2.1/verify_response/coverage_info_configuration_test.rb b/lib/davinci_crd_test_kit/server/v2.2.1/verify_response/coverage_info_configuration_test.rb index b48ebb3e..2079bc2b 100644 --- a/lib/davinci_crd_test_kit/server/v2.2.1/verify_response/coverage_info_configuration_test.rb +++ b/lib/davinci_crd_test_kit/server/v2.2.1/verify_response/coverage_info_configuration_test.rb @@ -21,6 +21,9 @@ class CoverageInfoConfigurationTest < Inferno::Test coverage-information/form-completion system actions. ) + verifies_requirements 'hl7.fhir.us.davinci-crd_2.2.1@dev-14', + 'hl7.fhir.us.davinci-crd_2.2.1@resp-28' + def coverage_info_message(cards, actions) card_summaries = cards.map { |card| card['summary'] }.compact action_descriptions = actions.map { |action| action['description'] }.compact diff --git a/spec/davinci_crd_test_kit/v2.2.1/discovery_configuration_test_spec.rb b/spec/davinci_crd_test_kit/v2.2.1/discovery_configuration_test_spec.rb index 55f2862b..deef550c 100644 --- a/spec/davinci_crd_test_kit/v2.2.1/discovery_configuration_test_spec.rb +++ b/spec/davinci_crd_test_kit/v2.2.1/discovery_configuration_test_spec.rb @@ -151,4 +151,19 @@ expect(result.result).to eq('pass'), result.result_message end + + it 'fails if the coverage-info configuration option is not type boolean' do + config_option = valid_config_option + config_option['type'] = 'integer' + + cds_services['services'].first['extension'] = + { + 'davinci-crd.configuration-options' => [config_option] + } + + result = run(runnable, cds_services: cds_services.to_json) + + expect(result.result).to eq('fail'), result.result_message + expect(first_error_message.message).to match(/is not of type boolean/) + end end