davinci_dtr_test_kit 0.12.0 → 0.14.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (139) 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 -28
  15. data/lib/davinci_dtr_test_kit/client_groups/dinner_static/dtr_smart_app_dinner_questionnaire_package_request_test.rb +14 -17
  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/full_ehr/dtr_full_ehr_questionnaire_response_conformance_test.rb +19 -0
  22. data/lib/davinci_dtr_test_kit/client_groups/full_ehr/dtr_full_ehr_questionnaire_response_correctness_test.rb +37 -0
  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 +7 -7
  29. data/lib/davinci_dtr_test_kit/client_groups/shared/dtr_questionnaire_response_pre_population_test.rb +16 -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 +114 -172
  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 +34 -0
  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 +101 -23
  43. data/lib/davinci_dtr_test_kit/dtr_options.rb +7 -0
  44. data/lib/davinci_dtr_test_kit/dtr_payer_server_suite.rb +9 -20
  45. data/lib/davinci_dtr_test_kit/dtr_questionnaire_response_validation.rb +126 -75
  46. data/lib/davinci_dtr_test_kit/dtr_smart_app_suite.rb +32 -56
  47. data/lib/davinci_dtr_test_kit/endpoints/cors.rb +20 -0
  48. data/lib/davinci_dtr_test_kit/endpoints/mock_authorization/authorize_endpoint.rb +32 -0
  49. data/lib/davinci_dtr_test_kit/endpoints/mock_authorization/simple_token_endpoint.rb +19 -0
  50. data/lib/davinci_dtr_test_kit/endpoints/mock_authorization/token_endpoint.rb +116 -0
  51. data/lib/davinci_dtr_test_kit/endpoints/mock_authorization.rb +83 -0
  52. data/lib/davinci_dtr_test_kit/endpoints/mock_ehr/fhir_get_endpoint.rb +95 -0
  53. data/lib/davinci_dtr_test_kit/endpoints/mock_ehr/questionnaire_response_endpoint.rb +22 -0
  54. data/lib/davinci_dtr_test_kit/endpoints/mock_ehr.rb +25 -0
  55. data/lib/davinci_dtr_test_kit/endpoints/mock_payer/full_ehr_next_question_endpoint.rb +11 -0
  56. data/lib/davinci_dtr_test_kit/endpoints/mock_payer/full_ehr_questionnaire_package_endpoint.rb +11 -0
  57. data/lib/davinci_dtr_test_kit/endpoints/mock_payer/next_question_endpoint.rb +162 -0
  58. data/lib/davinci_dtr_test_kit/endpoints/mock_payer/next_question_proxy_endpoint.rb +36 -0
  59. data/lib/davinci_dtr_test_kit/endpoints/mock_payer/questionnaire_package_endpoint.rb +62 -0
  60. data/lib/davinci_dtr_test_kit/endpoints/mock_payer/questionnaire_package_proxy_endpoint.rb +38 -0
  61. data/lib/davinci_dtr_test_kit/endpoints/mock_payer.rb +36 -0
  62. data/lib/davinci_dtr_test_kit/fixture_loader.rb +6 -84
  63. data/lib/davinci_dtr_test_kit/fixtures/dinner_adaptive/dinner_order_adaptive_next_question_burrito.json +10 -2
  64. data/lib/davinci_dtr_test_kit/fixtures/dinner_adaptive/dinner_order_adaptive_next_question_hamburger.json +10 -2
  65. data/lib/davinci_dtr_test_kit/fixtures/dinner_adaptive/dinner_order_adaptive_next_question_initial.json +10 -2
  66. data/lib/davinci_dtr_test_kit/fixtures/dinner_adaptive/questionnaire_dinner_order_adaptive.json +4 -3
  67. data/lib/davinci_dtr_test_kit/fixtures.rb +64 -46
  68. data/lib/davinci_dtr_test_kit/payer_server_groups/adaptive_form_libraries_test.rb +2 -2
  69. data/lib/davinci_dtr_test_kit/payer_server_groups/adaptive_form_questionnaire_expressions_test.rb +4 -3
  70. data/lib/davinci_dtr_test_kit/payer_server_groups/adaptive_form_questionnaire_extensions_test.rb +3 -2
  71. data/lib/davinci_dtr_test_kit/payer_server_groups/adaptive_next_questionnaire_expressions_test.rb +8 -8
  72. data/lib/davinci_dtr_test_kit/payer_server_groups/adaptive_next_questionnaire_extensions_test.rb +6 -5
  73. data/lib/davinci_dtr_test_kit/payer_server_groups/payer_server_adaptive_group.rb +2 -2
  74. data/lib/davinci_dtr_test_kit/payer_server_groups/payer_server_adaptive_request_validation_test.rb +2 -1
  75. data/lib/davinci_dtr_test_kit/payer_server_groups/payer_server_adaptive_response_bundles_validation_test.rb +6 -9
  76. data/lib/davinci_dtr_test_kit/payer_server_groups/payer_server_adaptive_response_search_validation_test.rb +15 -12
  77. data/lib/davinci_dtr_test_kit/payer_server_groups/payer_server_adaptive_response_validation_test.rb +33 -22
  78. data/lib/davinci_dtr_test_kit/payer_server_groups/payer_server_next_request_validation_test.rb +1 -1
  79. data/lib/davinci_dtr_test_kit/payer_server_groups/payer_server_next_response_complete_test.rb +4 -4
  80. data/lib/davinci_dtr_test_kit/payer_server_groups/payer_server_next_response_validation_test.rb +16 -12
  81. data/lib/davinci_dtr_test_kit/payer_server_groups/static_form_libraries_test.rb +2 -2
  82. data/lib/davinci_dtr_test_kit/payer_server_groups/static_form_questionnaire_expressions_test.rb +5 -4
  83. data/lib/davinci_dtr_test_kit/payer_server_groups/static_form_questionnaire_extensions_test.rb +4 -3
  84. data/lib/davinci_dtr_test_kit/payer_server_groups/static_form_request_validation_test.rb +2 -1
  85. data/lib/davinci_dtr_test_kit/payer_server_groups/static_form_response_validation_test.rb +32 -23
  86. data/lib/davinci_dtr_test_kit/profiles/communication_request/communication_request_read.rb +29 -0
  87. data/lib/davinci_dtr_test_kit/profiles/communication_request/communication_request_validation.rb +35 -0
  88. data/lib/davinci_dtr_test_kit/profiles/communication_request_group.rb +39 -0
  89. data/lib/davinci_dtr_test_kit/profiles/coverage/coverage_read.rb +29 -0
  90. data/lib/davinci_dtr_test_kit/profiles/coverage/coverage_validation.rb +35 -0
  91. data/lib/davinci_dtr_test_kit/profiles/coverage_group.rb +38 -0
  92. data/lib/davinci_dtr_test_kit/profiles/device_request/device_request_read.rb +29 -0
  93. data/lib/davinci_dtr_test_kit/profiles/device_request/device_request_validation.rb +35 -0
  94. data/lib/davinci_dtr_test_kit/profiles/device_request_group.rb +39 -0
  95. data/lib/davinci_dtr_test_kit/profiles/encounter/encounter_read.rb +29 -0
  96. data/lib/davinci_dtr_test_kit/profiles/encounter/encounter_validation.rb +35 -0
  97. data/lib/davinci_dtr_test_kit/profiles/encounter_group.rb +39 -0
  98. data/lib/davinci_dtr_test_kit/profiles/medication_request/medication_request_read.rb +29 -0
  99. data/lib/davinci_dtr_test_kit/profiles/medication_request/medication_request_validation.rb +35 -0
  100. data/lib/davinci_dtr_test_kit/profiles/medication_request_group.rb +39 -0
  101. data/lib/davinci_dtr_test_kit/profiles/nutrition_order/nutrition_order_read.rb +29 -0
  102. data/lib/davinci_dtr_test_kit/profiles/nutrition_order/nutrition_order_validation.rb +35 -0
  103. data/lib/davinci_dtr_test_kit/profiles/nutrition_order_group.rb +39 -0
  104. data/lib/davinci_dtr_test_kit/profiles/questionnaire_response/questionnaire_response_context_search.rb +35 -0
  105. data/lib/davinci_dtr_test_kit/profiles/questionnaire_response/questionnaire_response_create.rb +26 -0
  106. data/lib/davinci_dtr_test_kit/profiles/questionnaire_response/questionnaire_response_patient_search.rb +55 -0
  107. data/lib/davinci_dtr_test_kit/profiles/questionnaire_response/questionnaire_response_read.rb +22 -0
  108. data/lib/davinci_dtr_test_kit/profiles/questionnaire_response/questionnaire_response_update.rb +26 -0
  109. data/lib/davinci_dtr_test_kit/profiles/questionnaire_response/questionnaire_response_validation.rb +37 -0
  110. data/lib/davinci_dtr_test_kit/profiles/questionnaire_response_group.rb +66 -0
  111. data/lib/davinci_dtr_test_kit/profiles/service_request/service_request_read.rb +29 -0
  112. data/lib/davinci_dtr_test_kit/profiles/service_request/service_request_validation.rb +35 -0
  113. data/lib/davinci_dtr_test_kit/profiles/service_request_group.rb +39 -0
  114. data/lib/davinci_dtr_test_kit/profiles/task/task_create.rb +26 -0
  115. data/lib/davinci_dtr_test_kit/profiles/task/task_read.rb +29 -0
  116. data/lib/davinci_dtr_test_kit/profiles/task/task_update.rb +26 -0
  117. data/lib/davinci_dtr_test_kit/profiles/task/task_validation.rb +35 -0
  118. data/lib/davinci_dtr_test_kit/profiles/task_group.rb +52 -0
  119. data/lib/davinci_dtr_test_kit/profiles/vision_prescription/vision_prescription_read.rb +29 -0
  120. data/lib/davinci_dtr_test_kit/profiles/vision_prescription/vision_prescription_validation.rb +35 -0
  121. data/lib/davinci_dtr_test_kit/profiles/vision_prescription_group.rb +39 -0
  122. data/lib/davinci_dtr_test_kit/read_test.rb +22 -0
  123. data/lib/davinci_dtr_test_kit/tags.rb +5 -6
  124. data/lib/davinci_dtr_test_kit/update_test.rb +25 -0
  125. data/lib/davinci_dtr_test_kit/urls.rb +13 -10
  126. data/lib/davinci_dtr_test_kit/validation_test.rb +21 -5
  127. data/lib/davinci_dtr_test_kit/version.rb +1 -1
  128. data/lib/davinci_dtr_test_kit.rb +1 -1
  129. metadata +129 -24
  130. data/lib/davinci_dtr_test_kit/client_groups/dinner_static/dtr_full_ehr_prepopulation_representation_attestation_test.rb +0 -33
  131. data/lib/davinci_dtr_test_kit/client_groups/resp_assist_device/dtr_full_ehr_questionnaire_workflow_group.rb +0 -19
  132. data/lib/davinci_dtr_test_kit/ext/inferno_core/record_response_route.rb +0 -98
  133. data/lib/davinci_dtr_test_kit/ext/inferno_core/request.rb +0 -19
  134. data/lib/davinci_dtr_test_kit/ext/inferno_core/runnable.rb +0 -35
  135. data/lib/davinci_dtr_test_kit/mock_auth_server.rb +0 -145
  136. data/lib/davinci_dtr_test_kit/mock_ehr.rb +0 -97
  137. data/lib/davinci_dtr_test_kit/mock_payer.rb +0 -123
  138. /data/lib/davinci_dtr_test_kit/fixtures/{pre_populated_questionnaire_response.json → respiratory_assist_device/pre_populated_questionnaire_response.json} +0 -0
  139. /data/lib/davinci_dtr_test_kit/fixtures/{questionnaire_package.json → respiratory_assist_device/questionnaire_package.json} +0 -0
@@ -13,20 +13,20 @@ requirements and may change the test validation logic.
13
13
  ## Test Methodology
14
14
 
15
15
  Inferno will simulate a DTR client application (SMART client or Full EHR) that
16
- is making requests for questionnaires for the server under test to interact with.
16
+ is making requests for questionnaires for the server under test to interact with.
17
17
  The server will be expected to respond to these requests made by Inferno. Over the
18
- course of these interactions, Inferno will seek to observe conformant handling of
19
- DTR [requirements](https://hl7.org/fhir/us/davinci-dtr/STU2/specification.html#defining-questionnaires)
20
- around standard questionnaires, adaptive questionnaires, or both.
18
+ course of these interactions, Inferno will seek to observe conformant handling of
19
+ DTR [requirements](https://hl7.org/fhir/us/davinci-dtr/STU2/specification.html#defining-questionnaires)
20
+ around standard questionnaires, adaptive questionnaires, or both.
21
21
 
22
22
  In terms of the validation performed on the returned questionnaires these
23
23
  tests assume that payers are not required to support specific features, but only those
24
- that they need in order to implement their forms. The DTR IG does [require that](https://hl7.org/fhir/us/davinci-dtr/STU2/specification.html#population)
24
+ that they need in order to implement their forms. The DTR IG does [require that](https://hl7.org/fhir/us/davinci-dtr/STU2/specification.html#population)
25
25
  "Questionnaires SHALL include logic that supports population from the EHR where possible"
26
26
  and puts some restrictions on how Questionnaire features can be used. Thus, these
27
27
  tests require demonstration of pre-population features and validates conformant
28
28
  use of Questionnaire features, but don't currently require demonstration of all
29
- Questionnnaire Must Support elements.
29
+ Questionnaire Must Support elements.
30
30
 
31
31
  Because the business logic that determines which questionnaires are returned
32
32
  is outside of the DTR specification and will vary between implementers, testers
@@ -34,7 +34,7 @@ are required to provide the requests that Inferno will make to the server, eithe
34
34
  by providing the requests to make up-front, or by sending them to Inferno during
35
35
  test execution using a tester-controlled client.
36
36
 
37
- All responses returned by the server, as well as tester-provided requests, will be checked
37
+ All responses returned by the server, as well as tester-provided requests, will be checked
38
38
  for conformance to the DTR IG requirements individually and used in aggregate to determine
39
39
  whether required features and functionality are present. HL7® FHIR® resources are
40
40
  validated with the Java validator using `tx.fhir.org` as the terminology server.
@@ -46,33 +46,35 @@ validated with the Java validator using `tx.fhir.org` as the terminology server.
46
46
  Execution of these tests require a significant amount of tester input in the
47
47
  form of requests that Inferno will make against the server under test. If
48
48
  you don't have a server or know specific requests that will elicit representative
49
- questionnaires from your server, see the *Sample Execution* section below.
49
+ questionnaires from your server, see the _Sample Execution_ section below.
50
50
 
51
51
  Otherwise, the requests for Inferno to make can be provided in one of two ways:
52
- 1. Statically within the Inferno inputs: provide the json request bodies when running
52
+
53
+ 1. **Statically within the Inferno inputs**: provide the json request bodies when running
53
54
  the tests. This approach works very well for testing standard (static) questionnaires
54
- where there is only one request for Inferno to make (input = *Initial Static Questionnaire Request*). It is less ideal for adaptive
55
- questionnaires as a sequence of `$next-question` requests (inputs = *Initial Adaptive Questionnaire Request* and *Next Question Requests*) is required, which is provided as a json list of
55
+ where there is only one request for Inferno to make (input = _Initial Static Questionnaire Request_). It is less ideal for adaptive
56
+ questionnaires as a sequence of `$next-question` requests (inputs = _Initial Adaptive Questionnaire Request_ and _Next Question Requests_) is required, which is provided as a json list of
56
57
  request body objects.
57
- 2. Dynamically during test execution: use a tester-controlled client to provide requests to
58
+ 2. **Dynamically during test execution**: use a tester-controlled client to provide requests to
58
59
  Inferno while the tests are running. At points that Inferno needs to make a request, execution
59
60
  will pause while the request is provided from the client. Inferno uses a bearer token
60
- provided in the test inputs (input = *Access Token* for the DTR Client Flow (not the
61
- one under the *OAuth Credentials* input)) to identify these requests. The provided token
61
+ provided in the test inputs (input = _Access Token_ for the DTR Client Flow (not the
62
+ one under the _OAuth Credentials_ input)) to identify these requests. The provided token
62
63
  must be sent as a part of the string `Bearer <token>` within the `Authentication` header of
63
- all requests. When Inferno receives a request from the tester-controlled client, it will
64
+ all requests. When Inferno receives a request from the tester-controlled client, it will
64
65
  send that to the server under test and then return the response back to the client so that
65
66
  the client's workflow, e.g., around an adaptive questionnaire can continue.
66
67
 
67
68
  In addition to the above configuration needed for identification of tests, the following additional
68
69
  inputs are required
69
- - *Questionnaire Retrieval Method*: indicate whether only static, only adaptive, or both types
70
+
71
+ - _Questionnaire Retrieval Method_: indicate whether only static, only adaptive, or both types
70
72
  of questionnaires will be tested.
71
- - *FHIR Server Base Url*: the location of the server to test
72
- - *OAuth Credentials*: if the server under test requires authentication, provide those details
73
+ - _FHIR Server Base Url_: the location of the server to test
74
+ - _OAuth Credentials_: if the server under test requires authentication, provide those details
73
75
  here.
74
76
 
75
- For more details on additional inputs that may be needed, see the *Additional Configuration Details*
77
+ For more details on additional inputs that may be needed, see the _Additional Configuration Details_
76
78
  section below.
77
79
 
78
80
  ### Sample Execution
@@ -80,22 +82,22 @@ section below.
80
82
  If you would like to try out the tests but don't have a DTR payer server implementation,
81
83
  you can run these tests against the DTR SMART Client test suite included in this test kit
82
84
  using the following steps:
85
+
83
86
  1. Start an Inferno session of the Da Vinci DTR SMART App Test Suite.
84
- 1. Select test 1.1.1 *Retrieving the Static Questionnaire* from the menu on the left.
87
+ 1. Select test 1.1.1 _Retrieving the Static Questionnaire_ from the menu on the left.
85
88
  1. Click the "Run All Tests" button in the upper right.
86
89
  1. In the "SMART App Launch" select `Standalone Launch` and in the "client_id" input, put `sample`.
87
90
  1. Click the "submit" button in the dialog that appears. The client tests will now be waiting for requests.
88
91
  1. Start an Inferno session of the DTR Payer Server test suite.
89
- 1. Select test 1 *Static Questionnaire Package Retrieval* from the menu on the left.
90
- 1. Select the *Run Against DTR SMART App Tests* option from the Preset dropdown in the
92
+ 1. Select test 1 _Static Questionnaire Package Retrieval_ from the menu on the left.
93
+ 1. Select the _Run Against DTR SMART App Tests_ option from the Preset dropdown in the
91
94
  upper left.
92
95
  1. Click the "Run All Tests" button in the upper right.
93
96
  1. Click the "submit" button in the dialog that appears. The server tests will now make requests
94
- against the client test session, which will respond with a static questionnaire that the
97
+ against the client test session, which will respond with a static questionnaire that the
95
98
  these server tests can validate.
96
99
 
97
- At this time, only the standard questionnaire functionality can be tested using this approach as
98
- the client tests have not implemented an adaptive questionnaire set of tests.
100
+ At this time, only the standard questionnaire functionality can be tested using this approach.
99
101
 
100
102
  ## Additional Configuration Details
101
103
 
@@ -104,7 +106,7 @@ that appears when initiating a test run.
104
106
 
105
107
  ### Custom Endpoint for Accessing a Particular Resource
106
108
 
107
- If the `$questionnaire-package` requests should be made to a location other than
109
+ If the `$questionnaire-package` requests should be made to a location other than
108
110
  `/Questionnaire/$questionnaire-package` under the base server URL, enter the
109
111
  location the requests should be made relative to the base server URL.
110
112
 
@@ -118,10 +120,11 @@ intention of the IG authors then future versions of the tests may require the pa
118
120
  to provide additional examples.
119
121
 
120
122
  The payer responses are also tested to ensure that appropriate libraries and expressions are
121
- included to faciliate pre-population of questionnaires. The following is not tested:
123
+ included to facilitate pre-population of questionnaires. The following is not tested:
124
+
122
125
  - CQL is version 1.5
123
126
  - CQL is valid and executed to populate the questionnaire
124
127
  - CQL has a context of “Patient”
125
128
  - CQL definitions and variables defined on ancestor elements or preceding expression extensions within the same
126
- Questionnaire item are in scope for referencing in descendant/following expressions.
127
- - Within Expression elements, the base expression CQL SHALL be accompanied by a US Public Health Alternative Expression Extension containing the compiled JSON ELM for the expression.
129
+ Questionnaire item are in scope for referencing in descendant/following expressions.
130
+ - Within Expression elements, the base expression CQL SHALL be accompanied by a US Public Health Alternative Expression Extension containing the compiled JSON ELM for the expression.
@@ -12,24 +12,27 @@ requirements and may change the test validation logic.
12
12
 
13
13
  ## Test Methodology
14
14
 
15
- Inferno will simulate a DTR payer server and light EHR that will response to
16
- requests for questionnaires and clinical data for the app under test to interact with.
15
+ Inferno will simulate a DTR payer server and light EHR that will respond to
16
+ requests for questionnaires and clinical data for the app under test to interact with.
17
17
  The app 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
18
+ course of these interactions, Inferno will seek to observe conformant handling of
19
19
  DTR workflows and requirements around the retrieval, completion, and storage of
20
20
  questionnaires.
21
21
 
22
22
  Tests within this suite are associated with specific questionnaires that the app will
23
23
  demonstrate completion of. In each case, the app under test will initiate a request to
24
- the payer server simulated by Inferno for a questionnaire using the
24
+ the payer server simulated by Inferno for a questionnaire using the
25
25
  `$questionnaire-package` operation. Inferno will always return the specific questionnaire
26
26
  for the test being executed regardless of the input provided by the app, though it must
27
27
  be conformant. The app will then be asked to complete the questionnaire, including
28
+
28
29
  - Pre-populating answers based on directives in the questionnaire, which includes the
29
30
  fetching of associated data from the light EHR simulated by Inferno
30
31
  - Rendering the questionnaire for users and allowing them to make additional updates.
31
32
  These tests can include specific directions on details to include in the completed
32
33
  questionnaire.
34
+ - For adaptive questionnaires only, getting additional questions using the `$next-question`
35
+ operation until the questionnaire is complete.
33
36
  - Storing the completed questionnaire back to the light EHR simulated by Inferno. Inferno
34
37
  will validate the stored questionnaire, including pre-populated values (Inferno knows
35
38
  the pre-population logic and the data used in calculation) and other conformance details.
@@ -37,13 +40,15 @@ be conformant. The app will then be asked to complete the questionnaire, includi
37
40
  Apps will be required to complete all questionnaires in the suite, which in aggregate
38
41
  contain all questionnaire features that apps must support. Currently, the suite includes
39
42
  two questionnaires:
40
- 1. A fictious "dinner" questionnaire created for these tests. It tests basic
41
- item rendering and pre-population.
42
- 2. A Respiratory Assist Device questionnaire pulled from the DTR reference implementation.
43
+
44
+ 1. Standard and adaptive styles of a fictitious "dinner" questionnaire created for these tests.
45
+ They test basic item rendering, control flow, and pre-population.
46
+ 1. A Respiratory Assist Device questionnaire pulled from the DTR reference implementation.
43
47
  It tests additional features and represents a more realistic questionnaire.
48
+
44
49
  Additional questionnaires will be added in the future.
45
50
 
46
- All requests sent by the app will be checked
51
+ All requests sent by the app will be checked
47
52
  for conformance to the DTR IG requirements individually and used in aggregate to determine
48
53
  whether required features and functionality are present. HL7® FHIR® resources are
49
54
  validated with the Java validator using `tx.fhir.org` as the terminology server.
@@ -53,6 +58,7 @@ validated with the Java validator using `tx.fhir.org` as the terminology server.
53
58
  ### Quick Start
54
59
 
55
60
  This test suite can be run in two modes, each described below:
61
+
56
62
  1. [EHR launch mode](#ehr-launch)
57
63
  2. [Standalone launch mode](#standalone-launch)
58
64
 
@@ -64,7 +70,7 @@ The DTR specification allows apps and their partners significant leeway in terms
64
70
  what information is provided on launch and how that information gets used by the app
65
71
  to determine the `$questionnaire-package` endpoint and what details to submit as a
66
72
  part of that operation. Inferno cannot know ahead of time what data needs to be
67
- available for the app under test to successfully request, pre-populate, and render
73
+ available for the app under test to successfully request, pre-populate, and render
68
74
  a questionnaire. See the "`fhirContext` and available instances"
69
75
  section below for details on how to enable Inferno to meet the needs of your application.
70
76
 
@@ -72,28 +78,31 @@ section below for details on how to enable Inferno to meet the needs of your app
72
78
 
73
79
  In this mode Inferno will launch the app under test using the SMART App Launch
74
80
  [EHR launch](https://hl7.org/fhir/smart-app-launch/STU2.1/app-launch.html#launch-app-ehr-launch)
75
- flow.
81
+ flow.
76
82
 
77
83
  The tester must provide
84
+
78
85
  1. a `client_id`: can be any string and will uniquely identify the testing session.
79
86
  2. a `launch_uri`: will be used by Inferno to generate a link to launch the app under test.
80
87
 
81
88
  All the details needed to access clinical data from Inferno's simulated EHR are provided
82
- as a part of the SMART flow, including
89
+ as a part of the SMART flow, including
90
+
83
91
  - the FHIR base server URL to request data from
84
92
  - a bearer token to provide on all requests
85
93
 
86
94
  #### Standalone Launch
87
95
 
88
- In this mode the app under test will launch and on its own and reach out to Inferno to
89
- begin the workflow as described in the
96
+ In this mode the app under test will launch on its own and reach out to Inferno to
97
+ begin the workflow as described in the
90
98
  [standalone launch section](https://hl7.org/fhir/smart-app-launch/STU2.1/app-launch.html#launch-app-standalone-launch).
91
99
 
92
100
  The tester must provide
101
+
93
102
  1. a `client_id`: can be any string and will uniquely identify the testing session.
94
103
 
95
104
  The app will then need to connect to Inferno as directed to initiate the SMART and DTR
96
- workflow. The FHIR base server url that app will connect to is
105
+ workflow. The FHIR base server url that app will connect to is
97
106
  `[URL prefix]/custom/dtr_smart_app/fhir` where `[URL prefix]` comes from the URL of the
98
107
  test session which will be of the form `[URL prefix]/dtr_smart_app/[session id]`
99
108
 
@@ -101,20 +110,25 @@ test session which will be of the form `[URL prefix]/dtr_smart_app/[session id]`
101
110
 
102
111
  If you do not have a DTR SMART app but would like to try the tests out, you can use
103
112
  [this Postman collection](https://github.com/inferno-framework/davinci-dtr-test-kit/blob/main/config/DTR%20SMART%20App%20Tests%20Postman%20Demo.postman_collection.json)
104
- to make requests against Inferno. This does not include the capability to render the complete the
113
+ to make requests against Inferno. This does not include the capability to render the complete
105
114
  questionnaires, but does have samples of correctly and incorrectly completed QuestionnaireResponses.
106
115
  The following is a list of tests with the Postman requests that can be used with them:
107
116
 
108
- - **Standalone launch sequence**: use requests in the `SMART App Launch` folder during
117
+ - **Standalone launch sequence**: use requests in the `SMART App Launch` folder during
109
118
  tests **1.1.1.01** or **2.1.1.01** to simulate the SMART Launch flow and obtain an access
110
119
  token to use for subsequent requests. See the collection's Overview for details on the
111
120
  access token's generation.
112
- - **1.1** *Static Questionnaire Workflow*: use requests in the `Static Dinner` folder
113
- - **1.1.1.01** *Invoke the DTR Questionnaire Package operation*: submit request `Questionnaire Package for Dinner (Static)` while this test is waiting.
114
- - **1.1.3.01** *Save the QuestionnaireResponse after completing it*: submit request `Save QuestionnaireResponse for Dinner (Static)` while this test is waiting. If you want to see a failure, submit request `Save QuestionnaireResponse for Dinner (Static) - missing origin extension` instead.
115
- - **2.1** *Respiratory Assist Device Questionnaire Workflow*: use requests in the `Respiratory Assist Device` folder
116
- - **2.1.1.01** *Invoke the DTR Questionnaire Package operation*: submit request `Questionnaire Package for Resp Assist Device` while this test is waiting.
117
- - **2.1.3.01** *Save the QuestionnaireResponse after completing it*: submit request `Save Questionnaire Response for Resp Assist Device` while this test is waiting. If you want to see a failure, submit request `Save Questionnaire Response for Resp Assist Device - unexpected override` instead.
121
+ - **1.1** _Static Questionnaire Workflow_: use requests in the `Static Dinner` folder
122
+ - **1.1.1.01** _Invoke the DTR Questionnaire Package operation_: submit request `Questionnaire Package for Dinner (Static)` while this test is waiting.
123
+ - **1.1.3.01** _Save the QuestionnaireResponse after completing it_: submit request `Save QuestionnaireResponse for Dinner (Static)` while this test is waiting. If you want to see a failure, submit request `Save QuestionnaireResponse for Dinner (Static) - missing origin extension` instead.
124
+ - **1.2** _Adaptive Questionnaire Workflow_: use requests in the `Adaptive Dinner` folder
125
+ - **1.2.1.1.01** _Invoke the Questionnaire Package and Initial Next Question Operation_: submit requests `Questionnaire Package for Dinner` and then `Initial Next Question` while this test is waiting.
126
+ - **1.2.2.1.01** _Invoke the $next-question operation_: submit request `Second Next Question` while this test is waiting.
127
+ - **1.2.3.1.01** _Invoke the $next-question operation_: submit request `Final Next Question` while this test is waiting.
128
+ - **1.2.4.01** _Save the QuestionnaireResponse after completing it_: submit request `Save QuestionnaireResponse` while this test is waiting.
129
+ - **2.1** _Respiratory Assist Device Questionnaire Workflow_: use requests in the `Respiratory Assist Device` folder
130
+ - **2.1.1.01** _Invoke the DTR Questionnaire Package operation_: submit request `Questionnaire Package for Resp Assist Device` while this test is waiting.
131
+ - **2.1.3.01** _Save the QuestionnaireResponse after completing it_: submit request `Save Questionnaire Response for Resp Assist Device` while this test is waiting. If you want to see a failure, submit request `Save Questionnaire Response for Resp Assist Device - unexpected override` instead.
118
132
 
119
133
  ## Configuration Details
120
134
 
@@ -135,24 +149,26 @@ controlled by the following inputs present on each group associated with a quest
135
149
 
136
150
  - **SMART App Launch Patient ID**: provide an `id` for the subject Patient FHIR instance.
137
151
  - **SMART App Launch `fhirContext`**: provide a JSON object containing FHIR references to instances
138
- relevant to the DTR workflow, e.g.
139
-
152
+ relevant to the DTR workflow, e.g.
153
+
140
154
  ```
141
155
  [{reference: 'Coverage/cov015'}, {reference: 'DeviceRequest/devreqe0470'}]
142
- ```
156
+ ```
157
+
143
158
  This will be included under the `fhirContext` key of the token response.
159
+
144
160
  - **EHR-available resources**: provide a Bundle containing FHIR instances referenced in and from the
145
161
  previous two inputs. Each instance must include an `id` element that Inferno will use in conjunction
146
162
  with the `resourceType` to make the instances available at the `[server base url]/[resourceType]/[id]`.
147
163
 
148
164
  Each questionnaire workflow group description includes a link to the questionnaire package that Inferno will return
149
165
  (e.g., [here](https://github.com/inferno-framework/davinci-dtr-test-kit/blob/main/lib/davinci_dtr_test_kit/fixtures/dinner_static/questionnaire_dinner_order_static.json))
150
- where you can find `id` and `url` values and any other details needed to determine what inputs
166
+ where you can find `id` and `url` values and any other details needed to determine what inputs
151
167
  will allow the app under test to work with that questionnaire. Note additionally that Inferno will always
152
168
  return that questionnaire in response to `$questionnaire-package` requests made during that test.
153
169
 
154
170
  These inputs can be cumbersome to create and if you have suggestions about how to improve this process
155
- while keeping the flexibility of Inferno to run with any app, submit a ticket
171
+ while keeping the flexibility of Inferno to run with any app, submit a ticket
156
172
  [here](https://github.com/inferno-framework/davinci-pas-test-kit/issues).
157
173
 
158
174
  ## Limitations
@@ -163,9 +179,9 @@ features. A few specific features of interest are listed below.
163
179
 
164
180
  ### Launching and security
165
181
 
166
- This test kit contains basic SMART App Launch cabilities that may not be complete. In particular,
167
- refresh tokens are not currently supported and scopes are not precise. To provide feedback and
168
- input on the design of this feature and help us priortize improvements, submit a ticket
182
+ This test kit contains basic SMART App Launch capabilities that may not be complete. In particular,
183
+ refresh tokens are not currently supported and scopes are not precise. To provide feedback and
184
+ input on the design of this feature and help us prioritize improvements, submit a ticket
169
185
  [here](https://github.com/inferno-framework/davinci-pas-test-kit/issues).
170
186
 
171
187
  ### Combined payer and EHR FHIR servers
@@ -178,5 +194,5 @@ to retrieve questionnaires.
178
194
  ### Questionnaire Feature Coverage
179
195
 
180
196
  Not all questionnaire features that are must support within the DTR IG are currently represented
181
- in questionnaires tested by the IG. Adaptive questionnaires are a notable omission.
182
- Additional questionnaires testing additional features will be added in the future.
197
+ in questionnaires tested by the IG. Additional questionnaires testing additional features will
198
+ be added in the future.
@@ -1,15 +1,15 @@
1
- require_relative 'ext/inferno_core/runnable'
2
- require_relative 'ext/inferno_core/record_response_route'
3
- require_relative 'ext/inferno_core/request'
4
1
  require_relative 'client_groups/dinner_static/dtr_full_ehr_questionnaire_workflow_group'
2
+ require_relative 'client_groups/dinner_adaptive/dtr_full_ehr_adaptive_dinner_questionnaire_workflow_group'
5
3
  require_relative 'auth_groups/oauth2_authentication_group'
6
- require_relative 'mock_payer'
4
+ require_relative 'endpoints/cors'
5
+ require_relative 'endpoints/mock_authorization/simple_token_endpoint'
6
+ require_relative 'endpoints/mock_payer/full_ehr_questionnaire_package_endpoint'
7
+ require_relative 'endpoints/mock_payer/full_ehr_next_question_endpoint'
7
8
  require_relative 'version'
8
9
 
9
10
  module DaVinciDTRTestKit
10
11
  class DTRFullEHRSuite < Inferno::TestSuite
11
- extend MockPayer
12
- extend MockAuthServer
12
+ extend CORS
13
13
 
14
14
  id :dtr_full_ehr
15
15
  title 'Da Vinci DTR Full EHR Test Suite'
@@ -45,27 +45,23 @@ module DaVinciDTRTestKit
45
45
  end
46
46
  end
47
47
 
48
- allow_cors QUESTIONNAIRE_PACKAGE_PATH
48
+ allow_cors QUESTIONNAIRE_PACKAGE_PATH, NEXT_PATH
49
49
 
50
- record_response_route :post, PAYER_TOKEN_PATH, 'dtr_full_ehr_payer_token',
51
- method(:payer_token_response) do |request|
52
- DTRFullEHRSuite.extract_client_id_from_form_params(request)
53
- end
50
+ suite_endpoint :post, PAYER_TOKEN_PATH, MockAuthorization::SimpleTokenEndpoint
54
51
 
55
- record_response_route :post, QUESTIONNAIRE_PACKAGE_PATH, QUESTIONNAIRE_PACKAGE_TAG,
56
- method(:questionnaire_package_response) do |request|
57
- DTRFullEHRSuite.extract_bearer_token(request)
58
- end
52
+ suite_endpoint :post, QUESTIONNAIRE_PACKAGE_PATH, MockPayer::FullEHRQuestionnairePackageEndpoint
53
+ suite_endpoint :post, NEXT_PATH, MockPayer::FullEHRNextQuestionEndpoint
59
54
 
60
55
  resume_test_route :get, RESUME_PASS_PATH do |request|
61
- DTRFullEHRSuite.extract_token_from_query_params(request)
56
+ request.query_parameters['token']
62
57
  end
63
58
 
64
59
  resume_test_route :get, RESUME_FAIL_PATH, result: 'fail' do |request|
65
- DTRFullEHRSuite.extract_token_from_query_params(request)
60
+ request.query_parameters['token']
66
61
  end
67
62
 
68
63
  group from: :oauth2_authentication
69
64
  group from: :dtr_full_ehr_static_dinner_questionnaire_workflow
65
+ group from: :dtr_full_ehr_adaptive_dinner_questionnaire_workflow
70
66
  end
71
67
  end
@@ -1,18 +1,25 @@
1
+ require 'us_core_test_kit'
2
+ require 'tls_test_kit'
1
3
  require_relative 'version'
4
+ require_relative 'dtr_options'
5
+ require_relative 'profiles/questionnaire_response_group'
6
+ require_relative 'profiles/coverage_group'
7
+ require_relative 'profiles/communication_request_group'
8
+ require_relative 'profiles/device_request_group'
9
+ require_relative 'profiles/encounter_group'
10
+ require_relative 'profiles/medication_request_group'
11
+ require_relative 'profiles/nutrition_order_group'
12
+ require_relative 'profiles/service_request_group'
13
+ require_relative 'profiles/task_group'
14
+ require_relative 'profiles/vision_prescription_group'
15
+ require 'smart_app_launch/smart_stu1_suite'
16
+ require 'smart_app_launch/smart_stu2_suite'
2
17
 
3
18
  module DaVinciDTRTestKit
4
19
  class DTRLightEHRSuite < Inferno::TestSuite
5
20
  id :dtr_light_ehr
6
21
  title 'Da Vinci DTR Light EHR Test Suite'
7
- description %(
8
- # Da Vinci DTR Light EHR Test Suite
9
-
10
- This suite validates that an EMR or other application
11
- can act as a data source for a DTR SMART App. Inferno
12
- will act as a DTR SMART App making requests for data
13
- against the system under test and storing completed
14
- questionnaire responses.
15
- )
22
+ description File.read(File.join(__dir__, 'docs', 'dtr_light_ehr_suite_description_v201.md'))
16
23
 
17
24
  version VERSION
18
25
 
@@ -35,28 +42,99 @@ module DaVinciDTRTestKit
35
42
  }
36
43
  ]
37
44
 
38
- # These inputs will be available to all tests in this suite
39
45
  input :url,
40
- title: 'FHIR Server Base Url'
41
-
42
- input :credentials,
43
- title: 'OAuth Credentials',
44
- type: :oauth_credentials,
45
- optional: true
46
-
47
- # All FHIR requests in this suite will use this FHIR client
48
- fhir_client do
49
- url :url
50
- oauth_credentials :credentials
51
- end
46
+ title: 'FHIR Server Base Url',
47
+ description: 'URL of the target DTR Light EHR'
52
48
 
53
49
  # Hl7 Validator Wrapper:
54
50
  fhir_resource_validator do
55
- igs 'hl7.fhir.us.davinci-dtr#2.0.1'
51
+ igs('hl7.fhir.us.davinci-dtr#2.0.1', 'hl7.fhir.us.davinci-pas#2.0.1', 'hl7.fhir.us.davinci-crd#2.0.1')
56
52
 
57
53
  exclude_message do |message|
58
54
  message.message.match?(/\A\S+: \S+: URL value '.*' does not resolve/)
59
55
  end
60
56
  end
57
+
58
+ group do
59
+ title 'Authorization'
60
+
61
+ group from: :smart_discovery_stu2 do
62
+ required_suite_options DTROptions::SMART_2_REQUIREMENT
63
+ run_as_group
64
+
65
+ test from: :tls_version_test do
66
+ title 'DTR FHIR Server is secured by transport layer security'
67
+ description <<~DESCRIPTION
68
+ Under [Privacy, Security, and Safety](https://hl7.org/fhir/us/davinci-crd/STU2/security.html),
69
+ the DTR Implementation Guide imposes the following rule about TLS:
70
+ As per the [DTR Hook specification](https://cds-hooks.hl7.org/2.0/#security-and-safety),
71
+ communications between DTR Clients and DTR Servers SHALL
72
+ use TLS. Mutual TLS is not required by this specification but is permitted. DTR Servers and
73
+ DTR Clients SHOULD enforce a minimum version and other TLS configuration requirements based
74
+ on HRex rules for PHI exchange.
75
+ This test verifies that the FHIR server is using TLS 1.2 or higher.
76
+ DESCRIPTION
77
+
78
+ id :dtr_server_tls_version_stu2
79
+
80
+ config(
81
+ options: { minimum_allowed_version: OpenSSL::SSL::TLS1_2_VERSION }
82
+ )
83
+ end
84
+ end
85
+
86
+ group from: :smart_ehr_launch_stu2,
87
+ required_suite_options: DTROptions::SMART_2_REQUIREMENT,
88
+ run_as_group: true
89
+
90
+ group from: :smart_standalone_launch_stu2,
91
+ required_suite_options: DTROptions::SMART_2_REQUIREMENT,
92
+ run_as_group: true
93
+ end
94
+
95
+ group do
96
+ title 'FHIR API'
97
+ description %(This test group tests systems for their conformance to
98
+ the US Core v3.1.1 Capability Statement as defined by the DaVinci Documentation
99
+ Templates and Rules (DTR) v2.0.1 Implementation Guide Light DTR EHR
100
+ Capability Statement.
101
+
102
+ )
103
+
104
+ group from: :'us_core_v311-us_core_v311_fhir_api',
105
+ run_as_group: true
106
+ end
107
+
108
+ group do
109
+ title 'DTR Light EHR Profiles'
110
+ description %(This test group tests system for their conformance to
111
+ the RESTful capabilities by specified Resources/Profiles as defined by
112
+ the DaVinci Documentation Templates and Rules (DTR) v2.0,1 Implementation
113
+ Guide Light DTR EHR Capability Statement.
114
+
115
+ )
116
+
117
+ input :credentials,
118
+ title: 'OAuth Credentials',
119
+ type: :oauth_credentials,
120
+ optional: true
121
+
122
+ # All FHIR requests in this suite will use this FHIR client
123
+ fhir_client do
124
+ url :url
125
+ oauth_credentials :credentials
126
+ end
127
+
128
+ group from: :questionnaire_response_group
129
+ group from: :coverage_group
130
+ group from: :communication_request_group
131
+ group from: :device_request_group
132
+ group from: :encounter_group
133
+ group from: :medication_request_group
134
+ group from: :nutrition_order_group
135
+ group from: :service_request_group
136
+ group from: :task_group
137
+ group from: :vision_prescription_group
138
+ end
61
139
  end
62
140
  end
@@ -0,0 +1,7 @@
1
+ module DaVinciDTRTestKit
2
+ module DTROptions
3
+ SMART_2 = 'smart_app_launch_2'.freeze
4
+
5
+ SMART_2_REQUIREMENT = { smart_app_launch_version: SMART_2 }.freeze
6
+ end
7
+ end
@@ -1,17 +1,15 @@
1
- require_relative 'ext/inferno_core/runnable'
2
- require_relative 'ext/inferno_core/record_response_route'
3
- require_relative 'ext/inferno_core/request'
4
1
  require_relative 'payer_server_groups/payer_server_static_group'
5
2
  require_relative 'payer_server_groups/payer_server_adaptive_group'
6
3
  require_relative 'tags'
7
- require_relative 'mock_payer'
8
- require_relative 'mock_auth_server'
4
+ require_relative 'endpoints/cors'
5
+ require_relative 'endpoints/mock_authorization/simple_token_endpoint'
6
+ require_relative 'endpoints/mock_payer/questionnaire_package_proxy_endpoint'
7
+ require_relative 'endpoints/mock_payer/next_question_proxy_endpoint'
9
8
  require_relative 'version'
10
9
 
11
10
  module DaVinciDTRTestKit
12
11
  class DTRPayerServerSuite < Inferno::TestSuite
13
- extend MockAuthServer
14
- extend MockPayer
12
+ extend CORS
15
13
 
16
14
  id :dtr_payer_server
17
15
  title 'Da Vinci DTR Payer Server Test Suite'
@@ -106,22 +104,13 @@ module DaVinciDTRTestKit
106
104
 
107
105
  allow_cors QUESTIONNAIRE_PACKAGE_PATH, NEXT_PATH
108
106
 
109
- record_response_route :post, PAYER_TOKEN_PATH, 'dtr_payer_auth', method(:payer_token_response) do |request|
110
- DTRPayerServerSuite.extract_client_id_from_form_params(request)
111
- end
112
-
113
- record_response_route :post, QUESTIONNAIRE_PACKAGE_PATH, QUESTIONNAIRE_TAG,
114
- method(:payer_questionnaire_response), resumes: method(:test_resumes?) do |request|
115
- DTRPayerServerSuite.extract_bearer_token(request)
116
- end
107
+ suite_endpoint :post, PAYER_TOKEN_PATH, MockAuthorization::SimpleTokenEndpoint
117
108
 
118
- record_response_route :post, NEXT_PATH, NEXT_TAG,
119
- method(:questionnaire_next_response), resumes: method(:test_resumes?) do |request|
120
- DTRPayerServerSuite.extract_bearer_token(request)
121
- end
109
+ suite_endpoint :post, QUESTIONNAIRE_PACKAGE_PATH, MockPayer::QuestionnairePackageProxyEndpoint
110
+ suite_endpoint :post, NEXT_PATH, MockPayer::NextQuestionProxyEndpoint
122
111
 
123
112
  resume_test_route :get, RESUME_PASS_PATH do |request|
124
- DTRPayerServerSuite.extract_token_from_query_params(request)
113
+ request.query_parameters['token']
125
114
  end
126
115
 
127
116
  group from: :payer_server_static_package