davinci_pas_test_kit 0.12.0 → 0.12.2

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.
Files changed (63) hide show
  1. checksums.yaml +4 -4
  2. data/lib/davinci_pas_test_kit/client_suite.rb +24 -0
  3. data/lib/davinci_pas_test_kit/custom_groups/v2.0.1/client_tests/pas_client_approval_submit_test.rb +32 -1
  4. data/lib/davinci_pas_test_kit/custom_groups/v2.0.1/client_tests/pas_client_denial_submit_test.rb +30 -4
  5. data/lib/davinci_pas_test_kit/{generated/v2.0.1/client_tests/client_pended_pas_inquiry_request_bundle_validation_test.rb → custom_groups/v2.0.1/client_tests/pas_client_inquire_request_bundle_validation_test.rb} +26 -20
  6. data/lib/davinci_pas_test_kit/{generated/v2.0.1/client_tests/client_denial_pas_response_bundle_validation_test.rb → custom_groups/v2.0.1/client_tests/pas_client_inquire_response_bundle_validation_test.rb} +34 -21
  7. data/lib/davinci_pas_test_kit/custom_groups/v2.0.1/client_tests/pas_client_pended_submit_test.rb +130 -5
  8. data/lib/davinci_pas_test_kit/{generated/v2.0.1/client_tests/client_pas_request_bundle_validation_test.rb → custom_groups/v2.0.1/client_tests/pas_client_request_bundle_validation_test.rb} +28 -20
  9. data/lib/davinci_pas_test_kit/custom_groups/v2.0.1/client_tests/{pas_client_approval_submit_response_attest.rb → pas_client_response_attest.rb} +26 -9
  10. data/lib/davinci_pas_test_kit/{generated/v2.0.1/client_tests/client_pended_pas_response_bundle_validation_test.rb → custom_groups/v2.0.1/client_tests/pas_client_response_bundle_validation_test.rb} +44 -20
  11. data/lib/davinci_pas_test_kit/custom_groups/v2.0.1/client_tests/pas_client_submit_must_support_test.rb +3 -0
  12. data/lib/davinci_pas_test_kit/custom_groups/v2.0.1/client_tests/pas_client_subscription_create_test.rb +52 -0
  13. data/lib/davinci_pas_test_kit/custom_groups/v2.0.1/client_tests/pas_client_subscription_pas_conformance_test.rb +49 -0
  14. data/lib/davinci_pas_test_kit/custom_groups/v2.0.1/error_tests/pas_submission_error_test.rb +1 -0
  15. data/lib/davinci_pas_test_kit/custom_groups/v2.0.1/pas_client_approval_group.rb +21 -9
  16. data/lib/davinci_pas_test_kit/custom_groups/v2.0.1/pas_client_authentication_group.rb +2 -2
  17. data/lib/davinci_pas_test_kit/custom_groups/v2.0.1/pas_client_denial_group.rb +21 -22
  18. data/lib/davinci_pas_test_kit/custom_groups/v2.0.1/pas_client_pended_group.rb +97 -31
  19. data/lib/davinci_pas_test_kit/docs/client_suite_description_v201.md +213 -72
  20. data/lib/davinci_pas_test_kit/endpoints/claim_endpoint.rb +85 -134
  21. data/lib/davinci_pas_test_kit/endpoints/subscription_create_endpoint.rb +96 -0
  22. data/lib/davinci_pas_test_kit/endpoints/subscription_status_endpoint.rb +90 -0
  23. data/lib/davinci_pas_test_kit/generated/v2.0.1/claim/claim_operation_test.rb +1 -0
  24. data/lib/davinci_pas_test_kit/generated/v2.0.1/claiminquiryresponse/server_inquire_response_claiminquiryresponse_must_support_test.rb +1 -0
  25. data/lib/davinci_pas_test_kit/generated/v2.0.1/claimresponse/server_submit_response_claimresponse_must_support_test.rb +1 -0
  26. data/lib/davinci_pas_test_kit/generated/v2.0.1/pas_inquiry_request_bundle/metadata.yml +0 -2
  27. data/lib/davinci_pas_test_kit/generated/v2.0.1/pas_inquiry_request_bundle/server_pas_inquiry_request_bundle_validation_test.rb +3 -1
  28. data/lib/davinci_pas_test_kit/generated/v2.0.1/pas_inquiry_response_bundle/server_pas_inquiry_response_bundle_validation_test.rb +2 -1
  29. data/lib/davinci_pas_test_kit/generated/v2.0.1/pas_request_bundle/metadata.yml +0 -2
  30. data/lib/davinci_pas_test_kit/generated/v2.0.1/pas_request_bundle/server_pas_request_bundle_validation_test.rb +3 -1
  31. data/lib/davinci_pas_test_kit/generated/v2.0.1/pas_response_bundle/metadata.yml +0 -4
  32. data/lib/davinci_pas_test_kit/generated/v2.0.1/pas_response_bundle/server_pas_response_bundle_validation_test.rb +2 -1
  33. data/lib/davinci_pas_test_kit/generated/v2.0.1/pas_server_denial_use_case_group.rb +1 -1
  34. data/lib/davinci_pas_test_kit/generated/v2.0.1/pas_server_pended_use_case_group.rb +6 -5
  35. data/lib/davinci_pas_test_kit/generated/v2.0.1/server_suite.rb +1 -0
  36. data/lib/davinci_pas_test_kit/generator/group_generator.rb +9 -8
  37. data/lib/davinci_pas_test_kit/generator/group_metadata_extractor.rb +7 -3
  38. data/lib/davinci_pas_test_kit/generator/templates/suite.rb.erb +1 -0
  39. data/lib/davinci_pas_test_kit/generator/validation_test_generator.rb +19 -56
  40. data/lib/davinci_pas_test_kit/generator/value_extractor.rb +4 -1
  41. data/lib/davinci_pas_test_kit/generator.rb +1 -1
  42. data/lib/davinci_pas_test_kit/jobs/send_pas_subscription_notification.rb +136 -0
  43. data/lib/davinci_pas_test_kit/jobs/send_subscription_handshake.rb +139 -0
  44. data/lib/davinci_pas_test_kit/pas_bundle_validation.rb +12 -11
  45. data/lib/davinci_pas_test_kit/requirements/davinci-pas-test-kit_out_of_scope_requirements.csv +11 -0
  46. data/lib/davinci_pas_test_kit/requirements/davinci-pas-test-kit_requirements.csv +214 -0
  47. data/lib/davinci_pas_test_kit/requirements/generated/davinci-pas-test-kit_requirements_coverage.csv +214 -0
  48. data/lib/davinci_pas_test_kit/response_generator.rb +397 -0
  49. data/lib/davinci_pas_test_kit/tags.rb +9 -0
  50. data/lib/davinci_pas_test_kit/urls.rb +8 -0
  51. data/lib/davinci_pas_test_kit/user_input_response.rb +11 -8
  52. data/lib/davinci_pas_test_kit/validation_test.rb +0 -1
  53. data/lib/davinci_pas_test_kit/version.rb +2 -2
  54. data/lib/davinci_pas_test_kit.rb +1 -0
  55. data/lib/inferno_requirements_tools/ext/inferno_core/runnable.rb +22 -0
  56. data/lib/inferno_requirements_tools/tasks/requirements_coverage.rb +284 -0
  57. data/lib/requirements_config.yaml +17 -0
  58. metadata +36 -14
  59. data/lib/davinci_pas_test_kit/custom_groups/v2.0.1/client_tests/pas_client_denial_submit_response_attest.rb +0 -38
  60. data/lib/davinci_pas_test_kit/custom_groups/v2.0.1/client_tests/pas_client_pended_inquire_response_attest.rb +0 -39
  61. data/lib/davinci_pas_test_kit/custom_groups/v2.0.1/client_tests/pas_client_pended_inquire_test.rb +0 -35
  62. data/lib/davinci_pas_test_kit/custom_groups/v2.0.1/client_tests/pas_client_pended_submit_response_attest.rb +0 -39
  63. data/lib/davinci_pas_test_kit/generator/templates/validation_client.rb.erb +0 -50
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4d8d0b9a954307d87237d925246cea164d132e5c224b78986f6e949ef2655e96
4
- data.tar.gz: 43e264bd0e029fbc0e183818e8b7d6b7358765566ea1776cae732d6cf810a805
3
+ metadata.gz: f18ce63350f965138481f68402ae4dcdb560c35b6ed9ed3ad779d1b98dbdb13e
4
+ data.tar.gz: deaf4e6f43901b1c496f9754d3167da5f30186aac8e8ca29e52cfa9e13544cb0
5
5
  SHA512:
6
- metadata.gz: 230bd86fc641dacf8492c49d7e322c954c391ece2c6a6474886336709141e7862fd1d51612cb36c303e4323bc88b013bb7161acf279d7c0a0c8f8c841b99a338
7
- data.tar.gz: de2f53ac72aa59f9cd1e985b9b3685a8228e4981d202c9f9bb82ad6376ba001c079b71822f1341c374485dfb542f9e3be7d6dd81b1974e2e4a5bf7ed1702d185
6
+ metadata.gz: c33102ed5e52224b9a0062a7d7fb1ae997926815044298daf0d17032db1caf078c7ea0a92f218e0b0a970839827cb10e63a33e6c89eb1d7f7812b4d879d012ea
7
+ data.tar.gz: 9ee0ec2c10c29de7101e99317e46b1e6d77f09102a6d95e413ab2c0d413170832995299fb411d2119f6546f6c08d67618b1be13b5751ad1fa2c25ac404a6cd5a
@@ -1,12 +1,17 @@
1
+ require 'subscriptions_test_kit'
1
2
  require_relative 'validator_suppressions'
2
3
  require_relative 'tags'
3
4
  require_relative 'urls'
4
5
  require_relative 'endpoints/claim_endpoint'
5
6
  require_relative 'endpoints/token_endpoint'
7
+ require_relative 'endpoints/subscription_create_endpoint'
8
+ require_relative 'endpoints/subscription_status_endpoint'
6
9
  require_relative 'custom_groups/v2.0.1/pas_client_authentication_group'
7
10
  require_relative 'custom_groups/v2.0.1/pas_client_approval_group'
8
11
  require_relative 'custom_groups/v2.0.1/pas_client_denial_group'
9
12
  require_relative 'custom_groups/v2.0.1/pas_client_pended_group'
13
+ require_relative 'custom_groups/v2.0.1/client_tests/pas_client_subscription_create_test'
14
+ require_relative 'custom_groups/v2.0.1/client_tests/pas_client_subscription_pas_conformance_test'
10
15
  require_relative 'generated/v2.0.1/pas_client_submit_must_support_use_case_group'
11
16
  require_relative 'generated/v2.0.1/pas_client_inquiry_must_support_use_case_group'
12
17
 
@@ -48,6 +53,11 @@ module DaVinciPASTestKit
48
53
  suite_endpoint :post, TOKEN_PATH, TokenEndpoint
49
54
  suite_endpoint :post, SUBMIT_PATH, ClaimEndpoint
50
55
  suite_endpoint :post, INQUIRE_PATH, ClaimEndpoint
56
+ suite_endpoint :post, FHIR_SUBSCRIPTION_PATH, SubscriptionCreateEndpoint
57
+ suite_endpoint :get, FHIR_SUBSCRIPTION_INSTANCE_PATH, SubscriptionsTestKit::SubscriptionReadEndpoint
58
+ suite_endpoint :post, FHIR_SUBSCRIPTION_INSTANCE_STATUS_PATH, SubscriptionStatusEndpoint
59
+ suite_endpoint :get, FHIR_SUBSCRIPTION_INSTANCE_STATUS_PATH, SubscriptionStatusEndpoint
60
+ suite_endpoint :post, FHIR_SUBSCRIPTION_RESOURCE_STATUS_PATH, SubscriptionStatusEndpoint
51
61
 
52
62
  resume_test_route :get, RESUME_PASS_PATH do |request|
53
63
  request.query_parameters['token']
@@ -67,6 +77,20 @@ module DaVinciPASTestKit
67
77
  (user provided or generated during the authorization tests)
68
78
  in the Authorization HTTP header with prefix "Bearer: ".
69
79
  )
80
+ group do
81
+ title 'PAS Subscription Setup'
82
+ description %(
83
+ These tests verify that the client can create a Subscription instance
84
+ that will tell the Payer how to notify the client when pended claims
85
+ are updated.
86
+ )
87
+ run_as_group
88
+
89
+ test from: :pas_client_v201_subscription_create_test
90
+ test from: :subscriptions_r4_client_subscription_verification
91
+ test from: :pas_client_v201_subscription_pas_conformance_test
92
+ test from: :subscriptions_r4_client_handshake_notification_verification
93
+ end
70
94
 
71
95
  group do
72
96
  title 'Demonstrate Workflow Support'
@@ -1,9 +1,11 @@
1
1
  require_relative '../../../urls'
2
+ require_relative '../../../user_input_response'
2
3
 
3
4
  module DaVinciPASTestKit
4
5
  module DaVinciPASV201
5
6
  class PASClientApprovalSubmitTest < Inferno::Test
6
7
  include URLs
8
+ include UserInputResponse
7
9
 
8
10
  id :pas_client_v201_approval_submit_test
9
11
  title 'Client submits a claim using the $submit operation'
@@ -12,14 +14,39 @@ module DaVinciPASTestKit
12
14
  from the client. Upon receipt, Inferno will generate and send a
13
15
  response with an approved status.
14
16
  )
17
+ verifies_requirements 'hl7.fhir.us.davinci-pas_2.0.1@58', 'hl7.fhir.us.davinci-pas_2.0.1@62',
18
+ 'hl7.fhir.us.davinci-pas_2.0.1@70', 'hl7.fhir.us.davinci-pas_2.0.1@202'
19
+
15
20
  input :access_token,
16
21
  title: 'Access Token',
17
22
  description: %(
18
23
  Access token that the client will provide in the Authorization header of each request
19
24
  made during this test.
20
25
  )
26
+ input :approval_json_response,
27
+ title: 'Claim approved response JSON',
28
+ type: 'textarea',
29
+ optional: true,
30
+ description: %(
31
+ If provided, this JSON will be sent in response to $submit requests during this test
32
+ to indicate that the request has been approved.
33
+ It will be updated to make creation timestamps current.
34
+ If not provided, an approval response will be generated from the submitted Claim.
35
+ In either case, the response will be validated against the PAS Response Bundle profile.
36
+ )
37
+ submit_respond_with :approval_json_response
21
38
 
22
39
  run do
40
+ if user_inputted_response? :approval_json_response
41
+ assert_valid_json approval_json_response,
42
+ 'Input "Claim approved response JSON" must be valid JSON'
43
+ else
44
+ add_message('info', %(
45
+ No approved response provided in input '#{input_title(:approval_json_response)}'. Any responses to $submit
46
+ requests will be generated by Inferno from the submitted Claim.
47
+ ))
48
+ end
49
+
23
50
  wait(
24
51
  identifier: access_token,
25
52
  message: %(
@@ -29,7 +56,11 @@ module DaVinciPASTestKit
29
56
 
30
57
  `#{submit_url}`
31
58
 
32
- An approved response generated by Inferno will be returned.
59
+ The request must have an `Authorization` header with the value `Bearer #{access_token}`.
60
+
61
+ If the optional '**#{input_title(:approval_json_response)}**' input is populated, it will
62
+ be returned, updated with current timestamps. Otherwise, an approval response will
63
+ be generated by Inferno using the received Claim.
33
64
  )
34
65
  )
35
66
  end
@@ -1,13 +1,11 @@
1
1
  require_relative '../../../urls'
2
2
  require_relative '../../../user_input_response'
3
- require_relative '../../../pas_bundle_validation'
4
3
 
5
4
  module DaVinciPASTestKit
6
5
  module DaVinciPASV201
7
6
  class PASClientDenialSubmitTest < Inferno::Test
8
7
  include URLs
9
8
  include UserInputResponse
10
- include PasBundleValidation
11
9
 
12
10
  id :pas_client_v201_denial_submit_test
13
11
  title 'Client submits a claim using the $submit operation'
@@ -16,15 +14,39 @@ module DaVinciPASTestKit
16
14
  from the client. Upon receipt, Inferno will respond with the
17
15
  provided denial response.
18
16
  )
17
+ verifies_requirements 'hl7.fhir.us.davinci-pas_2.0.1@58', 'hl7.fhir.us.davinci-pas_2.0.1@62',
18
+ 'hl7.fhir.us.davinci-pas_2.0.1@70', 'hl7.fhir.us.davinci-pas_2.0.1@202'
19
+
19
20
  input :access_token,
20
21
  title: 'Access Token',
21
22
  description: %(
22
23
  Access token that the client will provide in the Authorization header of each request
23
24
  made during this test.
24
25
  )
26
+ input :denial_json_response,
27
+ title: 'Claim denied response JSON',
28
+ type: 'textarea',
29
+ optional: true,
30
+ description: %(
31
+ If provided, this JSON will be sent in response to $submit requests during this test
32
+ to indicate that the request has been denied.
33
+ It will be updated to make creation timestamps current.
34
+ If not provided, a denial response will be generated from the submitted Claim.
35
+ In either case, the response will be validated against the PAS Response Bundle profile.
36
+ )
37
+ submit_respond_with :denial_json_response
25
38
 
26
39
  run do
27
- check_user_inputted_response :denial_json_response
40
+ if user_inputted_response? :denial_json_response
41
+ assert_valid_json denial_json_response,
42
+ 'Input "Claim denied response JSON" must be valid JSON'
43
+ else
44
+ add_message('info', %(
45
+ No denied response provided in input '#{input_title(:denial_json_response)}'. Any responses to $submit
46
+ requests will be generated by Inferno from the submitted Claim.
47
+ ))
48
+ end
49
+
28
50
  wait(
29
51
  identifier: access_token,
30
52
  message: %(
@@ -34,7 +56,11 @@ module DaVinciPASTestKit
34
56
 
35
57
  `#{submit_url}`
36
58
 
37
- The denial response provided in the '**#{input_title(:denial_json_response)}**' input will be returned.
59
+ The request must have an `Authorization` header with the value `Bearer #{access_token}`.
60
+
61
+ If the optional '**#{input_title(:denial_json_response)}**' input is populated, it will
62
+ be returned, updated with current timestamps. Otherwise, a denial response will
63
+ be generated by Inferno using the received Claim.
38
64
  )
39
65
  )
40
66
  end
@@ -3,60 +3,66 @@ require_relative '../../../urls'
3
3
 
4
4
  module DaVinciPASTestKit
5
5
  module DaVinciPASV201
6
- class ClientPendedPasInquiryRequestBundleValidationTest < Inferno::Test
6
+ class PasClientInquireRequestBundleValidationTest < Inferno::Test
7
7
  include DaVinciPASTestKit::PasBundleValidation
8
8
  include URLs
9
9
 
10
- id :pas_client_v201_pended_pas_inquiry_request_bundle_validation_test
11
- title 'Inquiry Request Bundle is valid'
10
+ id :pas_client_v201_inquire_request_bundle_validation_test
11
+ title 'Inquire Request Bundle is valid'
12
12
  description %(
13
- This test validates the conformity of the
14
- client's request to the
15
- [PAS Inquiry Request Bundle](http://hl7.org/fhir/us/davinci-pas/StructureDefinition/profile-pas-inquiry-request-bundle) structure.
16
- It also checks that other conformance requirements defined in the [PAS Formal
13
+ This test verifies the conformity of the client's request body to the
14
+ [PAS Inquiry Request Bundle](http://hl7.org/fhir/us/davinci-pas/STU2/StructureDefinition-profile-pas-inquiry-request-bundle.html)
15
+ structure. It also checks that other conformance requirements defined in the [PAS Formal
17
16
  Specification](https://hl7.org/fhir/us/davinci-pas/STU2/specification.html),
18
17
  such as the presence of all referenced instances within the bundle and the
19
18
  conformance of those instances to the appropriate profiles, are met.
20
-
19
+
21
20
  It verifies the presence of mandatory elements and that elements with
22
21
  required bindings contain appropriate values. CodeableConcept element
23
22
  bindings will fail if none of their codings have a code/system belonging
24
23
  to the bound ValueSet. Quantity, Coding, and code element bindings will
25
24
  fail if their code/system are not found in the valueset.
26
-
25
+
27
26
  Note that because X12 value sets are not public, elements bound to value
28
27
  sets containing X12 codes are not validated.
29
-
28
+
30
29
  **Limitations**
31
-
30
+
32
31
  Due to recognized errors in the PAS IG around extension context definitions,
33
32
  this test may not pass due to spurious errors of the form "The extension
34
33
  [extension url] is not allowed at this point". See [this
35
34
  issue](https://github.com/inferno-framework/davinci-pas-test-kit/issues/11)
36
35
  for additional details.
37
36
  )
37
+ verifies_requirements 'hl7.fhir.us.davinci-pas_2.0.1@75', 'hl7.fhir.us.davinci-pas_2.0.1@121',
38
+ 'hl7.fhir.us.davinci-pas_2.0.1@122', 'hl7.fhir.us.davinci-pas_2.0.1@123',
39
+ 'hl7.fhir.us.davinci-pas_2.0.1@125', 'hl7.fhir.us.davinci-pas_2.0.1@126',
40
+ 'hl7.fhir.us.davinci-pas_2.0.1@127', 'hl7.fhir.us.davinci-pas_2.0.1@128'
38
41
 
39
- def resource_type
40
- 'Bundle'
42
+ def request_type_tag
43
+ INQUIRE_TAG
41
44
  end
42
45
 
43
- def request_type
44
- 'inquire'
46
+ def workflow_tag
47
+ config.options[:workflow_tag]
45
48
  end
46
49
 
47
50
  run do
48
- assert request.url == inquire_url,
49
- "Request made to wrong URL: #{request.url}. Should instead be to #{inquire_url}"
51
+ if workflow_tag.present?
52
+ load_tagged_requests(request_type_tag, workflow_tag)
53
+ else
54
+ load_tagged_requests(request_type_tag)
55
+ end
56
+ skip_if !request.present?, 'No inquire requests received.'
50
57
 
51
58
  validate_pas_bundle_json(
52
59
  request.request_body,
53
60
  'http://hl7.org/fhir/us/davinci-pas/StructureDefinition/profile-pas-inquiry-request-bundle',
54
61
  '2.0.1',
55
- request_type,
62
+ 'inquire',
56
63
  'request_bundle',
57
- message: 'The inquire Bundle request provided for the Claim/$inquire operation is invalid:'
64
+ message: 'The Bundle provided for the Claim/$inquire operation is invalid:'
58
65
  )
59
-
60
66
  end
61
67
  end
62
68
  end
@@ -1,37 +1,43 @@
1
1
  require_relative '../../../pas_bundle_validation'
2
2
  require_relative '../../../user_input_response'
3
+ require_relative '../../../response_generator'
3
4
 
4
5
  module DaVinciPASTestKit
5
6
  module DaVinciPASV201
6
- class ClientDenialPasResponseBundleValidationTest < Inferno::Test
7
+ class PasClientInquireResponseBundleValidationTest < Inferno::Test
7
8
  include DaVinciPASTestKit::PasBundleValidation
8
9
  include UserInputResponse
10
+ include ResponseGenerator
9
11
 
10
- id :pas_client_v201_denial_pas_response_bundle_validation_test
11
- title '[USER INPUT VALIDATION] Response Bundle is valid'
12
+ id :pas_client_v201_inquire_response_bundle_validation_test
13
+ title '[USER INPUT VERIFICATION] Inquire Response Bundle is valid'
12
14
  description %(
13
- **USER INPUT VALIDATION**: This test validates input provided by the user instead of the system under test.
15
+ **USER INPUT VERIFICATION**: This test verifies input provided by the tester instead of the system under test.
14
16
  Errors encountered will be treated as a skip instead of a failure.
15
-
16
- This test validates the conformity of the
17
- user input to the
18
- [PAS Response Bundle](http://hl7.org/fhir/us/davinci-pas/StructureDefinition/profile-pas-response-bundle) structure.
19
- It also checks that other conformance requirements defined in the [PAS Formal
17
+
18
+ This test verifies the conformity of the inquire response sent by Inferno, which will have been
19
+ either:
20
+ - the response body provided by the tester in the corresponding input, or
21
+ - created by Inferno from the $inquire Bundle.
22
+
23
+ In either case, this test verifies the conformity of the response body to the
24
+ [PAS Inquiry Response Bundle](https://hl7.org/fhir/us/davinci-pas/STU2/StructureDefinition-profile-pas-inquiry-response-bundle.html)
25
+ structure. It also checks that other conformance requirements defined in the [PAS Formal
20
26
  Specification](https://hl7.org/fhir/us/davinci-pas/STU2/specification.html),
21
27
  such as the presence of all referenced instances within the bundle and the
22
28
  conformance of those instances to the appropriate profiles, are met.
23
-
29
+
24
30
  It verifies the presence of mandatory elements and that elements with
25
31
  required bindings contain appropriate values. CodeableConcept element
26
32
  bindings will fail if none of their codings have a code/system belonging
27
33
  to the bound ValueSet. Quantity, Coding, and code element bindings will
28
34
  fail if their code/system are not found in the valueset.
29
-
35
+
30
36
  Note that because X12 value sets are not public, elements bound to value
31
37
  sets containing X12 codes are not validated.
32
-
38
+
33
39
  **Limitations**
34
-
40
+
35
41
  Due to recognized errors in the PAS IG around extension context definitions,
36
42
  this test may not pass due to spurious errors of the form "The extension
37
43
  [extension url] is not allowed at this point". See [this
@@ -39,24 +45,31 @@ module DaVinciPASTestKit
39
45
  for additional details.
40
46
  )
41
47
 
42
- def resource_type
43
- 'Bundle'
48
+ def request_type
49
+ 'inquire'
44
50
  end
45
51
 
46
- def request_type
47
- 'submit'
52
+ def workflow_tag
53
+ config.options[:workflow_tag]
48
54
  end
49
55
 
50
56
  run do
51
- check_user_inputted_response :denial_json_response
57
+ load_tagged_requests(workflow_tag, INQUIRE_TAG)
58
+ skip_if requests.empty?, 'No responses to verify because no inquire requests were made.'
59
+ message = if user_inputted_response? :inquire_json_response
60
+ "Invalid response generated from provided input '#{input_title(:inquire_json_response)}':"
61
+ else
62
+ 'Invalid response generated from the submitted claim:'
63
+ end
64
+
52
65
  validate_pas_bundle_json(
53
- denial_json_response,
54
- 'http://hl7.org/fhir/us/davinci-pas/StructureDefinition/profile-pas-response-bundle',
66
+ request.response_body,
67
+ 'http://hl7.org/fhir/us/davinci-pas/StructureDefinition/profile-pas-inquiry-response-bundle',
55
68
  '2.0.1',
56
69
  request_type,
57
70
  'response_bundle',
58
71
  skips: true,
59
- message: "Invalid input for '#{input_title(:denial_json_response)}':"
72
+ message:
60
73
  )
61
74
  end
62
75
  end
@@ -10,31 +10,156 @@ module DaVinciPASTestKit
10
10
  include PasBundleValidation
11
11
 
12
12
  id :pas_client_v201_pended_submit_test
13
- title 'Client submits a claim using the $submit operation'
13
+ title 'Client submits a claim and reacts to a pended response'
14
14
  description %(
15
15
  Inferno will wait for a prior authorization submission request
16
16
  from the client. Upon receipt, Inferno will respond with the
17
- provided pended response.
17
+ provided pended response. Subsequently, Inferno will send a
18
+ notification that the claim has been finalized and expect the
19
+ client under test to send a follow-up inquiry.
18
20
  )
21
+ verifies_requirements 'hl7.fhir.us.davinci-pas_2.0.1@58', 'hl7.fhir.us.davinci-pas_2.0.1@62',
22
+ 'hl7.fhir.us.davinci-pas_2.0.1@67', 'hl7.fhir.us.davinci-pas_2.0.1@70',
23
+ 'hl7.fhir.us.davinci-pas_2.0.1@119', 'hl7.fhir.us.davinci-pas_2.0.1@120',
24
+ 'hl7.fhir.us.davinci-pas_2.0.1@153', 'hl7.fhir.us.davinci-pas_2.0.1@202',
25
+ 'hl7.fhir.us.davinci-pas_2.0.1@203'
26
+
27
+ config options: { accepts_multiple_requests: true }
19
28
  input :access_token,
20
29
  title: 'Access Token',
21
30
  description: %(
22
31
  Access token that the client will provide in the Authorization header of each request
23
32
  made during this test.
24
33
  )
34
+ input :notification_bundle,
35
+ title: 'Claim updated notification JSON',
36
+ type: 'textarea',
37
+ optional: true,
38
+ description: %(
39
+ If provided, this JSON will be sent as the notification for the
40
+ PAS Subscription to tell the client that a decision has been made on the pended claim.
41
+ Before sending, Inferno will update the provided notification with details that the tester cannot
42
+ know ahead of time, including timestamps corresponding to the notification trigger time, and the id of
43
+ the triggering ClaimResponse if Inferno mocks that ClaimResponse because it is not provided by the
44
+ tester through the *Claim pended response JSON* input.
45
+ If not provided, a notification will be generated from the returned ClaimResponse.
46
+ In either case the response will be validated to ensure that the notification
47
+ is conformant.
48
+ )
49
+ input :pended_json_response,
50
+ title: 'Claim pended response JSON',
51
+ type: 'textarea',
52
+ optional: true,
53
+ description: %(
54
+ If provided, this JSON will be sent in response to $submit requests during this test
55
+ to indicate that the request has been pended awaiting a final decision.
56
+ It will be updated to make creation timestamps current.
57
+ If not provided, a pended response will be generated from the submitted Claim.
58
+ In either case the response will be validated against the PAS Response Bundle profile.
59
+ )
60
+ input :inquire_json_response,
61
+ title: 'Inquire approved response JSON',
62
+ type: 'textarea',
63
+ optional: true,
64
+ description: %(
65
+ If provided, this JSON will be sent in response to $inquire requests during this test
66
+ to indicate that the request has been approved.
67
+ It will be updated to make creation timestamps current.
68
+ If not provided, an approval response will be generated from the submitted Claim.
69
+ In either case, the response will be validated against the PAS Response Bundle profile.
70
+ )
71
+ input :client_endpoint_access_token,
72
+ optional: true,
73
+ title: 'Client Notification Access Token',
74
+ description: %(
75
+ The bearer token that Inferno will send on requests to the client under test's rest-hook notification
76
+ endpoint. Not needed if the client under test will create a Subscription with an appropriate header value
77
+ in the `channel.header` element. If a value for the `authorization` header is provided in
78
+ `channel.header`, this value will override it.
79
+ )
80
+ submit_respond_with :pended_json_response
81
+ inquire_respond_with :inquire_json_response
25
82
 
26
83
  run do
27
- check_user_inputted_response :pended_json_response
84
+ load_tagged_requests(SUBSCRIPTION_CREATE_TAG)
85
+ skip_if requests.empty?, # NOTE: subscription needed ahead of time to support notification generation
86
+ %(
87
+ Pended workflow tests cannot proceed because no Subscription exists to receive notifications
88
+ for pended claims. Run the _PAS Subscription Setup_ tests to provide a Subscription for use
89
+ in delivering notifications before re-running the pended workflow tests.
90
+ )
91
+
92
+ if user_inputted_response? :pended_json_response
93
+ assert_valid_json pended_json_response,
94
+ "Input '#{input_title(:pended_json_response)}' must be valid JSON"
95
+ else
96
+ add_message('info', %(
97
+ No pended response provided in input '#{input_title(:pended_json_response)}'. Any responses to $submit
98
+ requests will be generated by Inferno from the submitted Claim.
99
+ ))
100
+ end
101
+
102
+ if user_inputted_response? :inquire_json_response
103
+ assert_valid_json inquire_json_response,
104
+ "Input '#{input_title(:inquire_json_response)}' must be valid JSON"
105
+ else
106
+ add_message('info', %(
107
+ No inquire response provided in input '#{input_title(:inquire_json_response)}'. Any responses to $inquire
108
+ requests will be generated by Inferno from the inquired Claim.
109
+ ))
110
+ end
111
+
112
+ if notification_bundle.present?
113
+ assert_valid_json notification_bundle,
114
+ "Input '#{input_title(:notification_bundle)}' must be valid JSON"
115
+ else
116
+ add_message('info', %(
117
+ No notification body provided in input '#{input_title(:notification_bundle)}'. When sending a
118
+ notification finalizing a pended $submit response, the notification body will be generated by Inferno
119
+ from the submitted Claim.
120
+ ))
121
+ end
122
+
28
123
  wait(
29
124
  identifier: access_token,
125
+ timeout: 600,
30
126
  message: %(
31
127
  **Pended Workflow Test**:
32
128
 
33
- Submit a PAS request to
129
+ 1. Submit a PAS request to
34
130
 
35
131
  `#{submit_url}`
36
132
 
37
- The pended response provided in the '**#{input_title(:pended_json_response)}**' input will be returned.
133
+ The request must have an `Authorization` header with the value `Bearer #{access_token}`.
134
+
135
+ If the optional '**#{input_title(:pended_json_response)}**' input is populated, it will
136
+ be returned, updated with current timestamps. Otherwise, a pended response will
137
+ be generated by Inferno using the received Claim.
138
+
139
+ 2. Within 5-10 seconds, Inferno will send a notification indicating that the ClaimResponse has been
140
+ finalized. If the optional '**#{input_title(:notification_bundle)}**' input is populated
141
+ Inferno will send it as a notification. Otherwise, a notification will be generated
142
+ from Inferno. In either case, the notification will be delivered to the endpoint provided on the
143
+ Subscription during the _PAS Subscription Setup_ tests.
144
+
145
+ 3. Once the notification has been received, submit a PAS inquiry request to
146
+
147
+ `#{inquire_url}`
148
+
149
+ The request must have an `Authorization` header with the value `Bearer #{access_token}`.
150
+
151
+ If the optional '**#{input_title(:inquire_json_response)}**' input is populated, it will
152
+ be returned, updated with current timestamps. Otherwise, an approval response will
153
+ be generated by Inferno using the received Claim.
154
+
155
+ Note that Inferno will ask testers to attest to correct behavior of the system between these steps,
156
+ i.e., that the system marked the pended prior auth request appropriately after step 1 (submit) but
157
+ before step 2 (notification). Thus testers should check their system state as appropriate in order
158
+ to be able to faithfully answer the attestations.
159
+
160
+ Once the client has completed these steps,
161
+ [click here to complete the test](#{resume_pass_url}?token=#{access_token})
162
+ and continue Inferno's evaluation of the interaction.
38
163
  )
39
164
  )
40
165
  end
@@ -3,60 +3,68 @@ require_relative '../../../urls'
3
3
 
4
4
  module DaVinciPASTestKit
5
5
  module DaVinciPASV201
6
- class ClientPasRequestBundleValidationTest < Inferno::Test
6
+ class PasClientRequestBundleValidationTest < Inferno::Test
7
7
  include DaVinciPASTestKit::PasBundleValidation
8
8
  include URLs
9
9
 
10
- id :pas_client_v201_pas_request_bundle_validation_test
11
- title 'Request Bundle is valid'
10
+ id :pas_client_v201_request_bundle_validation_test
11
+ title 'Submit Request Bundle is valid'
12
12
  description %(
13
- This test validates the conformity of the
14
- client's request to the
15
- [PAS Request Bundle](http://hl7.org/fhir/us/davinci-pas/StructureDefinition/profile-pas-request-bundle) structure.
16
- It also checks that other conformance requirements defined in the [PAS Formal
13
+ This test verifies the conformity of the client's submit request body to the
14
+ [PAS Request Bundle](http://hl7.org/fhir/us/davinci-pas/STU2/StructureDefinition-profile-pas-request-bundle.html)
15
+ structure. It also checks that other conformance requirements defined in the [PAS Formal
17
16
  Specification](https://hl7.org/fhir/us/davinci-pas/STU2/specification.html),
18
17
  such as the presence of all referenced instances within the bundle and the
19
18
  conformance of those instances to the appropriate profiles, are met.
20
-
19
+
21
20
  It verifies the presence of mandatory elements and that elements with
22
21
  required bindings contain appropriate values. CodeableConcept element
23
22
  bindings will fail if none of their codings have a code/system belonging
24
23
  to the bound ValueSet. Quantity, Coding, and code element bindings will
25
24
  fail if their code/system are not found in the valueset.
26
-
25
+
27
26
  Note that because X12 value sets are not public, elements bound to value
28
27
  sets containing X12 codes are not validated.
29
-
28
+
30
29
  **Limitations**
31
-
30
+
32
31
  Due to recognized errors in the PAS IG around extension context definitions,
33
32
  this test may not pass due to spurious errors of the form "The extension
34
33
  [extension url] is not allowed at this point". See [this
35
34
  issue](https://github.com/inferno-framework/davinci-pas-test-kit/issues/11)
36
35
  for additional details.
37
36
  )
37
+ verifies_requirements 'hl7.fhir.us.davinci-pas_2.0.1@58', 'hl7.fhir.us.davinci-pas_2.0.1@59',
38
+ 'hl7.fhir.us.davinci-pas_2.0.1@60', 'hl7.fhir.us.davinci-pas_2.0.1@74',
39
+ 'hl7.fhir.us.davinci-pas_2.0.1@75', 'hl7.fhir.us.davinci-pas_2.0.1@76',
40
+ 'hl7.fhir.us.davinci-pas_2.0.1@77', 'hl7.fhir.us.davinci-pas_2.0.1@78',
41
+ 'hl7.fhir.us.davinci-pas_2.0.1@81', 'hl7.fhir.us.davinci-pas_2.0.1@85',
42
+ 'hl7.fhir.us.davinci-pas_2.0.1@86'
38
43
 
39
- def resource_type
40
- 'Bundle'
44
+ def workflow_tag
45
+ config.options[:workflow_tag]
41
46
  end
42
47
 
43
- def request_type
44
- 'submit'
48
+ def request_type_tag
49
+ SUBMIT_TAG
45
50
  end
46
51
 
47
52
  run do
48
- assert request.url == submit_url,
49
- "Request made to wrong URL: #{request.url}. Should instead be to #{submit_url}"
53
+ if workflow_tag.present?
54
+ load_tagged_requests(request_type_tag, workflow_tag)
55
+ else
56
+ load_tagged_requests(request_type_tag)
57
+ end
58
+ skip_if !request.present?, 'No submit requests received.'
50
59
 
51
60
  validate_pas_bundle_json(
52
61
  request.request_body,
53
62
  'http://hl7.org/fhir/us/davinci-pas/StructureDefinition/profile-pas-request-bundle',
54
63
  '2.0.1',
55
- request_type,
64
+ 'submit',
56
65
  'request_bundle',
57
- message: 'The submit Bundle request provided for the Claim/$submit operation is invalid:'
66
+ message: 'The Bundle provided for the Claim/$submit operation is invalid:'
58
67
  )
59
-
60
68
  end
61
69
  end
62
70
  end