davinci_pas_test_kit 0.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE +201 -0
- data/lib/davinci_pas_test_kit/client_suite.rb +289 -0
- data/lib/davinci_pas_test_kit/custom_groups/v2.0.1/claim_status/pas_claim_status_test.rb +109 -0
- data/lib/davinci_pas_test_kit/custom_groups/v2.0.1/client_tests/pas_client_approval_submit_response_attest.rb +39 -0
- data/lib/davinci_pas_test_kit/custom_groups/v2.0.1/client_tests/pas_client_approval_submit_test.rb +38 -0
- data/lib/davinci_pas_test_kit/custom_groups/v2.0.1/client_tests/pas_client_denial_submit_response_attest.rb +38 -0
- data/lib/davinci_pas_test_kit/custom_groups/v2.0.1/client_tests/pas_client_denial_submit_test.rb +43 -0
- data/lib/davinci_pas_test_kit/custom_groups/v2.0.1/client_tests/pas_client_inquire_must_support_test.rb +51 -0
- data/lib/davinci_pas_test_kit/custom_groups/v2.0.1/client_tests/pas_client_pended_inquire_response_attest.rb +39 -0
- data/lib/davinci_pas_test_kit/custom_groups/v2.0.1/client_tests/pas_client_pended_inquire_test.rb +35 -0
- data/lib/davinci_pas_test_kit/custom_groups/v2.0.1/client_tests/pas_client_pended_submit_response_attest.rb +39 -0
- data/lib/davinci_pas_test_kit/custom_groups/v2.0.1/client_tests/pas_client_pended_submit_test.rb +43 -0
- data/lib/davinci_pas_test_kit/custom_groups/v2.0.1/client_tests/pas_client_submit_must_support_test.rb +57 -0
- data/lib/davinci_pas_test_kit/custom_groups/v2.0.1/client_tests/pas_client_token_request_test.rb +31 -0
- data/lib/davinci_pas_test_kit/custom_groups/v2.0.1/client_tests/pas_client_token_validation_test.rb +18 -0
- data/lib/davinci_pas_test_kit/custom_groups/v2.0.1/error_tests/nonconformant_pas_bundle.json +16 -0
- data/lib/davinci_pas_test_kit/custom_groups/v2.0.1/error_tests/pas_inquiry_error_test.rb +38 -0
- data/lib/davinci_pas_test_kit/custom_groups/v2.0.1/error_tests/pas_submission_error_test.rb +56 -0
- data/lib/davinci_pas_test_kit/custom_groups/v2.0.1/must_support/device_request_metadata.yml +112 -0
- data/lib/davinci_pas_test_kit/custom_groups/v2.0.1/must_support/medication_request_metadata.yml +183 -0
- data/lib/davinci_pas_test_kit/custom_groups/v2.0.1/must_support/nutrition_order_metadata.yml +109 -0
- data/lib/davinci_pas_test_kit/custom_groups/v2.0.1/must_support/pas_client_must_support_requirement_test.rb +117 -0
- data/lib/davinci_pas_test_kit/custom_groups/v2.0.1/must_support/pas_server_must_support_requirement_test.rb +116 -0
- data/lib/davinci_pas_test_kit/custom_groups/v2.0.1/must_support/service_request_metadata.yml +148 -0
- data/lib/davinci_pas_test_kit/custom_groups/v2.0.1/pas_client_approval_group.rb +26 -0
- data/lib/davinci_pas_test_kit/custom_groups/v2.0.1/pas_client_authentication_group.rb +49 -0
- data/lib/davinci_pas_test_kit/custom_groups/v2.0.1/pas_client_denial_group.rb +41 -0
- data/lib/davinci_pas_test_kit/custom_groups/v2.0.1/pas_client_pended_group.rb +56 -0
- data/lib/davinci_pas_test_kit/custom_groups/v2.0.1/pas_error_group.rb +20 -0
- data/lib/davinci_pas_test_kit/ext/inferno_core/record_response_route.rb +98 -0
- data/lib/davinci_pas_test_kit/ext/inferno_core/request.rb +19 -0
- data/lib/davinci_pas_test_kit/ext/inferno_core/runnable.rb +18 -0
- data/lib/davinci_pas_test_kit/fhir_resource_navigation.rb +72 -0
- data/lib/davinci_pas_test_kit/generated/v2.0.1/beneficiary/client_inquiry_request_beneficiary_must_support_test.rb +75 -0
- data/lib/davinci_pas_test_kit/generated/v2.0.1/beneficiary/client_submit_request_beneficiary_must_support_test.rb +75 -0
- data/lib/davinci_pas_test_kit/generated/v2.0.1/beneficiary/metadata.yml +162 -0
- data/lib/davinci_pas_test_kit/generated/v2.0.1/beneficiary/server_inquiry_request_beneficiary_must_support_test.rb +75 -0
- data/lib/davinci_pas_test_kit/generated/v2.0.1/beneficiary/server_inquiry_response_beneficiary_must_support_test.rb +75 -0
- data/lib/davinci_pas_test_kit/generated/v2.0.1/beneficiary/server_submit_request_beneficiary_must_support_test.rb +75 -0
- data/lib/davinci_pas_test_kit/generated/v2.0.1/beneficiary/server_submit_response_beneficiary_must_support_test.rb +75 -0
- data/lib/davinci_pas_test_kit/generated/v2.0.1/claim/claim_operation_test.rb +67 -0
- data/lib/davinci_pas_test_kit/generated/v2.0.1/claim/metadata.yml +577 -0
- data/lib/davinci_pas_test_kit/generated/v2.0.1/claim_inquiry/claim_inquiry_operation_test.rb +57 -0
- data/lib/davinci_pas_test_kit/generated/v2.0.1/claim_inquiry/client_inquiry_request_claim_inquiry_must_support_test.rb +95 -0
- data/lib/davinci_pas_test_kit/generated/v2.0.1/claim_inquiry/metadata.yml +516 -0
- data/lib/davinci_pas_test_kit/generated/v2.0.1/claim_inquiry/server_inquiry_request_claim_inquiry_must_support_test.rb +95 -0
- data/lib/davinci_pas_test_kit/generated/v2.0.1/claim_update/client_submit_request_claim_update_must_support_test.rb +102 -0
- data/lib/davinci_pas_test_kit/generated/v2.0.1/claim_update/metadata.yml +591 -0
- data/lib/davinci_pas_test_kit/generated/v2.0.1/claim_update/server_submit_request_claim_update_must_support_test.rb +102 -0
- data/lib/davinci_pas_test_kit/generated/v2.0.1/claiminquiryresponse/metadata.yml +311 -0
- data/lib/davinci_pas_test_kit/generated/v2.0.1/claiminquiryresponse/server_inquiry_response_claiminquiryresponse_must_support_test.rb +73 -0
- data/lib/davinci_pas_test_kit/generated/v2.0.1/claimresponse/metadata.yml +318 -0
- data/lib/davinci_pas_test_kit/generated/v2.0.1/claimresponse/server_submit_response_claimresponse_must_support_test.rb +75 -0
- data/lib/davinci_pas_test_kit/generated/v2.0.1/client_tests/client_denial_pas_response_bundle_validation_test.rb +53 -0
- data/lib/davinci_pas_test_kit/generated/v2.0.1/client_tests/client_pas_request_bundle_validation_test.rb +55 -0
- data/lib/davinci_pas_test_kit/generated/v2.0.1/client_tests/client_pended_pas_inquiry_request_bundle_validation_test.rb +55 -0
- data/lib/davinci_pas_test_kit/generated/v2.0.1/client_tests/client_pended_pas_response_bundle_validation_test.rb +53 -0
- data/lib/davinci_pas_test_kit/generated/v2.0.1/communication_request/metadata.yml +130 -0
- data/lib/davinci_pas_test_kit/generated/v2.0.1/communication_request/server_submit_response_communication_request_must_support_test.rb +58 -0
- data/lib/davinci_pas_test_kit/generated/v2.0.1/coverage/client_inquiry_request_coverage_must_support_test.rb +55 -0
- data/lib/davinci_pas_test_kit/generated/v2.0.1/coverage/client_submit_request_coverage_must_support_test.rb +55 -0
- data/lib/davinci_pas_test_kit/generated/v2.0.1/coverage/metadata.yml +111 -0
- data/lib/davinci_pas_test_kit/generated/v2.0.1/coverage/server_inquiry_request_coverage_must_support_test.rb +55 -0
- data/lib/davinci_pas_test_kit/generated/v2.0.1/coverage/server_submit_request_coverage_must_support_test.rb +55 -0
- data/lib/davinci_pas_test_kit/generated/v2.0.1/device_request/client_submit_request_device_request_must_support_test.rb +51 -0
- data/lib/davinci_pas_test_kit/generated/v2.0.1/device_request/metadata.yml +112 -0
- data/lib/davinci_pas_test_kit/generated/v2.0.1/device_request/server_submit_request_device_request_must_support_test.rb +51 -0
- data/lib/davinci_pas_test_kit/generated/v2.0.1/encounter/client_submit_request_encounter_must_support_test.rb +67 -0
- data/lib/davinci_pas_test_kit/generated/v2.0.1/encounter/metadata.yml +213 -0
- data/lib/davinci_pas_test_kit/generated/v2.0.1/encounter/server_submit_request_encounter_must_support_test.rb +67 -0
- data/lib/davinci_pas_test_kit/generated/v2.0.1/insurer/client_inquiry_request_insurer_must_support_test.rb +60 -0
- data/lib/davinci_pas_test_kit/generated/v2.0.1/insurer/client_submit_request_insurer_must_support_test.rb +60 -0
- data/lib/davinci_pas_test_kit/generated/v2.0.1/insurer/metadata.yml +104 -0
- data/lib/davinci_pas_test_kit/generated/v2.0.1/insurer/server_inquiry_request_insurer_must_support_test.rb +60 -0
- data/lib/davinci_pas_test_kit/generated/v2.0.1/insurer/server_inquiry_response_insurer_must_support_test.rb +60 -0
- data/lib/davinci_pas_test_kit/generated/v2.0.1/insurer/server_submit_request_insurer_must_support_test.rb +60 -0
- data/lib/davinci_pas_test_kit/generated/v2.0.1/insurer/server_submit_response_insurer_must_support_test.rb +60 -0
- data/lib/davinci_pas_test_kit/generated/v2.0.1/medication_request/client_submit_request_medication_request_must_support_test.rb +61 -0
- data/lib/davinci_pas_test_kit/generated/v2.0.1/medication_request/metadata.yml +183 -0
- data/lib/davinci_pas_test_kit/generated/v2.0.1/medication_request/server_submit_request_medication_request_must_support_test.rb +61 -0
- data/lib/davinci_pas_test_kit/generated/v2.0.1/metadata.yml +5253 -0
- data/lib/davinci_pas_test_kit/generated/v2.0.1/nutrition_order/client_submit_request_nutrition_order_must_support_test.rb +53 -0
- data/lib/davinci_pas_test_kit/generated/v2.0.1/nutrition_order/metadata.yml +109 -0
- data/lib/davinci_pas_test_kit/generated/v2.0.1/nutrition_order/server_submit_request_nutrition_order_must_support_test.rb +53 -0
- data/lib/davinci_pas_test_kit/generated/v2.0.1/pas_client_inquiry_must_support_use_case_group.rb +51 -0
- data/lib/davinci_pas_test_kit/generated/v2.0.1/pas_client_submit_must_support_use_case_group.rb +61 -0
- data/lib/davinci_pas_test_kit/generated/v2.0.1/pas_inquiry_request_bundle/client_inquiry_request_pas_inquiry_request_bundle_must_support_test.rb +53 -0
- data/lib/davinci_pas_test_kit/generated/v2.0.1/pas_inquiry_request_bundle/metadata.yml +77 -0
- data/lib/davinci_pas_test_kit/generated/v2.0.1/pas_inquiry_request_bundle/server_inquiry_request_pas_inquiry_request_bundle_must_support_test.rb +53 -0
- data/lib/davinci_pas_test_kit/generated/v2.0.1/pas_inquiry_request_bundle/server_pas_inquiry_request_bundle_validation_test.rb +83 -0
- data/lib/davinci_pas_test_kit/generated/v2.0.1/pas_inquiry_response_bundle/metadata.yml +67 -0
- data/lib/davinci_pas_test_kit/generated/v2.0.1/pas_inquiry_response_bundle/server_inquiry_response_pas_inquiry_response_bundle_must_support_test.rb +52 -0
- data/lib/davinci_pas_test_kit/generated/v2.0.1/pas_inquiry_response_bundle/server_pas_inquiry_response_bundle_validation_test.rb +80 -0
- data/lib/davinci_pas_test_kit/generated/v2.0.1/pas_request_bundle/client_submit_request_pas_request_bundle_must_support_test.rb +53 -0
- data/lib/davinci_pas_test_kit/generated/v2.0.1/pas_request_bundle/metadata.yml +77 -0
- data/lib/davinci_pas_test_kit/generated/v2.0.1/pas_request_bundle/server_pas_request_bundle_validation_test.rb +83 -0
- data/lib/davinci_pas_test_kit/generated/v2.0.1/pas_request_bundle/server_submit_request_pas_request_bundle_must_support_test.rb +53 -0
- data/lib/davinci_pas_test_kit/generated/v2.0.1/pas_response_bundle/metadata.yml +71 -0
- data/lib/davinci_pas_test_kit/generated/v2.0.1/pas_response_bundle/server_pas_response_bundle_validation_test.rb +80 -0
- data/lib/davinci_pas_test_kit/generated/v2.0.1/pas_response_bundle/server_submit_response_pas_response_bundle_must_support_test.rb +52 -0
- data/lib/davinci_pas_test_kit/generated/v2.0.1/pas_server_approval_use_case_group.rb +59 -0
- data/lib/davinci_pas_test_kit/generated/v2.0.1/pas_server_denial_use_case_group.rb +59 -0
- data/lib/davinci_pas_test_kit/generated/v2.0.1/pas_server_must_support_use_case_group.rb +265 -0
- data/lib/davinci_pas_test_kit/generated/v2.0.1/pas_server_pended_use_case_group.rb +84 -0
- data/lib/davinci_pas_test_kit/generated/v2.0.1/practitioner/client_inquiry_request_practitioner_must_support_test.rb +53 -0
- data/lib/davinci_pas_test_kit/generated/v2.0.1/practitioner/client_submit_request_practitioner_must_support_test.rb +53 -0
- data/lib/davinci_pas_test_kit/generated/v2.0.1/practitioner/metadata.yml +74 -0
- data/lib/davinci_pas_test_kit/generated/v2.0.1/practitioner/server_inquiry_request_practitioner_must_support_test.rb +53 -0
- data/lib/davinci_pas_test_kit/generated/v2.0.1/practitioner/server_inquiry_response_practitioner_must_support_test.rb +53 -0
- data/lib/davinci_pas_test_kit/generated/v2.0.1/practitioner/server_submit_request_practitioner_must_support_test.rb +53 -0
- data/lib/davinci_pas_test_kit/generated/v2.0.1/practitioner/server_submit_response_practitioner_must_support_test.rb +53 -0
- data/lib/davinci_pas_test_kit/generated/v2.0.1/practitioner_role/client_inquiry_request_practitioner_role_must_support_test.rb +49 -0
- data/lib/davinci_pas_test_kit/generated/v2.0.1/practitioner_role/client_submit_request_practitioner_role_must_support_test.rb +49 -0
- data/lib/davinci_pas_test_kit/generated/v2.0.1/practitioner_role/metadata.yml +81 -0
- data/lib/davinci_pas_test_kit/generated/v2.0.1/practitioner_role/server_inquiry_request_practitioner_role_must_support_test.rb +49 -0
- data/lib/davinci_pas_test_kit/generated/v2.0.1/practitioner_role/server_inquiry_response_practitioner_role_must_support_test.rb +49 -0
- data/lib/davinci_pas_test_kit/generated/v2.0.1/practitioner_role/server_submit_request_practitioner_role_must_support_test.rb +49 -0
- data/lib/davinci_pas_test_kit/generated/v2.0.1/practitioner_role/server_submit_response_practitioner_role_must_support_test.rb +49 -0
- data/lib/davinci_pas_test_kit/generated/v2.0.1/requestor/client_inquiry_request_requestor_must_support_test.rb +63 -0
- data/lib/davinci_pas_test_kit/generated/v2.0.1/requestor/client_submit_request_requestor_must_support_test.rb +63 -0
- data/lib/davinci_pas_test_kit/generated/v2.0.1/requestor/metadata.yml +107 -0
- data/lib/davinci_pas_test_kit/generated/v2.0.1/requestor/server_inquiry_request_requestor_must_support_test.rb +63 -0
- data/lib/davinci_pas_test_kit/generated/v2.0.1/requestor/server_inquiry_response_requestor_must_support_test.rb +63 -0
- data/lib/davinci_pas_test_kit/generated/v2.0.1/requestor/server_submit_request_requestor_must_support_test.rb +63 -0
- data/lib/davinci_pas_test_kit/generated/v2.0.1/requestor/server_submit_response_requestor_must_support_test.rb +63 -0
- data/lib/davinci_pas_test_kit/generated/v2.0.1/resource_list.rb +54 -0
- data/lib/davinci_pas_test_kit/generated/v2.0.1/server_suite.rb +236 -0
- data/lib/davinci_pas_test_kit/generated/v2.0.1/service_request/client_submit_request_service_request_must_support_test.rb +53 -0
- data/lib/davinci_pas_test_kit/generated/v2.0.1/service_request/metadata.yml +148 -0
- data/lib/davinci_pas_test_kit/generated/v2.0.1/service_request/server_submit_request_service_request_must_support_test.rb +53 -0
- data/lib/davinci_pas_test_kit/generated/v2.0.1/subscriber/client_inquiry_request_subscriber_must_support_test.rb +74 -0
- data/lib/davinci_pas_test_kit/generated/v2.0.1/subscriber/client_submit_request_subscriber_must_support_test.rb +74 -0
- data/lib/davinci_pas_test_kit/generated/v2.0.1/subscriber/metadata.yml +159 -0
- data/lib/davinci_pas_test_kit/generated/v2.0.1/subscriber/server_inquiry_request_subscriber_must_support_test.rb +74 -0
- data/lib/davinci_pas_test_kit/generated/v2.0.1/subscriber/server_submit_request_subscriber_must_support_test.rb +74 -0
- data/lib/davinci_pas_test_kit/generated/v2.0.1/task/metadata.yml +192 -0
- data/lib/davinci_pas_test_kit/generated/v2.0.1/task/server_inquiry_response_task_must_support_test.rb +61 -0
- data/lib/davinci_pas_test_kit/generated/v2.0.1/task/server_submit_response_task_must_support_test.rb +61 -0
- data/lib/davinci_pas_test_kit/generator/group_generator.rb +440 -0
- data/lib/davinci_pas_test_kit/generator/group_metadata.rb +73 -0
- data/lib/davinci_pas_test_kit/generator/group_metadata_extractor.rb +244 -0
- data/lib/davinci_pas_test_kit/generator/ig_loader.rb +78 -0
- data/lib/davinci_pas_test_kit/generator/ig_metadata.rb +66 -0
- data/lib/davinci_pas_test_kit/generator/ig_metadata_extractor.rb +54 -0
- data/lib/davinci_pas_test_kit/generator/ig_resources.rb +74 -0
- data/lib/davinci_pas_test_kit/generator/must_support_check_profiles.rb +86 -0
- data/lib/davinci_pas_test_kit/generator/must_support_metadata_extractor.rb +327 -0
- data/lib/davinci_pas_test_kit/generator/must_support_test_generator.rb +155 -0
- data/lib/davinci_pas_test_kit/generator/naming.rb +50 -0
- data/lib/davinci_pas_test_kit/generator/operation_test_generator.rb +136 -0
- data/lib/davinci_pas_test_kit/generator/resource_list_generator.rb +59 -0
- data/lib/davinci_pas_test_kit/generator/suite_generator.rb +94 -0
- data/lib/davinci_pas_test_kit/generator/terminology_binding_metadata_extractor.rb +108 -0
- data/lib/davinci_pas_test_kit/generator/validation_test_generator.rb +181 -0
- data/lib/davinci_pas_test_kit/generator/value_extractor.rb +48 -0
- data/lib/davinci_pas_test_kit/generator.rb +80 -0
- data/lib/davinci_pas_test_kit/mock_server.rb +189 -0
- data/lib/davinci_pas_test_kit/must_support_test.rb +267 -0
- data/lib/davinci_pas_test_kit/pas_bundle_validation.rb +568 -0
- data/lib/davinci_pas_test_kit/tags.rb +7 -0
- data/lib/davinci_pas_test_kit/urls.rb +39 -0
- data/lib/davinci_pas_test_kit/user_input_response.rb +32 -0
- data/lib/davinci_pas_test_kit/validation_test.rb +58 -0
- data/lib/davinci_pas_test_kit/validator_suppressions.rb +143 -0
- data/lib/davinci_pas_test_kit/version.rb +5 -0
- data/lib/davinci_pas_test_kit.rb +2 -0
- metadata +281 -0
@@ -0,0 +1,26 @@
|
|
1
|
+
require_relative 'client_tests/pas_client_approval_submit_test'
|
2
|
+
require_relative 'client_tests/pas_client_approval_submit_response_attest'
|
3
|
+
require_relative '../../generated/v2.0.1/client_tests/client_pas_request_bundle_validation_test'
|
4
|
+
|
5
|
+
module DaVinciPASTestKit
|
6
|
+
module DaVinciPASV201
|
7
|
+
class PASClientApprovalGroup < Inferno::TestGroup
|
8
|
+
id :pas_client_v201_approval_group
|
9
|
+
title 'Demonstrate Approval Workflow'
|
10
|
+
description %(
|
11
|
+
Demonstrate the ability of the client to initiate a prior authorization
|
12
|
+
request and respond appropriately to an 'approved' decision.
|
13
|
+
)
|
14
|
+
run_as_group
|
15
|
+
|
16
|
+
test from: :pas_client_v201_approval_submit_test,
|
17
|
+
receives_request: :approval_claim
|
18
|
+
|
19
|
+
test from: :pas_client_v201_pas_request_bundle_validation_test,
|
20
|
+
uses_request: :approval_claim
|
21
|
+
|
22
|
+
test from: :pas_client_v201_approval_submit_response_attest,
|
23
|
+
uses_request: :approval_claim
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,49 @@
|
|
1
|
+
require_relative 'client_tests/pas_client_token_request_test'
|
2
|
+
require_relative 'client_tests/pas_client_token_validation_test'
|
3
|
+
|
4
|
+
module DaVinciPASTestKit
|
5
|
+
module DaVinciPASV201
|
6
|
+
class PASClientAuthenticationGroup < Inferno::TestGroup
|
7
|
+
id :pas_client_v201_authentication_group
|
8
|
+
title 'Demonstrate Authorization'
|
9
|
+
description %(
|
10
|
+
This group of tests allows Inferno to act as a OAuth server
|
11
|
+
and provide access tokens for the client under test to use
|
12
|
+
when making further requests.
|
13
|
+
|
14
|
+
The tests assume that the authentication workflow starts
|
15
|
+
after client registration. Upon clicking the "Run Tests" button
|
16
|
+
in the upper right, Inferno will ask for an input for the `client_id`
|
17
|
+
that was used for client registration, or manually configured in the
|
18
|
+
client.
|
19
|
+
|
20
|
+
Before submitting a token request, click the "Submit" button at the
|
21
|
+
bottom of the dialog to confirm the `client_id` that Inferno will
|
22
|
+
watch for.
|
23
|
+
|
24
|
+
Finally, make a valid token request that includes the specified `client_id`
|
25
|
+
to indicated token endpoint. This should be a POST of an `x-www-form-encoded`
|
26
|
+
body containing keys for `grant_type` with a value of `client_crendials` and
|
27
|
+
`client_id` with a value of the configured `client_id` value. For example, if
|
28
|
+
the `client_id` value was `123`, then the body of the request would be:
|
29
|
+
|
30
|
+
```grant_type=client_credentials&client_id=123```
|
31
|
+
|
32
|
+
The response json object will include an `access_token` key, for example:
|
33
|
+
|
34
|
+
```{"access_token":"97e792038d922bc3cf388b608e45c318","token_type":"bearer","expires_in":300}```
|
35
|
+
|
36
|
+
The value of the `access_token` key (`97e792038d922bc3cf388b608e45c318` in the example)
|
37
|
+
must be sent with every subsequent request to Inferno during this session in
|
38
|
+
the "Authorization" HTTP header with prefix "Bearer: ". In this example, the
|
39
|
+
Authorization HTTP header would have value:
|
40
|
+
|
41
|
+
```Bearer: 97e792038d922bc3cf388b608e45c318```
|
42
|
+
)
|
43
|
+
run_as_group
|
44
|
+
|
45
|
+
test from: :pas_client_v201_token_request_test
|
46
|
+
test from: :pas_client_v201_token_validation_test
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
@@ -0,0 +1,41 @@
|
|
1
|
+
require_relative 'client_tests/pas_client_denial_submit_test'
|
2
|
+
require_relative 'client_tests/pas_client_denial_submit_response_attest'
|
3
|
+
require_relative '../../generated/v2.0.1/client_tests/client_denial_pas_response_bundle_validation_test'
|
4
|
+
require_relative '../../generated/v2.0.1/client_tests/client_pas_request_bundle_validation_test'
|
5
|
+
require_relative '../../user_input_response'
|
6
|
+
|
7
|
+
module DaVinciPASTestKit
|
8
|
+
module DaVinciPASV201
|
9
|
+
class PASClientDenialGroup < Inferno::TestGroup
|
10
|
+
include UserInputResponse
|
11
|
+
id :pas_client_v201_denial_group
|
12
|
+
title 'Demonstrate Denial Workflow'
|
13
|
+
description %(
|
14
|
+
Demonstrate the ability of the client to initiate a prior authorization
|
15
|
+
request and respond appropriately to a 'denied' decision.
|
16
|
+
)
|
17
|
+
run_as_group
|
18
|
+
|
19
|
+
input :denial_json_response,
|
20
|
+
title: 'Claim denied response JSON',
|
21
|
+
type: 'textarea',
|
22
|
+
optional: true,
|
23
|
+
description: %(
|
24
|
+
The response provided will be validated against the PAS Response Bundle profile. If determined to be
|
25
|
+
invalid, a validation message will be returned, and the test group will be skipped.
|
26
|
+
)
|
27
|
+
|
28
|
+
test from: :pas_client_v201_denial_submit_test,
|
29
|
+
receives_request: :denial_claim,
|
30
|
+
respond_with: :denial_json_response
|
31
|
+
|
32
|
+
test from: :pas_client_v201_denial_pas_response_bundle_validation_test
|
33
|
+
|
34
|
+
test from: :pas_client_v201_pas_request_bundle_validation_test,
|
35
|
+
uses_request: :denial_claim
|
36
|
+
|
37
|
+
test from: :pas_client_v201_denial_submit_response_attest,
|
38
|
+
uses_request: :denial_claim
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
@@ -0,0 +1,56 @@
|
|
1
|
+
require_relative 'client_tests/pas_client_pended_submit_test'
|
2
|
+
require_relative 'client_tests/pas_client_pended_submit_response_attest'
|
3
|
+
require_relative 'client_tests/pas_client_pended_inquire_test'
|
4
|
+
require_relative 'client_tests/pas_client_pended_inquire_response_attest'
|
5
|
+
require_relative '../../generated/v2.0.1/client_tests/client_pended_pas_response_bundle_validation_test'
|
6
|
+
require_relative '../../generated/v2.0.1/client_tests/client_pas_request_bundle_validation_test'
|
7
|
+
require_relative '../../generated/v2.0.1/client_tests/client_pended_pas_inquiry_request_bundle_validation_test'
|
8
|
+
require_relative '../../user_input_response'
|
9
|
+
|
10
|
+
module DaVinciPASTestKit
|
11
|
+
module DaVinciPASV201
|
12
|
+
class PASClientPendedGroup < Inferno::TestGroup
|
13
|
+
include UserInputResponse
|
14
|
+
id :pas_client_v201_pended_group
|
15
|
+
title 'Demonstrate Pended Workflow'
|
16
|
+
description %(
|
17
|
+
Demonstrate the ability of the client to initiate a prior authorization
|
18
|
+
request and respond appropriately to a 'pended' decision, including
|
19
|
+
waiting for a notification that an update has been made (not currently
|
20
|
+
implemented) and making an inquiry request to retrieve the final result.
|
21
|
+
)
|
22
|
+
run_as_group
|
23
|
+
|
24
|
+
input :pended_json_response,
|
25
|
+
title: 'Claim pended response JSON',
|
26
|
+
type: 'textarea',
|
27
|
+
optional: true,
|
28
|
+
description: %(
|
29
|
+
The response provided will be validated against the PAS Response Bundle profile. If determined to be
|
30
|
+
invalid, a validation message will be returned, and the test group will be skipped.
|
31
|
+
)
|
32
|
+
|
33
|
+
test from: :pas_client_v201_pended_submit_test,
|
34
|
+
receives_request: :pended_claim,
|
35
|
+
respond_with: :pended_json_response
|
36
|
+
|
37
|
+
test from: :pas_client_v201_pended_pas_response_bundle_validation_test
|
38
|
+
|
39
|
+
test from: :pas_client_v201_pas_request_bundle_validation_test,
|
40
|
+
uses_request: :pended_claim
|
41
|
+
|
42
|
+
test from: :pas_client_v201_pended_submit_response_attest,
|
43
|
+
uses_request: :pended_claim
|
44
|
+
|
45
|
+
test from: :pas_client_v201_pended_inquire_test,
|
46
|
+
uses_request: :pended_claim,
|
47
|
+
receives_request: :pended_inquiry
|
48
|
+
|
49
|
+
test from: :pas_client_v201_pended_pas_inquiry_request_bundle_validation_test,
|
50
|
+
uses_request: :pended_inquiry
|
51
|
+
|
52
|
+
test from: :pas_client_v201_pended_inquire_response_attest,
|
53
|
+
uses_request: :pended_inquiry
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
require_relative 'error_tests/pas_submission_error_test'
|
2
|
+
require_relative 'error_tests/pas_inquiry_error_test'
|
3
|
+
|
4
|
+
module DaVinciPASTestKit
|
5
|
+
module DaVinciPASV201
|
6
|
+
class PASErrorGroup < Inferno::TestGroup
|
7
|
+
title 'Demonstrate Error Handling'
|
8
|
+
description %(
|
9
|
+
Validates Prior Authorization transaction error handling for malformed
|
10
|
+
request bundles.
|
11
|
+
)
|
12
|
+
|
13
|
+
id :pas_v201_error_group
|
14
|
+
run_as_group
|
15
|
+
|
16
|
+
test from: :prior_auth_submission_error
|
17
|
+
test from: :prior_auth_inquiry_error
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,98 @@
|
|
1
|
+
require 'hanami/controller'
|
2
|
+
|
3
|
+
module Inferno
|
4
|
+
module DSL
|
5
|
+
# A base class for creating routes with custom response logic. Requests and responses are tagged and saved.
|
6
|
+
# @private
|
7
|
+
# @see Inferno::DSL::Runnable#resume_test_route
|
8
|
+
class RecordResponseRoute < Hanami::Action
|
9
|
+
include Import[
|
10
|
+
requests_repo: 'inferno.repositories.requests',
|
11
|
+
results_repo: 'inferno.repositories.results',
|
12
|
+
test_runs_repo: 'inferno.repositories.test_runs',
|
13
|
+
tests_repo: 'inferno.repositories.tests'
|
14
|
+
]
|
15
|
+
|
16
|
+
def self.call(...)
|
17
|
+
new.call(...)
|
18
|
+
end
|
19
|
+
|
20
|
+
# @private
|
21
|
+
def test_run_identifier_block
|
22
|
+
self.class.singleton_class.instance_variable_get(:@test_run_identifier_block)
|
23
|
+
end
|
24
|
+
|
25
|
+
# @private
|
26
|
+
def build_response_block
|
27
|
+
self.class.singleton_class.instance_variable_get(:@build_response_block)
|
28
|
+
end
|
29
|
+
|
30
|
+
# @private
|
31
|
+
def tags
|
32
|
+
self.class.singleton_class.instance_variable_get(:@tags)
|
33
|
+
end
|
34
|
+
|
35
|
+
# @private
|
36
|
+
def resumes?(test)
|
37
|
+
instance_exec(test, &self.class.singleton_class.instance_variable_get(:@resumes))
|
38
|
+
end
|
39
|
+
|
40
|
+
# @private
|
41
|
+
def find_test_run(test_run_identifier)
|
42
|
+
test_runs_repo.find_latest_waiting_by_identifier(test_run_identifier)
|
43
|
+
end
|
44
|
+
|
45
|
+
# @private
|
46
|
+
def find_waiting_result(test_run)
|
47
|
+
results_repo.find_waiting_result(test_run_id: test_run.id)
|
48
|
+
end
|
49
|
+
|
50
|
+
# @private
|
51
|
+
def update_result(waiting_result)
|
52
|
+
results_repo.update_result(waiting_result.id, 'pass')
|
53
|
+
end
|
54
|
+
|
55
|
+
# @private
|
56
|
+
def persist_request(request, test_run, waiting_result, test)
|
57
|
+
requests_repo.create(
|
58
|
+
request.to_hash.merge(
|
59
|
+
test_session_id: test_run.test_session_id,
|
60
|
+
result_id: waiting_result.id,
|
61
|
+
name: test.config.request_name(test.incoming_request_name),
|
62
|
+
tags:
|
63
|
+
)
|
64
|
+
)
|
65
|
+
end
|
66
|
+
|
67
|
+
# @private
|
68
|
+
def find_test(waiting_result)
|
69
|
+
tests_repo.find(waiting_result.test_id)
|
70
|
+
end
|
71
|
+
|
72
|
+
# @private
|
73
|
+
def handle(req, res)
|
74
|
+
request = Inferno::Entities::Request.from_hanami_request(req)
|
75
|
+
|
76
|
+
test_run_identifier = instance_exec(request, &test_run_identifier_block)
|
77
|
+
|
78
|
+
test_run = find_test_run(test_run_identifier)
|
79
|
+
|
80
|
+
halt 500, "Unable to find test run with identifier '#{test_run_identifier}'." if test_run.nil?
|
81
|
+
|
82
|
+
waiting_result = find_waiting_result(test_run)
|
83
|
+
test = find_test(waiting_result)
|
84
|
+
|
85
|
+
test_runs_repo.mark_as_no_longer_waiting(test_run.id) if resumes? test
|
86
|
+
|
87
|
+
update_result(waiting_result) if resumes? test
|
88
|
+
|
89
|
+
instance_exec(request, test, waiting_result, &build_response_block)
|
90
|
+
|
91
|
+
Inferno::Entities::Request.to_hanami_response(request, res)
|
92
|
+
persist_request(request, test_run, waiting_result, test)
|
93
|
+
|
94
|
+
Jobs.perform(Jobs::ResumeTestRun, test_run.id) if resumes? test
|
95
|
+
end
|
96
|
+
end
|
97
|
+
end
|
98
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module Inferno
|
2
|
+
module Entities
|
3
|
+
class Request
|
4
|
+
def self.to_hanami_response(request, response)
|
5
|
+
response.status = request.status
|
6
|
+
response.body = request.response_body
|
7
|
+
request.response_headers.each do |header|
|
8
|
+
response.headers[header.name] = header.value
|
9
|
+
end
|
10
|
+
|
11
|
+
response
|
12
|
+
end
|
13
|
+
|
14
|
+
def response_headers=(headers_hash)
|
15
|
+
headers.concat(headers_hash.map { |key, value| Header.new(name: key.to_s, value:, type: 'response') })
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
require_relative 'record_response_route'
|
2
|
+
|
3
|
+
module Inferno
|
4
|
+
module DSL
|
5
|
+
module Runnable
|
6
|
+
def record_response_route(method, path, tags, build_response, resumes: ->(_) { true }, &block)
|
7
|
+
route_class = Class.new(Inferno::DSL::RecordResponseRoute) do |klass|
|
8
|
+
klass.singleton_class.instance_variable_set(:@build_response_block, build_response)
|
9
|
+
klass.singleton_class.instance_variable_set(:@test_run_identifier_block, block)
|
10
|
+
klass.singleton_class.instance_variable_set(:@tags, Array.wrap(tags))
|
11
|
+
klass.singleton_class.instance_variable_set(:@resumes, resumes)
|
12
|
+
end
|
13
|
+
|
14
|
+
route(method, path, route_class)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,72 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'json'
|
4
|
+
|
5
|
+
module DaVinciPASTestKit
|
6
|
+
module FHIRResourceNavigation
|
7
|
+
DAR_EXTENSION_URL = 'http://hl7.org/fhir/StructureDefinition/data-absent-reason'
|
8
|
+
|
9
|
+
def resolve_path(elements, path)
|
10
|
+
elements = Array.wrap(elements)
|
11
|
+
return elements if path.blank?
|
12
|
+
|
13
|
+
paths = path.split('.')
|
14
|
+
segment = paths.first
|
15
|
+
remaining_path = paths.drop(1).join('.')
|
16
|
+
|
17
|
+
elements.flat_map do |element|
|
18
|
+
child = get_next_value(element, segment)
|
19
|
+
resolve_path(child, remaining_path)
|
20
|
+
end.compact
|
21
|
+
end
|
22
|
+
|
23
|
+
def find_a_value_at(element, path, include_dar: false, &block)
|
24
|
+
return nil if element.nil?
|
25
|
+
|
26
|
+
elements = Array.wrap(element)
|
27
|
+
|
28
|
+
if path.blank?
|
29
|
+
unless include_dar
|
30
|
+
elements = elements.reject do |el|
|
31
|
+
el.respond_to?(:extension) && el.extension.any? { |ext| ext.url == DAR_EXTENSION_URL }
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
return elements.find(&block) if block_given?
|
36
|
+
|
37
|
+
return elements.first
|
38
|
+
end
|
39
|
+
|
40
|
+
path_segments = path.split('.')
|
41
|
+
segment = path_segments.shift.delete_suffix('[x]').to_sym
|
42
|
+
|
43
|
+
no_elements_present =
|
44
|
+
elements.none? do |elmt|
|
45
|
+
child = get_next_value(elmt, segment)
|
46
|
+
child.present? || child == false
|
47
|
+
end
|
48
|
+
|
49
|
+
return nil if no_elements_present
|
50
|
+
|
51
|
+
remaining_path = path_segments.join('.')
|
52
|
+
elements.each do |elmt|
|
53
|
+
child = get_next_value(elmt, segment)
|
54
|
+
element_found = if block_given?
|
55
|
+
find_a_value_at(child, remaining_path, include_dar:, &block)
|
56
|
+
else
|
57
|
+
find_a_value_at(child, remaining_path, include_dar:)
|
58
|
+
end
|
59
|
+
|
60
|
+
return element_found if element_found.present? || element_found == false
|
61
|
+
end
|
62
|
+
|
63
|
+
nil
|
64
|
+
end
|
65
|
+
|
66
|
+
def get_next_value(element, property)
|
67
|
+
element.send(property)
|
68
|
+
rescue NoMethodError
|
69
|
+
nil
|
70
|
+
end
|
71
|
+
end
|
72
|
+
end
|
@@ -0,0 +1,75 @@
|
|
1
|
+
require_relative '../../../must_support_test'
|
2
|
+
require_relative '../../../generator/group_metadata'
|
3
|
+
require_relative '../../../tags'
|
4
|
+
|
5
|
+
module DaVinciPASTestKit
|
6
|
+
module DaVinciPASV201
|
7
|
+
class ClientInquiryRequestBeneficiaryMustSupportTest < Inferno::Test
|
8
|
+
include DaVinciPASTestKit::MustSupportTest
|
9
|
+
|
10
|
+
title 'All must support elements for Profile PAS Beneficiary Patient are observed across all instances submitted'
|
11
|
+
description %(
|
12
|
+
|
13
|
+
PAS client systems are required to be able to populate all
|
14
|
+
must support elements on instances of all profiles included in
|
15
|
+
requests, including instances of the PAS Beneficiary Patient Profile.
|
16
|
+
This test checks all identified instances of the PAS Beneficiary Patient
|
17
|
+
Profile on requests sent by the client to ensure that the following
|
18
|
+
must support elements are observed:
|
19
|
+
|
20
|
+
* Patient.address
|
21
|
+
* Patient.address.city
|
22
|
+
* Patient.address.country
|
23
|
+
* Patient.address.district
|
24
|
+
* Patient.address.line
|
25
|
+
* Patient.address.period
|
26
|
+
* Patient.address.postalCode
|
27
|
+
* Patient.address.state
|
28
|
+
* Patient.birthDate
|
29
|
+
* Patient.communication
|
30
|
+
* Patient.communication.language
|
31
|
+
* Patient.extension:birthsex
|
32
|
+
* Patient.extension:ethnicity
|
33
|
+
* Patient.extension:race
|
34
|
+
* Patient.gender
|
35
|
+
* Patient.identifier
|
36
|
+
* Patient.identifier.system
|
37
|
+
* Patient.identifier.value
|
38
|
+
* Patient.multipleBirth[x]:multipleBirthInteger
|
39
|
+
* Patient.name
|
40
|
+
* Patient.name.family
|
41
|
+
* Patient.name.given
|
42
|
+
* Patient.name.prefix
|
43
|
+
* Patient.name.suffix
|
44
|
+
* Patient.telecom
|
45
|
+
* Patient.telecom.system
|
46
|
+
* Patient.telecom.use
|
47
|
+
* Patient.telecom.value
|
48
|
+
)
|
49
|
+
|
50
|
+
id :pas_client_inquiry_request_v201_beneficiary_must_support_test
|
51
|
+
|
52
|
+
def resource_type
|
53
|
+
'Patient'
|
54
|
+
end
|
55
|
+
|
56
|
+
def self.metadata
|
57
|
+
@metadata ||= Generator::GroupMetadata.new(YAML.load_file(File.join(__dir__, 'metadata.yml'), aliases: true))
|
58
|
+
end
|
59
|
+
|
60
|
+
def scratch_resources
|
61
|
+
scratch[:inquiry_request_resources] ||= {}
|
62
|
+
end
|
63
|
+
|
64
|
+
def resources_of_interest
|
65
|
+
collection = tagged_resources(INQUIRE_TAG).presence || all_scratch_resources
|
66
|
+
collection.select { |res| res.resourceType == resource_type }
|
67
|
+
end
|
68
|
+
|
69
|
+
run do
|
70
|
+
perform_must_support_test(resources_of_interest)
|
71
|
+
validate_must_support
|
72
|
+
end
|
73
|
+
end
|
74
|
+
end
|
75
|
+
end
|
@@ -0,0 +1,75 @@
|
|
1
|
+
require_relative '../../../must_support_test'
|
2
|
+
require_relative '../../../generator/group_metadata'
|
3
|
+
require_relative '../../../tags'
|
4
|
+
|
5
|
+
module DaVinciPASTestKit
|
6
|
+
module DaVinciPASV201
|
7
|
+
class ClientSubmitRequestBeneficiaryMustSupportTest < Inferno::Test
|
8
|
+
include DaVinciPASTestKit::MustSupportTest
|
9
|
+
|
10
|
+
title 'All must support elements for Profile PAS Beneficiary Patient are observed across all instances submitted'
|
11
|
+
description %(
|
12
|
+
|
13
|
+
PAS client systems are required to be able to populate all
|
14
|
+
must support elements on instances of all profiles included in
|
15
|
+
requests, including instances of the PAS Beneficiary Patient Profile.
|
16
|
+
This test checks all identified instances of the PAS Beneficiary Patient
|
17
|
+
Profile on requests sent by the client to ensure that the following
|
18
|
+
must support elements are observed:
|
19
|
+
|
20
|
+
* Patient.address
|
21
|
+
* Patient.address.city
|
22
|
+
* Patient.address.country
|
23
|
+
* Patient.address.district
|
24
|
+
* Patient.address.line
|
25
|
+
* Patient.address.period
|
26
|
+
* Patient.address.postalCode
|
27
|
+
* Patient.address.state
|
28
|
+
* Patient.birthDate
|
29
|
+
* Patient.communication
|
30
|
+
* Patient.communication.language
|
31
|
+
* Patient.extension:birthsex
|
32
|
+
* Patient.extension:ethnicity
|
33
|
+
* Patient.extension:race
|
34
|
+
* Patient.gender
|
35
|
+
* Patient.identifier
|
36
|
+
* Patient.identifier.system
|
37
|
+
* Patient.identifier.value
|
38
|
+
* Patient.multipleBirth[x]:multipleBirthInteger
|
39
|
+
* Patient.name
|
40
|
+
* Patient.name.family
|
41
|
+
* Patient.name.given
|
42
|
+
* Patient.name.prefix
|
43
|
+
* Patient.name.suffix
|
44
|
+
* Patient.telecom
|
45
|
+
* Patient.telecom.system
|
46
|
+
* Patient.telecom.use
|
47
|
+
* Patient.telecom.value
|
48
|
+
)
|
49
|
+
|
50
|
+
id :pas_client_submit_request_v201_beneficiary_must_support_test
|
51
|
+
|
52
|
+
def resource_type
|
53
|
+
'Patient'
|
54
|
+
end
|
55
|
+
|
56
|
+
def self.metadata
|
57
|
+
@metadata ||= Generator::GroupMetadata.new(YAML.load_file(File.join(__dir__, 'metadata.yml'), aliases: true))
|
58
|
+
end
|
59
|
+
|
60
|
+
def scratch_resources
|
61
|
+
scratch[:submit_request_resources] ||= {}
|
62
|
+
end
|
63
|
+
|
64
|
+
def resources_of_interest
|
65
|
+
collection = tagged_resources(SUBMIT_TAG).presence || all_scratch_resources
|
66
|
+
collection.select { |res| res.resourceType == resource_type }
|
67
|
+
end
|
68
|
+
|
69
|
+
run do
|
70
|
+
perform_must_support_test(resources_of_interest)
|
71
|
+
validate_must_support
|
72
|
+
end
|
73
|
+
end
|
74
|
+
end
|
75
|
+
end
|