davinci_dtr_test_kit 0.13.0 → 0.14.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (128) hide show
  1. checksums.yaml +4 -4
  2. data/lib/davinci_dtr_test_kit/client_groups/dinner_adaptive/dtr_adaptive_questionnaire_completion_group.rb +23 -0
  3. data/lib/davinci_dtr_test_kit/client_groups/dinner_adaptive/dtr_adaptive_questionnaire_followup_questions_group.rb +26 -0
  4. data/lib/davinci_dtr_test_kit/client_groups/dinner_adaptive/dtr_adaptive_questionnaire_next_question_request_test.rb +93 -0
  5. data/lib/davinci_dtr_test_kit/client_groups/dinner_adaptive/dtr_adaptive_questionnaire_next_question_request_validation_test.rb +62 -0
  6. data/lib/davinci_dtr_test_kit/client_groups/dinner_adaptive/dtr_adaptive_questionnaire_next_question_retrieval_group.rb +23 -0
  7. data/lib/davinci_dtr_test_kit/client_groups/dinner_adaptive/dtr_adaptive_questionnaire_response_validation_test.rb +66 -0
  8. data/lib/davinci_dtr_test_kit/client_groups/dinner_adaptive/dtr_full_ehr_adaptive_dinner_questionnaire_workflow_group.rb +76 -0
  9. data/lib/davinci_dtr_test_kit/client_groups/dinner_adaptive/dtr_full_ehr_adaptive_questionnaire_initial_retrieval_group.rb +27 -0
  10. data/lib/davinci_dtr_test_kit/client_groups/dinner_adaptive/dtr_full_ehr_adaptive_questionnaire_request_test.rb +63 -0
  11. data/lib/davinci_dtr_test_kit/client_groups/dinner_adaptive/dtr_smart_app_adaptive_questionnaire_initial_retrieval_group.rb +24 -0
  12. data/lib/davinci_dtr_test_kit/client_groups/dinner_adaptive/dtr_smart_app_adaptive_questionnaire_request_test.rb +148 -0
  13. data/lib/davinci_dtr_test_kit/client_groups/dinner_adaptive/dtr_smart_app_questionnaire_workflow_group.rb +75 -0
  14. data/lib/davinci_dtr_test_kit/client_groups/dinner_static/dtr_full_ehr_questionnaire_workflow_group.rb +22 -38
  15. data/lib/davinci_dtr_test_kit/client_groups/dinner_static/dtr_smart_app_dinner_questionnaire_package_request_test.rb +13 -16
  16. data/lib/davinci_dtr_test_kit/client_groups/dinner_static/dtr_smart_app_questionnaire_workflow_group.rb +9 -31
  17. data/lib/davinci_dtr_test_kit/client_groups/{dinner_static → full_ehr}/dtr_full_ehr_launch_attestation_test.rb +7 -6
  18. data/lib/davinci_dtr_test_kit/client_groups/{dinner_static → full_ehr}/dtr_full_ehr_prepopulation_attestation_test.rb +7 -7
  19. data/lib/davinci_dtr_test_kit/client_groups/{dinner_static → full_ehr}/dtr_full_ehr_prepopulation_override_attestation_test.rb +7 -7
  20. data/lib/davinci_dtr_test_kit/client_groups/{dinner_static/dtr_full_ehr_dinner_questionnaire_package_request_test.rb → full_ehr/dtr_full_ehr_questionnaire_package_request_test.rb} +2 -3
  21. data/lib/davinci_dtr_test_kit/client_groups/{dinner_static/dtr_full_ehr_dinner_static_questionnaire_response_conformance_test.rb → full_ehr/dtr_full_ehr_questionnaire_response_conformance_test.rb} +7 -3
  22. data/lib/davinci_dtr_test_kit/client_groups/{dinner_static/dtr_full_ehr_dinner_static_questionnaire_response_correctness_test.rb → full_ehr/dtr_full_ehr_questionnaire_response_correctness_test.rb} +14 -7
  23. data/lib/davinci_dtr_test_kit/client_groups/{dinner_static → full_ehr}/dtr_full_ehr_rendering_enabled_questions_attestation_test.rb +7 -7
  24. data/lib/davinci_dtr_test_kit/client_groups/full_ehr/dtr_full_ehr_saving_questionnaire_response_group.rb +29 -0
  25. data/lib/davinci_dtr_test_kit/client_groups/{dinner_static → full_ehr}/dtr_full_ehr_store_attestation_test.rb +7 -7
  26. data/lib/davinci_dtr_test_kit/client_groups/resp_assist_device/dtr_questionnaire_rendering_attestation_test.rb +7 -6
  27. data/lib/davinci_dtr_test_kit/client_groups/resp_assist_device/dtr_resp_questionnaire_package_request_test.rb +15 -18
  28. data/lib/davinci_dtr_test_kit/client_groups/shared/dtr_questionnaire_response_basic_conformance_test.rb +5 -1
  29. data/lib/davinci_dtr_test_kit/client_groups/shared/dtr_questionnaire_response_pre_population_test.rb +12 -5
  30. data/lib/davinci_dtr_test_kit/client_groups/{dinner_static → smart_app}/dtr_smart_app_prepopulation_attestation_test.rb +7 -7
  31. data/lib/davinci_dtr_test_kit/client_groups/{dinner_static → smart_app}/dtr_smart_app_prepopulation_override_attestation_test.rb +7 -6
  32. data/lib/davinci_dtr_test_kit/client_groups/{dinner_static → smart_app}/dtr_smart_app_questionnaire_response_save_test.rb +17 -7
  33. data/lib/davinci_dtr_test_kit/client_groups/{dinner_static → smart_app}/dtr_smart_app_rendering_enabled_questions_attestation_test.rb +7 -7
  34. data/lib/davinci_dtr_test_kit/client_groups/smart_app/dtr_smart_app_saving_questionnaire_response_group.rb +27 -0
  35. data/lib/davinci_dtr_test_kit/cql_test.rb +37 -140
  36. data/lib/davinci_dtr_test_kit/create_test.rb +25 -0
  37. data/lib/davinci_dtr_test_kit/docs/dtr_full_ehr_suite_description_v201.md +95 -37
  38. data/lib/davinci_dtr_test_kit/docs/dtr_light_ehr_suite_description_v201.md +15 -6
  39. data/lib/davinci_dtr_test_kit/docs/dtr_payer_server_suite_description_v201.md +32 -29
  40. data/lib/davinci_dtr_test_kit/docs/dtr_smart_app_suite_description_v201.md +48 -32
  41. data/lib/davinci_dtr_test_kit/dtr_full_ehr_suite.rb +13 -17
  42. data/lib/davinci_dtr_test_kit/dtr_light_ehr_suite.rb +67 -2
  43. data/lib/davinci_dtr_test_kit/dtr_payer_server_suite.rb +9 -20
  44. data/lib/davinci_dtr_test_kit/dtr_questionnaire_response_validation.rb +18 -10
  45. data/lib/davinci_dtr_test_kit/dtr_smart_app_suite.rb +32 -59
  46. data/lib/davinci_dtr_test_kit/endpoints/cors.rb +20 -0
  47. data/lib/davinci_dtr_test_kit/endpoints/mock_authorization/authorize_endpoint.rb +32 -0
  48. data/lib/davinci_dtr_test_kit/endpoints/mock_authorization/simple_token_endpoint.rb +19 -0
  49. data/lib/davinci_dtr_test_kit/endpoints/mock_authorization/token_endpoint.rb +116 -0
  50. data/lib/davinci_dtr_test_kit/endpoints/mock_authorization.rb +83 -0
  51. data/lib/davinci_dtr_test_kit/endpoints/mock_ehr/fhir_get_endpoint.rb +95 -0
  52. data/lib/davinci_dtr_test_kit/endpoints/mock_ehr/questionnaire_response_endpoint.rb +22 -0
  53. data/lib/davinci_dtr_test_kit/endpoints/mock_ehr.rb +25 -0
  54. data/lib/davinci_dtr_test_kit/endpoints/mock_payer/full_ehr_next_question_endpoint.rb +11 -0
  55. data/lib/davinci_dtr_test_kit/endpoints/mock_payer/full_ehr_questionnaire_package_endpoint.rb +11 -0
  56. data/lib/davinci_dtr_test_kit/endpoints/mock_payer/next_question_endpoint.rb +162 -0
  57. data/lib/davinci_dtr_test_kit/endpoints/mock_payer/next_question_proxy_endpoint.rb +36 -0
  58. data/lib/davinci_dtr_test_kit/endpoints/mock_payer/questionnaire_package_endpoint.rb +62 -0
  59. data/lib/davinci_dtr_test_kit/endpoints/mock_payer/questionnaire_package_proxy_endpoint.rb +38 -0
  60. data/lib/davinci_dtr_test_kit/endpoints/mock_payer.rb +36 -0
  61. data/lib/davinci_dtr_test_kit/fixtures/dinner_adaptive/dinner_order_adaptive_next_question_burrito.json +10 -2
  62. data/lib/davinci_dtr_test_kit/fixtures/dinner_adaptive/dinner_order_adaptive_next_question_hamburger.json +10 -2
  63. data/lib/davinci_dtr_test_kit/fixtures/dinner_adaptive/dinner_order_adaptive_next_question_initial.json +10 -2
  64. data/lib/davinci_dtr_test_kit/fixtures/dinner_adaptive/questionnaire_dinner_order_adaptive.json +4 -3
  65. data/lib/davinci_dtr_test_kit/fixtures.rb +24 -1
  66. data/lib/davinci_dtr_test_kit/payer_server_groups/adaptive_form_libraries_test.rb +2 -2
  67. data/lib/davinci_dtr_test_kit/payer_server_groups/adaptive_form_questionnaire_expressions_test.rb +4 -3
  68. data/lib/davinci_dtr_test_kit/payer_server_groups/adaptive_form_questionnaire_extensions_test.rb +3 -2
  69. data/lib/davinci_dtr_test_kit/payer_server_groups/adaptive_next_questionnaire_expressions_test.rb +6 -6
  70. data/lib/davinci_dtr_test_kit/payer_server_groups/adaptive_next_questionnaire_extensions_test.rb +6 -5
  71. data/lib/davinci_dtr_test_kit/payer_server_groups/payer_server_adaptive_group.rb +2 -2
  72. data/lib/davinci_dtr_test_kit/payer_server_groups/payer_server_adaptive_response_bundles_validation_test.rb +6 -9
  73. data/lib/davinci_dtr_test_kit/payer_server_groups/payer_server_adaptive_response_search_validation_test.rb +15 -12
  74. data/lib/davinci_dtr_test_kit/payer_server_groups/payer_server_adaptive_response_validation_test.rb +33 -23
  75. data/lib/davinci_dtr_test_kit/payer_server_groups/payer_server_next_response_complete_test.rb +4 -4
  76. data/lib/davinci_dtr_test_kit/payer_server_groups/payer_server_next_response_validation_test.rb +16 -12
  77. data/lib/davinci_dtr_test_kit/payer_server_groups/static_form_libraries_test.rb +2 -2
  78. data/lib/davinci_dtr_test_kit/payer_server_groups/static_form_questionnaire_expressions_test.rb +5 -4
  79. data/lib/davinci_dtr_test_kit/payer_server_groups/static_form_questionnaire_extensions_test.rb +4 -3
  80. data/lib/davinci_dtr_test_kit/payer_server_groups/static_form_response_validation_test.rb +32 -25
  81. data/lib/davinci_dtr_test_kit/profiles/communication_request/communication_request_read.rb +29 -0
  82. data/lib/davinci_dtr_test_kit/profiles/communication_request/communication_request_validation.rb +35 -0
  83. data/lib/davinci_dtr_test_kit/profiles/communication_request_group.rb +39 -0
  84. data/lib/davinci_dtr_test_kit/profiles/coverage/coverage_read.rb +29 -0
  85. data/lib/davinci_dtr_test_kit/profiles/coverage/coverage_validation.rb +35 -0
  86. data/lib/davinci_dtr_test_kit/profiles/coverage_group.rb +38 -0
  87. data/lib/davinci_dtr_test_kit/profiles/device_request/device_request_read.rb +29 -0
  88. data/lib/davinci_dtr_test_kit/profiles/device_request/device_request_validation.rb +35 -0
  89. data/lib/davinci_dtr_test_kit/profiles/device_request_group.rb +39 -0
  90. data/lib/davinci_dtr_test_kit/profiles/encounter/encounter_read.rb +29 -0
  91. data/lib/davinci_dtr_test_kit/profiles/encounter/encounter_validation.rb +35 -0
  92. data/lib/davinci_dtr_test_kit/profiles/encounter_group.rb +39 -0
  93. data/lib/davinci_dtr_test_kit/profiles/medication_request/medication_request_read.rb +29 -0
  94. data/lib/davinci_dtr_test_kit/profiles/medication_request/medication_request_validation.rb +35 -0
  95. data/lib/davinci_dtr_test_kit/profiles/medication_request_group.rb +39 -0
  96. data/lib/davinci_dtr_test_kit/profiles/nutrition_order/nutrition_order_read.rb +29 -0
  97. data/lib/davinci_dtr_test_kit/profiles/nutrition_order/nutrition_order_validation.rb +35 -0
  98. data/lib/davinci_dtr_test_kit/profiles/nutrition_order_group.rb +39 -0
  99. data/lib/davinci_dtr_test_kit/profiles/questionnaire_response/questionnaire_response_context_search.rb +35 -0
  100. data/lib/davinci_dtr_test_kit/profiles/questionnaire_response/questionnaire_response_create.rb +26 -0
  101. data/lib/davinci_dtr_test_kit/profiles/questionnaire_response/questionnaire_response_patient_search.rb +55 -0
  102. data/lib/davinci_dtr_test_kit/profiles/questionnaire_response/questionnaire_response_read.rb +22 -0
  103. data/lib/davinci_dtr_test_kit/profiles/questionnaire_response/questionnaire_response_update.rb +26 -0
  104. data/lib/davinci_dtr_test_kit/profiles/questionnaire_response/questionnaire_response_validation.rb +37 -0
  105. data/lib/davinci_dtr_test_kit/profiles/questionnaire_response_group.rb +66 -0
  106. data/lib/davinci_dtr_test_kit/profiles/service_request/service_request_read.rb +29 -0
  107. data/lib/davinci_dtr_test_kit/profiles/service_request/service_request_validation.rb +35 -0
  108. data/lib/davinci_dtr_test_kit/profiles/service_request_group.rb +39 -0
  109. data/lib/davinci_dtr_test_kit/profiles/task/task_create.rb +26 -0
  110. data/lib/davinci_dtr_test_kit/profiles/task/task_read.rb +29 -0
  111. data/lib/davinci_dtr_test_kit/profiles/task/task_update.rb +26 -0
  112. data/lib/davinci_dtr_test_kit/profiles/task/task_validation.rb +35 -0
  113. data/lib/davinci_dtr_test_kit/profiles/task_group.rb +52 -0
  114. data/lib/davinci_dtr_test_kit/profiles/vision_prescription/vision_prescription_read.rb +29 -0
  115. data/lib/davinci_dtr_test_kit/profiles/vision_prescription/vision_prescription_validation.rb +35 -0
  116. data/lib/davinci_dtr_test_kit/profiles/vision_prescription_group.rb +39 -0
  117. data/lib/davinci_dtr_test_kit/read_test.rb +22 -0
  118. data/lib/davinci_dtr_test_kit/tags.rb +5 -7
  119. data/lib/davinci_dtr_test_kit/update_test.rb +25 -0
  120. data/lib/davinci_dtr_test_kit/validation_test.rb +19 -4
  121. data/lib/davinci_dtr_test_kit/version.rb +1 -1
  122. metadata +110 -21
  123. data/lib/davinci_dtr_test_kit/ext/inferno_core/record_response_route.rb +0 -98
  124. data/lib/davinci_dtr_test_kit/ext/inferno_core/request.rb +0 -19
  125. data/lib/davinci_dtr_test_kit/ext/inferno_core/runnable.rb +0 -35
  126. data/lib/davinci_dtr_test_kit/mock_auth_server.rb +0 -228
  127. data/lib/davinci_dtr_test_kit/mock_ehr.rb +0 -105
  128. data/lib/davinci_dtr_test_kit/mock_payer.rb +0 -100
@@ -1,3 +1,10 @@
1
+ require_relative '../../tags'
2
+ require_relative 'dtr_smart_app_adaptive_questionnaire_initial_retrieval_group'
3
+ require_relative '../smart_app/dtr_smart_app_prepopulation_attestation_test'
4
+ require_relative '../smart_app/dtr_smart_app_prepopulation_override_attestation_test'
5
+ require_relative 'dtr_adaptive_questionnaire_followup_questions_group'
6
+ require_relative 'dtr_adaptive_questionnaire_completion_group'
7
+
1
8
  module DaVinciDTRTestKit
2
9
  class DTRSmartAppAdaptiveDinnerQuestionnaireWorkflowGroup < Inferno::TestGroup
3
10
  id :dtr_smart_app_adaptive_dinner_questionnaire_workflow
@@ -8,6 +15,7 @@ module DaVinciDTRTestKit
8
15
  demonstrate their ability to:
9
16
 
10
17
  1. Fetch the adaptive questionnaire package
18
+ ([DinnerOrderAdaptive](https://github.com/inferno-framework/davinci-dtr-test-kit/blob/main/lib/davinci_dtr_test_kit/fixtures/dinner_adaptive/questionnaire_dinner_order_adaptive.json))
11
19
  2. Fetch the first set of questions and render and pre-populate them appropriately, including:
12
20
  - fetch additional data needed for pre-population
13
21
  - pre-populate data as directed by the questionnaire
@@ -16,5 +24,72 @@ module DaVinciDTRTestKit
16
24
  4. Complete the questionnaire and provide the completed QuestionnaireResponse
17
25
  with appropriate indicators for pre-populated and manually-entered data.
18
26
  )
27
+
28
+ config(
29
+ options: {
30
+ smart_app: true
31
+ }
32
+ )
33
+
34
+ group do
35
+ id :dtr_smart_app_adaptive_questionnaire_retrieval
36
+ title 'Retrieving the Adaptive Questionnaire'
37
+ description %(
38
+ Inferno will wait for the client system to request a questionnaire using the
39
+ $questionnaire-package operation and follow up with an initial $next-question request to retrieve
40
+ the first set of questions.
41
+
42
+ The initial set of questions will be returned for the tester to complete.
43
+
44
+ Inferno will then validate the conformance of the requests.
45
+ )
46
+ run_as_group
47
+
48
+ group from: :dtr_smart_app_adaptive_questionnaire_initial_retrieval
49
+ group do
50
+ id :dtr_smart_app_initial_questionnaire_rendering
51
+ title 'Filling Out the Questionnaire'
52
+ description %(
53
+ The tester will interact with the questionnaire within their client system
54
+ such that pre-population steps are taken, the qustionnaire is rendered, and
55
+ they are able to fill it out. The tester will attest that questionnaire pre-population
56
+ and rendering directives were followed.
57
+ )
58
+
59
+ # Test 1: attest to the pre-population of the name fields
60
+ test from: :dtr_smart_app_prepopulation_attestation
61
+ # Test 2: attest to the pre-population and edit of the location field
62
+ test from: :dtr_smart_app_prepopulation_override_attestation
63
+ end
64
+ end
65
+
66
+ group from: :dtr_adaptive_questionnaire_followup_questions,
67
+ config: {
68
+ options: {
69
+ accepts_multiple_requests: true,
70
+ next_tag: "followup_#{CLIENT_NEXT_TAG}"
71
+ },
72
+ inputs: {
73
+ access_token: { name: :client_id }
74
+ }
75
+ }
76
+
77
+ group from: :dtr_adaptive_questionnaire_completion,
78
+ config: {
79
+ options: {
80
+ accepts_multiple_requests: true,
81
+ next_tag: "completion_#{CLIENT_NEXT_TAG}"
82
+ },
83
+ inputs: {
84
+ access_token: { name: :client_id }
85
+ }
86
+ }
87
+ group from: :dtr_smart_app_saving_questionnaire_response,
88
+ config: {
89
+ options: {
90
+ adaptive: true,
91
+ qr_profile_url: 'http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaireresponse-adapt'
92
+ }
93
+ }
19
94
  end
20
95
  end
@@ -1,12 +1,10 @@
1
- require_relative 'dtr_full_ehr_launch_attestation_test'
2
- require_relative 'dtr_full_ehr_dinner_questionnaire_package_request_test'
1
+ require_relative '../full_ehr/dtr_full_ehr_launch_attestation_test'
2
+ require_relative '../full_ehr/dtr_full_ehr_questionnaire_package_request_test'
3
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_dinner_static_questionnaire_response_conformance_test'
9
- require_relative 'dtr_full_ehr_dinner_static_questionnaire_response_correctness_test'
4
+ require_relative '../full_ehr/dtr_full_ehr_prepopulation_attestation_test'
5
+ require_relative '../full_ehr/dtr_full_ehr_rendering_enabled_questions_attestation_test'
6
+ require_relative '../full_ehr/dtr_full_ehr_prepopulation_override_attestation_test'
7
+ require_relative '../full_ehr/dtr_full_ehr_saving_questionnaire_response_group'
10
8
 
11
9
  module DaVinciDTRTestKit
12
10
  class DTRFullEHRStaticDinnerQuestionnaireWorkflowGroup < Inferno::TestGroup
@@ -36,9 +34,9 @@ module DaVinciDTRTestKit
36
34
  run_as_group
37
35
 
38
36
  # Test 0: attest to launch
39
- test from: :dtr_full_ehr_dinner_static_launch_attestation
37
+ test from: :dtr_full_ehr_launch_attestation
40
38
  # Test 1: wait for the $questionnaire-package request
41
- test from: :dtr_full_ehr_dinner_questionnaire_package_request
39
+ test from: :dtr_full_ehr_questionnaire_package_request
42
40
  # Test 2: validate the $questionnaire-package body
43
41
  test from: :dtr_questionnaire_package_request_validation
44
42
  end
@@ -55,37 +53,23 @@ module DaVinciDTRTestKit
55
53
  run_as_group
56
54
 
57
55
  # Test 1: attest to the pre-population of the name fields
58
- test from: :dtr_full_ehr_dinner_static_rendering_prepopulation_attestation
56
+ test from: :dtr_full_ehr_prepopulation_attestation
59
57
  # Test 2: attest to the pre-population and edit of the first name field
60
- test from: :dtr_full_ehr_dinner_static_prepopulation_override_attestation
58
+ test from: :dtr_full_ehr_prepopulation_override_attestation
61
59
  # Test 3: attest to the display of the toppings questions only when a dinner answer is selected
62
- test from: :dtr_full_ehr_dinner_static_rendering_enabledQs_attestation
60
+ test from: :dtr_full_ehr_rendering_enabled_questions_attestation
63
61
  end
64
62
 
65
- group do
66
- id :dtr_full_ehr_static_questionnaire_response
67
- title 'Saving the QuestionnaireResponse'
68
- description %(
69
- The tester will attest to the completion of the questionnaire such that
70
- the results are stored for later use.
71
- )
72
- input :questionnaire_response,
73
- type: 'textarea',
74
- title: 'Completed QuestionnaireResponse',
75
- optional: true,
76
- description: %(
77
- The QuestionnaireResponse as exported from the EHR after completion of the Questionnaire. IMPORTANT: If
78
- you have not yet run the 'Filling Out the Static Questionnaire' group, leave this blank until you have
79
- done so. Then, run just the 'Saving the QuestionnaireResponse' group and populate this input.
80
- )
81
- run_as_group
82
-
83
- # Test 1: attest QuestionnaireResponse saved
84
- test from: :dtr_full_ehr_dinner_static_store_attestation
85
- # Test 2: verify basic conformance of the QuestionnaireResponse
86
- test from: :dtr_full_ehr_dinner_static_questionnaire_response_conformance
87
- # Test 3: check workflow-specific details such as pre-population and overrides
88
- test from: :dtr_full_ehr_dinner_static_questionnaire_response_correctness
89
- end
63
+ group from: :dtr_full_ehr_saving_questionnaire_response,
64
+ config: {
65
+ inputs: {
66
+ questionnaire_response: {
67
+ description: "The QuestionnaireResponse as exported from the EHR after completion of the Questionnaire.
68
+ IMPORTANT: If you have not yet run the 'Filling Out the Static Questionnaire' group, leave this blank
69
+ until you have done so. Then, run just the 'Saving the QuestionnaireResponse' group and populate
70
+ this input."
71
+ }
72
+ }
73
+ }
90
74
  end
91
75
  end
@@ -11,6 +11,7 @@ module DaVinciDTRTestKit
11
11
  Inferno will wait for a DTR questionnaire package request from the client. Upon receipt, Inferno will generate and
12
12
  send a response.
13
13
  )
14
+ config options: { accepts_multiple_requests: true }
14
15
  input :smart_app_launch,
15
16
  type: 'radio',
16
17
  title: 'SMART App Launch',
@@ -21,38 +22,34 @@ module DaVinciDTRTestKit
21
22
  input :launch_uri,
22
23
  optional: true,
23
24
  description: 'Required if "Launch from Inferno" is selected'
24
- input :smart_patient_id,
25
+ input :static_smart_patient_id,
25
26
  optional: true,
26
27
  title: 'SMART App Launch Patient ID (Dinner Static)',
27
28
  type: 'text',
28
29
  description: %(
29
- Patient instance `id` to be provided by Inferno as the `patient` as a part of the SMART App
30
- Launch.
30
+ Patient instance ID to be provided by Inferno as the patient as a part of the SMART App Launch.
31
31
  ),
32
32
  default: 'pat015'
33
- input :smart_fhir_context,
33
+ input :static_smart_fhir_context,
34
34
  optional: true,
35
35
  title: 'SMART App Launch fhirContext (Dinner Static)',
36
36
  type: 'textarea',
37
37
  description: %(
38
- References to be provided by Inferno as the `fhirContext` as a part of the SMART App
38
+ References to be provided by Inferno as the fhirContext as a part of the SMART App
39
39
  Launch. These references help determine the behavior of the app. Referenced instances
40
40
  may be provided in the "EHR-available resources" input.
41
41
  ),
42
42
  default: JSON.pretty_generate([{ reference: 'Coverage/cov015' },
43
43
  { reference: 'DeviceRequest/devreqe0470' }])
44
- input :ehr_bundle,
44
+ input :static_ehr_bundle,
45
45
  optional: true,
46
46
  title: 'EHR-available resources (Dinner Static)',
47
47
  type: 'textarea',
48
48
  description: %(
49
49
  Resources available from the EHR needed to drive the dinner static workflow.
50
- Formatted as a FHIR bundle that contains resources, each with an `id` property populated. Each
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
-
53
- ```
54
- [fhir-base]/[resource type]/[instance id]
55
- ```
52
+ <fhir-base>/<resource type>/<instance id>
56
53
  )
57
54
 
58
55
  def example_client_jwt_payload_part
@@ -62,19 +59,19 @@ module DaVinciDTRTestKit
62
59
  run do
63
60
  # validate relevant inputs and provide warnings if they are bad
64
61
  warning do
65
- if smart_fhir_context
66
- assert_valid_json(smart_fhir_context,
62
+ if static_smart_fhir_context
63
+ assert_valid_json(static_smart_fhir_context,
67
64
  'The **SMART App Launch fhirContext** input is not valid JSON, so it will not be included in
68
65
  the access token response.')
69
66
  end
70
67
  end
71
68
 
72
69
  warning do
73
- if ehr_bundle
74
- assert_valid_json(ehr_bundle,
70
+ if static_ehr_bundle
71
+ assert_valid_json(static_ehr_bundle,
75
72
  'The **EHR-available resources** input is not valid JSON, so no tester-specified instances
76
73
  will be available to access from Inferno.')
77
- assert(FHIR.from_contents(ehr_bundle).is_a?(FHIR::Bundle),
74
+ assert(FHIR.from_contents(static_ehr_bundle).is_a?(FHIR::Bundle),
78
75
  'The **EHR-available resources** input does not contain a FHIR Bundle, so no tester-specified instances
79
76
  will be available to access from Inferno.')
80
77
  end
@@ -1,11 +1,9 @@
1
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 '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
- require_relative '../shared/dtr_questionnaire_response_basic_conformance_test'
8
- require_relative '../shared/dtr_questionnaire_response_pre_population_test'
3
+ require_relative '../smart_app/dtr_smart_app_prepopulation_attestation_test'
4
+ require_relative '../smart_app/dtr_smart_app_prepopulation_override_attestation_test'
5
+ require_relative '../smart_app/dtr_smart_app_rendering_enabled_questions_attestation_test'
6
+ require_relative '../smart_app/dtr_smart_app_saving_questionnaire_response_group'
9
7
 
10
8
  module DaVinciDTRTestKit
11
9
  class DTRSmartAppStaticDinnerQuestionnaireWorkflowGroup < Inferno::TestGroup
@@ -32,7 +30,7 @@ module DaVinciDTRTestKit
32
30
  description %(
33
31
  Inferno will wait for the client system to request a questionnaire using the
34
32
  $questionnaire-package operation and will return a static questionnaire for the
35
- tester to complete. Inferno will then validate the the conformance of the request.
33
+ tester to complete. Inferno will then validate the conformance of the request.
36
34
  )
37
35
  run_as_group
38
36
 
@@ -58,33 +56,13 @@ module DaVinciDTRTestKit
58
56
  # since the questionnaire asks them to
59
57
  # TODO: once Tom has gotten the reference server hooked up
60
58
  # Test 2: attest to the pre-population of the name fields
61
- test from: :dtr_smart_app_dinner_static_rendering_prepopulation_attestation
59
+ test from: :dtr_smart_app_prepopulation_attestation
62
60
  # Test 3: attest to the pre-population and edit of the location field
63
- test from: :dtr_smart_app_dinner_static_prepopulation_override_attestation
61
+ test from: :dtr_smart_app_prepopulation_override_attestation
64
62
  # Test 4: attest to the display of the toppings questions only when a dinner answer is selected
65
- test from: :dtr_smart_app_dinner_static_rendering_enabledQs_attestation
63
+ test from: :dtr_smart_app_rendering_enabled_questions_attestation
66
64
  end
67
65
 
68
- group do
69
- id :dtr_smart_app_static_questionnaire_response
70
- title 'Saving the QuestionnaireResponse'
71
- description %(
72
- The tester will complete the questionnaire such that a QuestionnaireResponse is stored
73
- back into Inferno's EHR endpoint. The stored QuestionnaireResponse will be evaluated for
74
- conformance, completeness, and correct indicators on pre-populated and manually-overriden
75
- items.
76
- )
77
- run_as_group
78
-
79
- # Test 1: wait for a QuestionnaireResponse
80
- test from: :dtr_smart_app_static_dinner_questionnaire_response_save,
81
- receives_request: :questionnaire_response_save
82
- # Test 2: validate basic conformance of the QuestionnaireResponse
83
- test from: :dtr_questionnaire_response_basic_conformance,
84
- uses_request: :questionnaire_response_save
85
- # Test 3: validate workflow-specific details such as pre-population and overrides
86
- test from: :dtr_questionnaire_response_pre_population,
87
- uses_request: :questionnaire_response_save
88
- end
66
+ group from: :dtr_smart_app_saving_questionnaire_response
89
67
  end
90
68
  end
@@ -1,26 +1,27 @@
1
+ require 'securerandom'
1
2
  require_relative '../../urls'
2
3
 
3
4
  module DaVinciDTRTestKit
4
- class DTRFullEHRStaticDinnerLaunchAttestationTest < Inferno::Test
5
+ class DTRFullEHRLaunchAttestationTest < Inferno::Test
5
6
  include URLs
6
7
 
7
- id :dtr_full_ehr_dinner_static_launch_attestation
8
+ id :dtr_full_ehr_launch_attestation
8
9
  title 'Launch DTR for a patient that has an official name (Attestation)'
9
10
  description %(
10
11
  Attest that DTR has been launched for a patient with data that will be used for prepopulation.
11
12
  )
12
- input :access_token
13
13
 
14
14
  run do
15
+ random_id = SecureRandom.uuid
15
16
  wait(
16
- identifier: access_token,
17
+ identifier: random_id,
17
18
  message: %(
18
19
  I attest that DTR has been launched in the context of a patient with an official name, including
19
20
  first and last.
20
21
 
21
- [Click here](#{resume_pass_url}?token=#{access_token}) if the above statement is **true**.
22
+ [Click here](#{resume_pass_url}?token=#{random_id}) if the above statement is **true**.
22
23
 
23
- [Click here](#{resume_fail_url}?token=#{access_token}) if the above statement is **false**.
24
+ [Click here](#{resume_fail_url}?token=#{random_id}) if the above statement is **false**.
24
25
  )
25
26
  )
26
27
  end
@@ -1,28 +1,28 @@
1
+ require 'securerandom'
1
2
  require_relative '../../urls'
2
3
 
3
4
  module DaVinciDTRTestKit
4
- class DTRFullEHRStaticDinnerPrepopulationAttestationTest < Inferno::Test
5
+ class DTRFullEHRPrepopulationAttestationTest < Inferno::Test
5
6
  include URLs
6
7
 
7
- id :dtr_full_ehr_dinner_static_rendering_prepopulation_attestation
8
+ id :dtr_full_ehr_prepopulation_attestation
8
9
  title 'Check that the client pre-populates the questionnaire (Attestation)'
9
10
  description %(
10
11
  Validate that pre-population of patient name information occurs as expected.
11
12
  )
12
- input :access_token
13
-
14
13
  run do
14
+ random_id = SecureRandom.uuid
15
15
  wait(
16
- identifier: access_token,
16
+ identifier: random_id,
17
17
  message: %(
18
18
  I attest that the DTR application pre-populates the following questions with the respective
19
19
  value for the official name of the patient:
20
20
  - Last Name
21
21
  - First Name
22
22
 
23
- [Click here](#{resume_pass_url}?token=#{access_token}) if the above statement is **true**.
23
+ [Click here](#{resume_pass_url}?token=#{random_id}) if the above statement is **true**.
24
24
 
25
- [Click here](#{resume_fail_url}?token=#{access_token}) if the above statement is **false**.
25
+ [Click here](#{resume_fail_url}?token=#{random_id}) if the above statement is **false**.
26
26
  )
27
27
  )
28
28
  end
@@ -1,25 +1,25 @@
1
+ require 'securerandom'
1
2
  require_relative '../../urls'
2
3
 
3
4
  module DaVinciDTRTestKit
4
- class DTRFullEHRStaticDinnerPrepopulationOverrideAttestationTest < Inferno::Test
5
+ class DTRFullEHRPrepopulationOverrideAttestationTest < Inferno::Test
5
6
  include URLs
6
7
 
7
- id :dtr_full_ehr_dinner_static_prepopulation_override_attestation
8
+ id :dtr_full_ehr_prepopulation_override_attestation
8
9
  title 'Validate the user can override pre-populated data (Attestation)'
9
10
  description %(
10
11
  Validate that the user can edit a pre-populated item and replace it with another value.
11
12
  )
12
- input :access_token
13
-
14
13
  run do
14
+ random_id = SecureRandom.uuid
15
15
  wait(
16
- identifier: access_token,
16
+ identifier: random_id,
17
17
  message: %(
18
18
  I attest that I have changed the prepopulated value in the First Name field to a new value.
19
19
 
20
- [Click here](#{resume_pass_url}?token=#{access_token}) if the above statement is **true**.
20
+ [Click here](#{resume_pass_url}?token=#{random_id}) if the above statement is **true**.
21
21
 
22
- [Click here](#{resume_fail_url}?token=#{access_token}) if the above statement is **false**.
22
+ [Click here](#{resume_fail_url}?token=#{random_id}) if the above statement is **false**.
23
23
  )
24
24
  )
25
25
  end
@@ -1,11 +1,10 @@
1
- require 'base64'
2
1
  require_relative '../../urls'
3
2
 
4
3
  module DaVinciDTRTestKit
5
- class DTRFullEHRDinnerQuestionnairePackageRequestTest < Inferno::Test
4
+ class DTRFullEHRQuestionnairePackageRequestTest < Inferno::Test
6
5
  include URLs
7
6
 
8
- id :dtr_full_ehr_dinner_questionnaire_package_request
7
+ id :dtr_full_ehr_questionnaire_package_request
9
8
  title 'Invoke the DTR Questionnaire Package operation'
10
9
  description %(
11
10
  Inferno will wait for a DTR questionnaire package request from the client. Upon receipt, Inferno will generate and
@@ -1,15 +1,19 @@
1
1
  require_relative '../../dtr_questionnaire_response_validation'
2
2
 
3
3
  module DaVinciDTRTestKit
4
- class DTRFullEHRDinnerStaticQuestionnaireResponseConformanceTest < Inferno::Test
4
+ class DTRFullEHRQuestionnaireResponseConformanceTest < Inferno::Test
5
5
  include DTRQuestionnaireResponseValidation
6
6
 
7
- id :dtr_full_ehr_dinner_static_questionnaire_response_conformance
7
+ id :dtr_full_ehr_questionnaire_response_conformance
8
8
  title 'QuestionnaireResponse is conformant'
9
9
 
10
+ def profile_url
11
+ config.options[:qr_profile_url]
12
+ end
13
+
10
14
  run do
11
15
  skip_if questionnaire_response.nil?, 'Completed QuestionnaireResponse input was blank'
12
- verify_basic_conformance(questionnaire_response)
16
+ verify_basic_conformance(questionnaire_response, profile_url)
13
17
  end
14
18
  end
15
19
  end
@@ -1,29 +1,36 @@
1
1
  require_relative '../../dtr_questionnaire_response_validation'
2
2
 
3
3
  module DaVinciDTRTestKit
4
- class DTRFullEHRDinnerStaticQuestionnaireResponseCorrectnessTest < Inferno::Test
4
+ class DTRFullEHRQuestionnaireResponseCorrectnessTest < Inferno::Test
5
5
  include DTRQuestionnaireResponseValidation
6
6
 
7
- id :dtr_full_ehr_dinner_static_questionnaire_response_correctness
7
+ id :dtr_full_ehr_questionnaire_response_correctness
8
8
  title 'QuestionnaireResponse is correct for the workflow'
9
9
  description %(
10
10
  The QuestionnaireResponse aligns with the following expectations for the workflow. This includes checks for
11
11
  the presence of the following answers and their appropriate origin source extensions:
12
12
 
13
- - PBD.1 (Last Name): `auto`
13
+ - `PBD.1` (Last Name) and `LOC.1` (Location): `auto`
14
14
  - PBD.2 (First Name): `override`
15
- - 3.1 (dinner choice): `manual`
15
+ - `3` (all nested dinner questions): `manual`
16
16
  )
17
17
 
18
18
  run do
19
19
  skip_if questionnaire_response.nil?, 'Completed QuestionnaireResponse input was blank'
20
20
  check_is_questionnaire_response(questionnaire_response)
21
21
 
22
- questionnaire = Fixtures.questionnaire_for_test(id)
23
- # questionnaire = Fixtures.find_questionnaire('DinnerOrderStatic')
24
22
  qr = FHIR.from_contents(questionnaire_response)
23
+ questionnaire = if config.options[:adaptive]
24
+ qr.contained.find do |res|
25
+ res.resourceType == 'Questionnaire'
26
+ end
27
+ else
28
+ Fixtures.questionnaire_for_test(id)
29
+ end
30
+ # questionnaire = Fixtures.find_questionnaire('DinnerOrderStatic')
25
31
  check_origin_sources(questionnaire.item, qr.item, expected_overrides: ['PBD.2'])
26
- check_answer_presence(qr.item, link_ids: ['PBD.1', 'PBD.2', 'LOC.1'])
32
+ required_link_ids = extract_required_link_ids(questionnaire.item)
33
+ check_answer_presence(qr.item, required_link_ids)
27
34
  assert(messages.none? { |m| m[:type] == 'error' }, 'QuestionnaireResponse is not correct, see error message(s)')
28
35
  end
29
36
  end
@@ -1,28 +1,28 @@
1
+ require 'securerandom'
1
2
  require_relative '../../urls'
2
3
 
3
4
  module DaVinciDTRTestKit
4
- class DTRFullEHRStaticDinnerRenderingAttestationTest < Inferno::Test
5
+ class DTRFullEHRRenderingEnabledQuestionsAttestationTest < Inferno::Test
5
6
  include URLs
6
7
 
7
- id :dtr_full_ehr_dinner_static_rendering_enabledQs_attestation
8
+ id :dtr_full_ehr_rendering_enabled_questions_attestation
8
9
  title 'Check that the client renders enabled questions appropriately (Attestation)'
9
10
  description %(
10
11
  Validate that the rendering of the questionnaire includes only the "What would you like on..."
11
12
  question appropriate for the dinner selection, if made.
12
13
  )
13
- input :access_token
14
-
15
14
  run do
15
+ random_id = SecureRandom.uuid
16
16
  wait(
17
- identifier: access_token,
17
+ identifier: random_id,
18
18
  message: %(
19
19
  I attest that the client application does not display any "What would you like on..."
20
20
  questions until I have selected a dinner choice and then only displays the
21
21
  "What would you like on..." question relevant for the dinner request:
22
22
 
23
- [Click here](#{resume_pass_url}?token=#{access_token}) if the above statement is **true**.
23
+ [Click here](#{resume_pass_url}?token=#{random_id}) if the above statement is **true**.
24
24
 
25
- [Click here](#{resume_fail_url}?token=#{access_token}) if the above statement is **false**.
25
+ [Click here](#{resume_fail_url}?token=#{random_id}) if the above statement is **false**.
26
26
  )
27
27
  )
28
28
  end
@@ -0,0 +1,29 @@
1
+ require_relative 'dtr_full_ehr_store_attestation_test'
2
+ require_relative 'dtr_full_ehr_questionnaire_response_conformance_test'
3
+ require_relative 'dtr_full_ehr_questionnaire_response_correctness_test'
4
+
5
+ module DaVinciDTRTestKit
6
+ class DTRFullEHRSavingQuestionnaireResponseGroup < Inferno::TestGroup
7
+ id :dtr_full_ehr_saving_questionnaire_response
8
+ title 'Saving the QuestionnaireResponse'
9
+ description %(
10
+ The tester will attest to the completion of the questionnaire such that
11
+ the results are stored for later use.
12
+ )
13
+ input :questionnaire_response,
14
+ type: 'textarea',
15
+ title: 'Completed QuestionnaireResponse',
16
+ optional: true,
17
+ description: %(
18
+ The QuestionnaireResponse as exported from the EHR after completion of the Questionnaire.
19
+ )
20
+ run_as_group
21
+
22
+ # Test 1: attest QuestionnaireResponse saved
23
+ test from: :dtr_full_ehr_store_attestation
24
+ # Test 2: verify basic conformance of the QuestionnaireResponse
25
+ test from: :dtr_full_ehr_questionnaire_response_conformance
26
+ # Test 3: check workflow-specific details such as pre-population and overrides
27
+ test from: :dtr_full_ehr_questionnaire_response_correctness
28
+ end
29
+ end
@@ -1,27 +1,27 @@
1
+ require 'securerandom'
1
2
  require_relative '../../urls'
2
3
 
3
4
  module DaVinciDTRTestKit
4
- class DTRFullEHRStaticDinnerStoreAttestationTest < Inferno::Test
5
+ class DTRFullEHRStoreAttestationTest < Inferno::Test
5
6
  include URLs
6
7
 
7
- id :dtr_full_ehr_dinner_static_store_attestation
8
+ id :dtr_full_ehr_store_attestation
8
9
  title 'Complete and Store the QuestionnaireResponse (Attestation)'
9
10
  description %(
10
11
  Attest that the questionnaire has been completed and the response has been persisted
11
12
  and can be exported as a FHIR QuestionnaireResponse instance.
12
13
  )
13
- input :access_token
14
-
15
14
  run do
15
+ random_id = SecureRandom.uuid
16
16
  wait(
17
- identifier: access_token,
17
+ identifier: random_id,
18
18
  message: %(
19
19
  I attest that the questionnaire has been completed and stored within the EHR for future
20
20
  use and export as a FHIR QuestionnaireResponse instance.
21
21
 
22
- [Click here](#{resume_pass_url}?token=#{access_token}) if the above statement is **true**.
22
+ [Click here](#{resume_pass_url}?token=#{random_id}) if the above statement is **true**.
23
23
 
24
- [Click here](#{resume_fail_url}?token=#{access_token}) if the above statement is **false**.
24
+ [Click here](#{resume_fail_url}?token=#{random_id}) if the above statement is **false**.
25
25
  )
26
26
  )
27
27
  end
@@ -1,3 +1,4 @@
1
+ require 'securerandom'
1
2
  require_relative '../../urls'
2
3
 
3
4
  module DaVinciDTRTestKit
@@ -7,24 +8,24 @@ module DaVinciDTRTestKit
7
8
  id :dtr_questionnaire_rendering_attestation
8
9
  title 'Check that the client renders the questionnaire (Attestation)'
9
10
  description %(
10
- Thist test provides the tester an opportunity to observe their client application following the receipt of the
11
- questionnaire pacakage and attest that the application renders the questionnaire.
11
+ This test provides the tester an opportunity to observe their client application following the receipt of the
12
+ questionnaire package and attest that the application renders the questionnaire.
12
13
  )
13
- input :client_id
14
14
 
15
15
  run do
16
16
  load_tagged_requests QUESTIONNAIRE_PACKAGE_TAG
17
17
  skip_if request.blank?, 'A Questionnaire Package request must be made prior to running this test'
18
+ token = SecureRandom.uuid
18
19
 
19
20
  wait(
20
- identifier: client_id,
21
+ identifier: token,
21
22
  message: %(
22
23
  I attest that the client application displays the questionnaire and respects the following rendering style:
23
24
  - The "Signature" field label is rendered with green text
24
25
 
25
- [Click here](#{resume_pass_url}?client_id=#{client_id}) if the above statement is **true**.
26
+ [Click here](#{resume_pass_url}?token=#{token}) if the above statement is **true**.
26
27
 
27
- [Click here](#{resume_fail_url}?client_id=#{client_id}) if the above statement is **false**.
28
+ [Click here](#{resume_fail_url}?token=#{token}) if the above statement is **false**.
28
29
  )
29
30
  )
30
31
  end