davinci_dtr_test_kit 0.11.1 → 0.12.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (35) hide show
  1. checksums.yaml +4 -4
  2. data/lib/davinci_dtr_test_kit/auth_groups/token_request_test.rb +1 -1
  3. data/lib/davinci_dtr_test_kit/client_groups/dinner_static/dtr_full_ehr_dinner_questionnaire_package_request_test.rb +52 -0
  4. data/lib/davinci_dtr_test_kit/client_groups/dinner_static/dtr_full_ehr_launch_attestation_test.rb +28 -0
  5. data/lib/davinci_dtr_test_kit/client_groups/dinner_static/dtr_full_ehr_prepopulation_attestation_test.rb +30 -0
  6. data/lib/davinci_dtr_test_kit/client_groups/dinner_static/dtr_full_ehr_prepopulation_override_attestation_test.rb +27 -0
  7. data/lib/davinci_dtr_test_kit/client_groups/dinner_static/dtr_full_ehr_prepopulation_representation_attestation_test.rb +33 -0
  8. data/lib/davinci_dtr_test_kit/client_groups/dinner_static/dtr_full_ehr_questionnaire_workflow_group.rb +81 -0
  9. data/lib/davinci_dtr_test_kit/client_groups/dinner_static/dtr_full_ehr_rendering_enabled_questions_attestation_test.rb +30 -0
  10. data/lib/davinci_dtr_test_kit/client_groups/dinner_static/dtr_full_ehr_store_attestation_test.rb +29 -0
  11. data/lib/davinci_dtr_test_kit/client_groups/dinner_static/{dtr_dinner_questionnaire_package_request_test.rb → dtr_smart_app_dinner_questionnaire_package_request_test.rb} +4 -4
  12. data/lib/davinci_dtr_test_kit/client_groups/dinner_static/{prepopulation_attestation_test.rb → dtr_smart_app_prepopulation_attestation_test.rb} +2 -2
  13. data/lib/davinci_dtr_test_kit/client_groups/dinner_static/{prepopulation_override_attestation_test.rb → dtr_smart_app_prepopulation_override_attestation_test.rb} +2 -2
  14. data/lib/davinci_dtr_test_kit/client_groups/dinner_static/{dtr_questionnaire_response_save_test.rb → dtr_smart_app_questionnaire_response_save_test.rb} +2 -2
  15. data/lib/davinci_dtr_test_kit/client_groups/dinner_static/dtr_smart_app_questionnaire_workflow_group.rb +13 -13
  16. data/lib/davinci_dtr_test_kit/client_groups/dinner_static/{rendering_enabled_questions_attestation_test.rb → dtr_smart_app_rendering_enabled_questions_attestation_test.rb} +2 -2
  17. data/lib/davinci_dtr_test_kit/client_groups/shared/dtr_questionnaire_package_request_validation_test.rb +1 -1
  18. data/lib/davinci_dtr_test_kit/client_groups/shared/dtr_questionnaire_response_basic_conformance_test.rb +1 -1
  19. data/lib/davinci_dtr_test_kit/docs/dtr_full_ehr_suite_description_v201.md +127 -0
  20. data/lib/davinci_dtr_test_kit/dtr_full_ehr_suite.rb +4 -12
  21. data/lib/davinci_dtr_test_kit/dtr_questionnaire_response_validation.rb +2 -2
  22. data/lib/davinci_dtr_test_kit/fixture_loader.rb +1 -1
  23. data/lib/davinci_dtr_test_kit/payer_server_groups/adaptive_next_questionnaire_expressions_test.rb +1 -1
  24. data/lib/davinci_dtr_test_kit/payer_server_groups/payer_server_adaptive_request_validation_test.rb +10 -19
  25. data/lib/davinci_dtr_test_kit/payer_server_groups/payer_server_adaptive_response_bundles_validation_test.rb +6 -6
  26. data/lib/davinci_dtr_test_kit/payer_server_groups/payer_server_adaptive_response_search_validation_test.rb +6 -6
  27. data/lib/davinci_dtr_test_kit/payer_server_groups/payer_server_adaptive_response_validation_test.rb +16 -18
  28. data/lib/davinci_dtr_test_kit/payer_server_groups/payer_server_next_request_validation_test.rb +6 -7
  29. data/lib/davinci_dtr_test_kit/payer_server_groups/payer_server_next_response_validation_test.rb +3 -1
  30. data/lib/davinci_dtr_test_kit/payer_server_groups/static_form_request_validation_test.rb +9 -21
  31. data/lib/davinci_dtr_test_kit/payer_server_groups/static_form_response_validation_test.rb +6 -14
  32. data/lib/davinci_dtr_test_kit/validation_test.rb +7 -9
  33. data/lib/davinci_dtr_test_kit/version.rb +1 -1
  34. data/lib/davinci_dtr_test_kit.rb +1 -1
  35. metadata +18 -9
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3449c737f53b2443bc81890e9788ff4aad6837c70865512e58b5a5d3809ad96e
4
- data.tar.gz: 4b2775168992e4887e5e330178138bd918a225bf9d57f2b7425a021acc7ee7c1
3
+ metadata.gz: 5120a6592cc4d31933d917e3214c89c8d505cdf6f8c3d5065d000588988052a8
4
+ data.tar.gz: c850d248ab0ae414fe399d03749d781e9f8c186525d67ba76c0d9cbad509aa17
5
5
  SHA512:
6
- metadata.gz: e6107a0cf03478d3bdc9c9b155af0664b8d39b9a3819e563c3dcf45bc69b34d80a83b0be270022be6d75aeb95a6b2b9b85d486c00693a9ad3e4f0605e2d504ee
7
- data.tar.gz: 69701c0a2b4a2a69ae16d5e8dd1b79fd9d27fddf0230d02dc6793be32752d965f01688d3661df72cfdddc9a208b252fda1303f516b5aa6458d33631383fc17f2
6
+ metadata.gz: 852190bb650b3f15d3fe25e79a08ba78778aeb85f836f32f6ed5e925859f14196cfb9d5719246a625c85803db6a606526ee2e735669bed0d574adaac3b23b8d9
7
+ data.tar.gz: 30e796f34e0b3e6b9088a2883af8bda32f8ac26d945c66cc6d4070b925c0eb40b362b9f76036d62b07aef6cc89d41e8c133efbb95d1bfb01233aa0289bd5889b
@@ -17,7 +17,7 @@ module DaVinciDTRTestKit
17
17
  message: %(
18
18
  Submit your token request to
19
19
 
20
- `#{token_url}`
20
+ `#{payer_token_url}`
21
21
  )
22
22
  )
23
23
  end
@@ -0,0 +1,52 @@
1
+ require 'base64'
2
+ require_relative '../../urls'
3
+
4
+ module DaVinciDTRTestKit
5
+ class DTRFullEHRDinnerQuestionnairePackageRequestTest < Inferno::Test
6
+ include URLs
7
+
8
+ id :dtr_full_ehr_dinner_questionnaire_package_request
9
+ title 'Invoke the DTR Questionnaire Package operation'
10
+ description %(
11
+ Inferno will wait for a DTR questionnaire package request from the client. Upon receipt, Inferno will generate and
12
+ send a response.
13
+ )
14
+
15
+ input :access_token,
16
+ description: %(
17
+ `Bearer` token that the client under test will send in the
18
+ `Authorization` header of each HTTP request to Inferno. Inferno
19
+ will look for this value to associate requests with this session.
20
+ )
21
+
22
+ run do
23
+ wait(
24
+ identifier: access_token,
25
+ message: %(
26
+ ### Questionnaire Package
27
+
28
+ Inferno will wait for the Full EHR to invoke the DTR Questionnaire Package operation by sending a POST
29
+ request to
30
+
31
+ `#{questionnaire_package_url}`
32
+
33
+ A questionnaire package generated by Inferno will be returned.
34
+
35
+ ### Request Identification
36
+
37
+ In order to identify requests for this session, Inferno will look for
38
+ an `Authorization` header with value:
39
+
40
+ ```
41
+ Bearer #{access_token}
42
+ ```
43
+
44
+ ### Continuing the Tests
45
+
46
+ When the DTR application has finished loading the Questionnaire
47
+ [Click here](#{resume_pass_url}?token=#{access_token}) to continue.
48
+ )
49
+ )
50
+ end
51
+ end
52
+ end
@@ -0,0 +1,28 @@
1
+ require_relative '../../urls'
2
+
3
+ module DaVinciDTRTestKit
4
+ class DTRFullEHRStaticDinnerLaunchAttestationTest < Inferno::Test
5
+ include URLs
6
+
7
+ id :dtr_full_ehr_dinner_static_launch_attestation
8
+ title 'Launch DTR for a patient that has an official name (Attestation)'
9
+ description %(
10
+ Attest that DTR has been launched for a patient with data that will be used for prepopulation.
11
+ )
12
+ input :access_token
13
+
14
+ run do
15
+ wait(
16
+ identifier: access_token,
17
+ message: %(
18
+ I attest that DTR has been launched in the context of a patient with an official name, including
19
+ first and last.
20
+
21
+ [Click here](#{resume_pass_url}?token=#{access_token}) if the above statement is **true**.
22
+
23
+ [Click here](#{resume_fail_url}?token=#{access_token}) if the above statement is **false**.
24
+ )
25
+ )
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,30 @@
1
+ require_relative '../../urls'
2
+
3
+ module DaVinciDTRTestKit
4
+ class DTRFullEHRStaticDinnerPrepopulationAttestationTest < Inferno::Test
5
+ include URLs
6
+
7
+ id :dtr_full_ehr_dinner_static_rendering_prepopulation_attestation
8
+ title 'Check that the client pre-populates the questionnaire (Attestation)'
9
+ description %(
10
+ Validate that pre-population of patient name information occurs as expected.
11
+ )
12
+ input :access_token
13
+
14
+ run do
15
+ wait(
16
+ identifier: access_token,
17
+ message: %(
18
+ I attest that the DTR application pre-populates the following questions with the respective
19
+ value for the official name of the patient:
20
+ - Last Name
21
+ - First Name
22
+
23
+ [Click here](#{resume_pass_url}?token=#{access_token}) if the above statement is **true**.
24
+
25
+ [Click here](#{resume_fail_url}?token=#{access_token}) if the above statement is **false**.
26
+ )
27
+ )
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,27 @@
1
+ require_relative '../../urls'
2
+
3
+ module DaVinciDTRTestKit
4
+ class DTRFullEHRStaticDinnerPrepopulationOverrideAttestationTest < Inferno::Test
5
+ include URLs
6
+
7
+ id :dtr_full_ehr_dinner_static_prepopulation_override_attestation
8
+ title 'Validate the user can override pre-populated data (Attestation)'
9
+ description %(
10
+ Validate that the user can edit a pre-populated item and replace it with another value.
11
+ )
12
+ input :access_token
13
+
14
+ run do
15
+ wait(
16
+ identifier: access_token,
17
+ message: %(
18
+ I attest that I have changed the prepopulated value in the First Name field to a new value.
19
+
20
+ [Click here](#{resume_pass_url}?token=#{access_token}) if the above statement is **true**.
21
+
22
+ [Click here](#{resume_fail_url}?token=#{access_token}) if the above statement is **false**.
23
+ )
24
+ )
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,33 @@
1
+ require_relative '../../urls'
2
+
3
+ module DaVinciDTRTestKit
4
+ class DTRFullEHRStaticDinnerPrepopulationRepresentationAttestationTest < Inferno::Test
5
+ include URLs
6
+
7
+ id :dtr_full_ehr_dinner_static_prepopulation_representation_attestation
8
+ title 'Verify the QuestionnaireResponse representation of the item data sources (Attestation)'
9
+ description %(
10
+ Attest that the QuestionnaireResponse representation of the stored answers includes the required
11
+ source indicators, including `auto`, `override`, and `manual`.
12
+ )
13
+ input :access_token
14
+
15
+ run do
16
+ wait(
17
+ identifier: access_token,
18
+ message: %(
19
+ I attest that the QuestionnaireResponse representation of the stored answers includes the
20
+ [orgin extension with source details](https://build.fhir.org/ig/HL7/davinci-dtr/StructureDefinition-information-origin.html),
21
+ including on the following fields entered during the tests:
22
+ - PBD.1 (Last Name): `auto`
23
+ - PBD.2 (First Name): `override`
24
+ - 3.1 (dinner choice): `manual`
25
+
26
+ [Click here](#{resume_pass_url}?token=#{access_token}) if the above statement is **true**.
27
+
28
+ [Click here](#{resume_fail_url}?token=#{access_token}) if the above statement is **false**.
29
+ )
30
+ )
31
+ end
32
+ end
33
+ end
@@ -0,0 +1,81 @@
1
+ require_relative 'dtr_full_ehr_launch_attestation_test'
2
+ require_relative 'dtr_full_ehr_dinner_questionnaire_package_request_test'
3
+ require_relative '../shared/dtr_questionnaire_package_request_validation_test'
4
+ require_relative 'dtr_full_ehr_prepopulation_attestation_test'
5
+ require_relative 'dtr_full_ehr_prepopulation_override_attestation_test'
6
+ require_relative 'dtr_full_ehr_rendering_enabled_questions_attestation_test'
7
+ require_relative 'dtr_full_ehr_store_attestation_test'
8
+ require_relative 'dtr_full_ehr_prepopulation_representation_attestation_test'
9
+
10
+ module DaVinciDTRTestKit
11
+ class DTRFullEHRStaticDinnerQuestionnaireWorkflowGroup < Inferno::TestGroup
12
+ id :dtr_full_ehr_static_dinner_questionnaire_workflow
13
+ title 'Static Questionnaire Workflow'
14
+ description %(
15
+ This test validates that a DTR Full EHR client can perform a full DTR Static Questionnaire workflow
16
+ using a mocked questionnaire requesting what a patient wants for dinner. The client system must
17
+ demonstrate its ability to:
18
+
19
+ 1. Fetch the static questionnaire package
20
+ ([DinnerOrderStatic](https://github.com/inferno-framework/davinci-dtr-test-kit/blob/main/lib/davinci_dtr_test_kit/fixtures/dinner_static/questionnaire_dinner_order_static.json))
21
+ 2. Render and pre-populate the questionnaire appropriately, including:
22
+ - pre-populate data as directed by the questionnaire
23
+ - display questions only when they are enabled by other answers
24
+ 3. Complete and store the questionnaire response for future use.
25
+ )
26
+
27
+ group do
28
+ id :dtr_full_ehr_static_questionnaire_retrieval
29
+ title 'Retrieving the Static Questionnaire'
30
+ description %(
31
+ After DTR launch, Inferno will wait for the client system to request a questionnaire using the
32
+ $questionnaire-package operation and will return a static questionnaire for the
33
+ tester to complete. Inferno will then validate the the conformance of the request.
34
+ )
35
+ run_as_group
36
+
37
+ # Test 0: attest to launch
38
+ test from: :dtr_full_ehr_dinner_static_launch_attestation
39
+ # Test 1: wait for the $questionnaire-package request
40
+ test from: :dtr_full_ehr_dinner_questionnaire_package_request
41
+ # Test 2: validate the $questionnaire-package body
42
+ test from: :dtr_questionnaire_package_request_validation
43
+ end
44
+
45
+ group do
46
+ id :dtr_full_ehr_static_questionnaire_rendering
47
+ title 'Filling Out the Static Questionnaire'
48
+ description %(
49
+ The tester will interact with the questionnaire within their client system
50
+ such that pre-population steps are taken, the qustionnaire is rendered, and
51
+ they are able to fill it out. The tester will attest that questionnaire pre-population
52
+ and rendering directives were followed.
53
+ )
54
+ run_as_group
55
+
56
+ # Test 1: attest to the pre-population of the name fields
57
+ test from: :dtr_full_ehr_dinner_static_rendering_prepopulation_attestation
58
+ # Test 2: attest to the pre-population and edit of the first name field
59
+ test from: :dtr_full_ehr_dinner_static_prepopulation_override_attestation
60
+ # Test 3: attest to the display of the toppings questions only when a dinner answer is selected
61
+ test from: :dtr_full_ehr_dinner_static_rendering_enabledQs_attestation
62
+ end
63
+
64
+ group do
65
+ id :dtr_full_ehr_static_questionnaire_response
66
+ title 'Saving the QuestionnaireResponse'
67
+ description %(
68
+ The tester will attest to the completion of the questionnaire such that
69
+ the results are stored for later use.
70
+ )
71
+ run_as_group
72
+
73
+ # Test 1: attest QuestionnaireResponse saved
74
+ test from: :dtr_full_ehr_dinner_static_store_attestation
75
+ # Test 2: validate basic conformance of the QuestionnaireResponse
76
+ # - not using currently
77
+ # Test 3: validate workflow-specific details such as pre-population and overrides
78
+ test from: :dtr_full_ehr_dinner_static_prepopulation_representation_attestation
79
+ end
80
+ end
81
+ end
@@ -0,0 +1,30 @@
1
+ require_relative '../../urls'
2
+
3
+ module DaVinciDTRTestKit
4
+ class DTRFullEHRStaticDinnerRenderingAttestationTest < Inferno::Test
5
+ include URLs
6
+
7
+ id :dtr_full_ehr_dinner_static_rendering_enabledQs_attestation
8
+ title 'Check that the client renders enabled questions appropriately (Attestation)'
9
+ description %(
10
+ Validate that the rendering of the questionnaire includes only the "What would you like on..."
11
+ question appropriate for the dinner selection, if made.
12
+ )
13
+ input :access_token
14
+
15
+ run do
16
+ wait(
17
+ identifier: access_token,
18
+ message: %(
19
+ I attest that the client application does not display any "What would you like on..."
20
+ questions until I have selected a dinner choice and then only displays the
21
+ "What would you like on..." question relevant for the dinner request:
22
+
23
+ [Click here](#{resume_pass_url}?token=#{access_token}) if the above statement is **true**.
24
+
25
+ [Click here](#{resume_fail_url}?token=#{access_token}) if the above statement is **false**.
26
+ )
27
+ )
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,29 @@
1
+ require_relative '../../urls'
2
+
3
+ module DaVinciDTRTestKit
4
+ class DTRFullEHRStaticDinnerStoreAttestationTest < Inferno::Test
5
+ include URLs
6
+
7
+ id :dtr_full_ehr_dinner_static_store_attestation
8
+ title 'Complete and Store the QuestionnaireResponse (Attestation)'
9
+ description %(
10
+ Attest that the questionnaire has been completed and the response has been persisted
11
+ and can be exported as a FHIR QuestionnaireResponse instance.
12
+ )
13
+ input :access_token
14
+
15
+ run do
16
+ wait(
17
+ identifier: access_token,
18
+ message: %(
19
+ I attest that the questionnaire has been completed and stored within the EHR for future
20
+ use and export as a FHIR QuestionnaireResponse instance.
21
+
22
+ [Click here](#{resume_pass_url}?token=#{access_token}) if the above statement is **true**.
23
+
24
+ [Click here](#{resume_fail_url}?token=#{access_token}) if the above statement is **false**.
25
+ )
26
+ )
27
+ end
28
+ end
29
+ end
@@ -2,10 +2,10 @@ require 'base64'
2
2
  require_relative '../../urls'
3
3
 
4
4
  module DaVinciDTRTestKit
5
- class DTRDinnerQuestionnairePackageRequestTest < Inferno::Test
5
+ class DTRSmartAppDinnerQuestionnairePackageRequestTest < Inferno::Test
6
6
  include URLs
7
7
 
8
- id :dtr_dinner_questionnaire_package_request
8
+ id :dtr_smart_app_dinner_questionnaire_package_request
9
9
  title 'Invoke the DTR Questionnaire Package operation'
10
10
  description %(
11
11
  Inferno will wait for a DTR questionnaire package request from the client. Upon receipt, Inferno will generate and
@@ -49,7 +49,7 @@ module DaVinciDTRTestKit
49
49
  Resources available from the EHR needed to drive the dinner static workflow.
50
50
  Formatted as a FHIR bundle that contains resources, each with an `id` property populated. Each
51
51
  instance present will be available for retrieval from Inferno at the endpoint:
52
-
52
+
53
53
  ```
54
54
  [fhir-base]/[resource type]/[instance id]
55
55
  ```
@@ -119,7 +119,7 @@ module DaVinciDTRTestKit
119
119
  an `Authorization` header with value:
120
120
 
121
121
  ```
122
- Bearer eyJhbGcmOiJub25lIn0.#{example_client_jwt_payload_part}.
122
+ Bearer eyJhbGciOiJub25lIn0.#{example_client_jwt_payload_part}.
123
123
  ```
124
124
 
125
125
  ### Continuing the Tests
@@ -1,10 +1,10 @@
1
1
  require_relative '../../urls'
2
2
 
3
3
  module DaVinciDTRTestKit
4
- class DTRStaticDinnerPrepopulationAttestationTest < Inferno::Test
4
+ class DTRSmartAppStaticDinnerPrepopulationAttestationTest < Inferno::Test
5
5
  include URLs
6
6
 
7
- id :dtr_dinner_static_rendering_prepopulation_attestation
7
+ id :dtr_smart_app_dinner_static_rendering_prepopulation_attestation
8
8
  title 'Check that the client pre-populates the questionnaire (Attestation)'
9
9
  description %(
10
10
  Validate that pre-population of patient name information occurs as expected.
@@ -1,10 +1,10 @@
1
1
  require_relative '../../urls'
2
2
 
3
3
  module DaVinciDTRTestKit
4
- class DTRStaticDinnerPrepopulationOverrideAttestationTest < Inferno::Test
4
+ class DTRSmartAppStaticDinnerPrepopulationOverrideAttestationTest < Inferno::Test
5
5
  include URLs
6
6
 
7
- id :dtr_dinner_static_prepopulation_override_attestation
7
+ id :dtr_smart_app_dinner_static_prepopulation_override_attestation
8
8
  title 'Validate the user can override pre-populated data (Attestation)'
9
9
  description %(
10
10
  Validate that the user can edit a pre-populated item and replace it with another value.
@@ -1,10 +1,10 @@
1
1
  require_relative '../../urls'
2
2
 
3
3
  module DaVinciDTRTestKit
4
- class DTRStaticDinnerQuestionnaireResponseSaveTest < Inferno::Test
4
+ class DTRSmartAppStaticDinnerQuestionnaireResponseSaveTest < Inferno::Test
5
5
  include URLs
6
6
 
7
- id :dtr_static_dinner_questionnaire_response_save
7
+ id :dtr_smart_app_static_dinner_questionnaire_response_save
8
8
  title 'Save the QuestionnaireResponse after completing it'
9
9
  description %(
10
10
  Inferno, acting as the EHR, will wait for a request to save the QuestionnaireResponse from the client.
@@ -1,9 +1,9 @@
1
- require_relative 'dtr_dinner_questionnaire_package_request_test'
1
+ require_relative 'dtr_smart_app_dinner_questionnaire_package_request_test'
2
2
  require_relative '../shared/dtr_questionnaire_package_request_validation_test'
3
- require_relative 'prepopulation_attestation_test'
4
- require_relative 'prepopulation_override_attestation_test'
5
- require_relative 'rendering_enabled_questions_attestation_test'
6
- require_relative 'dtr_questionnaire_response_save_test'
3
+ require_relative 'dtr_smart_app_prepopulation_attestation_test'
4
+ require_relative 'dtr_smart_app_prepopulation_override_attestation_test'
5
+ require_relative 'dtr_smart_app_rendering_enabled_questions_attestation_test'
6
+ require_relative 'dtr_smart_app_questionnaire_response_save_test'
7
7
  require_relative '../shared/dtr_questionnaire_response_basic_conformance_test'
8
8
  require_relative '../shared/dtr_questionnaire_response_pre_population_test'
9
9
 
@@ -27,7 +27,7 @@ module DaVinciDTRTestKit
27
27
  )
28
28
 
29
29
  group do
30
- id :dtr_static_questionnaire_retrieval
30
+ id :dtr_smart_app_static_questionnaire_retrieval
31
31
  title 'Retrieving the Static Questionnaire'
32
32
  description %(
33
33
  Inferno will wait for the client system to request a questionnaire using the
@@ -37,13 +37,13 @@ module DaVinciDTRTestKit
37
37
  run_as_group
38
38
 
39
39
  # Test 1: wait for the $questionnaire-package request
40
- test from: :dtr_dinner_questionnaire_package_request
40
+ test from: :dtr_smart_app_dinner_questionnaire_package_request
41
41
  # Test 2: validate the $questionnaire-package body
42
42
  test from: :dtr_questionnaire_package_request_validation
43
43
  end
44
44
 
45
45
  group do
46
- id :dtr_static_questionnaire_rendering
46
+ id :dtr_smart_app_static_questionnaire_rendering
47
47
  title 'Filling Out the Static Questionnaire'
48
48
  description %(
49
49
  The tester will interact with the questionnaire within their client system
@@ -58,15 +58,15 @@ module DaVinciDTRTestKit
58
58
  # since the questionnaire asks them to
59
59
  # TODO: once Tom has gotten the reference server hooked up
60
60
  # Test 2: attest to the pre-population of the name fields
61
- test from: :dtr_dinner_static_rendering_prepopulation_attestation
61
+ test from: :dtr_smart_app_dinner_static_rendering_prepopulation_attestation
62
62
  # Test 3: attest to the pre-population and edit of the location field
63
- test from: :dtr_dinner_static_prepopulation_override_attestation
63
+ test from: :dtr_smart_app_dinner_static_prepopulation_override_attestation
64
64
  # Test 4: attest to the display of the toppings questions only when a dinner answer is selected
65
- test from: :dtr_dinner_static_rendering_enabledQs_attestation
65
+ test from: :dtr_smart_app_dinner_static_rendering_enabledQs_attestation
66
66
  end
67
67
 
68
68
  group do
69
- id :dtr_static_questionnaire_response
69
+ id :dtr_smart_app_static_questionnaire_response
70
70
  title 'Saving the QuestionnaireResponse'
71
71
  description %(
72
72
  The tester will complete the questionnaire such that a QuestionnaireResponse is stored
@@ -77,7 +77,7 @@ module DaVinciDTRTestKit
77
77
  run_as_group
78
78
 
79
79
  # Test 1: wait for a QuestionnaireResponse
80
- test from: :dtr_static_dinner_questionnaire_response_save,
80
+ test from: :dtr_smart_app_static_dinner_questionnaire_response_save,
81
81
  receives_request: :questionnaire_response_save
82
82
  # Test 2: validate basic conformance of the QuestionnaireResponse
83
83
  test from: :dtr_questionnaire_response_basic_conformance,
@@ -1,10 +1,10 @@
1
1
  require_relative '../../urls'
2
2
 
3
3
  module DaVinciDTRTestKit
4
- class DTRStaticDinnerRenderingAttestationTest < Inferno::Test
4
+ class DTRSmartAppStaticDinnerRenderingAttestationTest < Inferno::Test
5
5
  include URLs
6
6
 
7
- id :dtr_dinner_static_rendering_enabledQs_attestation
7
+ id :dtr_smart_app_dinner_static_rendering_enabledQs_attestation
8
8
  title 'Check that the client renders enabled questions appropriately (Attestation)'
9
9
  description %(
10
10
  Validate that the rendering of the questionnaire includes only the "What would you like on..."
@@ -29,7 +29,7 @@ module DaVinciDTRTestKit
29
29
  assert input_params.present?, 'Request does not contain a recognized FHIR object'
30
30
  assert_resource_type(:parameters, resource: input_params)
31
31
  assert_valid_resource(resource: input_params,
32
- profile_url: 'http://hl7.org/fhir/us/davinci-dtr/StructureDefinition/dtr-qpackage-input-parameters')
32
+ profile_url: 'http://hl7.org/fhir/us/davinci-dtr/StructureDefinition/dtr-qpackage-input-parameters|2.0.1')
33
33
  end
34
34
  end
35
35
  end
@@ -22,7 +22,7 @@ module DaVinciDTRTestKit
22
22
  assert_resource_type(:questionnaire_response, resource: questionnaire_response)
23
23
 
24
24
  assert_valid_resource(resource: questionnaire_response,
25
- profile_url: 'http://hl7.org/fhir/us/davinci-dtr/StructureDefinition/dtr-questionnaireresponse')
25
+ profile_url: 'http://hl7.org/fhir/us/davinci-dtr/StructureDefinition/dtr-questionnaireresponse|2.0.1')
26
26
  end
27
27
  end
28
28
  end
@@ -0,0 +1,127 @@
1
+ The Da Vinci DTR Test Kit Full EHR Suite validates the conformance of SMART apps
2
+ to the STU 2 version of the HL7® FHIR®
3
+ [Da Vinci Documentation Templates and Rules (DTR) Implementation Guide](https://hl7.org/fhir/us/davinci-dtr/STU2/).
4
+
5
+ ## Scope
6
+
7
+ These tests are a **DRAFT** intended to allow app implementers to perform
8
+ preliminary checks of their systems against DTR IG requirements and [provide
9
+ feedback](https://github.com/inferno-framework/davinci-dtr-test-kit/issues)
10
+ on the tests. Future versions of these tests may validate other
11
+ requirements and may change the test validation logic.
12
+
13
+ ## Test Methodology
14
+
15
+ Inferno will simulate a DTR payer server that will response to
16
+ requests for questionnaires for the EHR under test to interact with.
17
+ The EHR will be expected to initiate requests to Inferno to elicit responses. Over the
18
+ course of these interactions, Inferno will seek to observe conformant handling of
19
+ DTR workflows and requirements around the retrieval, completion, and storage of
20
+ questionnaires.
21
+
22
+ Tests within this suite are associated with specific questionnaires that the EHR will
23
+ demonstrate completion of. In each case, the EHR under test will initiate a request to
24
+ the payer server simulated by Inferno for a questionnaire using the
25
+ `$questionnaire-package` operation. Inferno will always return the specific questionnaire
26
+ for the test being executed regardless of the input provided by the EHR, though it must
27
+ be conformant. The EHR will then be asked to complete the questionnaire, including
28
+ - Pre-populating answers based on directives in the questionnaire
29
+ - Rendering the questionnaire for users and allowing them to make additional updates.
30
+ These tests can include specific directions on details to include in the completed
31
+ questionnaire.
32
+ - Storing the completed questionnaire for future use as a FHIR QuestionnaireResponse.
33
+
34
+ EHRs will be required to complete all questionnaires in the suite, which in aggregate
35
+ contain all questionnaire features that apps must support. Currently, the suite includes
36
+ one questionnaire:
37
+ 1. A fictious "dinner" questionnaire created for these tests. It tests basic
38
+ item rendering and pre-population.
39
+ Additional questionnaires will be added in the future.
40
+
41
+ All requests sent by the app will be checked
42
+ for conformance to the DTR IG requirements individually and used in aggregate to determine
43
+ whether required features and functionality are present. HL7® FHIR® resources are
44
+ validated with the Java validator using `tx.fhir.org` as the terminology server.
45
+
46
+ ## Running the Tests
47
+
48
+ ### Quick Start
49
+
50
+ In order to run these tests, EHRs must be configured to interact with Inferno's simulated
51
+ payer server endpoint. The endpoint will be `[URL prefix]/custom/dtr_full_ehr/fhir` where
52
+ `[URL prefix]` can be inferred from the URL of the test session which will be of the form
53
+ `[URL prefix]/dtr_full_ehr/[session id]`.
54
+
55
+ In order for Inferno to associate requests sent to locations under these base URLs with this session,
56
+ it needs to know the bearer token that the EHR will send on requests, for which
57
+ there are two options.
58
+
59
+ 1. If you want to choose your own bearer token, then
60
+ 1. Select the "2. Basic Workflows" test from the list on the left (or other target test).
61
+ 2. Click the '*Run All Tests*' button on the right.
62
+ 3. In the "access_token" field, enter the bearer token that will be sent by the client
63
+ under test (as part of the Authorization header - `Bearer <provided value>`).
64
+ 4. Click the '*Submit*' button at the bottom of the dialog.
65
+ 2. If you want to use a client_id to obtain an access token, then
66
+ 1. Click the '*Run All Tests*' button on the right.
67
+ 2. Provide the EHR's registered id "client_id" field of the input (NOTE, Inferno
68
+ doesn't support the registration API, so this must be obtained from another
69
+ system or configured manually).
70
+ 3. Click the '*Submit*' button at the bottom of the dialog.
71
+ 4. Make a token request that includes the specified client id to the
72
+ `[URL prefix]/custom/dtr_full_ehr/mock_auth/token` endpoint to get
73
+ an access token to use on the request of the requests.
74
+
75
+ In either case, the tests will continue from that point. Further executions of tests under
76
+ this session will also use the selected bearer token.
77
+
78
+ Note: authentication options for these tests have not been finalized and are subject to change.
79
+
80
+ ### Postman-based Demo
81
+
82
+ If you do not have a DTR Full EHR but would like to try the tests out, you can use
83
+ [this Postman collection](https://github.com/inferno-framework/davinci-dtr-test-kit/blob/main/config/DTR%20Full%20EHR%20Tests%20Postman%20Demo.postman_collection.json)
84
+ to make requests against Inferno. This does not include the capability to render and complete the
85
+ questionnaires, but does have samples of correctly and incorrectly completed QuestionnaireResponses.
86
+ To run the tests using this approach:
87
+
88
+ 1. Install [postman](https://www.postman.com/downloads/).
89
+ 1. Import [this Postman collection](https://github.com/inferno-framework/davinci-dtr-test-kit/blob/main/config/DTR%20Full%20EHR%20Tests%20Postman%20Demo.postman_collection.json).
90
+ 1. Start a Da Vinci DTR Full EHR Test Suite Session.
91
+ 1. Update the postman collection configuration variables found by opening the "DTR Full EHR
92
+ Tests Postman Demo" collection and selecting the "Variables" tab.
93
+ - **base_url**: corresponds to the where the test suite session is running. Defaults to
94
+ `inferno.healthit.gov`. If running in another location, see guidance on the "Overview" tab
95
+ of the postman collection.
96
+ - **access_token**: note the "Current value" (update if desired) for use later.
97
+ 1. Return to Inferno and in the test list at the left, select *2 Static Questionnaire Workflow*.
98
+ 1. Click the "Run All Tests" button in the upper right.
99
+ 1. Add the **access_token** configured in postman to the Inferno input with the same name
100
+ 1. Click the "Submit" button in Inferno.
101
+ 1. Attest that the EHR has launched its DTR workflow in Inferno by clicking the link for the **true** response.
102
+ 1. Once the next wait dialog has appeared within Inferno asking for a `$questionnaire-package`
103
+ request, use postman to submit the "Questionnaire Package for Dinner (Static)" request. Confirm
104
+ that the response that looks similar to the "Example Working Response" in postman
105
+ and click the link to continue the tests.
106
+ 1. Attest to the remainder of the tests as desired to get a sense for what is involved in testing
107
+ with an actual EHR implementation. To see what a valid QuestionnaireResponse looks like, see
108
+ the "Sample QuestionnaireResponse for Dinner (Static) ..." request in postman.
109
+
110
+ ## Limitations
111
+
112
+ The DTR IG is a complex specification and these tests currently validate conformance to only
113
+ a subset of IG requirements. Future versions of the test suite will test further
114
+ features. A few specific features of interest are listed below.
115
+
116
+ ### Heavy Reliance on Attestations
117
+
118
+ Currently, these test kits do not have access to the QuestionnaireResponse and so validation
119
+ that the EHR performed CQL calculations and generated a conformant QuestionnaireResponse
120
+ based on pre-population and manual answers is left to a user attestation rather than a
121
+ mechanical check. Some level of mechanical checks are expected to be added in the future.
122
+
123
+ ### Questionnaire Feature Coverage
124
+
125
+ Not all questionnaire features that are must support within the DTR IG are currently represented
126
+ in questionnaires tested by the IG. Adaptive questionnaires are a notable omission.
127
+ Additional questionnaires testing additional features will be added in the future.
@@ -1,7 +1,7 @@
1
1
  require_relative 'ext/inferno_core/runnable'
2
2
  require_relative 'ext/inferno_core/record_response_route'
3
3
  require_relative 'ext/inferno_core/request'
4
- require_relative 'client_groups/resp_assist_device/dtr_full_ehr_questionnaire_workflow_group'
4
+ require_relative 'client_groups/dinner_static/dtr_full_ehr_questionnaire_workflow_group'
5
5
  require_relative 'auth_groups/oauth2_authentication_group'
6
6
  require_relative 'mock_payer'
7
7
  require_relative 'version'
@@ -9,19 +9,11 @@ require_relative 'version'
9
9
  module DaVinciDTRTestKit
10
10
  class DTRFullEHRSuite < Inferno::TestSuite
11
11
  extend MockPayer
12
+ extend MockAuthServer
12
13
 
13
14
  id :dtr_full_ehr
14
15
  title 'Da Vinci DTR Full EHR Test Suite'
15
- description %(
16
- # Da Vinci DTR Full EHR Test Suite
17
-
18
- This suite validates that an EHR or other application can act
19
- as a full DTR application requesting questionnaires from a
20
- payer server and using local data to complete and store them.
21
- Inferno will act as payer server returning questionnaires
22
- in response to queries from the system under test and validating
23
- that they can be completed as expected.
24
- )
16
+ description File.read(File.join(__dir__, 'docs', 'dtr_full_ehr_suite_description_v201.md'))
25
17
 
26
18
  version VERSION
27
19
 
@@ -74,6 +66,6 @@ module DaVinciDTRTestKit
74
66
  end
75
67
 
76
68
  group from: :oauth2_authentication
77
- group from: :dtr_full_ehr_questionnaire_workflow
69
+ group from: :dtr_full_ehr_static_dinner_questionnaire_workflow
78
70
  end
79
71
  end
@@ -88,7 +88,7 @@ module DaVinciDTRTestKit
88
88
  end
89
89
 
90
90
  origin_extension = find_extension(target_item_answer,
91
- 'http://hl7.org/fhir/us/davinci-dtr/StructureDefinition/information-origin')
91
+ 'http://hl7.org/fhir/us/davinci-dtr/StructureDefinition/information-origin|2.0.1')
92
92
  source_extension = find_extension(origin_extension, 'source')
93
93
 
94
94
  unless source_extension.present?
@@ -134,7 +134,7 @@ module DaVinciDTRTestKit
134
134
 
135
135
  # check origin.source extension
136
136
  origin_extension = find_extension(answer,
137
- 'http://hl7.org/fhir/us/davinci-dtr/StructureDefinition/information-origin')
137
+ 'http://hl7.org/fhir/us/davinci-dtr/StructureDefinition/information-origin|2.0.1')
138
138
  source_extension = find_extension(origin_extension, 'source')
139
139
 
140
140
  if source_extension.present?
@@ -23,7 +23,7 @@ module DaVinciDTRTestKit
23
23
  [
24
24
  'fixtures/dinner_static/questionnaire_dinner_order_static.json',
25
25
  'fixtures/dinner_static/questionnaire_response_dinner_order_static.json',
26
- ['dtr_smart_app_static_dinner_questionnaire_workflow']
26
+ ['dtr_smart_app_static_dinner_questionnaire_workflow', 'dtr_full_ehr_static_dinner_questionnaire_workflow']
27
27
  ],
28
28
  [
29
29
  'fixtures/dinner_adaptive/questionnaire_dinner_order_adaptive.json',
@@ -6,7 +6,7 @@ module DaVinciDTRTestKit
6
6
  id :dtr_v201_payer_adaptive_next_form_expressions_test
7
7
  title 'Questionnaire(s) contains items with expressions necessary for pre-population'
8
8
  description %(
9
- Inferno checks that the payer server response has appropriate expressions and that expressions are
9
+ Inferno checks that the payer server response to $next-question operation has appropriate expressions and that expressions are
10
10
  written in cql.
11
11
  )
12
12
 
@@ -3,7 +3,7 @@ module DaVinciDTRTestKit
3
3
  class PayerAdaptiveFormRequestTest < Inferno::Test
4
4
  include URLs
5
5
  include DaVinciDTRTestKit::ValidationTest
6
- title '[USER INPUT VALIDATION] Questionnaire Package request is valid'
6
+ title 'User Input Validation: Questionnaire Package request is valid'
7
7
  description %(
8
8
  This test validates the conformance of the client's request to the
9
9
  [DTR Questionnaire Package Input Parameters](http://hl7.org/fhir/us/davinci-dtr/StructureDefinition/dtr-qpackage-input-parameters)
@@ -13,32 +13,23 @@ module DaVinciDTRTestKit
13
13
  values. CodeableConcept element bindings will fail if none of their codings have a code/system belonging
14
14
  to the bound ValueSet. Quantity, Coding, and code element bindings will fail if their code/system are not found in
15
15
  the valueset.
16
-
17
- This test may process multiple resources, labeling messages with the corresponding tested resources
18
- in the order that they were received.
19
16
  )
20
17
  id :payer_server_adaptive_questionnaire_request_validation
21
18
 
22
19
  run do
23
20
  skip_if retrieval_method == 'Static', 'Performing only static flow tests - only one flow is required.'
21
+ profile_with_version = 'http://hl7.org/fhir/us/davinci-dtr/StructureDefinition/dtr-qpackage-input-parameters|2.0.1'
24
22
  if initial_adaptive_questionnaire_request.nil?
25
- resources = load_tagged_requests(QUESTIONNAIRE_TAG)
26
- using_manual_entry = false
23
+ requests = load_tagged_requests(QUESTIONNAIRE_TAG)
24
+ skip_if requests.blank?, 'No request resource received from the client.'
25
+ # making the assumption that only one request was made here - if there were multiple, we are only validating the first
26
+ resource_is_valid?(resource: FHIR.from_contents(requests[0].request[:body]), profile_url: profile_with_version)
27
27
  else
28
- resources = initial_adaptive_questionnaire_request
29
- using_manual_entry = true
28
+ request = FHIR.from_contents(initial_adaptive_questionnaire_request)
29
+ resource_is_valid?(resource: request, profile_url: profile_with_version)
30
30
  end
31
- skip_if resources.nil?, 'No request resources to validate.'
32
- perform_request_validation_test(
33
- resources,
34
- :parameters,
35
- 'http://hl7.org/fhir/us/davinci-dtr/StructureDefinition/dtr-qpackage-input-parameters',
36
- questionnaire_package_url,
37
- using_manual_entry
38
- )
39
- rescue Inferno::Exceptions::AssertionException => e
40
- msg = e.message.to_s.strip
41
- skip msg
31
+ errors_found = messages.any? { |message| message[:type] == 'error' }
32
+ skip_if errors_found, "Resource does not conform to the profile #{profile_with_version}"
42
33
  end
43
34
  end
44
35
  end
@@ -20,21 +20,21 @@ module DaVinciDTRTestKit
20
20
 
21
21
  run do
22
22
  skip_if retrieval_method == 'Static', 'Performing only static flow tests - only one flow is required.'
23
- test_passed = false
24
- profile_url = 'http://hl7.org/fhir/us/davinci-dtr/StructureDefinition/DTR-QPackageBundle'
23
+ test_passed = true
24
+ profile_url = 'http://hl7.org/fhir/us/davinci-dtr/StructureDefinition/DTR-QPackageBundle|2.0.1'
25
25
  assert !scratch[:adaptive_responses].nil?, 'No resources to validate.'
26
26
  scratch[:adaptive_responses].each_with_index do |resource, index|
27
27
  fhir_resource = FHIR.from_contents(resource.response[:body])
28
28
  fhir_resource.parameter.each do |param|
29
29
  resource_is_valid = validate_resource(param.resource, :bundle, profile_url, index)
30
- test_passed = true if resource_is_valid
30
+ test_passed = false unless resource_is_valid
31
31
  rescue StandardError
32
32
  next
33
33
  end
34
34
  end
35
- raise tests_failed[profile_url][0] if !test_passed && !tests_failed[profile_url].blank?
36
-
37
- messages.clear if test_passed
35
+ if !test_passed && !tests_failed[profile_url].blank?
36
+ assert test_passed, "Not all returned resources conform to the profile: #{profile_url}"
37
+ end
38
38
  end
39
39
  end
40
40
  end
@@ -20,23 +20,23 @@ module DaVinciDTRTestKit
20
20
 
21
21
  run do
22
22
  skip_if retrieval_method == 'Static', 'Performing only static flow tests - only one flow is required.'
23
- test_passed = false
24
- profile_url = 'http://hl7.org/fhir/us/davinci-dtr/StructureDefinition/dtr-questionnaire-adapt-search'
23
+ test_passed = true
24
+ profile_url = 'http://hl7.org/fhir/us/davinci-dtr/StructureDefinition/dtr-questionnaire-adapt-search|2.0.1'
25
25
  assert !scratch[:adaptive_responses].nil?, 'No resources to validate.'
26
26
  scratch[:adaptive_responses].each_with_index do |resource, index|
27
27
  fhir_resource = FHIR.from_contents(resource.response[:body])
28
28
  fhir_resource.parameter.each do |param|
29
29
  param.resource.entry.each do |entry|
30
30
  resource_is_valid = validate_resource(entry.resource, :questionnaire, profile_url, index)
31
- test_passed = true if resource_is_valid
31
+ test_passed = false unless resource_is_valid
32
32
  end
33
33
  rescue StandardError
34
34
  next
35
35
  end
36
36
  end
37
- raise tests_failed[profile_url][0] if !test_passed && !tests_failed[profile_url].blank?
38
-
39
- messages.clear if test_passed
37
+ if !test_passed && !tests_failed[profile_url].blank?
38
+ assert test_passed, "Not all returned resources conform to the profile: #{profile_url}"
39
+ end
40
40
  end
41
41
  end
42
42
  end
@@ -15,35 +15,33 @@ module DaVinciDTRTestKit
15
15
  to the bound ValueSet. Quantity, Coding, and code element bindings will fail if their code/system are not found in
16
16
  the valueset.
17
17
 
18
- This test may process multiple resources, labeling messages with the corresponding tested resources
19
18
  This test may process multiple resources, labeling messages with the corresponding tested resources
20
19
  in the order that they were received.
21
20
  )
22
21
 
23
22
  run do
24
23
  skip_if retrieval_method == 'Static', 'Performing only static flow tests - only one flow is required.'
24
+ profile_with_version = 'http://hl7.org/fhir/us/davinci-dtr/StructureDefinition/dtr-qpackage-output-parameters|2.0.1'
25
25
  endpoint = custom_endpoint.blank? ? '/Questionnaire/$questionnaire-package' : custom_endpoint
26
26
  if initial_adaptive_questionnaire_request.nil?
27
- resources = load_tagged_requests(QUESTIONNAIRE_TAG)
27
+ # making the assumption that only one response was received - if there were multiple, we are only validating the first
28
+ response = load_tagged_requests(QUESTIONNAIRE_TAG)[0]
29
+ scratch[:adaptive_responses] = [response]
30
+ resource = FHIR.from_contents(response.response[:body])
28
31
  else
29
- resources = []
30
- if initial_adaptive_questionnaire_request.is_a?(Array)
31
- initial_adaptive_questionnaire_request.each do |_resource|
32
- resources.push(fhir_operation("#{url}#{endpoint}", body: JSON.parse(initial_adaptive_questionnaire_request),
33
- headers: { 'Content-Type': 'application/json' }))
34
- end
35
- else
36
- resources.push(fhir_operation("#{url}#{endpoint}", body: JSON.parse(initial_adaptive_questionnaire_request),
37
- headers: { 'Content-Type': 'application/json' }))
38
- end
32
+ response = fhir_operation("#{url}#{endpoint}", body: JSON.parse(initial_adaptive_questionnaire_request),
33
+ headers: { 'Content-Type': 'application/json' })
34
+ resource = FHIR.from_contents(response.response[:body])
35
+ scratch[:adaptive_responses] = [response]
39
36
  end
40
- scratch[:adaptive_responses] = resources
37
+
41
38
  assert !scratch[:adaptive_responses].nil?, 'No resources to validate.'
42
- perform_response_validation_test(
43
- resources,
44
- :parameters,
45
- 'http://hl7.org/fhir/us/davinci-dtr/StructureDefinition/dtr-qpackage-output-parameters'
46
- )
39
+ assert_response_status([200, 201], response: response.response)
40
+ assert_resource_type(:parameters, resource: resource)
41
+ assert_valid_resource(resource: resource, profile_url: profile_with_version)
42
+ questionnaire_bundle = resource.parameter.find { |param| param.resource.resourceType == 'Bundle' }&.resource
43
+ assert questionnaire_bundle, 'No questionnaire bundle found in the response'
44
+ assert_valid_resource(resource: questionnaire_bundle, profile_url: 'http://hl7.org/fhir/us/davinci-dtr/StructureDefinition/DTR-QPackageBundle|2.0.1')
47
45
  end
48
46
  end
49
47
  end
@@ -3,7 +3,7 @@ module DaVinciDTRTestKit
3
3
  class PayerAdaptiveFormNextRequestTest < Inferno::Test
4
4
  include URLs
5
5
  include DaVinciDTRTestKit::ValidationTest
6
- title '[USER INPUT VALIDATION] Next Question request is valid'
6
+ title 'User Input Validation: Next Question request is valid'
7
7
  description %(
8
8
  This test validates the conformance of the client's request to the
9
9
  [SDC Parameters Next Question In](http://hl7.org/fhir/uv/sdc/StructureDefinition/parameters-questionnaire-next-question-in)
@@ -49,13 +49,12 @@ module DaVinciDTRTestKit
49
49
  using_manual_entry
50
50
  )
51
51
  else
52
- raise new Inferno::Exceptions::AssertionException.new "Resource does not conform to the either
53
- accepted profiles: http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaireresponse-adapt
54
- or http://hl7.org/fhir/uv/sdc/StructureDefinition/parameters-questionnaire-next-question-in"
52
+ messages << { type: 'error',
53
+ message: format_markdown("No resources were of type 'Parameters' or 'QuestionnaireResponse'") }
55
54
  end
56
- rescue Inferno::Exceptions::AssertionException => e
57
- msg = e.message.to_s.strip
58
- skip msg
55
+ errors_found = messages.any? { |message| message[:type] == 'error' }
56
+ skip_if errors_found, "No resources conform to the profiles http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaireresponse-adapt
57
+ or http://hl7.org/fhir/uv/sdc/StructureDefinition/parameters-questionnaire-next-question-in"
59
58
  end
60
59
  end
61
60
  end
@@ -14,7 +14,6 @@ module DaVinciDTRTestKit
14
14
  to the bound ValueSet. Quantity, Coding, and code element bindings will fail if their code/system are not found in
15
15
  the valueset.
16
16
 
17
- This test may process multiple resources, labeling messages with the corresponding tested resources
18
17
  This test may process multiple resources, labeling messages with the corresponding tested resources
19
18
  in the order that they were received.
20
19
  )
@@ -38,6 +37,9 @@ module DaVinciDTRTestKit
38
37
  :questionnaireResponse,
39
38
  'http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaireresponse'
40
39
  )
40
+ errors_found = messages.any? { |message| message[:type] == 'error' }
41
+ skip_if errors_found, "No resources conform to the profiles http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaireresponse-adapt
42
+ or http://hl7.org/fhir/uv/sdc/StructureDefinition/parameters-questionnaire-next-question-in"
41
43
  end
42
44
  end
43
45
  end
@@ -5,7 +5,7 @@ module DaVinciDTRTestKit
5
5
  include DaVinciDTRTestKit::ValidationTest
6
6
  include URLs
7
7
  id :dtr_v201_payer_static_form_request_validation_test
8
- title '[USER INPUT VALIDATION] Client sends payer server a request for a static form'
8
+ title 'User Input Validation: Client sends payer server a request for a static form'
9
9
  description %(
10
10
  Inferno will validate that the request to the payer server conforms to the
11
11
  [Input Parameters profile](http://hl7.org/fhir/us/davinci-dtr/StructureDefinition/dtr-qpackage-input-parameters).
@@ -14,36 +14,24 @@ module DaVinciDTRTestKit
14
14
  values. CodeableConcept element bindings will fail if none of their codings have a code/system belonging
15
15
  to the bound ValueSet. Quantity, Coding, and code element bindings will fail if their code/system
16
16
  are not found in the valueset.
17
-
18
- This test may process multiple resources, labeling messages with the corresponding tested resources
19
- in the order that they were received.
20
17
  )
21
18
  input :initial_static_questionnaire_request, :access_token, :retrieval_method
22
19
 
23
20
  run do
24
21
  skip_if retrieval_method == 'Adaptive', 'Performing only adaptive flow tests - only one flow is required.'
22
+ profile_with_version = 'http://hl7.org/fhir/us/davinci-dtr/StructureDefinition/dtr-qpackage-input-parameters|2.0.1'
25
23
  if initial_static_questionnaire_request.nil?
26
- using_manual_entry = false
27
24
  skip_if access_token.nil?, 'No access token provided - required for client flow.'
28
- resources = load_tagged_requests(QUESTIONNAIRE_TAG)
29
- skip_if resources.blank?, 'No request resource received from the client.'
30
- assert perform_request_validation_test(
31
- resources,
32
- :parameters,
33
- 'http://hl7.org/fhir/us/davinci-dtr/StructureDefinition/dtr-qpackage-input-parameters',
34
- questionnaire_package_url,
35
- using_manual_entry
36
- )
25
+ requests = load_tagged_requests(QUESTIONNAIRE_TAG)
26
+ skip_if requests.blank?, 'No request resource received from the client.'
27
+ # making the assumption that only one request was made here - if there were multiple, we are only validating the first
28
+ resource_is_valid?(resource: FHIR.from_contents(requests[0].request[:body]), profile_url: profile_with_version)
37
29
  else
38
- # TODO: fix redundant logic here
39
- skip_if initial_static_questionnaire_request.nil?, 'No request resource was provided - required for manual flow'
40
- assert_valid_json(initial_static_questionnaire_request)
41
30
  request = FHIR.from_contents(initial_static_questionnaire_request)
42
- assert assert_valid_resource(resource: request, profile_url: 'http://hl7.org/fhir/us/davinci-dtr/StructureDefinition/dtr-qpackage-input-parameters')
31
+ resource_is_valid?(resource: request, profile_url: profile_with_version)
43
32
  end
44
- rescue Inferno::Exceptions::AssertionException => e
45
- msg = e.message.to_s.strip
46
- skip msg
33
+ errors_found = messages.any? { |message| message[:type] == 'error' }
34
+ skip_if errors_found, "Resource does not conform to the profile #{profile_with_version}"
47
35
  end
48
36
  end
49
37
  end
@@ -15,23 +15,19 @@ module DaVinciDTRTestKit
15
15
  to the bound ValueSet. Quantity, Coding, and code element bindings will fail if their code/system are not found in
16
16
  the valueset.
17
17
 
18
- This test may process multiple resources, labeling messages with the corresponding tested resources
19
- in the order that they were received.
20
18
  )
21
19
  input :url
22
20
 
23
21
  run do
24
22
  skip_if retrieval_method == 'Adaptive', 'Performing only adaptive flow tests - only one flow is required.'
23
+ profile_with_version = 'http://hl7.org/fhir/us/davinci-dtr/StructureDefinition/dtr-qpackage-output-parameters|2.0.1'
25
24
  if initial_static_questionnaire_request.nil?
26
25
  skip_if access_token.nil?, 'No access token provided - required for client flow.'
27
26
  resources = load_tagged_requests(QUESTIONNAIRE_TAG)
28
27
  skip_if resources.nil?, 'No request resource received from the client.'
29
28
  scratch[:output_parameters] = resources
30
- perform_response_validation_test(
31
- resources,
32
- :parameters,
33
- 'http://hl7.org/fhir/us/davinci-dtr/StructureDefinition/dtr-qpackage-output-parameters'
34
- )
29
+ # making the assumption that only one response was received- if there were multiple, we are only validating the first
30
+ assert_valid_resource(resource: FHIR.from_contents(resources[0].request[:body]), profile_url: profile_with_version)
35
31
  else
36
32
  request = fhir_operation("#{url}/Questionnaire/$questionnaire-package",
37
33
  body: JSON.parse(initial_static_questionnaire_request),
@@ -40,15 +36,11 @@ module DaVinciDTRTestKit
40
36
  resource = FHIR.from_contents(request.response[:body])
41
37
  scratch[:output_parameters] = resource
42
38
  assert_response_status([200, 201], response: request.response)
43
- assert_resource_type(:parameters, resource:)
44
- perform_response_validation_test(
45
- [request],
46
- :parameters,
47
- 'http://hl7.org/fhir/us/davinci-dtr/StructureDefinition/dtr-qpackage-output-parameters'
48
- )
39
+ assert_resource_type(:parameters, resource: resource)
40
+ assert_valid_resource(resource: resource, profile_url: profile_with_version)
49
41
  questionnaire_bundle = resource.parameter.find { |param| param.resource.resourceType == 'Bundle' }&.resource
50
42
  assert questionnaire_bundle, 'No questionnaire bundle found in the response'
51
- assert_valid_resource(resource: questionnaire_bundle, profile_url: 'http://hl7.org/fhir/us/davinci-dtr/StructureDefinition/DTR-QPackageBundle')
43
+ assert_valid_resource(resource: questionnaire_bundle, profile_url: 'http://hl7.org/fhir/us/davinci-dtr/StructureDefinition/DTR-QPackageBundle|2.0.1')
52
44
  end
53
45
  end
54
46
  end
@@ -5,14 +5,15 @@ module DaVinciDTRTestKit
5
5
  end
6
6
 
7
7
  def validate_resource(fhir_resource, resource_type, profile_url, index)
8
- assert fhir_resource.present?, 'Resource does not contain a recognized FHIR object'
9
8
  begin
9
+ assert fhir_resource.present?, 'Resource does not contain a recognized FHIR object'
10
10
  assert_resource_type(resource_type, resource: fhir_resource)
11
11
  assert_valid_resource(resource: fhir_resource,
12
12
  profile_url:)
13
13
  rescue StandardError => e
14
+ add_message('error', e.message)
14
15
  messages.each do |message|
15
- message[:message].prepend("[Resource #{index + 1}] ")
16
+ message[:message].prepend("[Resource #{index + 1}] ") unless message[:message].start_with? '[Resource'
16
17
  end
17
18
  if tests_failed[profile_url].blank?
18
19
  tests_failed[profile_url] = [e]
@@ -37,19 +38,16 @@ module DaVinciDTRTestKit
37
38
  resources = [resources] unless resources.is_a?(Array)
38
39
  resources.each_with_index do |resource, index|
39
40
  if using_manual_entry
40
- assert_valid_json(resource.to_json)
41
41
  fhir_resource = FHIR.from_contents(resource.to_json)
42
42
  else
43
- assert resource.url == resource_url,
44
- "Request made to wrong URL: #{resource.request[:url]}. Should instead be to #{resource_url}"
45
- assert_valid_json(resource.request[:body])
43
+ if resource.url != resource_url
44
+ messages << { type: 'warning',
45
+ message: format_markdown("Request made to wrong URL: #{resource.request[:url]}. Should instead be to #{resource_url}") }
46
+ end
46
47
  fhir_resource = FHIR.from_contents(resource.request[:body])
47
48
  end
48
49
  validate_resource(fhir_resource, resource_type, profile_url, index)
49
50
  end
50
- return if tests_failed[profile_url].blank?
51
-
52
- raise tests_failed[profile_url][0]
53
51
  end
54
52
 
55
53
  def perform_response_validation_test(
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DaVinciDTRTestKit
4
- VERSION = '0.11.1'
4
+ VERSION = '0.12.0'
5
5
  end
@@ -1,4 +1,4 @@
1
1
  require_relative 'davinci_dtr_test_kit/dtr_payer_server_suite'
2
2
  require_relative 'davinci_dtr_test_kit/dtr_smart_app_suite'
3
- # require_relative 'davinci_dtr_test_kit/dtr_full_ehr_suite'
3
+ require_relative 'davinci_dtr_test_kit/dtr_full_ehr_suite'
4
4
  # require_relative 'davinci_dtr_test_kit/dtr_light_ehr_suite'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: davinci_dtr_test_kit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.1
4
+ version: 0.12.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Karl Naden
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2024-07-16 00:00:00.000000000 Z
13
+ date: 2024-09-19 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: inferno_core
@@ -18,14 +18,14 @@ dependencies:
18
18
  requirements:
19
19
  - - "~>"
20
20
  - !ruby/object:Gem::Version
21
- version: 0.4.37
21
+ version: 0.4.42
22
22
  type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
25
25
  requirements:
26
26
  - - "~>"
27
27
  - !ruby/object:Gem::Version
28
- version: 0.4.37
28
+ version: 0.4.42
29
29
  - !ruby/object:Gem::Dependency
30
30
  name: jwt
31
31
  requirement: !ruby/object:Gem::Requirement
@@ -54,12 +54,20 @@ files:
54
54
  - lib/davinci_dtr_test_kit/auth_groups/token_request_test.rb
55
55
  - lib/davinci_dtr_test_kit/auth_groups/token_validation_test.rb
56
56
  - lib/davinci_dtr_test_kit/client_groups/dinner_adaptive/dtr_smart_app_questionnaire_workflow_group.rb
57
- - lib/davinci_dtr_test_kit/client_groups/dinner_static/dtr_dinner_questionnaire_package_request_test.rb
58
- - lib/davinci_dtr_test_kit/client_groups/dinner_static/dtr_questionnaire_response_save_test.rb
57
+ - lib/davinci_dtr_test_kit/client_groups/dinner_static/dtr_full_ehr_dinner_questionnaire_package_request_test.rb
58
+ - lib/davinci_dtr_test_kit/client_groups/dinner_static/dtr_full_ehr_launch_attestation_test.rb
59
+ - lib/davinci_dtr_test_kit/client_groups/dinner_static/dtr_full_ehr_prepopulation_attestation_test.rb
60
+ - lib/davinci_dtr_test_kit/client_groups/dinner_static/dtr_full_ehr_prepopulation_override_attestation_test.rb
61
+ - lib/davinci_dtr_test_kit/client_groups/dinner_static/dtr_full_ehr_prepopulation_representation_attestation_test.rb
62
+ - lib/davinci_dtr_test_kit/client_groups/dinner_static/dtr_full_ehr_questionnaire_workflow_group.rb
63
+ - lib/davinci_dtr_test_kit/client_groups/dinner_static/dtr_full_ehr_rendering_enabled_questions_attestation_test.rb
64
+ - lib/davinci_dtr_test_kit/client_groups/dinner_static/dtr_full_ehr_store_attestation_test.rb
65
+ - lib/davinci_dtr_test_kit/client_groups/dinner_static/dtr_smart_app_dinner_questionnaire_package_request_test.rb
66
+ - lib/davinci_dtr_test_kit/client_groups/dinner_static/dtr_smart_app_prepopulation_attestation_test.rb
67
+ - lib/davinci_dtr_test_kit/client_groups/dinner_static/dtr_smart_app_prepopulation_override_attestation_test.rb
68
+ - lib/davinci_dtr_test_kit/client_groups/dinner_static/dtr_smart_app_questionnaire_response_save_test.rb
59
69
  - lib/davinci_dtr_test_kit/client_groups/dinner_static/dtr_smart_app_questionnaire_workflow_group.rb
60
- - lib/davinci_dtr_test_kit/client_groups/dinner_static/prepopulation_attestation_test.rb
61
- - lib/davinci_dtr_test_kit/client_groups/dinner_static/prepopulation_override_attestation_test.rb
62
- - lib/davinci_dtr_test_kit/client_groups/dinner_static/rendering_enabled_questions_attestation_test.rb
70
+ - lib/davinci_dtr_test_kit/client_groups/dinner_static/dtr_smart_app_rendering_enabled_questions_attestation_test.rb
63
71
  - lib/davinci_dtr_test_kit/client_groups/resp_assist_device/dtr_full_ehr_questionnaire_workflow_group.rb
64
72
  - lib/davinci_dtr_test_kit/client_groups/resp_assist_device/dtr_questionnaire_package_group.rb
65
73
  - lib/davinci_dtr_test_kit/client_groups/resp_assist_device/dtr_questionnaire_rendering_attestation_test.rb
@@ -72,6 +80,7 @@ files:
72
80
  - lib/davinci_dtr_test_kit/client_groups/shared/dtr_questionnaire_response_basic_conformance_test.rb
73
81
  - lib/davinci_dtr_test_kit/client_groups/shared/dtr_questionnaire_response_pre_population_test.rb
74
82
  - lib/davinci_dtr_test_kit/cql_test.rb
83
+ - lib/davinci_dtr_test_kit/docs/dtr_full_ehr_suite_description_v201.md
75
84
  - lib/davinci_dtr_test_kit/docs/dtr_payer_server_suite_description_v201.md
76
85
  - lib/davinci_dtr_test_kit/docs/dtr_smart_app_suite_description_v201.md
77
86
  - lib/davinci_dtr_test_kit/dtr_full_ehr_suite.rb