davinci_crd_test_kit 0.14.2 → 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/client_v221_against_inferno_crd_server_suite.json.erb +13 -1
- data/config/presets/server_v221_against_inferno_crd_client_suite.json.erb +1 -1
- data/config/presets/server_v221_against_inferno_crd_client_suite_prefetch_subset.json.erb +1 -1
- 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/endpoints/custom_service_response.rb +25 -10
- 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 +116 -25
- data/lib/davinci_crd_test_kit/client/endpoints/mock_service_response.rb +5 -24
- data/lib/davinci_crd_test_kit/client/endpoints/scenario_service_response.rb +1 -1
- 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 +8 -0
- data/lib/davinci_crd_test_kit/client/v2.0.1/auth/retrieve_jwks_test.rb +1 -1
- 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 +8 -1
- data/lib/davinci_crd_test_kit/client/v2.0.1/cds-services-v201.json +1 -1
- 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 +2 -5
- 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/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_optional_fields_test.rb +1 -1
- data/lib/davinci_crd_test_kit/client/v2.0.1/verify_response/client_display_cards_attest.rb +4 -4
- data/lib/davinci_crd_test_kit/client/v2.0.1/verify_response/inferno_response_validation.rb +1 -1
- data/lib/davinci_crd_test_kit/client/v2.2.1/api/client_coverage_info_update_test.rb +9 -9
- 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/client_coverage_based_invocation_attestation_test.rb +10 -10
- data/lib/davinci_crd_test_kit/client/v2.2.1/attestations/client_data_element_expectations_attestation_test.rb +7 -7
- data/lib/davinci_crd_test_kit/client/v2.2.1/attestations/client_hook_invocation_logging_attestation_test.rb +4 -4
- data/lib/davinci_crd_test_kit/client/v2.2.1/attestations/client_must_support_use_attestation_test.rb +4 -4
- data/lib/davinci_crd_test_kit/client/v2.2.1/attestations/client_prefetch_key_omission_attestation_test.rb +6 -5
- data/lib/davinci_crd_test_kit/client/v2.2.1/attestations/client_resource_identifiers_attestation_test.rb +4 -4
- data/lib/davinci_crd_test_kit/client/v2.2.1/attestations/client_response_case_distinction_attestation_test.rb +4 -4
- data/lib/davinci_crd_test_kit/client/v2.2.1/attestations/client_security_and_privacy_attestation_test.rb +4 -4
- data/lib/davinci_crd_test_kit/client/v2.2.1/attestations/client_workflow_integration_attestation_test.rb +4 -4
- data/lib/davinci_crd_test_kit/client/v2.2.1/auth/decode_auth_token_test.rb +3 -1
- data/lib/davinci_crd_test_kit/client/v2.2.1/auth/retrieve_jwks_test.rb +23 -13
- 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 +25 -11
- data/lib/davinci_crd_test_kit/client/v2.2.1/cds-services-prefetch-subset-v221.json +1 -1
- data/lib/davinci_crd_test_kit/client/v2.2.1/cds-services-v221.json +1 -1
- data/lib/davinci_crd_test_kit/client/v2.2.1/client_appointment_book_group.rb +10 -3
- data/lib/davinci_crd_test_kit/client/v2.2.1/client_attestations_group.rb +1 -7
- data/lib/davinci_crd_test_kit/client/v2.2.1/client_cross_hook_group.rb +13 -10
- data/lib/davinci_crd_test_kit/client/v2.2.1/client_cross_hook_interaction_group.rb +12 -4
- data/lib/davinci_crd_test_kit/client/v2.2.1/client_encounter_discharge_group.rb +9 -2
- data/lib/davinci_crd_test_kit/client/v2.2.1/client_encounter_start_group.rb +9 -2
- data/lib/davinci_crd_test_kit/client/v2.2.1/client_fhir_api_group.rb +25 -3
- data/lib/davinci_crd_test_kit/client/v2.2.1/client_hooks_group.rb +7 -10
- data/lib/davinci_crd_test_kit/client/v2.2.1/client_long_running_hook_group.rb +3 -3
- 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 +9 -2
- data/lib/davinci_crd_test_kit/client/v2.2.1/client_order_select_group.rb +8 -1
- data/lib/davinci_crd_test_kit/client/v2.2.1/client_order_sign_group.rb +9 -2
- 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 +10 -4
- data/lib/davinci_crd_test_kit/client/v2.2.1/client_self_pay_hook_group.rb +2 -4
- data/lib/davinci_crd_test_kit/client/v2.2.1/client_unknown_content_hook_group.rb +3 -3
- 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 +7 -3
- data/lib/davinci_crd_test_kit/client/v2.2.1/cross_hook/client_card_must_support_coverage_information_test.rb +4 -4
- data/lib/davinci_crd_test_kit/client/v2.2.1/cross_hook/client_fhirpath_collection_as_comma_delimited_string_test.rb +3 -3
- data/lib/davinci_crd_test_kit/client/v2.2.1/cross_hook/client_hook_instances_unique_test.rb +2 -2
- 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 +59 -29
- 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 +11 -24
- data/lib/davinci_crd_test_kit/client/v2.2.1/invocation/appointment_book_receive_request_test.rb +9 -27
- data/lib/davinci_crd_test_kit/client/v2.2.1/invocation/base_hook_invocation_receive_request_test.rb +59 -40
- data/lib/davinci_crd_test_kit/client/v2.2.1/invocation/cross_hooks_receive_request_test.rb +64 -35
- data/lib/davinci_crd_test_kit/client/v2.2.1/invocation/encounter_discharge_receive_request_test.rb +9 -27
- data/lib/davinci_crd_test_kit/client/v2.2.1/invocation/encounter_start_receive_request_test.rb +9 -27
- data/lib/davinci_crd_test_kit/client/v2.2.1/invocation/order_dispatch_receive_request_test.rb +9 -27
- data/lib/davinci_crd_test_kit/client/v2.2.1/invocation/order_select_receive_request_test.rb +9 -27
- data/lib/davinci_crd_test_kit/client/v2.2.1/invocation/order_sign_receive_request_test.rb +9 -27
- data/lib/davinci_crd_test_kit/client/v2.2.1/long_running/client_long_running_receive_request_test.rb +50 -38
- data/lib/davinci_crd_test_kit/client/v2.2.1/long_running/client_skip_long_running_attestation_test.rb +11 -11
- 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 +27 -20
- data/lib/davinci_crd_test_kit/client/v2.2.1/unknown_content/client_unknown_content_attestation_test.rb +7 -7
- data/lib/davinci_crd_test_kit/client/v2.2.1/unknown_content/client_unknown_content_receive_request_test.rb +38 -33
- 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 +63 -6
- data/lib/davinci_crd_test_kit/client/v2.2.1/verify_request/hook_request_coverage_verification_test.rb +23 -73
- data/lib/davinci_crd_test_kit/client/v2.2.1/verify_request/hook_request_data_fetch_verification_test.rb +12 -2
- data/lib/davinci_crd_test_kit/client/v2.2.1/verify_request/hook_request_granted_scopes_test.rb +7 -7
- data/lib/davinci_crd_test_kit/client/v2.2.1/verify_request/hook_request_prefetch_complete_test.rb +11 -13
- data/lib/davinci_crd_test_kit/client/v2.2.1/verify_request/hook_request_prefetch_profiles_test.rb +2 -2
- data/lib/davinci_crd_test_kit/client/v2.2.1/verify_request/hook_request_requested_version_test.rb +16 -4
- data/lib/davinci_crd_test_kit/client/v2.2.1/verify_request/hook_request_secured_transport_test.rb +1 -1
- data/lib/davinci_crd_test_kit/client/v2.2.1/verify_response/client_display_cards_attest.rb +8 -8
- data/lib/davinci_crd_test_kit/client/v2.2.1/verify_response/hook_response_support_coverage_information_test.rb +3 -3
- data/lib/davinci_crd_test_kit/client/v2.2.1/verify_response/inferno_response_validation.rb +8 -9
- data/lib/davinci_crd_test_kit/cross_suite/base_urls.rb +12 -0
- data/lib/davinci_crd_test_kit/cross_suite/cards_identification.rb +9 -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 +17 -9
- 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/profile_metadata.rb +75 -0
- data/lib/davinci_crd_test_kit/cross_suite/requests_logical_model_validation.rb +19 -9
- data/lib/davinci_crd_test_kit/cross_suite/resource_identity.rb +183 -0
- data/lib/davinci_crd_test_kit/cross_suite/short_circuit_interaction.rb +28 -0
- data/lib/davinci_crd_test_kit/cross_suite/tags.rb +15 -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/davinci_crd_test_kit_requirements.csv +3 -2
- data/lib/davinci_crd_test_kit/requirements/generated/crd_client_requirements_coverage.csv +1 -1
- data/lib/davinci_crd_test_kit/requirements/generated/crd_client_v221_requirements_coverage.csv +90 -89
- 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.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 +1 -1
- 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_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 +100 -12
- data/lib/davinci_crd_test_kit/client/endpoints/gather_response_generation_data.rb +0 -413
- data/lib/davinci_crd_test_kit/client/v2.2.1/attestations/client_authorized_scope_attestation_test.rb +0 -45
- data/lib/davinci_crd_test_kit/client/v2.2.1/attestations/client_must_support_exposure_attestation_test.rb +0 -43
- data/lib/davinci_crd_test_kit/client/v2.2.1/attestations/client_order_sign_support_attestation_test.rb +0 -42
- data/lib/davinci_crd_test_kit/client/v2.2.1/self_pay/client_self_pay_no_request_test.rb +0 -30
- data/lib/davinci_crd_test_kit/server/resource_extractor.rb +0 -68
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
require_relative '../../cross_suite/hook_request_resource_extraction'
|
|
2
|
+
require_relative '../../cross_suite/must_support_references'
|
|
3
|
+
require_relative '../../cross_suite/resource_identity'
|
|
4
|
+
require_relative 'hook_request_data_access'
|
|
5
|
+
|
|
6
|
+
module DaVinciCRDTestKit
|
|
7
|
+
# CRD v2.2.1: reads data not provided in the prefetch that tests verify later, namely the payer,
|
|
8
|
+
# parent locations, the resources referenced from must support elements, and the access level
|
|
9
|
+
# target.
|
|
10
|
+
module V221HookRequestDataGathering
|
|
11
|
+
include HookRequestDataAccess
|
|
12
|
+
|
|
13
|
+
MUST_SUPPORT_IG_VERSION = 'v2.2.1'.freeze
|
|
14
|
+
|
|
15
|
+
# gather additional fhir resources not requested via prefetch
|
|
16
|
+
# not used for response generation, but verified later, so a failure in one step is logged and
|
|
17
|
+
# the others still run (see #continue_after_failure)
|
|
18
|
+
def request_additional_fhir_data
|
|
19
|
+
continue_after_failure('reading the Coverage payer') { request_coverage_payer }
|
|
20
|
+
continue_after_failure('reading parent Locations') { request_parent_locations }
|
|
21
|
+
return unless include_in_cross_hook_analysis?
|
|
22
|
+
|
|
23
|
+
continue_after_failure('reading must support references') { request_must_support_references }
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
# Reads the resources referenced from the must support Reference elements of the resources in
|
|
27
|
+
# the request, so that the must support reference tests can later check that they resolved.
|
|
28
|
+
# Inferno cannot reach the CRD client's FHIR server once the hook request is over, so they have
|
|
29
|
+
# to be read now. Must support requirements are satisfied by the resources the request carries,
|
|
30
|
+
# so references within the resources read are not followed. A resource without an identity, such as
|
|
31
|
+
# one in a Bundle entry without a fullUrl, still has its absolute references read, though its relative
|
|
32
|
+
# ones cannot be resolved.
|
|
33
|
+
#
|
|
34
|
+
# Resources and references are compared by normalized absolute URL (see ResourceIdentity), so a
|
|
35
|
+
# resource the request already carries, or that was already read for it, is not read again. A reference
|
|
36
|
+
# to a server other than the `fhirServer` is read from that server without the access token.
|
|
37
|
+
# Once a server has timed out, further reads from it would likely time out too, so no more are
|
|
38
|
+
# attempted from that server.
|
|
39
|
+
def request_must_support_references
|
|
40
|
+
carried = Set.new
|
|
41
|
+
to_read = []
|
|
42
|
+
ResourceIdentity.each_resource(request_body) do |identity, raw_resource|
|
|
43
|
+
carried << ResourceIdentity.normalized_url(identity) if identity.present?
|
|
44
|
+
to_read.concat(must_support_references_to_read(HookRequestResourceExtraction.to_fhir_resource(raw_resource),
|
|
45
|
+
identity))
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
to_read.each do |url|
|
|
49
|
+
next if carried.include?(url) || fetched_references.include?(normalize_reference(url))
|
|
50
|
+
next if server_timed_out?(url)
|
|
51
|
+
|
|
52
|
+
fetch_reference(url)
|
|
53
|
+
end
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
# The absolute URLs of the readable references in the must support Reference elements of a
|
|
57
|
+
# resource identified by the given URL, or by none.
|
|
58
|
+
def must_support_references_to_read(resource, identity)
|
|
59
|
+
return [] unless resource.respond_to?(:resourceType)
|
|
60
|
+
|
|
61
|
+
base = ResourceIdentity.base_for(identity)
|
|
62
|
+
metadata = ProfileMetadata.for_resource_type(MUST_SUPPORT_IG_VERSION, resource.resourceType)
|
|
63
|
+
navigator = MustSupportReferences::Navigator.new(metadata)
|
|
64
|
+
MustSupportReferences.reference_elements(metadata).flat_map do |element|
|
|
65
|
+
navigator.literal_references(resource, element[:path]).filter_map do |reference|
|
|
66
|
+
url = ResourceIdentity.normalized_url(ResourceIdentity.absolute_reference(reference.reference, base))
|
|
67
|
+
url if ResourceIdentity.readable?(url)
|
|
68
|
+
end
|
|
69
|
+
end.uniq
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
def request_access_level_target
|
|
73
|
+
return if access_level_target_reference.blank?
|
|
74
|
+
|
|
75
|
+
fetch_reference(access_level_target_reference, additional_tag: ACCESS_LEVEL_TARGET_FETCH_TAG)
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
def access_level_target_reference
|
|
79
|
+
JSON.parse(result.input_json)
|
|
80
|
+
.find { |input| input['name'].include?('access_level_target_reference') }
|
|
81
|
+
&.dig('value')
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
def prefetched_coverage_resource
|
|
85
|
+
if prefetched_coverage.is_a?(FHIR::Bundle)
|
|
86
|
+
prefetched_coverage_entry&.resource
|
|
87
|
+
elsif prefetched_coverage.is_a?(FHIR::Coverage)
|
|
88
|
+
prefetched_coverage
|
|
89
|
+
end
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
# A search Bundle can hold entries other than Coverages, such as an OperationOutcome, so the
|
|
93
|
+
# first Coverage is used rather than the first entry.
|
|
94
|
+
def prefetched_coverage_entry
|
|
95
|
+
prefetched_coverage.entry.find { |entry| entry.resource.is_a?(FHIR::Coverage) }
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
def request_coverage_payer
|
|
99
|
+
return unless prefetched_coverage.present?
|
|
100
|
+
|
|
101
|
+
coverage_resource = prefetched_coverage_resource
|
|
102
|
+
return unless coverage_resource.present? && coverage_resource.payor.first&.reference.present?
|
|
103
|
+
|
|
104
|
+
payer_reference = resolved_reference(coverage_resource.payor.first.reference, prefetched_coverage_identity)
|
|
105
|
+
fetch_reference(payer_reference, additional_tag: PAYER_ORG_FETCH_TAG) if payer_reference.present?
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
# The absolute URL identifying the prefetched Coverage (see ResourceIdentity).
|
|
109
|
+
def prefetched_coverage_identity
|
|
110
|
+
full_url = prefetched_coverage_entry&.fullUrl if prefetched_coverage.is_a?(FHIR::Bundle)
|
|
111
|
+
full_url.presence || ResourceIdentity.restful_identity(prefetched_coverage_resource, fhir_server_base)
|
|
112
|
+
end
|
|
113
|
+
|
|
114
|
+
# The normalized absolute form of a reference held by the resource identified by the given URL,
|
|
115
|
+
# following the FHIR rules for resolving references, or the reference as given when it has no
|
|
116
|
+
# absolute form. nil for a reference that is not a string, which cannot be read.
|
|
117
|
+
def resolved_reference(reference, holder_identity)
|
|
118
|
+
return unless reference.is_a?(String)
|
|
119
|
+
|
|
120
|
+
base = ResourceIdentity.base_for(holder_identity) || fhir_server_base
|
|
121
|
+
ResourceIdentity.normalized_url(ResourceIdentity.absolute_reference(reference, base)) || reference
|
|
122
|
+
end
|
|
123
|
+
|
|
124
|
+
def fhir_server_base
|
|
125
|
+
ResourceIdentity.fhir_server_base(request_body)
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
def request_parent_locations
|
|
129
|
+
prefetched_locations_and_parents_hash
|
|
130
|
+
end
|
|
131
|
+
|
|
132
|
+
def prefetched_location_bundle
|
|
133
|
+
locations_data = request_body.dig('prefetch', 'locations') || request_body.dig('prefetch', 'locs')
|
|
134
|
+
locations = FHIR.from_contents(locations_data.to_json) if locations_data.present?
|
|
135
|
+
return locations if locations.is_a?(FHIR::Bundle)
|
|
136
|
+
return nil unless locations.is_a?(FHIR::Location)
|
|
137
|
+
|
|
138
|
+
FHIR::Bundle.new({ entry: [FHIR::Bundle::Entry.new({ resource: locations })] })
|
|
139
|
+
end
|
|
140
|
+
|
|
141
|
+
# The prefetched Locations and their ancestors, keyed by the normalized absolute URL identifying each (see
|
|
142
|
+
# ResourceIdentity), or by `Location/id` when the request gives nothing to make one from.
|
|
143
|
+
def prefetched_locations_and_parents_hash
|
|
144
|
+
prefetched_location_bundle&.entry&.each_with_object({}) do |entry, hash|
|
|
145
|
+
add_location_to_hash(entry.resource, hash, entry.fullUrl.presence)
|
|
146
|
+
end
|
|
147
|
+
end
|
|
148
|
+
|
|
149
|
+
# A parent is identified by the URL it was read from, so its own `partOf` resolves against the
|
|
150
|
+
# server it came from.
|
|
151
|
+
def add_location_to_hash(location, location_hash, identity = nil)
|
|
152
|
+
return unless location.is_a?(FHIR::Location) && location.id.present?
|
|
153
|
+
|
|
154
|
+
identity = ResourceIdentity.normalized_url(identity || location_identity(location))
|
|
155
|
+
return if location_hash.key?(identity)
|
|
156
|
+
|
|
157
|
+
location_hash[identity] = location
|
|
158
|
+
parent_reference = resolved_reference(location.partOf&.reference, identity)
|
|
159
|
+
return if parent_reference.blank?
|
|
160
|
+
|
|
161
|
+
parent_location = fetch_reference(parent_reference,
|
|
162
|
+
additional_tag: PARENT_LOCATION_FETCH_TAG,
|
|
163
|
+
parse_as_fhir: true)
|
|
164
|
+
add_location_to_hash(parent_location, location_hash, parent_reference)
|
|
165
|
+
end
|
|
166
|
+
|
|
167
|
+
# A Location given without a fullUrl is taken to be on the request's FHIR server.
|
|
168
|
+
def location_identity(location)
|
|
169
|
+
ResourceIdentity.restful_identity(location, fhir_server_base) || "Location/#{location.id}"
|
|
170
|
+
end
|
|
171
|
+
end
|
|
172
|
+
end
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
module DaVinciCRDTestKit
|
|
2
|
+
# Checks the JSON types of the claims CDS Hooks requires in the authentication JWT payload. JWT.decode
|
|
3
|
+
# does not check them: it coerces `exp` with `to_i`, accepts any `jti` that is not blank, and does not
|
|
4
|
+
# check `iat` at all when its verification is turned off. Claims that are absent are not checked here,
|
|
5
|
+
# since they are reported as missing separately.
|
|
6
|
+
module JwtClaimTypes
|
|
7
|
+
CLAIM_TYPES = {
|
|
8
|
+
'iss' => ['a string', ->(value) { value.is_a?(String) }],
|
|
9
|
+
'aud' => ['a string or an array of strings',
|
|
10
|
+
->(value) { value.is_a?(String) || (value.is_a?(Array) && value.all?(String)) }],
|
|
11
|
+
'exp' => ['a number', ->(value) { value.is_a?(Numeric) }],
|
|
12
|
+
'iat' => ['a number', ->(value) { value.is_a?(Numeric) }],
|
|
13
|
+
'jti' => ['a string', ->(value) { value.is_a?(String) }]
|
|
14
|
+
}.freeze
|
|
15
|
+
|
|
16
|
+
# One message for each claim present in the payload that does not have the type CDS Hooks requires.
|
|
17
|
+
def jwt_claim_type_errors(payload)
|
|
18
|
+
return [] unless payload.is_a?(Hash)
|
|
19
|
+
|
|
20
|
+
CLAIM_TYPES.filter_map do |claim, (expected, valid)|
|
|
21
|
+
next unless payload.key?(claim)
|
|
22
|
+
next if valid.call(payload[claim])
|
|
23
|
+
|
|
24
|
+
"JWT payload claim `#{claim}` must be #{expected}, got #{payload[claim].to_json}."
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
require_relative '../cross_suite/tags'
|
|
2
|
+
require_relative 'client_base_urls'
|
|
3
|
+
require_relative 'prefetched_coverage_value'
|
|
4
|
+
|
|
5
|
+
module DaVinciCRDTestKit
|
|
6
|
+
# Checks of the Coverage prefetched in a hook request against the payer Organization registered
|
|
7
|
+
# for the invoked Inferno service. The payer is read by Inferno while processing the hook request.
|
|
8
|
+
# Including tests need the `complete_prefetch_service_organization_id` and
|
|
9
|
+
# `subset_prefetch_service_organization_id` inputs and DaVinciCRDTestKit::MultiRequestMessageHelper.
|
|
10
|
+
module PrefetchedCoveragePayerHelper
|
|
11
|
+
include ClientBaseURLs
|
|
12
|
+
|
|
13
|
+
def payer_org_id_for_request(request)
|
|
14
|
+
if prefetch_target(request) == :subset
|
|
15
|
+
subset_prefetch_service_organization_id
|
|
16
|
+
else
|
|
17
|
+
complete_prefetch_service_organization_id
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
# The Coverages prefetched in the request: either the prefetched value itself when given as a
|
|
22
|
+
# Coverage, or the Coverages in a prefetched Bundle. A Coverage given outside a Bundle is reported
|
|
23
|
+
# by the prefetch completeness check, so it is still checked here.
|
|
24
|
+
def prefetched_coverages(request_body)
|
|
25
|
+
coverage_value = PrefetchedCoverageValue.find(request_body['prefetch'])
|
|
26
|
+
return [] if coverage_value.nil?
|
|
27
|
+
return [coverage_value] if coverage_value['resourceType'] == 'Coverage'
|
|
28
|
+
|
|
29
|
+
Array(coverage_value['entry']).filter_map { |entry| entry['resource'] if entry.is_a?(Hash) }
|
|
30
|
+
.select { |resource| resource.is_a?(Hash) && resource['resourceType'] == 'Coverage' }
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# the Coverage the payer is read from while processing the hook request
|
|
34
|
+
def first_prefetched_coverage(request_body)
|
|
35
|
+
prefetched_coverages(request_body).first
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
# the reference to the Coverage's first payer, or nil when it does not have one as a string
|
|
39
|
+
def coverage_payer_reference(coverage)
|
|
40
|
+
payor = coverage['payor']
|
|
41
|
+
first_payor = payor.first if payor.is_a?(Array)
|
|
42
|
+
reference = first_payor['reference'] if first_payor.is_a?(Hash)
|
|
43
|
+
reference if reference.is_a?(String)
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
def load_payer_request_for_hook_request(request_body)
|
|
47
|
+
hook_data_fetch_tag = TagMethods.hook_instance_data_fetch_tag(request_body['hookInstance'])
|
|
48
|
+
load_tagged_requests(PAYER_ORG_FETCH_TAG, hook_data_fetch_tag).first
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
# Reports any problem with the payer read for the request and returns the payer resource when one
|
|
52
|
+
# was returned, so that callers can check it further.
|
|
53
|
+
def check_payer_organization(request_body, request_index, expected_payer_org_id)
|
|
54
|
+
payer_request = load_payer_request_for_hook_request(request_body)
|
|
55
|
+
unless payer_request.present? && payer_request.status.to_s.starts_with?('2')
|
|
56
|
+
add_request_message('error',
|
|
57
|
+
"Inferno failed to retrieve the Coverage's payer during hook processing.",
|
|
58
|
+
request_index)
|
|
59
|
+
return
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
payer_resource = FHIR.from_contents(payer_request.response_body)
|
|
63
|
+
unless payer_resource.present?
|
|
64
|
+
add_request_message('error', 'Request for payer resource returned invalid FHIR data.', request_index)
|
|
65
|
+
return
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
if payer_resource.resourceType != 'Organization'
|
|
69
|
+
add_request_message('error', 'Payer for the Coverage is not an Organization: ' \
|
|
70
|
+
"got '#{payer_resource.resourceType}'", request_index)
|
|
71
|
+
end
|
|
72
|
+
if payer_resource.id != expected_payer_org_id
|
|
73
|
+
add_request_message('error', 'Payer for the Coverage has the wrong id: ' \
|
|
74
|
+
"expected '#{expected_payer_org_id}', got '#{payer_resource.id}'.",
|
|
75
|
+
request_index)
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
payer_resource
|
|
79
|
+
end
|
|
80
|
+
end
|
|
81
|
+
end
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
module DaVinciCRDTestKit
|
|
2
|
+
# Finds the coverage data a hook request prefetched, under the key requested by either of Inferno's
|
|
3
|
+
# simulated CRD servers: `coverage` by the complete prefetch server and `cov` by the subset prefetch
|
|
4
|
+
# server. A value that is not a JSON object does not hide a valid value under the other key.
|
|
5
|
+
module PrefetchedCoverageValue
|
|
6
|
+
KEYS = ['coverage', 'cov'].freeze
|
|
7
|
+
|
|
8
|
+
def self.find(prefetch)
|
|
9
|
+
return unless prefetch.is_a?(Hash)
|
|
10
|
+
|
|
11
|
+
prefetch.values_at(*KEYS).find { |value| value.is_a?(Hash) && value.present? }
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
@@ -1,10 +1,18 @@
|
|
|
1
|
+
require_relative '../cross_suite/short_circuit_interaction'
|
|
2
|
+
|
|
1
3
|
module DaVinciCRDTestKit
|
|
2
4
|
module TaggedRequestLoadHelper
|
|
5
|
+
include ShortCircuitInteraction
|
|
6
|
+
|
|
3
7
|
def load_requests_for_cross_hook_analysis
|
|
4
8
|
load_tagged_requests(CROSS_HOOK_ANALYSIS_TAG)
|
|
5
9
|
end
|
|
6
10
|
|
|
11
|
+
# Passes rather than loading anything when the group's first test decided no requests were
|
|
12
|
+
# coming, so a tester who demonstrated everything earlier is not left with skipped tests.
|
|
7
13
|
def load_interaction_group_requests
|
|
14
|
+
check_for_short_circuit
|
|
15
|
+
|
|
8
16
|
load_tagged_requests(config.options[:crd_interaction_group])
|
|
9
17
|
end
|
|
10
18
|
|
|
@@ -22,7 +22,7 @@ module DaVinciCRDTestKit
|
|
|
22
22
|
title: 'CRD JSON Web Key Set (JWKS)',
|
|
23
23
|
type: 'textarea',
|
|
24
24
|
description: %(
|
|
25
|
-
The client's registered JWK Set containing
|
|
25
|
+
The client's registered JWK Set containing its public key, either
|
|
26
26
|
as a publicly accessible url containing the JWKS, or the raw JWKS.
|
|
27
27
|
Run or re-run the **Client Registration** group to set or
|
|
28
28
|
change this value. Used if the `jku` header is not found in the auth token jwt.
|
|
@@ -10,11 +10,12 @@ module DaVinciCRDTestKit
|
|
|
10
10
|
description %(
|
|
11
11
|
Verify that the JWT header contains the header fields required by the
|
|
12
12
|
[CDS hooks spec](https://cds-hooks.hl7.org/2.0#trusting-cds-clients).
|
|
13
|
-
The `alg`, `kid`, and `typ` fields are required
|
|
14
|
-
`JWT` and that the key used to sign the token can be
|
|
13
|
+
The `alg`, `kid`, and `typ` fields are required, and `alg` and `kid` must be strings. This test
|
|
14
|
+
also verifies that the `typ` field is set to `JWT` and that the key used to sign the token can be
|
|
15
|
+
identified in the JWKS.
|
|
15
16
|
)
|
|
16
17
|
|
|
17
|
-
verifies_requirements 'cds-hooks_2.0@182', 'cds-hooks_2.0@184', 'cds-hooks_2.0@202'
|
|
18
|
+
verifies_requirements 'cds-hooks_2.0@181', 'cds-hooks_2.0@182', 'cds-hooks_2.0@184', 'cds-hooks_2.0@202'
|
|
18
19
|
|
|
19
20
|
input :auth_token_headers_json, :crd_jwks_keys_json
|
|
20
21
|
output :auth_tokens_jwk_json
|
|
@@ -32,7 +33,11 @@ module DaVinciCRDTestKit
|
|
|
32
33
|
header = JSON.parse(token_header)
|
|
33
34
|
algorithm = header['alg']
|
|
34
35
|
|
|
35
|
-
|
|
36
|
+
if algorithm.blank?
|
|
37
|
+
add_message('error', "#{request_number}Token header must have the `alg` field")
|
|
38
|
+
elsif !algorithm.is_a?(String)
|
|
39
|
+
add_message('error', "#{request_number}Token header `alg` field must be a string, got #{algorithm.to_json}")
|
|
40
|
+
end
|
|
36
41
|
|
|
37
42
|
add_message('error', "#{request_number}Token header `alg` field cannot be set to none") if algorithm == 'none'
|
|
38
43
|
|
|
@@ -50,6 +55,11 @@ module DaVinciCRDTestKit
|
|
|
50
55
|
end
|
|
51
56
|
|
|
52
57
|
kid = header['kid']
|
|
58
|
+
unless kid.is_a?(String)
|
|
59
|
+
add_message('error', "#{request_number}Token header `kid` field must be a string, got #{kid.to_json}")
|
|
60
|
+
next
|
|
61
|
+
end
|
|
62
|
+
|
|
53
63
|
keys = JSON.parse(crd_jwks_keys[index])
|
|
54
64
|
|
|
55
65
|
jwk = keys.find { |key| key['kid'] == kid }
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
require_relative '../../client_hook_request_validation'
|
|
2
|
+
require_relative '../../jwt_claim_types'
|
|
2
3
|
|
|
3
4
|
module DaVinciCRDTestKit
|
|
4
5
|
module V201
|
|
5
6
|
class TokenPayloadTest < Inferno::Test
|
|
6
7
|
include ClientHookRequestValidation
|
|
8
|
+
include DaVinciCRDTestKit::JwtClaimTypes
|
|
7
9
|
include ClientURLs
|
|
8
10
|
|
|
9
11
|
id :crd_v201_token_payload
|
|
@@ -18,9 +20,10 @@ module DaVinciCRDTestKit
|
|
|
18
20
|
- `aud` must match the URL of the CDS Service endpoint being invoked
|
|
19
21
|
- `exp` must represent a time in the future
|
|
20
22
|
- `jti` must be a non-blank string that uniquely identifies this authentication JWT
|
|
23
|
+
- `iss` must be a string, `aud` a string or an array of strings, and `exp` and `iat` numbers
|
|
21
24
|
)
|
|
22
25
|
|
|
23
|
-
verifies_requirements 'cds-hooks_2.0@180', 'cds-hooks_2.0@
|
|
26
|
+
verifies_requirements 'cds-hooks_2.0@180', 'cds-hooks_2.0@187', 'cds-hooks_2.0@189',
|
|
24
27
|
'cds-hooks_2.0@190', 'cds-hooks_2.0@191', 'cds-hooks_2.0@192', 'cds-hooks_2.0@196',
|
|
25
28
|
'cds-hooks_2.0@203'
|
|
26
29
|
|
|
@@ -85,6 +88,10 @@ module DaVinciCRDTestKit
|
|
|
85
88
|
add_message('error', "#{request_number}Token validation error: #{e.message}")
|
|
86
89
|
end
|
|
87
90
|
|
|
91
|
+
jwt_claim_type_errors(unverified_payload).each do |message|
|
|
92
|
+
add_message('error', "#{request_number}#{message}")
|
|
93
|
+
end
|
|
94
|
+
|
|
88
95
|
missing_claims = required_claims - unverified_payload.keys
|
|
89
96
|
next if missing_claims.empty?
|
|
90
97
|
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
{
|
|
5
5
|
"hook": "appointment-book",
|
|
6
6
|
"title": "Appointment Booking CDS Service",
|
|
7
|
-
"description": "An example of a CDS Service that is invoked when user
|
|
7
|
+
"description": "An example of a CDS Service that is invoked when user books a future appointment for a patient",
|
|
8
8
|
"id": "appointment-book-service",
|
|
9
9
|
"prefetch": {
|
|
10
10
|
"user": "{{context.userId}}",
|
|
@@ -74,7 +74,7 @@ module DaVinciCRDTestKit
|
|
|
74
74
|
Under [Privacy, Security, and Safety](https://hl7.org/fhir/us/davinci-crd/STU2/security.html),
|
|
75
75
|
the CRD Implementation Guide imposes the following rule about TLS:
|
|
76
76
|
|
|
77
|
-
As per the [CDS
|
|
77
|
+
As per the [CDS Hooks specification](https://cds-hooks.hl7.org/2.0/#security-and-safety),
|
|
78
78
|
communications between CRD clients and CRD servers SHALL
|
|
79
79
|
use TLS. Mutual TLS is not required by this specification but is permitted. CRD servers and
|
|
80
80
|
CRD clients SHOULD enforce a minimum version and other TLS configuration requirements based
|
|
@@ -104,7 +104,7 @@ module DaVinciCRDTestKit
|
|
|
104
104
|
Under [Privacy, Security, and Safety](https://hl7.org/fhir/us/davinci-crd/STU2/security.html),
|
|
105
105
|
the CRD Implementation Guide imposes the following rule about TLS:
|
|
106
106
|
|
|
107
|
-
As per the [CDS
|
|
107
|
+
As per the [CDS Hooks specification](https://cds-hooks.hl7.org/2.0/#security-and-safety),
|
|
108
108
|
communications between CRD clients and CRD servers SHALL
|
|
109
109
|
use TLS. Mutual TLS is not required by this specification but is permitted. CRD servers and
|
|
110
110
|
CRD clients SHOULD enforce a minimum version and other TLS configuration requirements based
|
|
@@ -4,6 +4,7 @@ require_relative 'client_encounter_start_group'
|
|
|
4
4
|
require_relative 'client_order_dispatch_group'
|
|
5
5
|
require_relative 'client_order_select_group'
|
|
6
6
|
require_relative 'client_order_sign_group'
|
|
7
|
+
require_relative '../client_input_helper'
|
|
7
8
|
|
|
8
9
|
module DaVinciCRDTestKit
|
|
9
10
|
module V201
|
|
@@ -43,11 +44,7 @@ module DaVinciCRDTestKit
|
|
|
43
44
|
|
|
44
45
|
input :cds_jwt_iss,
|
|
45
46
|
title: 'CRD JWT Issuer',
|
|
46
|
-
description:
|
|
47
|
-
Value of the `iss` claim that must be sent on the Bearer token in the `Authorization`
|
|
48
|
-
header of all requests. Run or re-run the **Client Registration** group to set or
|
|
49
|
-
change this value.
|
|
50
|
-
),
|
|
47
|
+
description: ClientInputHelper.v201_locked_cds_jwt_iss_description,
|
|
51
48
|
locked: true
|
|
52
49
|
|
|
53
50
|
input_order :cds_jwt_iss, :cds_jwk_set
|
|
@@ -15,7 +15,7 @@ module DaVinciCRDTestKit
|
|
|
15
15
|
id :crd_client
|
|
16
16
|
title 'Da Vinci CRD Client v2.0.1 Test Suite'
|
|
17
17
|
description <<~DESCRIPTION
|
|
18
|
-
The Da Vinci CRD Client Test Suite tests the conformance of
|
|
18
|
+
The Da Vinci CRD Client Test Suite tests the conformance of CRD clients
|
|
19
19
|
to [version 2.0.1 of the Da Vinci Coverage Requirements Discovery (CRD)
|
|
20
20
|
Implementation Guide](https://hl7.org/fhir/us/davinci-crd/STU2).
|
|
21
21
|
|
|
@@ -30,7 +30,7 @@ module DaVinciCRDTestKit
|
|
|
30
30
|
DESCRIPTION
|
|
31
31
|
|
|
32
32
|
suite_summary <<~SUMMARY
|
|
33
|
-
The Da Vinci CRD Client Test Suite tests the conformance of
|
|
33
|
+
The Da Vinci CRD Client Test Suite tests the conformance of CRD clients
|
|
34
34
|
to [version 2.0.1 of the Da Vinci Coverage Requirements Discovery (CRD)
|
|
35
35
|
Implementation Guide](https://hl7.org/fhir/us/davinci-crd/STU2).
|
|
36
36
|
SUMMARY
|
data/lib/davinci_crd_test_kit/client/v2.0.1/invocation/appointment_book_receive_request_test.rb
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
require_relative '../client_urls'
|
|
2
|
+
require_relative '../../client_input_helper'
|
|
2
3
|
|
|
3
4
|
module DaVinciCRDTestKit
|
|
4
5
|
module V201
|
|
@@ -15,7 +16,7 @@ module DaVinciCRDTestKit
|
|
|
15
16
|
level of detail provided is insufficient to determine coverage.
|
|
16
17
|
|
|
17
18
|
For more details on how Inferno's simulated CDS Service behave during hook invocation see the
|
|
18
|
-
[simulated CRD server(https://github.com/inferno-framework/davinci-crd-test-kit/wiki/Client-Details#crd-server-
|
|
19
|
+
[simulated CRD server(https://github.com/inferno-framework/davinci-crd-test-kit/wiki/Client-Details#simulated-crd-server-in-the-crd-client-v201-suite)
|
|
19
20
|
documentation.
|
|
20
21
|
)
|
|
21
22
|
config options: { accepts_multiple_requests: true }
|
|
@@ -26,39 +27,19 @@ module DaVinciCRDTestKit
|
|
|
26
27
|
|
|
27
28
|
input :cds_jwt_iss,
|
|
28
29
|
title: 'CRD JWT Issuer',
|
|
29
|
-
description:
|
|
30
|
-
Value of the `iss` claim that must be sent on the Bearer token in the `Authorization`
|
|
31
|
-
header of all requests. Run or re-run the **Client Registration** group to set or
|
|
32
|
-
change this value.
|
|
33
|
-
),
|
|
30
|
+
description: ClientInputHelper.v201_locked_cds_jwt_iss_description,
|
|
34
31
|
locked: true
|
|
35
32
|
input :appointment_book_response_approach,
|
|
36
33
|
title: 'Response generation approach for appointment-book',
|
|
37
|
-
description:
|
|
38
|
-
Determines how Inferno will generate response for appointment-book
|
|
39
|
-
hook invocations.
|
|
40
|
-
),
|
|
34
|
+
description: ClientInputHelper.response_approach_description('appointment-book'),
|
|
41
35
|
type: 'radio',
|
|
42
36
|
default: 'mocked',
|
|
43
|
-
options:
|
|
44
|
-
list_options: [
|
|
45
|
-
{
|
|
46
|
-
label: 'Create simple mocks based on selected response types',
|
|
47
|
-
value: 'mocked'
|
|
48
|
-
},
|
|
49
|
-
{
|
|
50
|
-
label: 'Generate responses based on a tester-provided template',
|
|
51
|
-
value: 'custom'
|
|
52
|
-
}
|
|
53
|
-
]
|
|
54
|
-
}
|
|
37
|
+
options: ClientInputHelper.response_approach_options
|
|
55
38
|
input :appointment_book_selected_response_types,
|
|
56
39
|
title: 'Response types to return from appointment-book hook requests',
|
|
57
40
|
description: %(
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
a [Coverage Information](https://hl7.org/fhir/us/davinci-crd/2.2.1/en/cards.html#coverage-information-response-type)
|
|
61
|
-
response for this primary hook.
|
|
41
|
+
#{ClientInputHelper.mocked_response_types_intro}
|
|
42
|
+
#{ClientInputHelper.default_response_type_note(primary: true)}
|
|
62
43
|
),
|
|
63
44
|
type: 'checkbox',
|
|
64
45
|
default: ['coverage_information', 'external_reference', 'instructions'],
|
|
@@ -94,18 +75,16 @@ module DaVinciCRDTestKit
|
|
|
94
75
|
enable_when: { input_name: 'appointment_book_response_approach', value: 'mocked' }
|
|
95
76
|
input :appointment_book_custom_response_template,
|
|
96
77
|
title: 'Custom response template for appointment-book hook requests',
|
|
97
|
-
description:
|
|
98
|
-
Provide a [custom response template](https://github.com/inferno-framework/davinci-crd-test-kit/wiki/Controlling-Simulated-Responses#tester-directed-custom-responses)
|
|
99
|
-
in JSON form for Inferno to use when responding to hook invocations.
|
|
100
|
-
),
|
|
78
|
+
description: ClientInputHelper.custom_response_template_description,
|
|
101
79
|
type: 'textarea',
|
|
102
80
|
optional: true,
|
|
103
81
|
enable_when: { input_name: 'appointment_book_response_approach', value: 'custom' }
|
|
104
82
|
output :continuation_url
|
|
83
|
+
flag_as_tester_initiated_exchange
|
|
105
84
|
|
|
106
85
|
run do
|
|
107
86
|
identifier = cds_jwt_iss
|
|
108
|
-
continuation_url =
|
|
87
|
+
continuation_url = resume_pass_url_for(identifier)
|
|
109
88
|
output(continuation_url:)
|
|
110
89
|
|
|
111
90
|
wait(
|
data/lib/davinci_crd_test_kit/client/v2.0.1/invocation/encounter_discharge_receive_request_test.rb
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
require_relative '../client_urls'
|
|
2
|
+
require_relative '../../client_input_helper'
|
|
2
3
|
|
|
3
4
|
module DaVinciCRDTestKit
|
|
4
5
|
module V201
|
|
@@ -12,7 +13,7 @@ module DaVinciCRDTestKit
|
|
|
12
13
|
hook requests and responds to the client with the response types selected as an input.
|
|
13
14
|
|
|
14
15
|
For more details on how Inferno's simulated CDS Service behave during hook invocation see the
|
|
15
|
-
[simulated CRD server](https://github.com/inferno-framework/davinci-crd-test-kit/wiki/Client-Details#crd-server-
|
|
16
|
+
[simulated CRD server](https://github.com/inferno-framework/davinci-crd-test-kit/wiki/Client-Details#simulated-crd-server-in-the-crd-client-v201-suite)
|
|
16
17
|
documentation.
|
|
17
18
|
)
|
|
18
19
|
verifies_requirements 'hl7.fhir.us.davinci-crd_2.0.1@197', 'hl7.fhir.us.davinci-crd_2.0.1@243',
|
|
@@ -23,39 +24,19 @@ module DaVinciCRDTestKit
|
|
|
23
24
|
|
|
24
25
|
input :cds_jwt_iss,
|
|
25
26
|
title: 'CRD JWT Issuer',
|
|
26
|
-
description:
|
|
27
|
-
Value of the `iss` claim that must be sent on the Bearer token in the `Authorization`
|
|
28
|
-
header of all requests. Run or re-run the **Client Registration** group to set or
|
|
29
|
-
change this value.
|
|
30
|
-
),
|
|
27
|
+
description: ClientInputHelper.v201_locked_cds_jwt_iss_description,
|
|
31
28
|
locked: true
|
|
32
29
|
input :encounter_discharge_response_approach,
|
|
33
30
|
title: 'Response generation approach for encounter-discharge',
|
|
34
|
-
description:
|
|
35
|
-
Determines how Inferno will generate response for encounter-discharge
|
|
36
|
-
hook invocations.
|
|
37
|
-
),
|
|
31
|
+
description: ClientInputHelper.response_approach_description('encounter-discharge'),
|
|
38
32
|
type: 'radio',
|
|
39
33
|
default: 'mocked',
|
|
40
|
-
options:
|
|
41
|
-
list_options: [
|
|
42
|
-
{
|
|
43
|
-
label: 'Create simple mocks based on selected response types',
|
|
44
|
-
value: 'mocked'
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
label: 'Generate responses based on a tester-provided template',
|
|
48
|
-
value: 'custom'
|
|
49
|
-
}
|
|
50
|
-
]
|
|
51
|
-
}
|
|
34
|
+
options: ClientInputHelper.response_approach_options
|
|
52
35
|
input :encounter_discharge_selected_response_types,
|
|
53
36
|
title: 'Response types to return from encounter-discharge hook requests',
|
|
54
37
|
description: %(
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
an [Instructions](https://hl7.org/fhir/us/davinci-crd/2.2.1/en/cards.html#instructions-response-type)
|
|
58
|
-
response for this secondary hook.
|
|
38
|
+
#{ClientInputHelper.mocked_response_types_intro}
|
|
39
|
+
#{ClientInputHelper.default_response_type_note(primary: false)}
|
|
59
40
|
),
|
|
60
41
|
type: 'checkbox',
|
|
61
42
|
default: ['coverage_information', 'external_reference', 'instructions'],
|
|
@@ -91,18 +72,16 @@ module DaVinciCRDTestKit
|
|
|
91
72
|
enable_when: { input_name: 'encounter_discharge_response_approach', value: 'mocked' }
|
|
92
73
|
input :encounter_discharge_custom_response_template,
|
|
93
74
|
title: 'Custom response template for encounter-discharge hook requests',
|
|
94
|
-
description:
|
|
95
|
-
Provide a [custom response template](https://github.com/inferno-framework/davinci-crd-test-kit/wiki/Controlling-Simulated-Responses#tester-directed-custom-responses)
|
|
96
|
-
in JSON form for Inferno to use when responding to hook invocations.
|
|
97
|
-
),
|
|
75
|
+
description: ClientInputHelper.custom_response_template_description,
|
|
98
76
|
type: 'textarea',
|
|
99
77
|
optional: true,
|
|
100
78
|
enable_when: { input_name: 'encounter_discharge_response_approach', value: 'custom' }
|
|
101
79
|
output :continuation_url
|
|
80
|
+
flag_as_tester_initiated_exchange
|
|
102
81
|
|
|
103
82
|
run do
|
|
104
83
|
identifier = cds_jwt_iss
|
|
105
|
-
continuation_url =
|
|
84
|
+
continuation_url = resume_pass_url_for(identifier)
|
|
106
85
|
output(continuation_url:)
|
|
107
86
|
|
|
108
87
|
wait(
|