davinci_crd_test_kit 0.14.1 → 0.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/config/presets/{inferno_crd_server_suite.json.erb → client_against_inferno_crd_server_suite.json.erb} +0 -33
- data/config/presets/{ri_crd_request_generator.json.erb → client_against_ri_crd_request_generator.json.erb} +1 -14
- data/config/presets/client_v221_against_inferno_crd_server_suite.json.erb +96 -0
- data/config/presets/client_v221_against_ri_br_provider.json.erb +31 -0
- data/config/presets/{ri_crd_request_generator.json_v221.json.erb → client_v221_against_ri_crd_request_generator.json.erb} +1 -1
- data/config/presets/{inferno_crd_client_suite.json.erb → server_against_inferno_crd_client_suite.json.erb} +0 -43
- data/config/presets/{ri_crd_server.json.erb → server_against_ri_crd_server.json.erb} +1 -44
- data/config/presets/{inferno_crd_client_suite_v221.json.erb → server_v221_against_inferno_crd_client_suite.json.erb} +1 -62
- data/config/presets/{inferno_crd_client_suite_prefetch_subset_v221.json.erb → server_v221_against_inferno_crd_client_suite_prefetch_subset.json.erb} +1 -47
- data/config/presets/server_v221_against_inferno_g31_suite.json.erb +49 -0
- data/lib/davinci_crd_test_kit/client/client_base_urls.rb +5 -0
- data/lib/davinci_crd_test_kit/client/client_input_helper.rb +102 -0
- data/lib/davinci_crd_test_kit/client/client_wait_messages.rb +68 -0
- data/lib/davinci_crd_test_kit/client/cross_hook_helper.rb +26 -0
- data/lib/davinci_crd_test_kit/client/endpoints/custom_service_response.rb +32 -17
- data/lib/davinci_crd_test_kit/client/endpoints/hook_request_data_access.rb +228 -0
- data/lib/davinci_crd_test_kit/client/endpoints/hook_request_endpoint.rb +172 -56
- data/lib/davinci_crd_test_kit/client/endpoints/mock_service_response.rb +29 -29
- data/lib/davinci_crd_test_kit/client/endpoints/scenario_service_response.rb +54 -0
- data/lib/davinci_crd_test_kit/client/endpoints/v201_hook_request_data_gathering.rb +219 -0
- data/lib/davinci_crd_test_kit/client/endpoints/v221_hook_request_data_gathering.rb +172 -0
- data/lib/davinci_crd_test_kit/client/jwt_claim_types.rb +28 -0
- data/lib/davinci_crd_test_kit/client/multi_request_message_helper.rb +1 -1
- data/lib/davinci_crd_test_kit/client/prefetched_coverage_payer_helper.rb +81 -0
- data/lib/davinci_crd_test_kit/client/prefetched_coverage_value.rb +14 -0
- data/lib/davinci_crd_test_kit/client/tagged_request_load_helper.rb +14 -25
- data/lib/davinci_crd_test_kit/client/v2.0.1/auth/retrieve_jwks_test.rb +36 -24
- data/lib/davinci_crd_test_kit/client/v2.0.1/auth/token_header_test.rb +14 -4
- data/lib/davinci_crd_test_kit/client/v2.0.1/auth/token_payload_test.rb +42 -22
- data/lib/davinci_crd_test_kit/client/v2.0.1/cds-services-v201.json +21 -21
- data/lib/davinci_crd_test_kit/client/v2.0.1/client_appointment_book_group.rb +12 -10
- data/lib/davinci_crd_test_kit/client/v2.0.1/client_encounter_discharge_group.rb +12 -10
- data/lib/davinci_crd_test_kit/client/v2.0.1/client_encounter_start_group.rb +12 -10
- data/lib/davinci_crd_test_kit/client/v2.0.1/client_fhir_api_group.rb +2 -2
- data/lib/davinci_crd_test_kit/client/v2.0.1/client_hooks_group.rb +7 -10
- data/lib/davinci_crd_test_kit/client/v2.0.1/client_order_dispatch_group.rb +12 -10
- data/lib/davinci_crd_test_kit/client/v2.0.1/client_order_select_group.rb +12 -10
- data/lib/davinci_crd_test_kit/client/v2.0.1/client_order_sign_group.rb +12 -10
- data/lib/davinci_crd_test_kit/client/v2.0.1/crd_client_suite.rb +2 -2
- data/lib/davinci_crd_test_kit/client/v2.0.1/invocation/appointment_book_receive_request_test.rb +10 -31
- data/lib/davinci_crd_test_kit/client/v2.0.1/invocation/encounter_discharge_receive_request_test.rb +10 -31
- data/lib/davinci_crd_test_kit/client/v2.0.1/invocation/encounter_start_receive_request_test.rb +8 -29
- data/lib/davinci_crd_test_kit/client/v2.0.1/invocation/order_dispatch_receive_request_test.rb +10 -31
- data/lib/davinci_crd_test_kit/client/v2.0.1/invocation/order_select_receive_request_test.rb +8 -29
- data/lib/davinci_crd_test_kit/client/v2.0.1/invocation/order_sign_receive_request_test.rb +10 -31
- data/lib/davinci_crd_test_kit/client/v2.0.1/must_support/client_card_must_support_coverage_information.rb +3 -36
- data/lib/davinci_crd_test_kit/client/v2.0.1/must_support/client_card_must_support_external_reference.rb +3 -36
- data/lib/davinci_crd_test_kit/client/v2.0.1/must_support/client_card_must_support_instructions.rb +3 -36
- data/lib/davinci_crd_test_kit/client/v2.0.1/registration/client_registration_verification_test.rb +3 -7
- data/lib/davinci_crd_test_kit/client/v2.0.1/registration/client_service_registration_attestation_test.rb +11 -3
- data/lib/davinci_crd_test_kit/client/v2.0.1/verify_request/hook_request_fetched_data_test.rb +4 -13
- data/lib/davinci_crd_test_kit/client/v2.0.1/verify_request/hook_request_optional_fields_test.rb +1 -1
- data/lib/davinci_crd_test_kit/client/v2.0.1/verify_request/hook_request_prefetch_equals_queried_test.rb +3 -13
- data/lib/davinci_crd_test_kit/client/v2.0.1/verify_response/client_display_cards_attest.rb +7 -17
- data/lib/davinci_crd_test_kit/client/v2.0.1/verify_response/inferno_response_validation.rb +4 -14
- data/lib/davinci_crd_test_kit/client/v2.2.1/api/client_coverage_info_update_test.rb +10 -10
- data/lib/davinci_crd_test_kit/client/v2.2.1/api/client_crd_update_verification_group.rb +1 -1
- data/lib/davinci_crd_test_kit/client/v2.2.1/attestations/attestation_instructions.rb +10 -0
- data/lib/davinci_crd_test_kit/client/v2.2.1/attestations/client_coverage_based_invocation_attestation_test.rb +44 -0
- data/lib/davinci_crd_test_kit/client/v2.2.1/attestations/client_data_element_expectations_attestation_test.rb +44 -0
- data/lib/davinci_crd_test_kit/client/v2.2.1/attestations/client_hook_invocation_logging_attestation_test.rb +43 -0
- data/lib/davinci_crd_test_kit/client/v2.2.1/attestations/client_must_support_use_attestation_test.rb +41 -0
- data/lib/davinci_crd_test_kit/client/v2.2.1/attestations/client_prefetch_key_omission_attestation_test.rb +43 -0
- data/lib/davinci_crd_test_kit/client/v2.2.1/attestations/client_resource_identifiers_attestation_test.rb +43 -0
- data/lib/davinci_crd_test_kit/client/v2.2.1/attestations/client_response_case_distinction_attestation_test.rb +43 -0
- data/lib/davinci_crd_test_kit/client/v2.2.1/attestations/client_security_and_privacy_attestation_test.rb +43 -0
- data/lib/davinci_crd_test_kit/client/v2.2.1/attestations/client_workflow_integration_attestation_test.rb +44 -0
- data/lib/davinci_crd_test_kit/client/v2.2.1/auth/decode_auth_token_test.rb +4 -2
- data/lib/davinci_crd_test_kit/client/v2.2.1/auth/retrieve_jwks_test.rb +47 -26
- data/lib/davinci_crd_test_kit/client/v2.2.1/auth/token_header_test.rb +32 -6
- data/lib/davinci_crd_test_kit/client/v2.2.1/auth/token_payload_test.rb +60 -33
- data/lib/davinci_crd_test_kit/client/v2.2.1/cds-services-prefetch-subset-v221.json +48 -48
- data/lib/davinci_crd_test_kit/client/v2.2.1/cds-services-v221.json +51 -51
- data/lib/davinci_crd_test_kit/client/v2.2.1/client_appointment_book_group.rb +24 -15
- data/lib/davinci_crd_test_kit/client/v2.2.1/client_attestations_group.rb +43 -0
- data/lib/davinci_crd_test_kit/client/v2.2.1/client_cross_hook_group.rb +28 -9
- data/lib/davinci_crd_test_kit/client/v2.2.1/client_cross_hook_interaction_group.rb +106 -0
- data/lib/davinci_crd_test_kit/client/v2.2.1/client_encounter_discharge_group.rb +20 -11
- data/lib/davinci_crd_test_kit/client/v2.2.1/client_encounter_start_group.rb +20 -11
- data/lib/davinci_crd_test_kit/client/v2.2.1/client_fhir_api_group.rb +39 -15
- data/lib/davinci_crd_test_kit/client/v2.2.1/client_hooks_group.rb +16 -19
- data/lib/davinci_crd_test_kit/client/v2.2.1/client_long_running_hook_group.rb +5 -4
- data/lib/davinci_crd_test_kit/client/v2.2.1/client_multiple_payers_hook_group.rb +40 -0
- data/lib/davinci_crd_test_kit/client/v2.2.1/client_order_dispatch_group.rb +23 -14
- data/lib/davinci_crd_test_kit/client/v2.2.1/client_order_select_group.rb +19 -10
- data/lib/davinci_crd_test_kit/client/v2.2.1/client_order_sign_group.rb +23 -14
- data/lib/davinci_crd_test_kit/client/v2.2.1/client_registration_group.rb +7 -7
- data/lib/davinci_crd_test_kit/client/v2.2.1/client_scenarios_group.rb +32 -0
- data/lib/davinci_crd_test_kit/client/v2.2.1/client_self_pay_hook_group.rb +34 -0
- data/lib/davinci_crd_test_kit/client/v2.2.1/client_unknown_content_hook_group.rb +34 -0
- data/lib/davinci_crd_test_kit/client/v2.2.1/client_user_access_level_group.rb +82 -0
- data/lib/davinci_crd_test_kit/client/v2.2.1/crd_client_suite.rb +26 -6
- data/lib/davinci_crd_test_kit/client/v2.2.1/cross_hook/client_card_must_support_coverage_information_test.rb +5 -5
- data/lib/davinci_crd_test_kit/client/v2.2.1/cross_hook/client_fhirpath_collection_as_comma_delimited_string_test.rb +7 -14
- data/lib/davinci_crd_test_kit/client/v2.2.1/cross_hook/client_hook_instances_unique_test.rb +3 -11
- data/lib/davinci_crd_test_kit/client/v2.2.1/cross_hook/client_jwt_ids_unique_test.rb +89 -0
- data/lib/davinci_crd_test_kit/client/v2.2.1/cross_hook/client_location_address_propagation_test.rb +65 -31
- data/lib/davinci_crd_test_kit/client/v2.2.1/cross_hook/client_order_types_signed_test.rb +101 -0
- data/lib/davinci_crd_test_kit/client/v2.2.1/cross_hook/client_prefetch_complete_and_subset_test.rb +13 -35
- data/lib/davinci_crd_test_kit/client/v2.2.1/invocation/appointment_book_receive_request_test.rb +17 -116
- data/lib/davinci_crd_test_kit/client/v2.2.1/invocation/base_hook_invocation_receive_request_test.rb +182 -0
- data/lib/davinci_crd_test_kit/client/v2.2.1/invocation/cross_hooks_receive_request_test.rb +126 -0
- data/lib/davinci_crd_test_kit/client/v2.2.1/invocation/encounter_discharge_receive_request_test.rb +17 -117
- data/lib/davinci_crd_test_kit/client/v2.2.1/invocation/encounter_start_receive_request_test.rb +17 -117
- data/lib/davinci_crd_test_kit/client/v2.2.1/invocation/order_dispatch_receive_request_test.rb +17 -125
- data/lib/davinci_crd_test_kit/client/v2.2.1/invocation/order_select_receive_request_test.rb +17 -125
- data/lib/davinci_crd_test_kit/client/v2.2.1/invocation/order_sign_receive_request_test.rb +17 -125
- data/lib/davinci_crd_test_kit/client/v2.2.1/long_running/client_long_running_receive_request_test.rb +52 -32
- data/lib/davinci_crd_test_kit/client/v2.2.1/long_running/client_skip_long_running_attestation_test.rb +12 -12
- data/lib/davinci_crd_test_kit/client/v2.2.1/multiple_payers/client_multiple_payers_request_verification_test.rb +215 -0
- data/lib/davinci_crd_test_kit/client/v2.2.1/multiple_payers/client_multiple_payers_workflow_test.rb +71 -0
- data/lib/davinci_crd_test_kit/client/v2.2.1/must_support/generated/appointment_must_support_test.rb +84 -0
- data/lib/davinci_crd_test_kit/client/v2.2.1/must_support/generated/appointment_reference_resolution_test.rb +82 -0
- data/lib/davinci_crd_test_kit/client/v2.2.1/must_support/generated/client_cross_hook_must_support_group.rb +181 -0
- data/lib/davinci_crd_test_kit/client/v2.2.1/must_support/generated/communication_request_must_support_test.rb +69 -0
- data/lib/davinci_crd_test_kit/client/v2.2.1/must_support/generated/communication_request_reference_resolution_test.rb +79 -0
- data/lib/davinci_crd_test_kit/client/v2.2.1/must_support/generated/coverage_must_support_test.rb +73 -0
- data/lib/davinci_crd_test_kit/client/v2.2.1/must_support/generated/coverage_reference_resolution_test.rb +67 -0
- data/lib/davinci_crd_test_kit/client/v2.2.1/must_support/generated/device_must_support_test.rb +59 -0
- data/lib/davinci_crd_test_kit/client/v2.2.1/must_support/generated/device_request_must_support_test.rb +72 -0
- data/lib/davinci_crd_test_kit/client/v2.2.1/must_support/generated/device_request_reference_resolution_test.rb +76 -0
- data/lib/davinci_crd_test_kit/client/v2.2.1/must_support/generated/encounter_must_support_test.rb +83 -0
- data/lib/davinci_crd_test_kit/client/v2.2.1/must_support/generated/encounter_reference_resolution_test.rb +76 -0
- data/lib/davinci_crd_test_kit/client/v2.2.1/must_support/generated/location_must_support_test.rb +63 -0
- data/lib/davinci_crd_test_kit/client/v2.2.1/must_support/generated/location_reference_resolution_test.rb +60 -0
- data/lib/davinci_crd_test_kit/client/v2.2.1/must_support/generated/medication_must_support_test.rb +54 -0
- data/lib/davinci_crd_test_kit/client/v2.2.1/must_support/generated/medication_request_must_support_test.rb +95 -0
- data/lib/davinci_crd_test_kit/client/v2.2.1/must_support/generated/medication_request_reference_resolution_test.rb +79 -0
- data/lib/davinci_crd_test_kit/client/v2.2.1/must_support/generated/nutrition_order_must_support_test.rb +136 -0
- data/lib/davinci_crd_test_kit/client/v2.2.1/must_support/generated/nutrition_order_reference_resolution_test.rb +67 -0
- data/lib/davinci_crd_test_kit/client/v2.2.1/must_support/generated/organization_must_support_test.rb +66 -0
- data/lib/davinci_crd_test_kit/client/v2.2.1/must_support/generated/organization_reference_resolution_test.rb +60 -0
- data/lib/davinci_crd_test_kit/client/v2.2.1/must_support/generated/patient_must_support_test.rb +69 -0
- data/lib/davinci_crd_test_kit/client/v2.2.1/must_support/generated/practitioner_must_support_test.rb +65 -0
- data/lib/davinci_crd_test_kit/client/v2.2.1/must_support/generated/practitioner_role_must_support_test.rb +60 -0
- data/lib/davinci_crd_test_kit/client/v2.2.1/must_support/generated/practitioner_role_reference_resolution_test.rb +66 -0
- data/lib/davinci_crd_test_kit/client/v2.2.1/must_support/generated/service_request_must_support_test.rb +93 -0
- data/lib/davinci_crd_test_kit/client/v2.2.1/must_support/generated/service_request_reference_resolution_test.rb +81 -0
- data/lib/davinci_crd_test_kit/client/v2.2.1/must_support/generated/vision_prescription_must_support_test.rb +79 -0
- data/lib/davinci_crd_test_kit/client/v2.2.1/must_support/generated/vision_prescription_reference_resolution_test.rb +65 -0
- data/lib/davinci_crd_test_kit/client/v2.2.1/must_support/request_must_support_reference_resolution.rb +379 -0
- data/lib/davinci_crd_test_kit/client/v2.2.1/must_support/request_must_support_scope.rb +66 -0
- data/lib/davinci_crd_test_kit/client/v2.2.1/must_support/request_must_support_with_attestation_option.rb +331 -0
- data/lib/davinci_crd_test_kit/client/v2.2.1/registration/client_registration_verification_test.rb +16 -30
- data/lib/davinci_crd_test_kit/client/v2.2.1/registration/client_service_registration_attestation_test.rb +84 -39
- data/lib/davinci_crd_test_kit/client/v2.2.1/self_pay/client_self_pay_workflow_test.rb +62 -0
- data/lib/davinci_crd_test_kit/client/v2.2.1/unknown_content/client_unknown_content_attestation_test.rb +99 -0
- data/lib/davinci_crd_test_kit/client/v2.2.1/unknown_content/client_unknown_content_receive_request_test.rb +67 -0
- data/lib/davinci_crd_test_kit/client/v2.2.1/user_access_level/access_level_api_access_test.rb +124 -0
- data/lib/davinci_crd_test_kit/client/v2.2.1/user_access_level/access_level_prefetch_scope_test.rb +85 -0
- data/lib/davinci_crd_test_kit/client/v2.2.1/user_access_level/access_level_receive_request_test.rb +92 -0
- data/lib/davinci_crd_test_kit/client/v2.2.1/user_access_level/access_level_same_scenario_test.rb +340 -0
- data/lib/davinci_crd_test_kit/client/v2.2.1/user_access_level/access_level_target_reference.rb +16 -0
- data/lib/davinci_crd_test_kit/client/v2.2.1/verify_request/hook_request_conformance_test.rb +64 -7
- data/lib/davinci_crd_test_kit/client/v2.2.1/verify_request/hook_request_coverage_verification_test.rb +31 -73
- data/lib/davinci_crd_test_kit/client/v2.2.1/verify_request/hook_request_data_fetch_verification_test.rb +13 -3
- data/lib/davinci_crd_test_kit/client/v2.2.1/verify_request/hook_request_granted_scopes_test.rb +8 -8
- data/lib/davinci_crd_test_kit/client/v2.2.1/verify_request/hook_request_prefetch_complete_test.rb +12 -14
- data/lib/davinci_crd_test_kit/client/v2.2.1/verify_request/hook_request_prefetch_profiles_test.rb +3 -3
- data/lib/davinci_crd_test_kit/client/v2.2.1/verify_request/hook_request_requested_version_test.rb +17 -5
- data/lib/davinci_crd_test_kit/client/v2.2.1/verify_request/hook_request_secured_transport_test.rb +2 -2
- data/lib/davinci_crd_test_kit/client/v2.2.1/verify_response/client_display_cards_attest.rb +59 -27
- data/lib/davinci_crd_test_kit/client/v2.2.1/verify_response/hook_response_support_coverage_information_test.rb +4 -4
- data/lib/davinci_crd_test_kit/client/v2.2.1/verify_response/inferno_response_validation.rb +13 -11
- data/lib/davinci_crd_test_kit/cross_suite/base_urls.rb +12 -0
- data/lib/davinci_crd_test_kit/cross_suite/cards_identification.rb +18 -2
- data/lib/davinci_crd_test_kit/cross_suite/fhirpath_on_cds_request.rb +10 -9
- data/lib/davinci_crd_test_kit/cross_suite/generated/v2.2.1/appointment_with_order/metadata.yml +67 -0
- data/lib/davinci_crd_test_kit/cross_suite/generated/v2.2.1/appointment_without_order/metadata.yml +150 -0
- data/lib/davinci_crd_test_kit/cross_suite/generated/v2.2.1/communication_request/metadata.yml +71 -0
- data/lib/davinci_crd_test_kit/cross_suite/generated/v2.2.1/coverage/metadata.yml +71 -0
- data/lib/davinci_crd_test_kit/cross_suite/generated/v2.2.1/device/metadata.yml +22 -0
- data/lib/davinci_crd_test_kit/cross_suite/generated/v2.2.1/device_request/metadata.yml +85 -0
- data/lib/davinci_crd_test_kit/cross_suite/generated/v2.2.1/encounter/metadata.yml +82 -0
- data/lib/davinci_crd_test_kit/cross_suite/generated/v2.2.1/hrex_organization/metadata.yml +6 -0
- data/lib/davinci_crd_test_kit/cross_suite/generated/v2.2.1/location/metadata.yml +27 -0
- data/lib/davinci_crd_test_kit/cross_suite/generated/v2.2.1/medication/metadata.yml +17 -0
- data/lib/davinci_crd_test_kit/cross_suite/generated/v2.2.1/medication_request/metadata.yml +166 -0
- data/lib/davinci_crd_test_kit/cross_suite/generated/v2.2.1/nutrition_order/metadata.yml +166 -0
- data/lib/davinci_crd_test_kit/cross_suite/generated/v2.2.1/organization/metadata.yml +42 -0
- data/lib/davinci_crd_test_kit/cross_suite/generated/v2.2.1/patient/metadata.yml +29 -0
- data/lib/davinci_crd_test_kit/cross_suite/generated/v2.2.1/practitioner/metadata.yml +37 -0
- data/lib/davinci_crd_test_kit/cross_suite/generated/v2.2.1/practitioner_role/metadata.yml +36 -0
- data/lib/davinci_crd_test_kit/cross_suite/generated/v2.2.1/service_request/metadata.yml +202 -0
- data/lib/davinci_crd_test_kit/cross_suite/generated/v2.2.1/us_core_allergyintolerance/metadata.yml +6 -0
- data/lib/davinci_crd_test_kit/cross_suite/generated/v2.2.1/us_core_condition_encounter_diagnosis/metadata.yml +6 -0
- data/lib/davinci_crd_test_kit/cross_suite/generated/v2.2.1/us_core_condition_problems_health_concerns/metadata.yml +6 -0
- data/lib/davinci_crd_test_kit/cross_suite/generated/v2.2.1/us_core_diagnosticreport_lab/metadata.yml +6 -0
- data/lib/davinci_crd_test_kit/cross_suite/generated/v2.2.1/us_core_diagnosticreport_note/metadata.yml +6 -0
- data/lib/davinci_crd_test_kit/cross_suite/generated/v2.2.1/us_core_documentreference/metadata.yml +6 -0
- data/lib/davinci_crd_test_kit/cross_suite/generated/v2.2.1/us_core_location/metadata.yml +6 -0
- data/lib/davinci_crd_test_kit/cross_suite/generated/v2.2.1/us_core_organization/metadata.yml +6 -0
- data/lib/davinci_crd_test_kit/cross_suite/generated/v2.2.1/us_core_patient/metadata.yml +6 -0
- data/lib/davinci_crd_test_kit/cross_suite/generated/v2.2.1/us_core_practitioner/metadata.yml +6 -0
- data/lib/davinci_crd_test_kit/cross_suite/generated/v2.2.1/us_core_procedure/metadata.yml +6 -0
- data/lib/davinci_crd_test_kit/cross_suite/generated/v2.2.1/vision_prescription/metadata.yml +66 -0
- data/lib/davinci_crd_test_kit/cross_suite/hook_request_field_validation.rb +3 -2
- data/lib/davinci_crd_test_kit/cross_suite/hook_request_resource_extraction.rb +121 -0
- data/lib/davinci_crd_test_kit/cross_suite/logical_models_override_helper.rb +47 -22
- data/lib/davinci_crd_test_kit/cross_suite/must_support_references.rb +49 -0
- data/lib/davinci_crd_test_kit/cross_suite/must_support_slice_matching.rb +50 -0
- data/lib/davinci_crd_test_kit/cross_suite/prefetch_completeness_checker.rb +75 -39
- data/lib/davinci_crd_test_kit/cross_suite/prefetch_profile_validation.rb +2 -0
- data/lib/davinci_crd_test_kit/cross_suite/profile_metadata.rb +75 -0
- data/lib/davinci_crd_test_kit/cross_suite/requests_logical_model_validation.rb +45 -36
- data/lib/davinci_crd_test_kit/cross_suite/resource_identity.rb +183 -0
- data/lib/davinci_crd_test_kit/cross_suite/response_logical_model_validation.rb +48 -41
- data/lib/davinci_crd_test_kit/cross_suite/short_circuit_interaction.rb +28 -0
- data/lib/davinci_crd_test_kit/cross_suite/tags.rb +18 -1
- data/lib/davinci_crd_test_kit/generator/crd_must_support_metadata_extractor.rb +147 -0
- data/lib/davinci_crd_test_kit/generator/must_support_metadata_generator.rb +207 -0
- data/lib/davinci_crd_test_kit/generator/must_support_test_generator.rb +249 -0
- data/lib/davinci_crd_test_kit/generator/templates/must_support_group.rb.erb +118 -0
- data/lib/davinci_crd_test_kit/generator/templates/must_support_test.rb.erb +22 -0
- data/lib/davinci_crd_test_kit/generator/templates/reference_resolution_test.rb.erb +22 -0
- data/lib/davinci_crd_test_kit/igs/davinci_crd_2.2.1.tgz +0 -0
- data/lib/davinci_crd_test_kit/igs/davinci_hrex_1.2.0.tgz +0 -0
- data/lib/davinci_crd_test_kit/metadata.rb +2 -2
- data/lib/davinci_crd_test_kit/requirements/cds-hooks_3.0.0-ballot_requirements.xlsx +0 -0
- data/lib/davinci_crd_test_kit/requirements/davinci_crd_test_kit_requirements.csv +9 -4
- data/lib/davinci_crd_test_kit/requirements/generated/crd_client_requirements_coverage.csv +107 -107
- data/lib/davinci_crd_test_kit/requirements/generated/crd_client_v221_requirements_coverage.csv +107 -102
- data/lib/davinci_crd_test_kit/requirements/generated/crd_server_requirements_coverage.csv +18 -18
- data/lib/davinci_crd_test_kit/requirements/generated/crd_server_v221_requirements_coverage.csv +36 -32
- data/lib/davinci_crd_test_kit/requirements/hl7.fhir.us.davinci-crd_2.2.1_requirements.xlsx +0 -0
- data/lib/davinci_crd_test_kit/server/endpoints/mock_ehr/fhir_create_endpoint.rb +2 -0
- data/lib/davinci_crd_test_kit/server/endpoints/mock_ehr/fhir_delete_endpoint.rb +2 -0
- data/lib/davinci_crd_test_kit/server/endpoints/mock_ehr/fhir_read_endpoint.rb +2 -0
- data/lib/davinci_crd_test_kit/server/endpoints/mock_ehr/fhir_request_handler.rb +6 -0
- data/lib/davinci_crd_test_kit/server/endpoints/mock_ehr/fhir_search_endpoint.rb +21 -12
- data/lib/davinci_crd_test_kit/server/endpoints/mock_ehr/fhir_update_endpoint.rb +2 -0
- data/lib/davinci_crd_test_kit/server/endpoints/mock_ehr_endpoints.rb +3 -0
- data/lib/davinci_crd_test_kit/server/server_abstract_invoke_hook_test.rb +2 -2
- data/lib/davinci_crd_test_kit/server/v2.0.1/crd_server_suite.rb +1 -1
- data/lib/davinci_crd_test_kit/server/v2.0.1/server_hooks_group.rb +5 -5
- data/lib/davinci_crd_test_kit/server/v2.2.1/discovery/discovery_standard_prefetch_expressions_test.rb +1 -2
- data/lib/davinci_crd_test_kit/server/v2.2.1/must_support/supported_us_core_versions_test.rb +2 -2
- data/lib/davinci_crd_test_kit/server/v2.2.1/server_appointment_book_group.rb +1 -1
- data/lib/davinci_crd_test_kit/server/v2.2.1/server_demonstrate_hook_response_group.rb +3 -3
- data/lib/davinci_crd_test_kit/server/v2.2.1/server_encounter_discharge_group.rb +1 -1
- data/lib/davinci_crd_test_kit/server/v2.2.1/server_encounter_start_group.rb +1 -1
- data/lib/davinci_crd_test_kit/server/v2.2.1/server_hooks_group.rb +5 -5
- data/lib/davinci_crd_test_kit/server/v2.2.1/server_order_dispatch_group.rb +1 -1
- data/lib/davinci_crd_test_kit/server/v2.2.1/server_order_select_group.rb +1 -1
- data/lib/davinci_crd_test_kit/server/v2.2.1/server_order_sign_group.rb +1 -1
- data/lib/davinci_crd_test_kit/server/v2.2.1/server_required_card_response_validation_group.rb +1 -1
- data/lib/davinci_crd_test_kit/server/v2.2.1/specific_coverage_responses/coverage_not_found_group.rb +1 -1
- data/lib/davinci_crd_test_kit/server/v2.2.1/specific_coverage_responses/no_active_coverage_group.rb +1 -1
- data/lib/davinci_crd_test_kit/server/v2.2.1/specific_coverage_responses/no_member_found_group.rb +1 -1
- data/lib/davinci_crd_test_kit/server/v2.2.1/specific_coverage_responses/technical_issues_group.rb +1 -1
- data/lib/davinci_crd_test_kit/server/v2.2.1/verify_request/service_request_context_validation_test.rb +1 -1
- data/lib/davinci_crd_test_kit/server/v2.2.1/verify_request/service_request_no_custom_extensions_test.rb +2 -2
- data/lib/davinci_crd_test_kit/server/v2.2.1/verify_request/service_request_optional_fields_validation_test.rb +1 -1
- data/lib/davinci_crd_test_kit/server/v2.2.1/verify_request/service_request_required_fields_validation_test.rb +1 -1
- data/lib/davinci_crd_test_kit/version.rb +2 -2
- metadata +132 -16
- data/config/presets/inferno_crd_server_suite_v221.json.erb +0 -94
- data/lib/davinci_crd_test_kit/client/endpoints/gather_response_generation_data.rb +0 -410
- data/lib/davinci_crd_test_kit/server/resource_extractor.rb +0 -68
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
require_relative 'user_access_level/access_level_receive_request_test'
|
|
2
|
+
require_relative 'user_access_level/access_level_same_scenario_test'
|
|
3
|
+
require_relative 'user_access_level/access_level_api_access_test'
|
|
4
|
+
require_relative 'user_access_level/access_level_prefetch_scope_test'
|
|
5
|
+
require_relative '../../cross_suite/tags'
|
|
6
|
+
|
|
7
|
+
module DaVinciCRDTestKit
|
|
8
|
+
module V221
|
|
9
|
+
class ClientUserAccessLevelGroup < Inferno::TestGroup
|
|
10
|
+
title 'User Access Level Scoping'
|
|
11
|
+
id :crd_v221_client_user_access_level
|
|
12
|
+
description <<~DESCRIPTION
|
|
13
|
+
This group verifies that during a CDS Service hook invocation, access to data on
|
|
14
|
+
the CRD client's FHIR server is scoped to the authorized access level of the user
|
|
15
|
+
when the hook is invoked. Testers will invoke a hook twice, each time with consistent
|
|
16
|
+
content (e.g., an order for the same service): once as a user with full access, and
|
|
17
|
+
again as a user with limited access. Testers will provide a reference to a resource
|
|
18
|
+
that the full-access user is expected to be able to access while the limited-access user
|
|
19
|
+
cannot. If possible, the resource should be in the set of prefetched data that Inferno
|
|
20
|
+
requests. Inferno will use the access token supplied in each hook request to read that
|
|
21
|
+
resource and will compare the two runs to confirm that data available to the payer differs
|
|
22
|
+
according to the user's access level, both in provided prefetch data and in what can be
|
|
23
|
+
retrieved using the access token provided in the hook request.
|
|
24
|
+
|
|
25
|
+
Hook requests made during these tests will not be checked for conformance beyond scenario
|
|
26
|
+
requirements for confirming that both hook requests contain consistent content. The requests
|
|
27
|
+
will not be included in the cross-invocation analyses around must support and other coverage
|
|
28
|
+
requirements.
|
|
29
|
+
DESCRIPTION
|
|
30
|
+
|
|
31
|
+
run_as_group
|
|
32
|
+
|
|
33
|
+
input_order :access_level_target_reference
|
|
34
|
+
|
|
35
|
+
config(
|
|
36
|
+
options: {
|
|
37
|
+
hook_name: ANY_HOOK_TAG,
|
|
38
|
+
include_in_cross_hook_analysis: false
|
|
39
|
+
}
|
|
40
|
+
)
|
|
41
|
+
|
|
42
|
+
# only the interaction group differs, so that the two runs' requests can be told apart
|
|
43
|
+
test from: :crd_v221_access_level_receive_request, id: :crd_v221_access_level_receive_request_full do
|
|
44
|
+
title 'CRD client invokes a hook as a full-access user'
|
|
45
|
+
description %(
|
|
46
|
+
During this test, Inferno will wait while the CRD client makes a single hook request of any
|
|
47
|
+
type, made while the tester is signed in as a user with full access.
|
|
48
|
+
|
|
49
|
+
Inferno will use the access token in the request to attempt to read the resource
|
|
50
|
+
referenced in the **Target Resource Reference** input and will return a
|
|
51
|
+
[mocked](https://github.com/inferno-framework/davinci-crd-test-kit/wiki/Controlling-Simulated-Responses#mocked-responses)
|
|
52
|
+
coverage-information response. The details of the request and its response are not
|
|
53
|
+
evaluated or checked for conformance in this test. The test will automatically continue
|
|
54
|
+
once Inferno has received a single valid hook request.
|
|
55
|
+
)
|
|
56
|
+
config options: { crd_interaction_group: ACCESS_LEVEL_FULL_GROUP_TAG }
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
test from: :crd_v221_access_level_receive_request, id: :crd_v221_access_level_receive_request_limited do
|
|
60
|
+
title 'CRD client invokes the same hook as a limited-access user'
|
|
61
|
+
description %(
|
|
62
|
+
During this test, Inferno will wait while the CRD client makes a single hook request, made
|
|
63
|
+
while the tester is signed in as a user with limited access. It must invoke the same hook
|
|
64
|
+
for the same patient and the same order(s), appointment(s), or encounter as the full-access
|
|
65
|
+
request made during the previous test.
|
|
66
|
+
|
|
67
|
+
Inferno will use the access token in the request to attempt to read the resource
|
|
68
|
+
referenced in the **Target Resource Reference** input and will return a
|
|
69
|
+
[mocked](https://github.com/inferno-framework/davinci-crd-test-kit/wiki/Controlling-Simulated-Responses#mocked-responses)
|
|
70
|
+
coverage-information response. The details of the request and its response are not
|
|
71
|
+
evaluated or checked for conformance in this test. The test will automatically continue
|
|
72
|
+
once Inferno has received a single valid hook request.
|
|
73
|
+
)
|
|
74
|
+
config options: { crd_interaction_group: ACCESS_LEVEL_LIMITED_GROUP_TAG }
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
test from: :crd_v221_access_level_same_scenario
|
|
78
|
+
test from: :crd_v221_access_level_api_access
|
|
79
|
+
test from: :crd_v221_access_level_prefetch_scope
|
|
80
|
+
end
|
|
81
|
+
end
|
|
82
|
+
end
|
|
@@ -2,7 +2,8 @@ require_relative 'client_fhir_api_group'
|
|
|
2
2
|
require_relative 'client_hooks_group'
|
|
3
3
|
require_relative 'client_cross_hook_group'
|
|
4
4
|
require_relative 'client_registration_group'
|
|
5
|
-
require_relative '
|
|
5
|
+
require_relative 'client_scenarios_group'
|
|
6
|
+
require_relative 'client_attestations_group'
|
|
6
7
|
require_relative '../endpoints/cds_services_discovery_handler'
|
|
7
8
|
require_relative '../../cross_suite/tags'
|
|
8
9
|
require_relative 'client_urls'
|
|
@@ -28,18 +29,22 @@ module DaVinciCRDTestKit
|
|
|
28
29
|
[provide feedback](https://github.com/inferno-framework/davinci-crd-test-kit/issues) on the tests.
|
|
29
30
|
Future versions of these tests may validate other requirements and may change how these are tested.
|
|
30
31
|
|
|
31
|
-
|
|
32
|
+
Before running these tests, testers should be familiar with
|
|
33
|
+
- [Inferno's client testing paradigm as used in this CRD client suite](https://github.com/inferno-framework/davinci-crd-test-kit/wiki/Client-Details#client-testing-paradigm)
|
|
34
|
+
- [Inferno's approach to simulating CRD hook responses](https://github.com/inferno-framework/davinci-crd-test-kit/wiki/Client-Details#tester-provided-responses)
|
|
35
|
+
|
|
36
|
+
Additional information about this test suite can be found in the
|
|
32
37
|
[client section](https://github.com/inferno-framework/davinci-crd-test-kit/wiki/Client-Details) of the
|
|
33
38
|
[CRD Test Kit Wiki](https://github.com/inferno-framework/davinci-crd-test-kit/wiki), including:
|
|
34
39
|
- [What testers need to successfully execute these tests](https://github.com/inferno-framework/davinci-crd-test-kit/wiki/Client-Instructions-v2.2.1#pre-execution-setup-and-required-information),
|
|
35
40
|
- [Minimal](https://github.com/inferno-framework/davinci-crd-test-kit/wiki/Client-Instructions-v2.2.1#quick-start)
|
|
36
41
|
and [complete](https://github.com/inferno-framework/davinci-crd-test-kit/wiki/Client-Instructions-v2.2.1#additional-testing-options)
|
|
37
|
-
instructions for executing against a client
|
|
42
|
+
instructions for executing this suite against a CRD client, and
|
|
38
43
|
- How to [interpret test results](https://github.com/inferno-framework/davinci-crd-test-kit/wiki/Client-Instructions-v2.2.1#interpreting-results).
|
|
39
44
|
DESCRIPTION
|
|
40
45
|
|
|
41
46
|
suite_summary <<~SUMMARY
|
|
42
|
-
The Da Vinci CRD Client v2.2.1 Test Suite tests the conformance of
|
|
47
|
+
The Da Vinci CRD Client v2.2.1 Test Suite tests the conformance of CRD clients
|
|
43
48
|
to [version 2.2.1 of the Da Vinci Coverage Requirements Discovery (CRD)
|
|
44
49
|
Implementation Guide](https://hl7.org/fhir/us/davinci-crd/2.2.1).
|
|
45
50
|
SUMMARY
|
|
@@ -114,7 +119,6 @@ module DaVinciCRDTestKit
|
|
|
114
119
|
CRD_MESSAGE_FILTERS = [
|
|
115
120
|
/\A\S+: \S+: URL value '.*' does not resolve/,
|
|
116
121
|
%r{This element is not allowed by the profile http://hl7\.org/fhir/tools/StructureDefinition/CDSHooksExtensions\|1\.1\.2},
|
|
117
|
-
/CDSHooksRequest.extension: Unrecognized property/,
|
|
118
122
|
/No definition could be found for URL value/
|
|
119
123
|
].freeze
|
|
120
124
|
|
|
@@ -167,6 +171,21 @@ module DaVinciCRDTestKit
|
|
|
167
171
|
end
|
|
168
172
|
end
|
|
169
173
|
|
|
174
|
+
fhir_resource_validator :no_custom_extensions do
|
|
175
|
+
igs('hl7.fhir.us.davinci-crd#2.2.1')
|
|
176
|
+
|
|
177
|
+
validation_context do
|
|
178
|
+
snomedCT '731000124108' # explicit snomedCT expansion parameter
|
|
179
|
+
extensions [] # no extensions not in the spec
|
|
180
|
+
end
|
|
181
|
+
|
|
182
|
+
exclude_message do |message|
|
|
183
|
+
CRD_MESSAGE_FILTERS.any? do |match_template|
|
|
184
|
+
message.message.match?(match_template)
|
|
185
|
+
end
|
|
186
|
+
end
|
|
187
|
+
end
|
|
188
|
+
|
|
170
189
|
suite_option :us_core_version,
|
|
171
190
|
title: 'US Core Version',
|
|
172
191
|
list_options: [
|
|
@@ -224,11 +243,12 @@ module DaVinciCRDTestKit
|
|
|
224
243
|
|
|
225
244
|
group from: :crd_v221_client_registration
|
|
226
245
|
group from: :crd_v221_client_hooks
|
|
246
|
+
group from: :crd_v221_client_scenarios
|
|
227
247
|
group from: :crd_v221_client_cross_hook
|
|
228
|
-
group from: :crd_v221_client_long_running_hook
|
|
229
248
|
end
|
|
230
249
|
|
|
231
250
|
group from: :crd_v221_client_fhir_api
|
|
251
|
+
group from: :crd_v221_client_attestations
|
|
232
252
|
end
|
|
233
253
|
end
|
|
234
254
|
end
|
|
@@ -7,16 +7,16 @@ module DaVinciCRDTestKit
|
|
|
7
7
|
include CardsIdentification
|
|
8
8
|
include TaggedRequestLoadHelper
|
|
9
9
|
|
|
10
|
-
title '
|
|
10
|
+
title 'CRD client supports the Coverage Information response type'
|
|
11
11
|
id :crd_v221_client_card_must_support_coverage_information
|
|
12
12
|
description <<~DESCRIPTION
|
|
13
|
-
During this test, Inferno will verify that the client demonstrated support for the [Coverage Information](https://hl7.org/fhir/us/davinci-crd/2.2.1/en/cards.html#coverage-information)
|
|
14
|
-
response type
|
|
13
|
+
During this test, Inferno will verify that the CRD client demonstrated support for the [Coverage Information](https://hl7.org/fhir/us/davinci-crd/2.2.1/en/cards.html#coverage-information-response-type)
|
|
14
|
+
response type. At least one hook invocation received during this session must have returned a Coverage Information action.
|
|
15
15
|
Additionally, all [coverage-information extension](https://hl7.org/fhir/us/davinci-crd/2.2.1/en/StructureDefinition-ext-coverage-information.html)
|
|
16
16
|
must support elements must be demonstrated across all the returned actions.
|
|
17
17
|
|
|
18
18
|
If this test fails, adjust the [cards returned by Inferno's simulated CRD server](https://github.com/inferno-framework/davinci-crd-test-kit/wiki/Controlling-Simulated-Responses)
|
|
19
|
-
and/or the hook requests made by the client during the Hooks tests such that Coverage Information actions are returned
|
|
19
|
+
and/or the hook requests made by the CRD client during the Hooks tests such that Coverage Information actions are returned
|
|
20
20
|
that cover the full scope of the [coverage-information extension](https://hl7.org/fhir/us/davinci-crd/2.2.1/en/StructureDefinition-ext-coverage-information.html)
|
|
21
21
|
and support for them is demonstrated.
|
|
22
22
|
DESCRIPTION
|
|
@@ -46,7 +46,7 @@ module DaVinciCRDTestKit
|
|
|
46
46
|
end
|
|
47
47
|
|
|
48
48
|
run do
|
|
49
|
-
loaded_requests =
|
|
49
|
+
loaded_requests = load_requests_for_cross_hook_analysis
|
|
50
50
|
skip_if loaded_requests.blank?, 'No hook requests received.'
|
|
51
51
|
|
|
52
52
|
sorted_cards = sorted_cards_from_requests(loaded_requests)
|
|
@@ -1,10 +1,14 @@
|
|
|
1
|
+
require_relative '../../cross_hook_helper'
|
|
2
|
+
|
|
1
3
|
module DaVinciCRDTestKit
|
|
2
4
|
module V221
|
|
3
5
|
class ClientFHIRPathCollectionAsCommaDelimitedStringTest < Inferno::Test
|
|
4
|
-
|
|
6
|
+
include CrossHookHelper
|
|
7
|
+
|
|
8
|
+
title 'CRD client correctly interprets collections when substituting FHIRPath results in prefetch templates'
|
|
5
9
|
id :crd_v221_client_fhir_path_collection_as_comma_delimited_string
|
|
6
10
|
description <<~DESCRIPTION
|
|
7
|
-
The CDS Hooks specification requires that when a FHIRPath token in
|
|
11
|
+
The CDS Hooks specification requires that when a FHIRPath token in a
|
|
8
12
|
prefetch template resolves to a collection of datatypes (e.g., resource ids),
|
|
9
13
|
then the collection gets turned into a comma-delimited string when instantiating
|
|
10
14
|
the prefetch template.
|
|
@@ -12,7 +16,7 @@ module DaVinciCRDTestKit
|
|
|
12
16
|
During this test, Inferno will verify that during a previously-run hook test,
|
|
13
17
|
there was at least one instance of a prefetch template that has a
|
|
14
18
|
token which Inferno expects to result in a collection with multiple unique members.
|
|
15
|
-
Note that this does not test whether the client correctly
|
|
19
|
+
Note that this does not test whether the CRD client correctly
|
|
16
20
|
handles the collection, which is checked by the
|
|
17
21
|
"Hook requests include the requested prefetch data" test.
|
|
18
22
|
|
|
@@ -32,17 +36,6 @@ module DaVinciCRDTestKit
|
|
|
32
36
|
'Perform more complex hook requests and re-run.'
|
|
33
37
|
end
|
|
34
38
|
|
|
35
|
-
def find_completeness_tests
|
|
36
|
-
hooks_group = self.class.parent.parent.groups.find do |group|
|
|
37
|
-
group.id.to_s.include?('crd_v221_client_hooks')
|
|
38
|
-
end
|
|
39
|
-
hooks_group.groups.map do |group|
|
|
40
|
-
group.groups.flat_map(&:tests).find do |test|
|
|
41
|
-
test.id.to_s.include?('crd_v221_hook_request_prefetch_complete')
|
|
42
|
-
end
|
|
43
|
-
end.compact
|
|
44
|
-
end
|
|
45
|
-
|
|
46
39
|
def completeness_tests_demonstrate_collection_token_substitution?(prefetch_completeness_tests)
|
|
47
40
|
results_repo = Inferno::Repositories::Results.new
|
|
48
41
|
results = results_repo.current_results_for_test_session_and_runnables(test_session_id,
|
|
@@ -1,34 +1,26 @@
|
|
|
1
|
-
require_relative '../../tagged_request_load_helper'
|
|
2
1
|
require_relative '../../multi_request_message_helper'
|
|
3
2
|
require_relative '../../../cross_suite/tags'
|
|
4
3
|
|
|
5
4
|
module DaVinciCRDTestKit
|
|
6
5
|
module V221
|
|
7
6
|
class ClientHookInstancesUniqueTest < Inferno::Test
|
|
8
|
-
include TaggedRequestLoadHelper
|
|
9
7
|
include MultiRequestMessageHelper
|
|
10
8
|
|
|
11
|
-
title '
|
|
9
|
+
title 'CRD client does not reuse hookInstance values'
|
|
12
10
|
id :crd_v221_client_hook_instances_unique
|
|
13
11
|
description <<~DESCRIPTION
|
|
14
12
|
The CDS Hooks specification requires that the `hookInstance` field of each hook
|
|
15
13
|
request be globally unique so that it can be used for tracking
|
|
16
14
|
and auditing.
|
|
17
15
|
|
|
18
|
-
During this test, Inferno will
|
|
16
|
+
During this test, Inferno will verify that across all hook invocations performed during these
|
|
19
17
|
tests, the `hookInstance` field was never reused.
|
|
20
18
|
DESCRIPTION
|
|
21
19
|
|
|
22
20
|
verifies_requirements 'cds-hooks_3.0.0-ballot@25'
|
|
23
21
|
|
|
24
|
-
config(
|
|
25
|
-
options: {
|
|
26
|
-
crd_test_group: DUPLICATED_HOOK_INSTANCE_TAG
|
|
27
|
-
}
|
|
28
|
-
)
|
|
29
|
-
|
|
30
22
|
run do
|
|
31
|
-
duplicated_hook_instance_requests =
|
|
23
|
+
duplicated_hook_instance_requests = load_tagged_requests(DUPLICATED_HOOK_INSTANCE_TAG)
|
|
32
24
|
reused_values = duplicated_hook_instance_requests.map.with_index do |request, request_index|
|
|
33
25
|
request_body = parse_json_request_entity(request.request_body, 'Request body', request_index)
|
|
34
26
|
next nil unless request_body.present?
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
require_relative '../../tagged_request_load_helper'
|
|
2
|
+
require_relative '../../../cross_suite/tags'
|
|
3
|
+
|
|
4
|
+
module DaVinciCRDTestKit
|
|
5
|
+
module V221
|
|
6
|
+
class ClientJwtIdsUniqueTest < Inferno::Test
|
|
7
|
+
include TaggedRequestLoadHelper
|
|
8
|
+
|
|
9
|
+
title 'CRD client does not reuse JWT `jti` values'
|
|
10
|
+
id :crd_v221_client_jwt_ids_unique
|
|
11
|
+
description <<~DESCRIPTION
|
|
12
|
+
The CDS Hooks specification requires that the `jti` claim of the authentication JWT sent
|
|
13
|
+
with each hook request be a nonce that uniquely identifies that JWT, so that CDS Services can
|
|
14
|
+
use it to protect against replay attacks. A CDS Service does so by rejecting a `jti` it has
|
|
15
|
+
already received, so each hook request must carry a new JWT with its own `jti`.
|
|
16
|
+
|
|
17
|
+
During this test, Inferno will verify that no `jti` value was sent on more than one of the hook
|
|
18
|
+
requests it processed during these tests, including those made during the scenarios.
|
|
19
|
+
DESCRIPTION
|
|
20
|
+
|
|
21
|
+
verifies_requirements 'cds-hooks_3.0.0-ballot@192'
|
|
22
|
+
|
|
23
|
+
def bearer_token(request)
|
|
24
|
+
request.request_header('Authorization')&.value&.delete_prefix('Bearer ')
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
def jwt_id(token)
|
|
28
|
+
payload, = JWT.decode(token, nil, false)
|
|
29
|
+
payload['jti'] if payload.is_a?(Hash)
|
|
30
|
+
rescue JWT::DecodeError
|
|
31
|
+
nil
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
def tagged_requests_exist?(tag)
|
|
35
|
+
Inferno::Repositories::Requests.new.tagged_requests(test_session_id, [tag]).present?
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
# The `jti` values the hook endpoint found on an earlier request when it received a later one. The
|
|
39
|
+
# duplicate requests are not loaded into the result, since each is loaded with the others sharing
|
|
40
|
+
# its `jti`.
|
|
41
|
+
def repeated_jwt_ids
|
|
42
|
+
Inferno::Repositories::Requests.new.tagged_requests(test_session_id, [DUPLICATED_JWT_ID_TAG])
|
|
43
|
+
.filter_map { |request| jwt_id(bearer_token(request)) }
|
|
44
|
+
.uniq
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
# identifies a request by its hook and `hookInstance`, since the requests can come from any group
|
|
48
|
+
def request_label(request)
|
|
49
|
+
body = begin
|
|
50
|
+
JSON.parse(request.request_body.to_s)
|
|
51
|
+
rescue JSON::ParserError
|
|
52
|
+
nil
|
|
53
|
+
end
|
|
54
|
+
body = {} unless body.is_a?(Hash)
|
|
55
|
+
"`#{body['hook'] || 'unknown hook'}` (hookInstance `#{body['hookInstance'] || 'none'}`)"
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
def request_list(hook_requests)
|
|
59
|
+
labels = hook_requests.sort_by(&:index).map { |request| request_label(request) }
|
|
60
|
+
"#{labels.length} hook requests: #{labels.to_sentence}"
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
# Says whether the JWT itself was resent or the `jti` was reused in new JWTs, since the two point
|
|
64
|
+
# to different fixes in the CRD client.
|
|
65
|
+
def report_repeated_jti(jti, requests_by_token)
|
|
66
|
+
sent_on = request_list(requests_by_token.values.flatten)
|
|
67
|
+
repetition =
|
|
68
|
+
if requests_by_token.length == 1
|
|
69
|
+
"The same JWT (`jti` #{jti.to_json}) was sent on #{sent_on}."
|
|
70
|
+
else
|
|
71
|
+
"`jti` #{jti.to_json} was used by #{requests_by_token.length} different JWTs, sent on #{sent_on}."
|
|
72
|
+
end
|
|
73
|
+
add_message('error', "#{repetition} Each hook request must carry a new JWT with its own `jti`.")
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
run do
|
|
77
|
+
skip_if !tagged_requests_exist?(CROSS_HOOK_ANALYSIS_TAG), 'No hook requests received.'
|
|
78
|
+
|
|
79
|
+
repeated_jwt_ids.each do |jti|
|
|
80
|
+
requests_sharing_jti = load_tagged_requests(TagMethods.jwt_id_tag(jti))
|
|
81
|
+
report_repeated_jti(jti, requests_sharing_jti.group_by { |request| bearer_token(request) })
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
assert_no_error_messages('Inferno received the same `jti` value on more than one hook request. ' \
|
|
85
|
+
'See Messages for details.')
|
|
86
|
+
end
|
|
87
|
+
end
|
|
88
|
+
end
|
|
89
|
+
end
|
data/lib/davinci_crd_test_kit/client/v2.2.1/cross_hook/client_location_address_propagation_test.rb
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
require_relative '../../../cross_suite/resource_identity'
|
|
1
2
|
require_relative '../../../cross_suite/tags'
|
|
2
3
|
require_relative '../../tagged_request_load_helper'
|
|
3
4
|
|
|
@@ -6,7 +7,7 @@ module DaVinciCRDTestKit
|
|
|
6
7
|
class ClientLocationAddressPropagationTest < Inferno::Test
|
|
7
8
|
include TaggedRequestLoadHelper
|
|
8
9
|
|
|
9
|
-
title '
|
|
10
|
+
title 'CRD client propagates addresses to child Location resources'
|
|
10
11
|
id :crd_v221_client_location_address_propagation
|
|
11
12
|
description <<~DESCRIPTION
|
|
12
13
|
The CRD IG requires that ([prof-13](https://hl7.org/fhir/us/davinci-crd/2.2.1/en/StructureDefinition-profile-location.html#ci-c-prof-13))
|
|
@@ -28,27 +29,27 @@ module DaVinciCRDTestKit
|
|
|
28
29
|
skip_if loaded_requests.blank?, 'No hook requests received.'
|
|
29
30
|
pass_if prefetched_location_hash.blank?, 'No Location resources in use, so verification not needed.'
|
|
30
31
|
|
|
31
|
-
prefetched_location_hash.
|
|
32
|
-
check_location_address_propagation(location)
|
|
32
|
+
prefetched_location_hash.each do |identity, location|
|
|
33
|
+
check_location_address_propagation(location, identity)
|
|
33
34
|
end
|
|
34
35
|
|
|
35
36
|
assert_no_error_messages('Address propagation issues found. See Messages for details.')
|
|
36
37
|
end
|
|
37
38
|
|
|
38
39
|
# checks that the location has an address if a parent also has an address
|
|
39
|
-
def check_location_address_propagation(location, root_id = location.id)
|
|
40
|
+
def check_location_address_propagation(location, identity, root_id = location.id)
|
|
40
41
|
return if location.address.present?
|
|
41
42
|
return unless location.partOf.present? && location.partOf.reference.present?
|
|
42
43
|
|
|
43
|
-
|
|
44
|
-
parent =
|
|
44
|
+
parent_identity = parent_identity(location.partOf.reference, identity)
|
|
45
|
+
parent = prefetched_location_hash[parent_identity] || fetched_location_hash[parent_identity]
|
|
45
46
|
if parent.present?
|
|
46
|
-
check_location_conformance(parent, root_id)
|
|
47
|
+
check_location_conformance(parent, parent_identity, root_id)
|
|
47
48
|
if parent.address.present?
|
|
48
49
|
add_message('error', "Address missing on prefetched 'Location/#{root_id}': " \
|
|
49
50
|
"parent 'Location/#{parent.id}' has an address.")
|
|
50
51
|
else
|
|
51
|
-
check_location_address_propagation(parent, root_id)
|
|
52
|
+
check_location_address_propagation(parent, parent_identity, root_id)
|
|
52
53
|
end
|
|
53
54
|
else
|
|
54
55
|
add_message('error', "Unable to check address propagation prefetched 'Location/#{root_id}': " \
|
|
@@ -58,19 +59,32 @@ module DaVinciCRDTestKit
|
|
|
58
59
|
nil
|
|
59
60
|
end
|
|
60
61
|
|
|
62
|
+
# The identity of the Location a `partOf` reference names, resolved against the base of the
|
|
63
|
+
# Location holding it, following the FHIR rules for resolving references. As when Inferno read
|
|
64
|
+
# the parent during the hook request, a prefetched Location whose identity is not a RESTful URL,
|
|
65
|
+
# such as a `urn:uuid:` fullUrl, falls back to its request's FHIR server. A reference with no
|
|
66
|
+
# absolute form is used as given.
|
|
67
|
+
def parent_identity(reference, child_identity)
|
|
68
|
+
base = ResourceIdentity.base_for(child_identity) || prefetched_location_fhir_servers[child_identity]
|
|
69
|
+
ResourceIdentity.normalized_url(ResourceIdentity.absolute_reference(reference, base)) || reference
|
|
70
|
+
end
|
|
71
|
+
|
|
61
72
|
# skip profile check if in the prefetch hash (done elsewhere) or already checked
|
|
62
|
-
def check_location_conformance(location, root_id)
|
|
63
|
-
key
|
|
64
|
-
return if prefetched_location_hash.key?(key) || fetched_locations_checked_for_conformance.key?(key)
|
|
73
|
+
def check_location_conformance(location, identity, root_id)
|
|
74
|
+
return if prefetched_location_hash.key?(identity) || fetched_locations_checked_for_conformance.key?(identity)
|
|
65
75
|
|
|
66
|
-
fetched_locations_checked_for_conformance[
|
|
76
|
+
fetched_locations_checked_for_conformance[identity] = location
|
|
67
77
|
validator_response_details = []
|
|
68
78
|
return if resource_is_valid?(resource: location, profile_url: 'http://hl7.org/fhir/us/davinci-crd/StructureDefinition/profile-location|2.2.1',
|
|
69
79
|
add_messages_to_runnable: false, validator_response_details:)
|
|
70
80
|
|
|
71
81
|
message_prefix = "Parent of prefetched 'Location/#{root_id}'"
|
|
72
82
|
add_message('error', "Location/#{location.id}: #{message_prefix} does not conform to the CRD Location profile.")
|
|
73
|
-
validator_response_details.each
|
|
83
|
+
validator_response_details.each do |issue|
|
|
84
|
+
next if issue.filtered
|
|
85
|
+
|
|
86
|
+
add_message(issue.severity, "(#{message_prefix}) #{issue.message}")
|
|
87
|
+
end
|
|
74
88
|
end
|
|
75
89
|
|
|
76
90
|
def fetched_locations_checked_for_conformance
|
|
@@ -78,9 +92,11 @@ module DaVinciCRDTestKit
|
|
|
78
92
|
end
|
|
79
93
|
|
|
80
94
|
def loaded_requests
|
|
81
|
-
@loaded_requests ||=
|
|
95
|
+
@loaded_requests ||= load_requests_for_cross_hook_analysis
|
|
82
96
|
end
|
|
83
97
|
|
|
98
|
+
# The prefetched Locations of every hook request, keyed by the normalized absolute URL identifying each (see
|
|
99
|
+
# ResourceIdentity), or by `Location/id` when the request gives nothing to make one from.
|
|
84
100
|
def prefetched_location_hash
|
|
85
101
|
@prefetched_location_hash ||= build_prefetched_locations_hash
|
|
86
102
|
end
|
|
@@ -90,17 +106,39 @@ module DaVinciCRDTestKit
|
|
|
90
106
|
request_body = JSON.parse(request.request_body)
|
|
91
107
|
next unless request_body.is_a?(Hash)
|
|
92
108
|
|
|
93
|
-
|
|
94
|
-
next unless prefetched_location_bundle.present?
|
|
95
|
-
|
|
96
|
-
prefetched_location_bundle.entry.each do |entry|
|
|
97
|
-
add_location_to_hash(entry.resource, location_hash)
|
|
98
|
-
end
|
|
109
|
+
add_prefetched_locations(request_body, location_hash)
|
|
99
110
|
rescue JSON::ParserError
|
|
100
111
|
next
|
|
101
112
|
end
|
|
102
113
|
end
|
|
103
114
|
|
|
115
|
+
def add_prefetched_locations(request_body, location_hash)
|
|
116
|
+
fhir_server = ResourceIdentity.fhir_server_base(request_body)
|
|
117
|
+
extract_prefetched_location_bundle(request_body)&.entry&.each do |entry|
|
|
118
|
+
location = entry.resource
|
|
119
|
+
next unless location.is_a?(FHIR::Location) && location.id.present?
|
|
120
|
+
|
|
121
|
+
add_prefetched_location(location_hash, prefetched_location_identity(entry, fhir_server), location,
|
|
122
|
+
fhir_server)
|
|
123
|
+
end
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
def add_prefetched_location(location_hash, identity, location, fhir_server)
|
|
127
|
+
location_hash[identity] ||= location
|
|
128
|
+
prefetched_location_fhir_servers[identity] ||= fhir_server
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
# The FHIR server of the hook request that carried each prefetched Location, by identity.
|
|
132
|
+
def prefetched_location_fhir_servers
|
|
133
|
+
@prefetched_location_fhir_servers ||= {}
|
|
134
|
+
end
|
|
135
|
+
|
|
136
|
+
# A Location given without a fullUrl is taken to be on the request's FHIR server.
|
|
137
|
+
def prefetched_location_identity(entry, fhir_server)
|
|
138
|
+
identity = entry.fullUrl.presence || ResourceIdentity.restful_identity(entry.resource, fhir_server)
|
|
139
|
+
ResourceIdentity.normalized_url(identity) || "Location/#{entry.resource.id}"
|
|
140
|
+
end
|
|
141
|
+
|
|
104
142
|
def extract_prefetched_location_bundle(request_body)
|
|
105
143
|
locations_data = request_body.dig('prefetch', 'locations') || request_body.dig('prefetch', 'locs')
|
|
106
144
|
locations = FHIR.from_contents(locations_data.to_json) if locations_data.present?
|
|
@@ -110,26 +148,22 @@ module DaVinciCRDTestKit
|
|
|
110
148
|
FHIR::Bundle.new({ entry: [FHIR::Bundle::Entry.new({ resource: locations })] })
|
|
111
149
|
end
|
|
112
150
|
|
|
151
|
+
# The parent Locations read during hook requests, keyed by the normalized URL each was read from. A read
|
|
152
|
+
# only counts when it returned the Location that URL names.
|
|
113
153
|
def fetched_location_hash
|
|
114
154
|
@fetched_location_hash ||= build_fetched_locations_hash
|
|
115
155
|
end
|
|
116
156
|
|
|
117
157
|
def build_fetched_locations_hash
|
|
118
|
-
load_tagged_requests(PARENT_LOCATION_FETCH_TAG
|
|
119
|
-
|
|
158
|
+
load_tagged_requests(PARENT_LOCATION_FETCH_TAG).each_with_object({}) do |request, location_hash|
|
|
159
|
+
location = FHIR.from_contents(request.response_body)
|
|
160
|
+
next unless location.is_a?(FHIR::Location) && ResourceIdentity.names?(request.url, location)
|
|
161
|
+
|
|
162
|
+
location_hash[ResourceIdentity.normalized_url(request.url)] ||= location
|
|
120
163
|
rescue JSON::ParserError
|
|
121
164
|
next
|
|
122
165
|
end
|
|
123
166
|
end
|
|
124
|
-
|
|
125
|
-
def add_location_to_hash(location, location_hash)
|
|
126
|
-
return unless location.is_a?(FHIR::Location) && location.id.present?
|
|
127
|
-
|
|
128
|
-
relative_reference = "#{location.resourceType}/#{location.id}"
|
|
129
|
-
return if location_hash.key?(relative_reference)
|
|
130
|
-
|
|
131
|
-
location_hash[relative_reference] = location
|
|
132
|
-
end
|
|
133
167
|
end
|
|
134
168
|
end
|
|
135
169
|
end
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
require_relative '../../../cross_suite/hook_request_resource_extraction'
|
|
2
|
+
require_relative '../../../cross_suite/profiles_and_resource_types'
|
|
3
|
+
require_relative '../../../cross_suite/tags'
|
|
4
|
+
|
|
5
|
+
module DaVinciCRDTestKit
|
|
6
|
+
module V221
|
|
7
|
+
class ClientOrderTypesSignedTest < Inferno::Test
|
|
8
|
+
include HookRequestResourceExtraction
|
|
9
|
+
|
|
10
|
+
title 'Observed order types were submitted as draftOrders on the order-sign hook'
|
|
11
|
+
id :crd_v221_client_order_types_signed
|
|
12
|
+
description <<~DESCRIPTION
|
|
13
|
+
CRD clients are required to support the `order-sign` hook for the order types they handle.
|
|
14
|
+
During this test, Inferno will verify that every order type it observed appeared as a
|
|
15
|
+
`draftOrder` on an `order-sign` invocation.
|
|
16
|
+
DESCRIPTION
|
|
17
|
+
|
|
18
|
+
verifies_requirements 'hl7.fhir.us.davinci-crd_2.2.1@hook-3'
|
|
19
|
+
|
|
20
|
+
def requests_repo
|
|
21
|
+
@requests_repo ||= Inferno::Repositories::Requests.new
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
# Reads the requests directly rather than going through `load_tagged_requests`, which would
|
|
25
|
+
# also associate every cross-invocation request with this test's own result.
|
|
26
|
+
def tagged_requests(*tags)
|
|
27
|
+
requests_repo.tagged_requests(test_session_id, tags)
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
# The hooks each order type was seen on, so that an unsigned type can say where it did turn up
|
|
31
|
+
# rather than only where it did not.
|
|
32
|
+
def hooks_by_order_type
|
|
33
|
+
tagged_requests(CROSS_HOOK_ANALYSIS_TAG).each_with_object({}) do |request, hooks|
|
|
34
|
+
request_body = parse_request_body(request)
|
|
35
|
+
hook = request_body['hook'] if request_body.is_a?(Hash)
|
|
36
|
+
|
|
37
|
+
each_hook_request_resource(request_body) do |raw_resource|
|
|
38
|
+
resource_type = raw_resource['resourceType']
|
|
39
|
+
next unless ProfilesAndResourceTypes::ORDER_RESOURCE_TYPES.include?(resource_type)
|
|
40
|
+
|
|
41
|
+
(hooks[resource_type] ||= Set.new) << hook if hook.present?
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
# Only the draftOrders bundle counts, since that is where an order-sign invocation carries the
|
|
47
|
+
# orders being signed. The same resource elsewhere in the request does not demonstrate signing.
|
|
48
|
+
def signed_order_types
|
|
49
|
+
tagged_requests(ORDER_SIGN_TAG, CROSS_HOOK_ANALYSIS_TAG).each_with_object(Set.new) do |request, types|
|
|
50
|
+
each_resource_within(draft_orders(request)) do |raw_resource|
|
|
51
|
+
resource_type = raw_resource['resourceType']
|
|
52
|
+
types << resource_type if ProfilesAndResourceTypes::ORDER_RESOURCE_TYPES.include?(resource_type)
|
|
53
|
+
end
|
|
54
|
+
end
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
# A malformed request may carry a body or `context` that is not a JSON object, which `dig` would
|
|
58
|
+
# raise on, so each level is checked before reading from it.
|
|
59
|
+
def draft_orders(request)
|
|
60
|
+
body = parse_request_body(request)
|
|
61
|
+
context = body['context'] if body.is_a?(Hash)
|
|
62
|
+
context['draftOrders'] if context.is_a?(Hash)
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
# An order type can turn up on an order-sign request without being in its `draftOrders`, so the
|
|
66
|
+
# hook is named only where it does not contradict the finding.
|
|
67
|
+
def unsigned_message(resource_type, hooks)
|
|
68
|
+
elsewhere = Array(hooks&.to_a) - ['order-sign']
|
|
69
|
+
if elsewhere.blank?
|
|
70
|
+
return "There was an instance of `#{resource_type}` that was observed, but never seen as a " \
|
|
71
|
+
'draft order on an `order-sign` invocation. All supported order types must be able ' \
|
|
72
|
+
'to be sent as a draft order on an order-sign hook invocation.'
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
"There was an instance of `#{resource_type}` that was observed on the " \
|
|
76
|
+
"#{elsewhere.sort.map { |hook| "`#{hook}`" }.to_sentence} " \
|
|
77
|
+
"#{'hook'.pluralize(elsewhere.length)}, but never seen as a draft order on an " \
|
|
78
|
+
'`order-sign` invocation. All supported order types must be able to be sent as a draft ' \
|
|
79
|
+
'order on an order-sign hook invocation.'
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
run do
|
|
83
|
+
observed_hooks = hooks_by_order_type
|
|
84
|
+
observed = observed_hooks.keys
|
|
85
|
+
skip_if observed.blank?, 'No order resources were found in the hook requests received.'
|
|
86
|
+
|
|
87
|
+
unsigned = observed - signed_order_types.to_a
|
|
88
|
+
|
|
89
|
+
unsigned.each do |resource_type|
|
|
90
|
+
add_message('error', unsigned_message(resource_type, observed_hooks[resource_type]))
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
assert unsigned.blank?,
|
|
94
|
+
"#{unsigned.length} of the #{observed.length} order type(s) observed were never signed: " \
|
|
95
|
+
"#{unsigned.join(', ')}."
|
|
96
|
+
|
|
97
|
+
pass "All #{observed.length} order type(s) observed were signed: #{observed.join(', ')}."
|
|
98
|
+
end
|
|
99
|
+
end
|
|
100
|
+
end
|
|
101
|
+
end
|