davinci_dtr_test_kit 0.15.0 → 0.15.1

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 (51) hide show
  1. checksums.yaml +4 -4
  2. data/lib/davinci_dtr_test_kit/client_groups/custom_static/dtr_full_ehr_custom_static_workflow_group.rb +3 -2
  3. data/lib/davinci_dtr_test_kit/client_groups/dinner_adaptive/dtr_adaptive_next_question_request_test.rb +1 -0
  4. data/lib/davinci_dtr_test_kit/client_groups/dinner_adaptive/dtr_adaptive_next_question_request_validation_test.rb +1 -0
  5. data/lib/davinci_dtr_test_kit/client_groups/dinner_adaptive/dtr_adaptive_response_validation_test.rb +3 -1
  6. data/lib/davinci_dtr_test_kit/client_groups/dinner_adaptive/dtr_full_ehr_adaptive_dinner_workflow_group.rb +2 -0
  7. data/lib/davinci_dtr_test_kit/client_groups/dinner_adaptive/dtr_full_ehr_adaptive_request_test.rb +2 -0
  8. data/lib/davinci_dtr_test_kit/client_groups/dinner_adaptive/dtr_smart_app_adaptive_dinner_workflow_group.rb +1 -1
  9. data/lib/davinci_dtr_test_kit/client_groups/dinner_static/dtr_full_ehr_static_dinner_workflow_group.rb +2 -1
  10. data/lib/davinci_dtr_test_kit/client_groups/full_ehr/dtr_full_ehr_prepopulation_attestation_test.rb +2 -0
  11. data/lib/davinci_dtr_test_kit/client_groups/full_ehr/dtr_full_ehr_prepopulation_override_attestation_test.rb +1 -0
  12. data/lib/davinci_dtr_test_kit/client_groups/full_ehr/dtr_full_ehr_questionnaire_package_request_test.rb +1 -0
  13. data/lib/davinci_dtr_test_kit/client_groups/full_ehr/dtr_full_ehr_questionnaire_response_correctness_test.rb +1 -0
  14. data/lib/davinci_dtr_test_kit/client_groups/full_ehr/dtr_full_ehr_store_attestation_test.rb +1 -0
  15. data/lib/davinci_dtr_test_kit/client_groups/light_ehr/dtr_light_ehr_supported_endpoints_group.rb +22 -0
  16. data/lib/davinci_dtr_test_kit/client_groups/light_ehr/dtr_light_ehr_supported_payers_accept_header_test.rb +26 -0
  17. data/lib/davinci_dtr_test_kit/client_groups/light_ehr/dtr_light_ehr_supported_payers_config_test.rb +34 -0
  18. data/lib/davinci_dtr_test_kit/client_groups/light_ehr/dtr_light_ehr_supported_payers_endpoint_test.rb +44 -0
  19. data/lib/davinci_dtr_test_kit/client_groups/light_ehr/dtr_light_ehr_supported_payers_use_test.rb +32 -0
  20. data/lib/davinci_dtr_test_kit/client_groups/light_ehr/dtr_light_ehr_supported_payers_user_response_test.rb +70 -0
  21. data/lib/davinci_dtr_test_kit/client_groups/light_ehr/fhir_context_references_test.rb +2 -3
  22. data/lib/davinci_dtr_test_kit/client_groups/shared/dtr_prepopulation_attestation_test.rb +2 -0
  23. data/lib/davinci_dtr_test_kit/client_groups/shared/dtr_prepopulation_override_attestation_test.rb +3 -2
  24. data/lib/davinci_dtr_test_kit/client_groups/shared/dtr_questionnaire_package_request_validation_test.rb +2 -0
  25. data/lib/davinci_dtr_test_kit/client_groups/shared/dtr_questionnaire_response_prepopulation_test.rb +3 -0
  26. data/lib/davinci_dtr_test_kit/client_groups/shared/dtr_rendering_attestation_test.rb +3 -1
  27. data/lib/davinci_dtr_test_kit/client_groups/smart_app/dtr_smart_app_prepopulation_attestation_test.rb +2 -0
  28. data/lib/davinci_dtr_test_kit/client_groups/smart_app/dtr_smart_app_questionnaire_response_correctness_test.rb +2 -0
  29. data/lib/davinci_dtr_test_kit/dtr_light_ehr_suite.rb +18 -4
  30. data/lib/davinci_dtr_test_kit/endpoints/mock_payer/light_ehr_supported_payer_endpoint.rb +44 -0
  31. data/lib/davinci_dtr_test_kit/metadata.rb +1 -1
  32. data/lib/davinci_dtr_test_kit/payer_server_groups/adaptive_form_libraries_test.rb +3 -0
  33. data/lib/davinci_dtr_test_kit/payer_server_groups/adaptive_form_questionnaire_expressions_test.rb +1 -0
  34. data/lib/davinci_dtr_test_kit/payer_server_groups/adaptive_form_questionnaire_extensions_test.rb +3 -0
  35. data/lib/davinci_dtr_test_kit/payer_server_groups/adaptive_next_questionnaire_expressions_test.rb +1 -0
  36. data/lib/davinci_dtr_test_kit/payer_server_groups/adaptive_next_questionnaire_extensions_test.rb +4 -1
  37. data/lib/davinci_dtr_test_kit/payer_server_groups/payer_server_adaptive_request_test.rb +2 -0
  38. data/lib/davinci_dtr_test_kit/payer_server_groups/payer_server_adaptive_response_bundles_validation_test.rb +2 -1
  39. data/lib/davinci_dtr_test_kit/payer_server_groups/payer_server_adaptive_response_search_validation_test.rb +8 -3
  40. data/lib/davinci_dtr_test_kit/payer_server_groups/payer_server_adaptive_response_validation_test.rb +2 -0
  41. data/lib/davinci_dtr_test_kit/payer_server_groups/payer_server_next_response_complete_test.rb +1 -0
  42. data/lib/davinci_dtr_test_kit/payer_server_groups/static_form_libraries_test.rb +3 -0
  43. data/lib/davinci_dtr_test_kit/payer_server_groups/static_form_questionnaire_expressions_test.rb +1 -0
  44. data/lib/davinci_dtr_test_kit/payer_server_groups/static_form_questionnaire_extensions_test.rb +3 -0
  45. data/lib/davinci_dtr_test_kit/payer_server_groups/static_form_request_test.rb +2 -0
  46. data/lib/davinci_dtr_test_kit/payer_server_groups/static_form_response_validation_test.rb +2 -0
  47. data/lib/davinci_dtr_test_kit/requirements/generated/davinci-dtr-test-kit_requirements_coverage.csv +47 -47
  48. data/lib/davinci_dtr_test_kit/tags.rb +1 -0
  49. data/lib/davinci_dtr_test_kit/urls.rb +5 -0
  50. data/lib/davinci_dtr_test_kit/version.rb +2 -2
  51. metadata +9 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ad9415f71349f1c47b02b99f12e39561a171bdfa990298b465b11529db3dd7a1
4
- data.tar.gz: dfb2b95d1059b441a3cb86e1720d56621ca782b97771436bb22ac55b2fa30500
3
+ metadata.gz: 4a3fe760280763026036d2cc3885b0799a22b9d6ede79c544458c77f6cd763a5
4
+ data.tar.gz: 5711f5f7b0d0db55c6fc47229566c8edbb577764ca18026a51b3847df739b203
5
5
  SHA512:
6
- metadata.gz: 608ce68bd4a9f24a63019d8428ec4dac2126e7355d7034f65ce91f13ea4a3a137a54f435fe6d70ff941c9a72f4d9aa04653f406ca7ae75534b5365e311aea6df
7
- data.tar.gz: 38141199dae845ac8124ff43c9a198bebd37c32f3554f8e8f76d27bb2c112dd8934171f98910fbc330b6ebe3661034f32f23193434e6cf60c5b61aac578834b0
6
+ metadata.gz: 2389fdb82bbfbd48cba4c4b4cb150efb438d5702642c0b3ebcc50ad5d3e63cfb5ffe68e1ad4a6b526664f6a6f7d0602d3e2d36926462be299e3e16248a1fde0b
7
+ data.tar.gz: 10dd9f24d65d53cb995df50db102bd5a37ccef33eba8034c240e7e0345ff2e29e16327a016cd79bb888a3837fd4b62cad0493481e07a3188f9ae2dcdb95d4303
@@ -27,6 +27,7 @@ module DaVinciDTRTestKit
27
27
  - Allowing the tester to manually enter responses, including overriding pre-populated answers.
28
28
  3. Complete and store the QuestionnaireResponse for future use.
29
29
  )
30
+ verifies_requirements 'hl7.fhir.us.davinci-dtr_2.0.1@35', 'hl7.fhir.us.davinci-dtr_2.0.1@208'
30
31
 
31
32
  group do
32
33
  id :dtr_full_ehr_custom_static_retrieval
@@ -62,7 +63,7 @@ module DaVinciDTRTestKit
62
63
  test from: :dtr_custom_qp_validation
63
64
  # Test 4: verify the custom response has the necessary libraries for pre-population
64
65
  test from: :dtr_custom_questionnaire_libraries
65
- # Test 5: verify the custom response has the necessaru extensions for pre-population
66
+ # Test 5: verify the custom response has the necessary extensions for pre-population
66
67
  test from: :dtr_custom_questionnaire_extensions
67
68
  # Test 6: verify custom response has necessary expressions for pre-population
68
69
  test from: :dtr_custom_questionnaire_expressions
@@ -73,7 +74,7 @@ module DaVinciDTRTestKit
73
74
  title 'Filling Out the Static Questionnaire'
74
75
  description %(
75
76
  The tester will interact with the questionnaire within their client system
76
- such that pre-population steps are taken, the qustionnaire is rendered, and
77
+ such that pre-population steps are taken, the questionnaire is rendered, and
77
78
  they are able to fill it out. The tester will attest that questionnaire pre-population
78
79
  and rendering directives were followed.
79
80
  )
@@ -12,6 +12,7 @@ module DaVinciDTRTestKit
12
12
  Inferno will validate the request body and update the contained Questionnaire to include
13
13
  the next question or set of questions.
14
14
  )
15
+ verifies_requirements 'hl7.fhir.us.davinci-dtr_2.0.1@264'
15
16
 
16
17
  input :access_token
17
18
 
@@ -27,6 +27,7 @@ module DaVinciDTRTestKit
27
27
  The QuestionnaireResponse resource's structure and conformance will be validated
28
28
  in the following test ('Adaptive QuestionnaireResponse is valid').
29
29
  )
30
+ verifies_requirements 'hl7.fhir.us.davinci-dtr_2.0.1@264'
30
31
 
31
32
  def assert_valid_resource_type(resource)
32
33
  type = resource.resourceType
@@ -14,7 +14,7 @@ module DaVinciDTRTestKit
14
14
  structure. It verifies the presence of mandatory elements and that elements
15
15
  with required bindings contain appropriate values.
16
16
 
17
- It also ensures that all required questions are answered, and that the `origin.source`
17
+ It also ensures that all required questions are answered, and that the `origin.source`
18
18
  extension is correct for each answer:
19
19
  - `PBD.1` (Last Name) and `LOC.1` (Location): `auto`
20
20
  - `PBD.2` (First Name): `override`
@@ -24,6 +24,8 @@ module DaVinciDTRTestKit
24
24
  since neither the QuestionnaireResponse nor the contained Questionnaire will have any items,
25
25
  as no questions are yet known.
26
26
  )
27
+ verifies_requirements 'hl7.fhir.us.davinci-dtr_2.0.1@38', 'hl7.fhir.us.davinci-dtr_2.0.1@210',
28
+ 'hl7.fhir.us.davinci-dtr_2.0.1@264'
27
29
 
28
30
  def profile_url
29
31
  'http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaireresponse-adapt'
@@ -23,6 +23,8 @@ module DaVinciDTRTestKit
23
23
  4. Complete the questionnaire and provide the completed QuestionnaireResponse
24
24
  with appropriate indicators for pre-populated and manually-entered data.
25
25
  )
26
+ verifies_requirements 'hl7.fhir.us.davinci-dtr_2.0.1@36', 'hl7.fhir.us.davinci-dtr_2.0.1@203',
27
+ 'hl7.fhir.us.davinci-dtr_2.0.1@208'
26
28
 
27
29
  group do
28
30
  id :dtr_full_ehr_adaptive_retrieval
@@ -16,6 +16,8 @@ module DaVinciDTRTestKit
16
16
  2. **Initial Next Question Request**: After receiving the package, the client should invoke the
17
17
  `$next-question` operation. Inferno will respond by providing the first set of questions.
18
18
  )
19
+ verifies_requirements 'hl7.fhir.us.davinci-dtr_2.0.1@165', 'hl7.fhir.us.davinci-dtr_2.0.1@262',
20
+ 'hl7.fhir.us.davinci-dtr_2.0.1@264'
19
21
 
20
22
  config options: { accepts_multiple_requests: true }
21
23
  input :access_token
@@ -52,7 +52,7 @@ module DaVinciDTRTestKit
52
52
  title 'Filling Out the Questionnaire'
53
53
  description %(
54
54
  The tester will interact with the questionnaire within their client system
55
- such that pre-population steps are taken, the qustionnaire is rendered, and
55
+ such that pre-population steps are taken, the questionnaire is rendered, and
56
56
  they are able to fill it out. The tester will attest that questionnaire pre-population
57
57
  and rendering directives were followed.
58
58
  )
@@ -22,6 +22,7 @@ module DaVinciDTRTestKit
22
22
  - display questions only when they are enabled by other answers
23
23
  3. Complete and store the questionnaire response for future use.
24
24
  )
25
+ verifies_requirements 'hl7.fhir.us.davinci-dtr_2.0.1@35', 'hl7.fhir.us.davinci-dtr_2.0.1@208'
25
26
 
26
27
  group do
27
28
  id :dtr_full_ehr_static_retrieval
@@ -46,7 +47,7 @@ module DaVinciDTRTestKit
46
47
  title 'Filling Out the Static Questionnaire'
47
48
  description %(
48
49
  The tester will interact with the questionnaire within their client system
49
- such that pre-population steps are taken, the qustionnaire is rendered, and
50
+ such that pre-population steps are taken, the questionnaire is rendered, and
50
51
  they are able to fill it out. The tester will attest that questionnaire pre-population
51
52
  and rendering directives were followed.
52
53
  )
@@ -10,6 +10,8 @@ module DaVinciDTRTestKit
10
10
  description %(
11
11
  Validate that pre-population of patient name information occurs as expected.
12
12
  )
13
+ verifies_requirements 'hl7.fhir.us.davinci-dtr_2.0.1@207'
14
+
13
15
  run do
14
16
  random_id = SecureRandom.uuid
15
17
  wait(
@@ -10,6 +10,7 @@ module DaVinciDTRTestKit
10
10
  description %(
11
11
  Validate that the user can edit a pre-populated item and replace it with another value.
12
12
  )
13
+
13
14
  run do
14
15
  random_id = SecureRandom.uuid
15
16
  wait(
@@ -10,6 +10,7 @@ module DaVinciDTRTestKit
10
10
  Inferno will wait for a DTR questionnaire package request from the client. Upon receipt, Inferno will generate and
11
11
  send a response.
12
12
  )
13
+ verifies_requirements 'hl7.fhir.us.davinci-dtr_2.0.1@165', 'hl7.fhir.us.davinci-dtr_2.0.1@262'
13
14
 
14
15
  input :access_token,
15
16
  description: %(
@@ -15,6 +15,7 @@ module DaVinciDTRTestKit
15
15
  - `PBD.2` (First Name): `override`
16
16
  - `3` (all nested dinner questions): `manual`
17
17
  )
18
+ verifies_requirements 'hl7.fhir.us.davinci-dtr_2.0.1@209', 'hl7.fhir.us.davinci-dtr_2.0.1@210'
18
19
 
19
20
  run do
20
21
  skip_if questionnaire_response.blank?, 'Completed QuestionnaireResponse input was blank'
@@ -11,6 +11,7 @@ module DaVinciDTRTestKit
11
11
  Attest that the questionnaire has been completed and the response has been persisted
12
12
  and can be exported as a FHIR QuestionnaireResponse instance.
13
13
  )
14
+
14
15
  run do
15
16
  random_id = SecureRandom.uuid
16
17
  wait(
@@ -0,0 +1,22 @@
1
+ require_relative 'dtr_light_ehr_supported_payers_config_test'
2
+ require_relative 'dtr_light_ehr_supported_payers_accept_header_test'
3
+ require_relative 'dtr_light_ehr_supported_payers_endpoint_test'
4
+ require_relative 'dtr_light_ehr_supported_payers_user_response_test'
5
+ require_relative 'dtr_light_ehr_supported_payers_use_test'
6
+
7
+ module DaVinciDTRTestKit
8
+ class DTRLightEHRSupportedEndpointsGroup < Inferno::TestGroup
9
+ id :dtr_light_ehr_supported_endpoints
10
+ title 'Supported Payers Endpoint'
11
+ description %(This group checks that systems can request and react to a DTR
12
+ SMART App's [list of supported payers](https://hl7.org/fhir/us/davinci-dtr/STU2/specification.html#determination-of-payers-supported-by-a-dtr-app).
13
+ )
14
+ run_as_group
15
+
16
+ test from: :dtr_light_ehr_sp_config
17
+ test from: :dtr_light_ehr_sp_endpoint
18
+ test from: :dtr_light_ehr_sp_accept_header
19
+ test from: :dtr_light_ehr_sp_user_response
20
+ test from: :dtr_light_ehr_sp_use
21
+ end
22
+ end
@@ -0,0 +1,26 @@
1
+ require_relative '../../urls'
2
+ require_relative '../../tags'
3
+
4
+ module DaVinciDTRTestKit
5
+ class DTRLightEHRSupportedPayersAcceptHeaderTest < Inferno::Test
6
+ include URLs
7
+ id :dtr_light_ehr_sp_accept_header
8
+ title 'Client uses the required Accept HTTP header value'
9
+ description %(
10
+ This test verifies that the request to the supported payers endpoint
11
+ includes an `Accept` HTTP header set to `application/json`.
12
+ )
13
+
14
+ verifies_requirements 'hl7.fhir.us.davinci-dtr_2.0.1@108'
15
+
16
+ run do
17
+ load_tagged_requests(SUPPORTED_PAYER_TAG)
18
+ accept_header = request.request_headers.find { |header| header.name.downcase == 'accept' }
19
+
20
+ assert accept_header.present?, 'Accept header must be provided'
21
+ assert accept_header.value == 'application/json', "Invalid Accept header: Expected 'application/json'
22
+ but received '#{accept_header.value}'"
23
+ pass 'Accept header is correctly set to application/json'
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,34 @@
1
+ require_relative '../../urls'
2
+
3
+ module DaVinciDTRTestKit
4
+ class DTRLightEHRSupportedPayersConfigTest < Inferno::Test
5
+ include URLs
6
+ id :dtr_light_ehr_sp_config
7
+ title 'Demonstrate supported payers configuration'
8
+ description %(
9
+ During this test, the tester will demonstrate the capability of the light EHR under test to configure a supported
10
+ payers endpoint for Inferno's simulated DTR SMART App.
11
+ )
12
+
13
+ verifies_requirements 'hl7.fhir.us.davinci-dtr_2.0.1@105'
14
+
15
+ input :unique_url_id, type: :text
16
+
17
+ run do
18
+ identifier = SecureRandom.hex(32)
19
+ wait(
20
+ identifier:,
21
+ message: <<~MESSAGE
22
+ Show that the Light EHR under test has been configured to use the following URL
23
+ as the supported payers endpoint for Inferno's simulated DTR SMART App:
24
+
25
+ `#{supported_payer_url(unique_url_id)}`
26
+
27
+ [Click here](#{resume_pass_url}?token=#{identifier}) if the system **successfully** demonstrates this configuration.
28
+
29
+ [Click here](#{resume_fail_url}?token=#{identifier}) if the system **does not** demonstrate this configuration.
30
+ MESSAGE
31
+ )
32
+ end
33
+ end
34
+ end
@@ -0,0 +1,44 @@
1
+ require_relative '../../urls'
2
+
3
+ module DaVinciDTRTestKit
4
+ class DTRLightEHRSupportedPayersEndpointTest < Inferno::Test
5
+ include URLs
6
+ id :dtr_light_ehr_sp_endpoint
7
+ title 'Client can request an app\'s supported payers list'
8
+ description %(
9
+ This test verifies that the app can successfully access the supported payers endpoint via a GET request
10
+ )
11
+ input :unique_url_id,
12
+ title: 'Supported Payers Endpoint Path',
13
+ description: %(
14
+ A unique identifier that will be used to construct the supported payers
15
+ endpoint URL. This allows a permanent configuration for the tester to
16
+ use across Inferno sessions.
17
+ )
18
+ input :user_response,
19
+ title: 'Custom Supported Payers Response',
20
+ description: %(
21
+ If present, the value will be returned when the client makes a request to the supported payers endpoint,
22
+ allowing testers to instruct Inferno how to respond with payers that are configured in the
23
+ system under test. The provided response will be checked for conformance to the required
24
+ JSON structure. If not provided, Inferno will return a pre-configured value.
25
+ ),
26
+ optional: true,
27
+ type: 'textarea'
28
+
29
+ verifies_requirements 'hl7.fhir.us.davinci-dtr_2.0.1@104', 'hl7.fhir.us.davinci-dtr_2.0.1@107'
30
+
31
+ run do
32
+ wait(
33
+ identifier: unique_url_id,
34
+ message: %(
35
+ ### Supported Payer Endpoint
36
+
37
+ Inferno will wait for the Light EHR to to make a GET request to
38
+
39
+ `#{supported_payer_url(unique_url_id)}`
40
+ )
41
+ )
42
+ end
43
+ end
44
+ end
@@ -0,0 +1,32 @@
1
+ require_relative '../../urls'
2
+
3
+ module DaVinciDTRTestKit
4
+ class DTRLightEHRSupportedPayersUseTest < Inferno::Test
5
+ include URLs
6
+ id :dtr_light_ehr_sp_use
7
+ title 'Demonstrate use of the supported payers response'
8
+ description %(
9
+ During this test, the tester will demonstrate the ability of the light EHR under test to use the response from
10
+ the supported payers endpoint to suppress the launch of Inferno's simulated DTR SMART App for a patient
11
+ who is covered only by payers not included in the returned supported payers list.
12
+ )
13
+
14
+ verifies_requirements 'hl7.fhir.us.davinci-dtr_2.0.1@115'
15
+
16
+ run do
17
+ identifier = SecureRandom.hex(32)
18
+ wait(
19
+ identifier:,
20
+ message: <<~MESSAGE
21
+ Demonstrate that when DTR is needed for a patient that is not covered by payers included in the
22
+ supported payers list returned from the endpoint, launching Inferno's simulated DTR App
23
+ is not an option.
24
+
25
+ [Click here](#{resume_pass_url}?token=#{identifier}) if the system **successfully** demonstrates this capability.
26
+
27
+ [Click here](#{resume_fail_url}?token=#{identifier}) if the system **does not** demonstrate this capability.
28
+ MESSAGE
29
+ )
30
+ end
31
+ end
32
+ end
@@ -0,0 +1,70 @@
1
+ require_relative '../../urls'
2
+ require_relative '../../tags'
3
+
4
+ module DaVinciDTRTestKit
5
+ class DTRLightEHRSupportedPayersUserResponseTest < Inferno::Test
6
+ include URLs
7
+ id :dtr_light_ehr_sp_user_response
8
+ title %(
9
+ [USER INPUT VERIFICATION] Tester-provided supported payers response is conformant
10
+ )
11
+ description %(
12
+ This test verifies that the user-provided response conforms
13
+ to the requirements for a supported payers response. The test will
14
+ be omitted if the tester does not provide a custom response in the
15
+ **Custom Supported Payers Response** input.
16
+ )
17
+
18
+ input :user_response, type: :textarea, optional: true
19
+
20
+ def validate_response(parsed_response)
21
+ assert parsed_response.present?, 'User provided response is nil.'
22
+
23
+ unless parsed_response.is_a?(Hash)
24
+ add_message('error', 'Response is not a valid JSON object (Hash expected).')
25
+ return
26
+ end
27
+
28
+ unless parsed_response['payers'].is_a?(Array)
29
+ add_message('error', 'The "payers" field is not an array.')
30
+ return
31
+ end
32
+
33
+ add_message('error', 'Response does not contain the required "payers" key.') unless parsed_response.key?('payers')
34
+ add_message('error', 'The "payers" field is an empty array.') if parsed_response['payers'].empty?
35
+
36
+ parsed_response['payers'].each_with_index do |payer, index|
37
+ validate_payer(payer, index)
38
+ end
39
+ end
40
+
41
+ def validate_payer(payer, index)
42
+ unless payer.is_a?(Hash)
43
+ add_message('error', "Payer at index #{index} is not a valid JSON object (Hash expected).")
44
+ return
45
+ end
46
+
47
+ add_message('error', "Payer at index #{index} does not contain the required 'id' key.") unless payer.key?('id')
48
+ add_message('error', "Payer at index #{index} does not contain the required 'name' key.") unless payer['name']
49
+ end
50
+
51
+ run do
52
+ omit_if user_response.nil?, 'No user response provided, default response returned.'
53
+
54
+ load_tagged_requests(SUPPORTED_PAYER_TAG)
55
+ request_record = requests.first
56
+
57
+ assert request_record.present?, 'No requests made to the supported payers endpoint.'
58
+
59
+ begin
60
+ parsed_response = JSON.parse(request_record.response_body)
61
+ rescue JSON::ParserError
62
+ assert false, 'User response is not valid JSON.'
63
+ end
64
+
65
+ validate_response(parsed_response)
66
+ assert messages.none? { |msg| msg[:type] == 'error' }, 'User response is invalid.'
67
+ pass 'User response is present and valid.'
68
+ end
69
+ end
70
+ end
@@ -15,9 +15,8 @@ module DaVinciDTRTestKit
15
15
  See the [Launching DTR](https://hl7.org/fhir/us/davinci-dtr/STU2/specification.html#launching-dtr)
16
16
  section of the DTR IG for details.
17
17
  )
18
- verifies_requirements 'hl7.fhir.us.davinci-dtr_2.0.1@127'
19
- verifies_requirements 'hl7.fhir.us.davinci-dtr_2.0.1@128'
20
- verifies_requirements 'hl7.fhir.us.davinci-dtr_2.0.1@129'
18
+ verifies_requirements 'hl7.fhir.us.davinci-dtr_2.0.1@127', 'hl7.fhir.us.davinci-dtr_2.0.1@128',
19
+ 'hl7.fhir.us.davinci-dtr_2.0.1@129'
21
20
  optional
22
21
 
23
22
  uses_request :token
@@ -13,6 +13,8 @@ module DaVinciDTRTestKit
13
13
  Note that the test requires that two questions be pre-populated so that both a pre-populated
14
14
  and an overridden answer can be demonstrated when the QuestionnaireResponse is generated.
15
15
  )
16
+ verifies_requirements 'hl7.fhir.us.davinci-dtr_2.0.1@207'
17
+
16
18
  run do
17
19
  random_id = SecureRandom.uuid
18
20
  wait(
@@ -10,11 +10,12 @@ module DaVinciDTRTestKit
10
10
  description %(
11
11
  Validate that the user can edit the rendered form to provide answers, including
12
12
  - Providing an answer for an unanswered question.
13
- - Overridding a pre-populated answer with a manual answer.
13
+ - Overriding a pre-populated answer with a manual answer.
14
14
 
15
15
  Note that at least one pre-populated answer must remain un-altered to demonstrate
16
- its representaton in the resulting QuestionnaireResponse.
16
+ its representation in the resulting QuestionnaireResponse.
17
17
  )
18
+
18
19
  run do
19
20
  random_id = SecureRandom.uuid
20
21
  wait(
@@ -16,6 +16,8 @@ module DaVinciDTRTestKit
16
16
  to the bound ValueSet. Quantity, Coding, and code element bindings will fail if their code/system are not found in
17
17
  the valueset.
18
18
  )
19
+ verifies_requirements 'hl7.fhir.us.davinci-dtr_2.0.1@168', 'hl7.fhir.us.davinci-dtr_2.0.1@293',
20
+ 'hl7.fhir.us.davinci-dtr_2.0.1@295'
19
21
 
20
22
  run do
21
23
  load_tagged_requests QUESTIONNAIRE_PACKAGE_TAG
@@ -20,6 +20,9 @@ module DaVinciDTRTestKit
20
20
  the origin.source extension set to 'override' and an answer different
21
21
  from the expected result from execution of the CQL on Inferno's data.
22
22
  )
23
+ verifies_requirements 'hl7.fhir.us.davinci-dtr_2.0.1@173', 'hl7.fhir.us.davinci-dtr_2.0.1@174',
24
+ 'hl7.fhir.us.davinci-dtr_2.0.1@176', 'hl7.fhir.us.davinci-dtr_2.0.1@178',
25
+ 'hl7.fhir.us.davinci-dtr_2.0.1@207'
23
26
 
24
27
  run do
25
28
  questionnaire_response_json = request.request_body
@@ -11,13 +11,15 @@ module DaVinciDTRTestKit
11
11
  The tester will attest to the ability of the client to appropriately render the
12
12
  Questionnaire and allow user interaction.
13
13
  )
14
+ verifies_requirements 'hl7.fhir.us.davinci-dtr_2.0.1@4'
15
+
14
16
  run do
15
17
  random_id = SecureRandom.uuid
16
18
  wait(
17
19
  identifier: random_id,
18
20
  message: %(
19
21
  I attest that the DTR client application has displayed the tester-provided Questionnaire
20
- appropriately, following all rendering and formating directives within the Questionnaire
22
+ appropriately, following all rendering and formatting directives within the Questionnaire
21
23
  and allowing the user to interact with the questions in the form.
22
24
 
23
25
  [Click here](#{resume_pass_url}?token=#{random_id}) if the above statement is **true**.
@@ -10,6 +10,8 @@ module DaVinciDTRTestKit
10
10
  description %(
11
11
  Validate that pre-population of patient name information occurs as expected.
12
12
  )
13
+ verifies_requirements 'hl7.fhir.us.davinci-dtr_2.0.1@207'
14
+
13
15
  run do
14
16
  random_id = SecureRandom.uuid
15
17
  wait(
@@ -13,6 +13,8 @@ module DaVinciDTRTestKit
13
13
  automatically pre-populated, and manually overridden.
14
14
  - Contains answers for all required items.
15
15
  )
16
+ verifies_requirements 'hl7.fhir.us.davinci-dtr_2.0.1@209', 'hl7.fhir.us.davinci-dtr_2.0.1@210'
17
+
16
18
  input :custom_questionnaire_package_response,
17
19
  title: 'Custom Questionnaire Package Response JSON',
18
20
  description: %(
@@ -13,6 +13,8 @@ require_relative 'profiles/service_request_group'
13
13
  require_relative 'profiles/task_group'
14
14
  require_relative 'profiles/vision_prescription_group'
15
15
  require_relative 'client_groups/light_ehr/dtr_smart_ehr_launch'
16
+ require_relative 'endpoints/mock_payer/light_ehr_supported_payer_endpoint'
17
+ require_relative 'client_groups/light_ehr/dtr_light_ehr_supported_endpoints_group'
16
18
  require 'smart_app_launch/smart_stu1_suite'
17
19
  require 'smart_app_launch/smart_stu2_suite'
18
20
 
@@ -41,10 +43,6 @@ module DaVinciDTRTestKit
41
43
  }
42
44
  ]
43
45
 
44
- input :url,
45
- title: 'FHIR Server Base Url',
46
- description: 'URL of the target DTR Light EHR'
47
-
48
46
  # Hl7 Validator Wrapper:
49
47
  fhir_resource_validator do
50
48
  igs('hl7.fhir.us.davinci-dtr#2.0.1', 'hl7.fhir.us.davinci-pas#2.0.1', 'hl7.fhir.us.davinci-crd#2.0.1')
@@ -54,6 +52,16 @@ module DaVinciDTRTestKit
54
52
  end
55
53
  end
56
54
 
55
+ suite_endpoint :get, SUPPORTED_PAYER_PATH, LightEHRSupportedPayerEndpoint
56
+
57
+ resume_test_route :get, RESUME_PASS_PATH do |request|
58
+ request.query_parameters['token']
59
+ end
60
+
61
+ resume_test_route :get, RESUME_FAIL_PATH, result: 'fail' do |request|
62
+ request.query_parameters['token']
63
+ end
64
+
57
65
  group do
58
66
  title 'Authorization'
59
67
 
@@ -105,6 +113,10 @@ module DaVinciDTRTestKit
105
113
 
106
114
  )
107
115
 
116
+ input :url,
117
+ title: 'FHIR Server Base Url',
118
+ description: 'URL of the target DTR Light EHR'
119
+
108
120
  group from: :'us_core_v311-us_core_v311_fhir_api',
109
121
  run_as_group: true,
110
122
  verifies_requirements: ['hl7.fhir.us.davinci-dtr_2.0.1@2', 'hl7.fhir.us.davinci-dtr_2.0.1@281']
@@ -142,5 +154,7 @@ module DaVinciDTRTestKit
142
154
  group from: :vision_prescription_group
143
155
  end
144
156
  end
157
+
158
+ group from: :dtr_light_ehr_supported_endpoints
145
159
  end
146
160
  end
@@ -0,0 +1,44 @@
1
+ require_relative '../../tags'
2
+
3
+ module DaVinciDTRTestKit
4
+ class LightEHRSupportedPayerEndpoint < Inferno::DSL::SuiteEndpoint
5
+ def name
6
+ 'light_ehr_supported_payer_endpoint'
7
+ end
8
+
9
+ def test_run_identifier
10
+ request.params[:tester_url_id]
11
+ end
12
+
13
+ def tags
14
+ [SUPPORTED_PAYER_TAG]
15
+ end
16
+
17
+ def make_response
18
+ user_response = JSON.parse(result.input_json)&.find { |input| input['name'] == 'user_response' }&.dig('value')
19
+
20
+ response.body = if user_response.present?
21
+ user_response
22
+ else
23
+ default_response
24
+ end
25
+ response.status = 200
26
+ response.headers['Content-Type'] = 'application/json'
27
+ end
28
+
29
+ private
30
+
31
+ def default_response
32
+ {
33
+ payers: [
34
+ { id: 'payer1', name: 'Payer One' },
35
+ { id: 'payer2', name: 'Payer Two' }
36
+ ]
37
+ }.to_json
38
+ end
39
+
40
+ def update_result
41
+ results_repo.update_result(result.id, 'pass')
42
+ end
43
+ end
44
+ end
@@ -3,7 +3,7 @@ require_relative 'version'
3
3
  module DaVinciDTRTestKit
4
4
  class Metadata < Inferno::TestKit
5
5
  id :davinci_dtr_test_kit
6
- title 'DDa Vinci Documentation Templates and Rules (DTR) Test Kit'
6
+ title 'Da Vinci Documentation Templates and Rules (DTR) Test Kit'
7
7
  description <<~DESCRIPTION
8
8
  The Da Vinci Documentation Templates and Rules (DTR) Test Kit validates
9
9
  the conformance of DTR SMART app client and payer server implementations to
@@ -9,6 +9,9 @@ module DaVinciDTRTestKit
9
9
  Inferno check that the payer response contains no duplicate library names
10
10
  and that libraries contain cql and elm data.
11
11
  )
12
+ verifies_requirements 'hl7.fhir.us.davinci-dtr_2.0.1@84', 'hl7.fhir.us.davinci-dtr_2.0.1@95',
13
+ 'hl7.fhir.us.davinci-dtr_2.0.1@96', 'hl7.fhir.us.davinci-dtr_2.0.1@99',
14
+ 'hl7.fhir.us.davinci-dtr_2.0.1@101', 'hl7.fhir.us.davinci-dtr_2.0.1@102'
12
15
 
13
16
  run do
14
17
  skip_if retrieval_method == 'Static', 'Performing only static flow tests - only one flow is required.'
@@ -9,6 +9,7 @@ module DaVinciDTRTestKit
9
9
  Inferno checks that the payer server response has appropriate expressions and that expressions are
10
10
  written in cql.
11
11
  )
12
+ verifies_requirements 'hl7.fhir.us.davinci-dtr_2.0.1@64'
12
13
 
13
14
  run do
14
15
  skip_if retrieval_method == 'Static', 'Performing only static flow tests - only one flow is required.'
@@ -9,6 +9,9 @@ module DaVinciDTRTestKit
9
9
  Inferno checks that the payer server response has appropriate extensions and references to libraries within
10
10
  those extensions.
11
11
  )
12
+ verifies_requirements 'hl7.fhir.us.davinci-dtr_2.0.1@57', 'hl7.fhir.us.davinci-dtr_2.0.1@62',
13
+ 'hl7.fhir.us.davinci-dtr_2.0.1@83', 'hl7.fhir.us.davinci-dtr_2.0.1@98',
14
+ 'hl7.fhir.us.davinci-dtr_2.0.1@309', 'hl7.fhir.us.davinci-dtr_2.0.1@317'
12
15
 
13
16
  run do
14
17
  skip_if retrieval_method == 'Static', 'Performing only static flow tests - only one flow is required.'