davinci_pas_test_kit 0.12.2 → 0.13.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.
Files changed (106) hide show
  1. checksums.yaml +4 -4
  2. data/config/presets/pas_server_subscription_creation_against_pas_client.json +32 -0
  3. data/lib/davinci_pas_test_kit/certs/InfernoCA.key +52 -0
  4. data/lib/davinci_pas_test_kit/certs/InfernoCA.pem +35 -0
  5. data/lib/davinci_pas_test_kit/certs/TestKit.pem +32 -0
  6. data/lib/davinci_pas_test_kit/certs/TestKitPrivateKey.key +28 -0
  7. data/lib/davinci_pas_test_kit/client_suite.rb +141 -100
  8. data/lib/davinci_pas_test_kit/custom_groups/v2.0.1/client_registration/configuration_other_display_test.rb +46 -0
  9. data/lib/davinci_pas_test_kit/custom_groups/v2.0.1/client_registration/configuration_smart_display_test.rb +37 -0
  10. data/lib/davinci_pas_test_kit/custom_groups/v2.0.1/client_registration/configuration_udap_display_test.rb +37 -0
  11. data/lib/davinci_pas_test_kit/custom_groups/v2.0.1/client_registration/other_auth_attest_test.rb +36 -0
  12. data/lib/davinci_pas_test_kit/custom_groups/v2.0.1/client_tests/pas_client_approval_submit_test.rb +21 -10
  13. data/lib/davinci_pas_test_kit/custom_groups/v2.0.1/client_tests/pas_client_denial_submit_test.rb +20 -10
  14. data/lib/davinci_pas_test_kit/custom_groups/v2.0.1/client_tests/pas_client_inquire_must_support_test.rb +21 -9
  15. data/lib/davinci_pas_test_kit/custom_groups/v2.0.1/client_tests/pas_client_pended_submit_test.rb +24 -14
  16. data/lib/davinci_pas_test_kit/custom_groups/v2.0.1/client_tests/pas_client_response_attest.rb +4 -9
  17. data/lib/davinci_pas_test_kit/custom_groups/v2.0.1/client_tests/pas_client_submit_must_support_test.rb +21 -9
  18. data/lib/davinci_pas_test_kit/custom_groups/v2.0.1/client_tests/pas_client_subscription_create_test.rb +23 -13
  19. data/lib/davinci_pas_test_kit/custom_groups/v2.0.1/client_tests/pas_client_subscription_pas_conformance_test.rb +5 -24
  20. data/lib/davinci_pas_test_kit/custom_groups/v2.0.1/error_tests/pas_inquiry_error_test.rb +1 -0
  21. data/lib/davinci_pas_test_kit/custom_groups/v2.0.1/error_tests/pas_submission_error_test.rb +3 -1
  22. data/lib/davinci_pas_test_kit/custom_groups/v2.0.1/notification/pas_subscription_notification_test.rb +24 -20
  23. data/lib/davinci_pas_test_kit/custom_groups/v2.0.1/pas_client_approval_group.rb +6 -4
  24. data/lib/davinci_pas_test_kit/custom_groups/v2.0.1/pas_client_auth_smart_group.rb +32 -0
  25. data/lib/davinci_pas_test_kit/custom_groups/v2.0.1/pas_client_auth_udap_group.rb +31 -0
  26. data/lib/davinci_pas_test_kit/custom_groups/v2.0.1/pas_client_denial_group.rb +10 -4
  27. data/lib/davinci_pas_test_kit/custom_groups/v2.0.1/pas_client_must_support_group.rb +29 -0
  28. data/lib/davinci_pas_test_kit/custom_groups/v2.0.1/pas_client_options.rb +25 -0
  29. data/lib/davinci_pas_test_kit/custom_groups/v2.0.1/pas_client_pended_group.rb +11 -4
  30. data/lib/davinci_pas_test_kit/custom_groups/v2.0.1/pas_client_registration_group.rb +63 -0
  31. data/lib/davinci_pas_test_kit/custom_groups/v2.0.1/pas_client_subscription_setup_group.rb +23 -0
  32. data/lib/davinci_pas_test_kit/custom_groups/v2.0.1/pas_client_workflows_group.rb +21 -0
  33. data/lib/davinci_pas_test_kit/custom_groups/v2.0.1/pas_server_subscription_input_conformance.rb +35 -0
  34. data/lib/davinci_pas_test_kit/custom_groups/v2.0.1/pas_server_subscription_setup.rb +43 -0
  35. data/lib/davinci_pas_test_kit/descriptions.rb +10 -0
  36. data/lib/davinci_pas_test_kit/docs/client_suite_description_v201.md +203 -79
  37. data/lib/davinci_pas_test_kit/docs/demo/PAS Client Suite Demonstration.postman_collection.json +246 -0
  38. data/lib/davinci_pas_test_kit/docs/server_suite_description_v201.md +21 -10
  39. data/lib/davinci_pas_test_kit/endpoints/claim_endpoint.rb +13 -1
  40. data/lib/davinci_pas_test_kit/endpoints/subscription_create_endpoint.rb +13 -1
  41. data/lib/davinci_pas_test_kit/endpoints/subscription_status_endpoint.rb +10 -1
  42. data/lib/davinci_pas_test_kit/endpoints/token_endpoint.rb +29 -15
  43. data/lib/davinci_pas_test_kit/generated/v2.0.1/beneficiary/metadata.yml +2 -1
  44. data/lib/davinci_pas_test_kit/generated/v2.0.1/claim/claim_operation_test.rb +1 -2
  45. data/lib/davinci_pas_test_kit/generated/v2.0.1/claim/metadata.yml +28 -17
  46. data/lib/davinci_pas_test_kit/generated/v2.0.1/claim_inquiry/claim_inquiry_operation_test.rb +1 -2
  47. data/lib/davinci_pas_test_kit/generated/v2.0.1/claim_inquiry/client_inquire_request_claim_inquiry_must_support_test.rb +4 -1
  48. data/lib/davinci_pas_test_kit/generated/v2.0.1/claim_inquiry/metadata.yml +7 -1
  49. data/lib/davinci_pas_test_kit/generated/v2.0.1/claim_inquiry/server_inquire_request_claim_inquiry_must_support_test.rb +3 -1
  50. data/lib/davinci_pas_test_kit/generated/v2.0.1/claim_update/client_submit_request_claim_update_must_support_test.rb +9 -3
  51. data/lib/davinci_pas_test_kit/generated/v2.0.1/claim_update/metadata.yml +28 -17
  52. data/lib/davinci_pas_test_kit/generated/v2.0.1/claim_update/server_submit_request_claim_update_must_support_test.rb +9 -3
  53. data/lib/davinci_pas_test_kit/generated/v2.0.1/claiminquiryresponse/metadata.yml +6 -0
  54. data/lib/davinci_pas_test_kit/generated/v2.0.1/claiminquiryresponse/server_inquire_response_claiminquiryresponse_must_support_test.rb +1 -1
  55. data/lib/davinci_pas_test_kit/generated/v2.0.1/claimresponse/metadata.yml +8 -0
  56. data/lib/davinci_pas_test_kit/generated/v2.0.1/claimresponse/server_submit_response_claimresponse_must_support_test.rb +1 -1
  57. data/lib/davinci_pas_test_kit/generated/v2.0.1/communication_request/metadata.yml +4 -0
  58. data/lib/davinci_pas_test_kit/generated/v2.0.1/coverage/metadata.yml +11 -5
  59. data/lib/davinci_pas_test_kit/generated/v2.0.1/device_request/metadata.yml +2 -0
  60. data/lib/davinci_pas_test_kit/generated/v2.0.1/encounter/metadata.yml +6 -0
  61. data/lib/davinci_pas_test_kit/generated/v2.0.1/insurer/metadata.yml +4 -2
  62. data/lib/davinci_pas_test_kit/generated/v2.0.1/medication_request/metadata.yml +2 -0
  63. data/lib/davinci_pas_test_kit/generated/v2.0.1/metadata.yml +153 -53
  64. data/lib/davinci_pas_test_kit/generated/v2.0.1/nutrition_order/metadata.yml +2 -0
  65. data/lib/davinci_pas_test_kit/generated/v2.0.1/pas_inquiry_request_bundle/metadata.yml +2 -1
  66. data/lib/davinci_pas_test_kit/generated/v2.0.1/pas_inquiry_request_bundle/server_pas_inquiry_request_bundle_validation_test.rb +0 -2
  67. data/lib/davinci_pas_test_kit/generated/v2.0.1/pas_inquiry_response_bundle/metadata.yml +2 -1
  68. data/lib/davinci_pas_test_kit/generated/v2.0.1/pas_inquiry_response_bundle/server_pas_inquiry_response_bundle_validation_test.rb +2 -3
  69. data/lib/davinci_pas_test_kit/generated/v2.0.1/pas_request_bundle/metadata.yml +2 -1
  70. data/lib/davinci_pas_test_kit/generated/v2.0.1/pas_request_bundle/server_pas_request_bundle_validation_test.rb +0 -2
  71. data/lib/davinci_pas_test_kit/generated/v2.0.1/pas_response_bundle/metadata.yml +2 -1
  72. data/lib/davinci_pas_test_kit/generated/v2.0.1/pas_response_bundle/server_pas_response_bundle_validation_test.rb +2 -3
  73. data/lib/davinci_pas_test_kit/generated/v2.0.1/pas_server_approval_use_case_group.rb +0 -1
  74. data/lib/davinci_pas_test_kit/generated/v2.0.1/pas_server_denial_use_case_group.rb +0 -1
  75. data/lib/davinci_pas_test_kit/generated/v2.0.1/pas_server_must_support_use_case_group.rb +3 -0
  76. data/lib/davinci_pas_test_kit/generated/v2.0.1/pas_server_pended_use_case_group.rb +10 -3
  77. data/lib/davinci_pas_test_kit/generated/v2.0.1/practitioner/metadata.yml +2 -1
  78. data/lib/davinci_pas_test_kit/generated/v2.0.1/practitioner_role/metadata.yml +4 -0
  79. data/lib/davinci_pas_test_kit/generated/v2.0.1/requestor/metadata.yml +4 -2
  80. data/lib/davinci_pas_test_kit/generated/v2.0.1/server_suite.rb +8 -5
  81. data/lib/davinci_pas_test_kit/generated/v2.0.1/service_request/metadata.yml +2 -0
  82. data/lib/davinci_pas_test_kit/generated/v2.0.1/task/metadata.yml +4 -0
  83. data/lib/davinci_pas_test_kit/generator/group_generator.rb +20 -4
  84. data/lib/davinci_pas_test_kit/generator/group_metadata_extractor.rb +2 -2
  85. data/lib/davinci_pas_test_kit/generator/ig_resources.rb +4 -0
  86. data/lib/davinci_pas_test_kit/generator/must_support_test_generator.rb +14 -3
  87. data/lib/davinci_pas_test_kit/generator/operation_test_generator.rb +16 -3
  88. data/lib/davinci_pas_test_kit/generator/templates/group.rb.erb +10 -3
  89. data/lib/davinci_pas_test_kit/generator/templates/must_support.rb.erb +3 -0
  90. data/lib/davinci_pas_test_kit/generator/templates/operation.rb.erb +4 -1
  91. data/lib/davinci_pas_test_kit/generator/templates/suite.rb.erb +8 -5
  92. data/lib/davinci_pas_test_kit/generator/templates/validation.rb.erb +5 -4
  93. data/lib/davinci_pas_test_kit/generator/validation_test_generator.rb +12 -1
  94. data/lib/davinci_pas_test_kit/must_support_test.rb +2 -202
  95. data/lib/davinci_pas_test_kit/pas_subscription_verification.rb +30 -0
  96. data/lib/davinci_pas_test_kit/requirements/generated/davinci-pas-test-kit_requirements_coverage.csv +58 -58
  97. data/lib/davinci_pas_test_kit/session_identification.rb +45 -0
  98. data/lib/davinci_pas_test_kit/tags.rb +1 -0
  99. data/lib/davinci_pas_test_kit/urls.rb +61 -9
  100. data/lib/davinci_pas_test_kit/version.rb +2 -2
  101. data/lib/requirements_config.yaml +1 -1
  102. metadata +54 -8
  103. data/lib/davinci_pas_test_kit/custom_groups/v2.0.1/client_tests/pas_client_token_request_test.rb +0 -31
  104. data/lib/davinci_pas_test_kit/custom_groups/v2.0.1/client_tests/pas_client_token_validation_test.rb +0 -18
  105. data/lib/davinci_pas_test_kit/custom_groups/v2.0.1/pas_client_authentication_group.rb +0 -49
  106. data/lib/davinci_pas_test_kit/generator/must_support_metadata_extractor.rb +0 -327
@@ -1,11 +1,14 @@
1
1
  require_relative '../../../urls'
2
+ require_relative '../../../descriptions'
2
3
  require_relative '../../../user_input_response'
4
+ require_relative '../../../session_identification'
3
5
 
4
6
  module DaVinciPASTestKit
5
7
  module DaVinciPASV201
6
8
  class PASClientApprovalSubmitTest < Inferno::Test
7
9
  include URLs
8
10
  include UserInputResponse
11
+ include SessionIdentification
9
12
 
10
13
  id :pas_client_v201_approval_submit_test
11
14
  title 'Client submits a claim using the $submit operation'
@@ -17,12 +20,6 @@ module DaVinciPASTestKit
17
20
  verifies_requirements 'hl7.fhir.us.davinci-pas_2.0.1@58', 'hl7.fhir.us.davinci-pas_2.0.1@62',
18
21
  'hl7.fhir.us.davinci-pas_2.0.1@70', 'hl7.fhir.us.davinci-pas_2.0.1@202'
19
22
 
20
- input :access_token,
21
- title: 'Access Token',
22
- description: %(
23
- Access token that the client will provide in the Authorization header of each request
24
- made during this test.
25
- )
26
23
  input :approval_json_response,
27
24
  title: 'Claim approved response JSON',
28
25
  type: 'textarea',
@@ -34,6 +31,19 @@ module DaVinciPASTestKit
34
31
  If not provided, an approval response will be generated from the submitted Claim.
35
32
  In either case, the response will be validated against the PAS Response Bundle profile.
36
33
  )
34
+ input :client_id,
35
+ title: 'Client Id',
36
+ type: 'text',
37
+ optional: true,
38
+ locked: true,
39
+ description: INPUT_CLIENT_ID_LOCKED
40
+ input :session_url_path,
41
+ title: 'Session-specific URL path extension',
42
+ type: 'text',
43
+ optional: true,
44
+ locked: true,
45
+ description: INPUT_SESSION_URL_PATH_LOCKED
46
+
37
47
  submit_respond_with :approval_json_response
38
48
 
39
49
  run do
@@ -47,16 +57,17 @@ module DaVinciPASTestKit
47
57
  ))
48
58
  end
49
59
 
60
+ wait_identifier = session_wait_identifier(client_id, session_url_path)
61
+ submit_endpoint = session_endpont_url(:submit, client_id, session_url_path)
62
+
50
63
  wait(
51
- identifier: access_token,
64
+ identifier: wait_identifier,
52
65
  message: %(
53
66
  **Approval Workflow Test**:
54
67
 
55
68
  Submit a PAS request to
56
69
 
57
- `#{submit_url}`
58
-
59
- The request must have an `Authorization` header with the value `Bearer #{access_token}`.
70
+ `#{submit_endpoint}`
60
71
 
61
72
  If the optional '**#{input_title(:approval_json_response)}**' input is populated, it will
62
73
  be returned, updated with current timestamps. Otherwise, an approval response will
@@ -1,10 +1,13 @@
1
1
  require_relative '../../../urls'
2
+ require_relative '../../../descriptions'
2
3
  require_relative '../../../user_input_response'
4
+ require_relative '../../../session_identification'
3
5
 
4
6
  module DaVinciPASTestKit
5
7
  module DaVinciPASV201
6
8
  class PASClientDenialSubmitTest < Inferno::Test
7
9
  include URLs
10
+ include SessionIdentification
8
11
  include UserInputResponse
9
12
 
10
13
  id :pas_client_v201_denial_submit_test
@@ -17,12 +20,6 @@ module DaVinciPASTestKit
17
20
  verifies_requirements 'hl7.fhir.us.davinci-pas_2.0.1@58', 'hl7.fhir.us.davinci-pas_2.0.1@62',
18
21
  'hl7.fhir.us.davinci-pas_2.0.1@70', 'hl7.fhir.us.davinci-pas_2.0.1@202'
19
22
 
20
- input :access_token,
21
- title: 'Access Token',
22
- description: %(
23
- Access token that the client will provide in the Authorization header of each request
24
- made during this test.
25
- )
26
23
  input :denial_json_response,
27
24
  title: 'Claim denied response JSON',
28
25
  type: 'textarea',
@@ -34,6 +31,18 @@ module DaVinciPASTestKit
34
31
  If not provided, a denial response will be generated from the submitted Claim.
35
32
  In either case, the response will be validated against the PAS Response Bundle profile.
36
33
  )
34
+ input :client_id,
35
+ title: 'Client Id',
36
+ type: 'text',
37
+ optional: true,
38
+ locked: true,
39
+ description: INPUT_CLIENT_ID_LOCKED
40
+ input :session_url_path,
41
+ title: 'Session-specific URL path extension',
42
+ type: 'text',
43
+ optional: true,
44
+ locked: true,
45
+ description: INPUT_SESSION_URL_PATH_LOCKED
37
46
  submit_respond_with :denial_json_response
38
47
 
39
48
  run do
@@ -47,16 +56,17 @@ module DaVinciPASTestKit
47
56
  ))
48
57
  end
49
58
 
59
+ wait_identifier = session_wait_identifier(client_id, session_url_path)
60
+ submit_endpoint = session_endpont_url(:submit, client_id, session_url_path)
61
+
50
62
  wait(
51
- identifier: access_token,
63
+ identifier: wait_identifier,
52
64
  message: %(
53
65
  **Denial Workflow Test**:
54
66
 
55
67
  Submit a PAS request to
56
68
 
57
- `#{submit_url}`
58
-
59
- The request must have an `Authorization` header with the value `Bearer #{access_token}`.
69
+ `#{submit_endpoint}`
60
70
 
61
71
  If the optional '**#{input_title(:denial_json_response)}**' input is populated, it will
62
72
  be returned, updated with current timestamps. Otherwise, a denial response will
@@ -1,9 +1,12 @@
1
1
  require_relative '../../../urls'
2
+ require_relative '../../../descriptions'
3
+ require_relative '../../../session_identification'
2
4
 
3
5
  module DaVinciPASTestKit
4
6
  module DaVinciPASV201
5
7
  class PASClientInquireMustSupportTest < Inferno::Test
6
8
  include URLs
9
+ include SessionIdentification
7
10
 
8
11
  id :pas_client_inquire_v201_must_support_test
9
12
  title 'Client inquires about claims using the $inquire operation to demonstrate coverage of must support elements'
@@ -11,17 +14,26 @@ module DaVinciPASTestKit
11
14
  This test allows the client to send $inquire requests in addition to any already sent in previous test groups
12
15
  for Inferno to evaluate coverage of must support elements.
13
16
  )
14
- input :access_token,
15
- title: 'Access Token',
16
- description: %(
17
- Access token that the client will provide in the Authorization header of each request
18
- made during this test.
19
- )
17
+ input :client_id,
18
+ title: 'Client Id',
19
+ type: 'text',
20
+ optional: true,
21
+ locked: true,
22
+ description: INPUT_CLIENT_ID_LOCKED
23
+ input :session_url_path,
24
+ title: 'Session-specific URL path extension',
25
+ type: 'text',
26
+ optional: true,
27
+ locked: true,
28
+ description: INPUT_SESSION_URL_PATH_LOCKED
20
29
  config options: { accepts_multiple_requests: true }
21
30
 
22
31
  run do
32
+ wait_identifier = session_wait_identifier(client_id, session_url_path)
33
+ inquire_endpoint = session_endpont_url(:inquire, client_id, session_url_path)
34
+
23
35
  wait(
24
- identifier: access_token,
36
+ identifier: wait_identifier,
25
37
  message: %(
26
38
  The client system may now make multiple $inquire requests before continuing. These requests should
27
39
  cumulatively demonstrate coverage of all required profiles and all must support elements within those
@@ -40,9 +52,9 @@ module DaVinciPASTestKit
40
52
 
41
53
  Submit PAS requests to
42
54
 
43
- `#{inquire_url}`
55
+ `#{inquire_endpoint}`
44
56
 
45
- and [click here](#{resume_pass_url}?token=#{access_token}) when done.
57
+ and [click here](#{resume_pass_url}?token=#{wait_identifier}) when done.
46
58
  )
47
59
  )
48
60
  end
@@ -1,11 +1,14 @@
1
1
  require_relative '../../../urls'
2
+ require_relative '../../../descriptions'
2
3
  require_relative '../../../user_input_response'
3
4
  require_relative '../../../pas_bundle_validation'
5
+ require_relative '../../../session_identification'
4
6
 
5
7
  module DaVinciPASTestKit
6
8
  module DaVinciPASV201
7
9
  class PASClientPendedSubmitTest < Inferno::Test
8
10
  include URLs
11
+ include SessionIdentification
9
12
  include UserInputResponse
10
13
  include PasBundleValidation
11
14
 
@@ -25,12 +28,6 @@ module DaVinciPASTestKit
25
28
  'hl7.fhir.us.davinci-pas_2.0.1@203'
26
29
 
27
30
  config options: { accepts_multiple_requests: true }
28
- input :access_token,
29
- title: 'Access Token',
30
- description: %(
31
- Access token that the client will provide in the Authorization header of each request
32
- made during this test.
33
- )
34
31
  input :notification_bundle,
35
32
  title: 'Claim updated notification JSON',
36
33
  type: 'textarea',
@@ -77,6 +74,19 @@ module DaVinciPASTestKit
77
74
  in the `channel.header` element. If a value for the `authorization` header is provided in
78
75
  `channel.header`, this value will override it.
79
76
  )
77
+ input :client_id,
78
+ title: 'Client Id',
79
+ type: 'text',
80
+ optional: true,
81
+ locked: true,
82
+ description: INPUT_CLIENT_ID_LOCKED
83
+ input :session_url_path,
84
+ title: 'Session-specific URL path extension',
85
+ type: 'text',
86
+ optional: true,
87
+ locked: true,
88
+ description: INPUT_SESSION_URL_PATH_LOCKED
89
+
80
90
  submit_respond_with :pended_json_response
81
91
  inquire_respond_with :inquire_json_response
82
92
 
@@ -120,17 +130,19 @@ module DaVinciPASTestKit
120
130
  ))
121
131
  end
122
132
 
133
+ wait_identifier = session_wait_identifier(client_id, session_url_path)
134
+ submit_endpoint = session_endpont_url(:submit, client_id, session_url_path)
135
+ inquire_endpoint = session_endpont_url(:inquire, client_id, session_url_path)
136
+
123
137
  wait(
124
- identifier: access_token,
138
+ identifier: wait_identifier,
125
139
  timeout: 600,
126
140
  message: %(
127
141
  **Pended Workflow Test**:
128
142
 
129
143
  1. Submit a PAS request to
130
144
 
131
- `#{submit_url}`
132
-
133
- The request must have an `Authorization` header with the value `Bearer #{access_token}`.
145
+ `#{submit_endpoint}`
134
146
 
135
147
  If the optional '**#{input_title(:pended_json_response)}**' input is populated, it will
136
148
  be returned, updated with current timestamps. Otherwise, a pended response will
@@ -144,9 +156,7 @@ module DaVinciPASTestKit
144
156
 
145
157
  3. Once the notification has been received, submit a PAS inquiry request to
146
158
 
147
- `#{inquire_url}`
148
-
149
- The request must have an `Authorization` header with the value `Bearer #{access_token}`.
159
+ `#{inquire_endpoint}`
150
160
 
151
161
  If the optional '**#{input_title(:inquire_json_response)}**' input is populated, it will
152
162
  be returned, updated with current timestamps. Otherwise, an approval response will
@@ -158,7 +168,7 @@ module DaVinciPASTestKit
158
168
  to be able to faithfully answer the attestations.
159
169
 
160
170
  Once the client has completed these steps,
161
- [click here to complete the test](#{resume_pass_url}?token=#{access_token})
171
+ [click here to complete the test](#{resume_pass_url}?token=#{wait_identifier})
162
172
  and continue Inferno's evaluation of the interaction.
163
173
  )
164
174
  )
@@ -12,12 +12,6 @@ module DaVinciPASTestKit
12
12
  the receipt of response and attest that users are able to see the appropriate
13
13
  updates to the corresponding prior authorization request in their system.
14
14
  )
15
- input :access_token,
16
- title: 'Access Token',
17
- description: %(
18
- Access token that the client will provide in the Authorization header of each request
19
- made during this test.
20
- )
21
15
 
22
16
  def workflow_tag
23
17
  config.options[:workflow_tag]
@@ -39,16 +33,17 @@ module DaVinciPASTestKit
39
33
  end
40
34
 
41
35
  run do
36
+ identifier = SecureRandom.hex(32)
42
37
  wait(
43
- identifier: access_token,
38
+ identifier:,
44
39
  message: %(
45
40
  **#{workflow_name} Workflow Test**:
46
41
 
47
42
  #{attest_message}
48
43
 
49
- [Click here](#{resume_pass_url}?token=#{access_token}) if the above statement is **true**.
44
+ [Click here](#{resume_pass_url}?token=#{identifier}) if the above statement is **true**.
50
45
 
51
- [Click here](#{resume_fail_url}?token=#{access_token}) if the above statement is **false**.
46
+ [Click here](#{resume_fail_url}?token=#{identifier}) if the above statement is **false**.
52
47
  )
53
48
  )
54
49
  end
@@ -1,9 +1,12 @@
1
1
  require_relative '../../../urls'
2
+ require_relative '../../../descriptions'
3
+ require_relative '../../../session_identification'
2
4
 
3
5
  module DaVinciPASTestKit
4
6
  module DaVinciPASV201
5
7
  class PASClientSubmitMustSupportTest < Inferno::Test
6
8
  include URLs
9
+ include SessionIdentification
7
10
 
8
11
  id :pas_client_submit_v201_must_support_test
9
12
  title 'Client submits claims using the $submit operation to demonstrate coverage of must support elements'
@@ -14,17 +17,26 @@ module DaVinciPASTestKit
14
17
  verifies_requirements 'hl7.fhir.us.davinci-pas_2.0.1@58', 'hl7.fhir.us.davinci-pas_2.0.1@62',
15
18
  'hl7.fhir.us.davinci-pas_2.0.1@70', 'hl7.fhir.us.davinci-pas_2.0.1@202'
16
19
 
17
- input :access_token,
18
- title: 'Access Token',
19
- description: %(
20
- Access token that the client will provide in the Authorization header of each request
21
- made during this test.
22
- )
20
+ input :client_id,
21
+ title: 'Client Id',
22
+ type: 'text',
23
+ optional: true,
24
+ locked: true,
25
+ description: INPUT_CLIENT_ID_LOCKED
26
+ input :session_url_path,
27
+ title: 'Session-specific URL path extension',
28
+ type: 'text',
29
+ optional: true,
30
+ locked: true,
31
+ description: INPUT_SESSION_URL_PATH_LOCKED
23
32
  config options: { accepts_multiple_requests: true }
24
33
 
25
34
  run do
35
+ wait_identifier = session_wait_identifier(client_id, session_url_path)
36
+ submit_endpoint = session_endpont_url(:submit, client_id, session_url_path)
37
+
26
38
  wait(
27
- identifier: access_token,
39
+ identifier: wait_identifier,
28
40
  message: %(
29
41
  The client system may now make multiple $submit requests before continuing. These requests should
30
42
  cumulatively demonstrate coverage of all required profiles and all must support elements within those
@@ -49,9 +61,9 @@ module DaVinciPASTestKit
49
61
 
50
62
  Submit PAS requests to
51
63
 
52
- `#{submit_url}`
64
+ `#{submit_endpoint}`
53
65
 
54
- and [click here](#{resume_pass_url}?token=#{access_token}) when done.
66
+ and [click here](#{resume_pass_url}?token=#{wait_identifier}) when done.
55
67
  )
56
68
  )
57
69
  end
@@ -1,9 +1,12 @@
1
1
  require_relative '../../../urls'
2
+ require_relative '../../../descriptions'
3
+ require_relative '../../../session_identification'
2
4
 
3
5
  module DaVinciPASTestKit
4
6
  module DaVinciPASV201
5
7
  class PASClientSubscriptionCreateTest < Inferno::Test
6
8
  include URLs
9
+ include SessionIdentification
7
10
 
8
11
  id :pas_client_v201_subscription_create_test
9
12
  title 'Client submits a Subscription Creation Request'
@@ -14,33 +17,40 @@ module DaVinciPASTestKit
14
17
  verifies_requirements 'hl7.fhir.us.davinci-pas_2.0.1@137', 'hl7.fhir.us.davinci-pas_2.0.1@140',
15
18
  'hl7.fhir.us.davinci-pas_2.0.1@142'
16
19
 
17
- input :access_token,
18
- title: 'Access Token',
19
- description: %(
20
- Access token that the client will provide in the Authorization header of each request
21
- made during this test.
22
- )
20
+ input :client_id,
21
+ title: 'Client Id',
22
+ type: 'text',
23
+ optional: true,
24
+ locked: true,
25
+ description: INPUT_CLIENT_ID_LOCKED
26
+ input :session_url_path,
27
+ title: 'Session-specific URL path extension',
28
+ type: 'text',
29
+ optional: true,
30
+ locked: true,
31
+ description: INPUT_SESSION_URL_PATH_LOCKED
23
32
  input :client_endpoint_access_token,
24
33
  optional: true,
25
34
  title: 'Client Notification Access Token',
26
35
  description: %(
27
36
  The bearer token that Inferno will send on requests to the client under test's rest-hook notification
28
- endpoint. Not needed if the client under test will create a Subscription with an appropriate header value
29
- in the `channel.header` element. If a value for the `authorization` header is provided in
30
- `channel.header`, this value will override it.
37
+ endpoint, including handshake notifications sent after Subscription creation. Not needed if the client
38
+ under test will create a Subscription with an appropriate header value in the `channel.header` element.
39
+ If a value for the `authorization` header is provided in `channel.header`, this value will override it.
31
40
  )
32
41
 
33
42
  run do
43
+ wait_identifier = session_wait_identifier(client_id, session_url_path)
44
+ subscription_endpoint = session_endpont_url(:subscription, client_id, session_url_path)
45
+
34
46
  wait(
35
- identifier: access_token,
47
+ identifier: wait_identifier,
36
48
  message: %(
37
49
  **Subscription Creation Test**:
38
50
 
39
51
  Submit a POST with a Subscription to:
40
52
 
41
- `#{fhir_subscription_url}`
42
-
43
- The request must have an `Authorization` header with the value `Bearer #{access_token}`.
53
+ `#{subscription_endpoint}`
44
54
 
45
55
  Upon receipt, Inferno will send a handshake request to verify that notifications can be
46
56
  delivered and continue the test with a pass or fail based on the result.
@@ -1,8 +1,12 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require_relative '../../../pas_subscription_verification'
4
+
3
5
  module DaVinciPASTestKit
4
6
  module DaVinciPASV201
5
7
  class SubscriptionPASConformanceTest < Inferno::Test
8
+ include PASSubscriptionVerification
9
+
6
10
  id :pas_client_v201_subscription_pas_conformance_test
7
11
  title 'Client Subscription PAS Conformance Verification'
8
12
  description %(
@@ -19,30 +23,7 @@ module DaVinciPASTestKit
19
23
  skip_if(requests.none?, 'Inferno did not receive a Subscription creation request')
20
24
  subscription_resource = request.request_body
21
25
 
22
- assert_valid_json(subscription_resource)
23
- subscription = JSON.parse(subscription_resource)
24
-
25
- unless subscription['criteria'] == 'http://hl7.org/fhir/us/davinci-pas/SubscriptionTopic/PASSubscriptionTopic'
26
- add_message('error', %(
27
- The created Subscription must use the PAS-defined Subscription topic
28
- `http://hl7.org/fhir/us/davinci-pas/SubscriptionTopic/PASSubscriptionTopic`
29
- in the `Subscription.criteria` element.
30
- ))
31
- end
32
-
33
- filter_criteria = subscription.dig('_criteria', 'extension')
34
- &.select do |ext|
35
- ext['url'] == 'http://hl7.org/fhir/uv/subscriptions-backport/StructureDefinition/backport-filter-criteria'
36
- end
37
- unless filter_criteria&.length == 1
38
- add_message('error', %(
39
- The created Subscription must include a single filter on the submitting organization
40
- in the `Subscription.criteria.extension` element.
41
- ))
42
- end
43
-
44
- assert messages.none? { |msg| msg[:type] == 'error' },
45
- 'The Created Subscription does not conform to PAS requirements - see messages for details.'
26
+ verify_pas_subscription(subscription_resource)
46
27
  end
47
28
  end
48
29
  end
@@ -19,6 +19,7 @@ module DaVinciPASTestKit
19
19
  via the error capability.
20
20
  )
21
21
  makes_request :pa_invalid_inquiry
22
+ verifies_requirements 'hl7.fhir.us.davinci-pas_2.0.1@112', 'hl7.fhir.us.davinci-pas_2.0.1@113'
22
23
 
23
24
  run do
24
25
  file_path = File.join(File.dirname(__FILE__), 'nonconformant_pas_bundle.json')
@@ -20,7 +20,9 @@ module DaVinciPASTestKit
20
20
 
21
21
  The server SHOULD respond within 15 seconds.
22
22
  }
23
- verifies_requirements 'hl7.fhir.us.davinci-pas_2.0.1@70'
23
+ verifies_requirements 'hl7.fhir.us.davinci-pas_2.0.1@104', 'hl7.fhir.us.davinci-pas_2.0.1@105',
24
+ 'hl7.fhir.us.davinci-pas_2.0.1@106', 'hl7.fhir.us.davinci-pas_2.0.1@112',
25
+ 'hl7.fhir.us.davinci-pas_2.0.1@113'
24
26
 
25
27
  output :response_time
26
28
  makes_request :pa_invalid_request
@@ -1,40 +1,44 @@
1
+ require_relative '../../../urls'
2
+
1
3
  module DaVinciPASTestKit
2
4
  module DaVinciPASV201
5
+ # TODO: none of file name, class name, or ID match
3
6
  class PasUpdateNotificationTest < Inferno::Test
7
+ include URLs
4
8
  id :prior_auth_claim_response_update_notification_validation
5
9
  title 'Server notifies the client that the pended claim was updated.'
6
10
  description %(
7
11
  This test validates that the server can notify the client that a final
8
12
  decision has been made about a pended claim so that the client can query
9
- for the details. Currently, testers attest that the decision on the prior
10
- authorization request has been finalized so that Inferno can check the rest of
11
- the pended workflow. In the future, Inferno will validate that the server
12
- can accept requests for a subscription and send notifications alerting the client
13
- to the availability of updates to the prior authorization request (see details on this limitation
14
- [here](https://github.com/inferno-framework/davinci-pas-test-kit/blob/main/lib/davinci_pas_test_kit/docs/server_suite_description_v201.md#testing-limitations)).
13
+ for the details. This test depends on prior successful subscription creation in
14
+ Test Group **1 Subscription Setup**.
15
15
  )
16
+ verifies_requirements 'hl7.fhir.us.davinci-pas_2.0.1@141'
17
+
18
+ input :access_token,
19
+ title: 'Notification Access Token',
20
+ description: %(
21
+ An access token that the server under test will send to Inferno on notifications
22
+ so that the request gets associated with this test session. The token must be
23
+ provided as a `Bearer` token in the `Authorization` header of HTTP requests
24
+ sent to Inferno.
25
+ )
16
26
 
17
27
  run do
18
- token = SecureRandom.hex(32)
19
- # rubocop:disable Layout/LineLength
20
28
  wait(
21
- identifier: token,
29
+ identifier: "notification #{access_token}",
22
30
  message: %(
23
- Inferno has received a 'Pended' claim response indicating that a final decision
24
- has not yet been made on the prior authorization request.
31
+ Inferno has received a 'Pended' claim response indicating that a final decision has not yet been made on the
32
+ prior authorization request.
25
33
 
26
- Please
27
- **[click
28
- here](#{Inferno::Application['base_url']}/custom/davinci_pas_server_suite_v201/resume_after_notification?token=#{token})**
29
- when the status of this claim has been finalized to inform Inferno to resume testing.
34
+ Inferno will now wait for a notification at its rest-hook endpoint before making an $inquire request.
35
+ Inferno will automatically resume when a notification is received.
30
36
 
31
- Future versions of this test will validate subscription-based notifications as
32
- described within the implementation guide (see
33
- [here](https://github.com/inferno-framework/davinci-pas-test-kit/blob/main/lib/davinci_pas_test_kit/docs/server_suite_description_v201.md#testing-limitations)
34
- for more details on this current limitation).
37
+ _If the server is unable to send a notification or if Inferno has not automatically resumed after the server
38
+ attempted to send a notification, you may
39
+ **[click here](#{resume_skip_url}?token=notification+#{access_token})** to skip this test._
35
40
  )
36
41
  )
37
- # rubocop:enable Layout/LineLength
38
42
  end
39
43
  end
40
44
  end
@@ -8,10 +8,10 @@ module DaVinciPASTestKit
8
8
  module DaVinciPASV201
9
9
  class PASClientApprovalGroup < Inferno::TestGroup
10
10
  id :pas_client_v201_approval_group
11
- title 'Demonstrate Approval Workflow'
11
+ title 'Approval Workflow'
12
12
  description %(
13
- Demonstrate the ability of the client to initiate a prior authorization
14
- request and respond appropriately to an 'approved' decision.
13
+ During these tests, the client will initiate a prior authorization
14
+ request and show it can respond appropriately to an 'approved' decision.
15
15
  )
16
16
  run_as_group
17
17
 
@@ -20,6 +20,7 @@ module DaVinciPASTestKit
20
20
  test from: :pas_client_v201_approval_submit_test
21
21
  test from: :pas_client_v201_request_bundle_validation_test,
22
22
  config: { options: { workflow_tag: APPROVAL_WORKFLOW_TAG } }
23
+
23
24
  test from: :pas_client_v201_response_bundle_validation_test,
24
25
  config: { options: { workflow_tag: APPROVAL_WORKFLOW_TAG } }
25
26
  test from: :pas_client_v201_response_attest,
@@ -31,7 +32,8 @@ module DaVinciPASTestKit
31
32
  ),
32
33
  config: { options: {
33
34
  workflow_tag: APPROVAL_WORKFLOW_TAG,
34
- attest_message: "I attest that the client system displays the submitted claim as 'approved' meaning that the user can proceed with ordering or providing the requested service." # rubocop:disable Layout/LineLength
35
+ attest_message: "I attest that the client system displays the submitted claim as 'approved' meaning " \
36
+ 'that the user can proceed with ordering or providing the requested service.'
35
37
  } }
36
38
  end
37
39
  end
@@ -0,0 +1,32 @@
1
+ require 'smart_app_launch_test_kit'
2
+ require_relative 'pas_client_options'
3
+ require_relative '../../tags'
4
+
5
+ module DaVinciPASTestKit
6
+ module DaVinciPASV201
7
+ class PASClientAuthSMARTGroup < Inferno::TestGroup
8
+ id :pas_client_v201_auth_smart
9
+ title 'Review Authentication Interactions'
10
+ description %(
11
+ During these tests, Inferno will verify that the client interacted with Inferno's
12
+ simulated SMART authorization server in a conformant manner when requesting access tokens
13
+ and that the client under test was able to use provided access tokens to make PAS
14
+ requests.
15
+
16
+ Before running these tests, execute the tests for at least one "PAS workflows" sub-group
17
+ so that the client will request an access token and use it on a PAS request.
18
+ )
19
+ run_as_group
20
+
21
+ # smart auth verification
22
+ test from: :smart_client_token_request_bsca_verification,
23
+ config: {
24
+ options: { endpoint_suite_id: :davinci_pas_client_suite_v201 }
25
+ }
26
+ test from: :smart_client_token_use_verification,
27
+ config: {
28
+ options: { access_request_tags: [SUBMIT_TAG, INQUIRE_TAG] }
29
+ }
30
+ end
31
+ end
32
+ end