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.
- checksums.yaml +4 -4
- data/lib/davinci_dtr_test_kit/client_groups/dinner_adaptive/dtr_adaptive_questionnaire_completion_group.rb +23 -0
- data/lib/davinci_dtr_test_kit/client_groups/dinner_adaptive/dtr_adaptive_questionnaire_followup_questions_group.rb +26 -0
- data/lib/davinci_dtr_test_kit/client_groups/dinner_adaptive/dtr_adaptive_questionnaire_next_question_request_test.rb +93 -0
- data/lib/davinci_dtr_test_kit/client_groups/dinner_adaptive/dtr_adaptive_questionnaire_next_question_request_validation_test.rb +62 -0
- data/lib/davinci_dtr_test_kit/client_groups/dinner_adaptive/dtr_adaptive_questionnaire_next_question_retrieval_group.rb +23 -0
- data/lib/davinci_dtr_test_kit/client_groups/dinner_adaptive/dtr_adaptive_questionnaire_response_validation_test.rb +66 -0
- data/lib/davinci_dtr_test_kit/client_groups/dinner_adaptive/dtr_full_ehr_adaptive_dinner_questionnaire_workflow_group.rb +76 -0
- data/lib/davinci_dtr_test_kit/client_groups/dinner_adaptive/dtr_full_ehr_adaptive_questionnaire_initial_retrieval_group.rb +27 -0
- data/lib/davinci_dtr_test_kit/client_groups/dinner_adaptive/dtr_full_ehr_adaptive_questionnaire_request_test.rb +63 -0
- data/lib/davinci_dtr_test_kit/client_groups/dinner_adaptive/dtr_smart_app_adaptive_questionnaire_initial_retrieval_group.rb +24 -0
- data/lib/davinci_dtr_test_kit/client_groups/dinner_adaptive/dtr_smart_app_adaptive_questionnaire_request_test.rb +148 -0
- data/lib/davinci_dtr_test_kit/client_groups/dinner_adaptive/dtr_smart_app_questionnaire_workflow_group.rb +75 -0
- data/lib/davinci_dtr_test_kit/client_groups/dinner_static/dtr_full_ehr_questionnaire_workflow_group.rb +22 -28
- data/lib/davinci_dtr_test_kit/client_groups/dinner_static/dtr_smart_app_dinner_questionnaire_package_request_test.rb +14 -17
- data/lib/davinci_dtr_test_kit/client_groups/dinner_static/dtr_smart_app_questionnaire_workflow_group.rb +9 -31
- data/lib/davinci_dtr_test_kit/client_groups/{dinner_static → full_ehr}/dtr_full_ehr_launch_attestation_test.rb +7 -6
- data/lib/davinci_dtr_test_kit/client_groups/{dinner_static → full_ehr}/dtr_full_ehr_prepopulation_attestation_test.rb +7 -7
- data/lib/davinci_dtr_test_kit/client_groups/{dinner_static → full_ehr}/dtr_full_ehr_prepopulation_override_attestation_test.rb +7 -7
- 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
- data/lib/davinci_dtr_test_kit/client_groups/full_ehr/dtr_full_ehr_questionnaire_response_conformance_test.rb +19 -0
- data/lib/davinci_dtr_test_kit/client_groups/full_ehr/dtr_full_ehr_questionnaire_response_correctness_test.rb +37 -0
- data/lib/davinci_dtr_test_kit/client_groups/{dinner_static → full_ehr}/dtr_full_ehr_rendering_enabled_questions_attestation_test.rb +7 -7
- data/lib/davinci_dtr_test_kit/client_groups/full_ehr/dtr_full_ehr_saving_questionnaire_response_group.rb +29 -0
- data/lib/davinci_dtr_test_kit/client_groups/{dinner_static → full_ehr}/dtr_full_ehr_store_attestation_test.rb +7 -7
- data/lib/davinci_dtr_test_kit/client_groups/resp_assist_device/dtr_questionnaire_rendering_attestation_test.rb +7 -6
- data/lib/davinci_dtr_test_kit/client_groups/resp_assist_device/dtr_resp_questionnaire_package_request_test.rb +15 -18
- data/lib/davinci_dtr_test_kit/client_groups/shared/dtr_questionnaire_response_basic_conformance_test.rb +7 -7
- data/lib/davinci_dtr_test_kit/client_groups/shared/dtr_questionnaire_response_pre_population_test.rb +16 -5
- data/lib/davinci_dtr_test_kit/client_groups/{dinner_static → smart_app}/dtr_smart_app_prepopulation_attestation_test.rb +7 -7
- data/lib/davinci_dtr_test_kit/client_groups/{dinner_static → smart_app}/dtr_smart_app_prepopulation_override_attestation_test.rb +7 -6
- data/lib/davinci_dtr_test_kit/client_groups/{dinner_static → smart_app}/dtr_smart_app_questionnaire_response_save_test.rb +17 -7
- data/lib/davinci_dtr_test_kit/client_groups/{dinner_static → smart_app}/dtr_smart_app_rendering_enabled_questions_attestation_test.rb +7 -7
- data/lib/davinci_dtr_test_kit/client_groups/smart_app/dtr_smart_app_saving_questionnaire_response_group.rb +27 -0
- data/lib/davinci_dtr_test_kit/cql_test.rb +114 -172
- data/lib/davinci_dtr_test_kit/create_test.rb +25 -0
- data/lib/davinci_dtr_test_kit/docs/dtr_full_ehr_suite_description_v201.md +95 -37
- data/lib/davinci_dtr_test_kit/docs/dtr_light_ehr_suite_description_v201.md +34 -0
- data/lib/davinci_dtr_test_kit/docs/dtr_payer_server_suite_description_v201.md +32 -29
- data/lib/davinci_dtr_test_kit/docs/dtr_smart_app_suite_description_v201.md +48 -32
- data/lib/davinci_dtr_test_kit/dtr_full_ehr_suite.rb +13 -17
- data/lib/davinci_dtr_test_kit/dtr_light_ehr_suite.rb +101 -23
- data/lib/davinci_dtr_test_kit/dtr_options.rb +7 -0
- data/lib/davinci_dtr_test_kit/dtr_payer_server_suite.rb +9 -20
- data/lib/davinci_dtr_test_kit/dtr_questionnaire_response_validation.rb +126 -75
- data/lib/davinci_dtr_test_kit/dtr_smart_app_suite.rb +32 -56
- data/lib/davinci_dtr_test_kit/endpoints/cors.rb +20 -0
- data/lib/davinci_dtr_test_kit/endpoints/mock_authorization/authorize_endpoint.rb +32 -0
- data/lib/davinci_dtr_test_kit/endpoints/mock_authorization/simple_token_endpoint.rb +19 -0
- data/lib/davinci_dtr_test_kit/endpoints/mock_authorization/token_endpoint.rb +116 -0
- data/lib/davinci_dtr_test_kit/endpoints/mock_authorization.rb +83 -0
- data/lib/davinci_dtr_test_kit/endpoints/mock_ehr/fhir_get_endpoint.rb +95 -0
- data/lib/davinci_dtr_test_kit/endpoints/mock_ehr/questionnaire_response_endpoint.rb +22 -0
- data/lib/davinci_dtr_test_kit/endpoints/mock_ehr.rb +25 -0
- data/lib/davinci_dtr_test_kit/endpoints/mock_payer/full_ehr_next_question_endpoint.rb +11 -0
- data/lib/davinci_dtr_test_kit/endpoints/mock_payer/full_ehr_questionnaire_package_endpoint.rb +11 -0
- data/lib/davinci_dtr_test_kit/endpoints/mock_payer/next_question_endpoint.rb +162 -0
- data/lib/davinci_dtr_test_kit/endpoints/mock_payer/next_question_proxy_endpoint.rb +36 -0
- data/lib/davinci_dtr_test_kit/endpoints/mock_payer/questionnaire_package_endpoint.rb +62 -0
- data/lib/davinci_dtr_test_kit/endpoints/mock_payer/questionnaire_package_proxy_endpoint.rb +38 -0
- data/lib/davinci_dtr_test_kit/endpoints/mock_payer.rb +36 -0
- data/lib/davinci_dtr_test_kit/fixture_loader.rb +6 -84
- data/lib/davinci_dtr_test_kit/fixtures/dinner_adaptive/dinner_order_adaptive_next_question_burrito.json +10 -2
- data/lib/davinci_dtr_test_kit/fixtures/dinner_adaptive/dinner_order_adaptive_next_question_hamburger.json +10 -2
- data/lib/davinci_dtr_test_kit/fixtures/dinner_adaptive/dinner_order_adaptive_next_question_initial.json +10 -2
- data/lib/davinci_dtr_test_kit/fixtures/dinner_adaptive/questionnaire_dinner_order_adaptive.json +4 -3
- data/lib/davinci_dtr_test_kit/fixtures.rb +64 -46
- data/lib/davinci_dtr_test_kit/payer_server_groups/adaptive_form_libraries_test.rb +2 -2
- data/lib/davinci_dtr_test_kit/payer_server_groups/adaptive_form_questionnaire_expressions_test.rb +4 -3
- data/lib/davinci_dtr_test_kit/payer_server_groups/adaptive_form_questionnaire_extensions_test.rb +3 -2
- data/lib/davinci_dtr_test_kit/payer_server_groups/adaptive_next_questionnaire_expressions_test.rb +8 -8
- data/lib/davinci_dtr_test_kit/payer_server_groups/adaptive_next_questionnaire_extensions_test.rb +6 -5
- data/lib/davinci_dtr_test_kit/payer_server_groups/payer_server_adaptive_group.rb +2 -2
- data/lib/davinci_dtr_test_kit/payer_server_groups/payer_server_adaptive_request_validation_test.rb +2 -1
- data/lib/davinci_dtr_test_kit/payer_server_groups/payer_server_adaptive_response_bundles_validation_test.rb +6 -9
- data/lib/davinci_dtr_test_kit/payer_server_groups/payer_server_adaptive_response_search_validation_test.rb +15 -12
- data/lib/davinci_dtr_test_kit/payer_server_groups/payer_server_adaptive_response_validation_test.rb +33 -22
- data/lib/davinci_dtr_test_kit/payer_server_groups/payer_server_next_request_validation_test.rb +1 -1
- data/lib/davinci_dtr_test_kit/payer_server_groups/payer_server_next_response_complete_test.rb +4 -4
- data/lib/davinci_dtr_test_kit/payer_server_groups/payer_server_next_response_validation_test.rb +16 -12
- data/lib/davinci_dtr_test_kit/payer_server_groups/static_form_libraries_test.rb +2 -2
- data/lib/davinci_dtr_test_kit/payer_server_groups/static_form_questionnaire_expressions_test.rb +5 -4
- data/lib/davinci_dtr_test_kit/payer_server_groups/static_form_questionnaire_extensions_test.rb +4 -3
- data/lib/davinci_dtr_test_kit/payer_server_groups/static_form_request_validation_test.rb +2 -1
- data/lib/davinci_dtr_test_kit/payer_server_groups/static_form_response_validation_test.rb +32 -23
- data/lib/davinci_dtr_test_kit/profiles/communication_request/communication_request_read.rb +29 -0
- data/lib/davinci_dtr_test_kit/profiles/communication_request/communication_request_validation.rb +35 -0
- data/lib/davinci_dtr_test_kit/profiles/communication_request_group.rb +39 -0
- data/lib/davinci_dtr_test_kit/profiles/coverage/coverage_read.rb +29 -0
- data/lib/davinci_dtr_test_kit/profiles/coverage/coverage_validation.rb +35 -0
- data/lib/davinci_dtr_test_kit/profiles/coverage_group.rb +38 -0
- data/lib/davinci_dtr_test_kit/profiles/device_request/device_request_read.rb +29 -0
- data/lib/davinci_dtr_test_kit/profiles/device_request/device_request_validation.rb +35 -0
- data/lib/davinci_dtr_test_kit/profiles/device_request_group.rb +39 -0
- data/lib/davinci_dtr_test_kit/profiles/encounter/encounter_read.rb +29 -0
- data/lib/davinci_dtr_test_kit/profiles/encounter/encounter_validation.rb +35 -0
- data/lib/davinci_dtr_test_kit/profiles/encounter_group.rb +39 -0
- data/lib/davinci_dtr_test_kit/profiles/medication_request/medication_request_read.rb +29 -0
- data/lib/davinci_dtr_test_kit/profiles/medication_request/medication_request_validation.rb +35 -0
- data/lib/davinci_dtr_test_kit/profiles/medication_request_group.rb +39 -0
- data/lib/davinci_dtr_test_kit/profiles/nutrition_order/nutrition_order_read.rb +29 -0
- data/lib/davinci_dtr_test_kit/profiles/nutrition_order/nutrition_order_validation.rb +35 -0
- data/lib/davinci_dtr_test_kit/profiles/nutrition_order_group.rb +39 -0
- data/lib/davinci_dtr_test_kit/profiles/questionnaire_response/questionnaire_response_context_search.rb +35 -0
- data/lib/davinci_dtr_test_kit/profiles/questionnaire_response/questionnaire_response_create.rb +26 -0
- data/lib/davinci_dtr_test_kit/profiles/questionnaire_response/questionnaire_response_patient_search.rb +55 -0
- data/lib/davinci_dtr_test_kit/profiles/questionnaire_response/questionnaire_response_read.rb +22 -0
- data/lib/davinci_dtr_test_kit/profiles/questionnaire_response/questionnaire_response_update.rb +26 -0
- data/lib/davinci_dtr_test_kit/profiles/questionnaire_response/questionnaire_response_validation.rb +37 -0
- data/lib/davinci_dtr_test_kit/profiles/questionnaire_response_group.rb +66 -0
- data/lib/davinci_dtr_test_kit/profiles/service_request/service_request_read.rb +29 -0
- data/lib/davinci_dtr_test_kit/profiles/service_request/service_request_validation.rb +35 -0
- data/lib/davinci_dtr_test_kit/profiles/service_request_group.rb +39 -0
- data/lib/davinci_dtr_test_kit/profiles/task/task_create.rb +26 -0
- data/lib/davinci_dtr_test_kit/profiles/task/task_read.rb +29 -0
- data/lib/davinci_dtr_test_kit/profiles/task/task_update.rb +26 -0
- data/lib/davinci_dtr_test_kit/profiles/task/task_validation.rb +35 -0
- data/lib/davinci_dtr_test_kit/profiles/task_group.rb +52 -0
- data/lib/davinci_dtr_test_kit/profiles/vision_prescription/vision_prescription_read.rb +29 -0
- data/lib/davinci_dtr_test_kit/profiles/vision_prescription/vision_prescription_validation.rb +35 -0
- data/lib/davinci_dtr_test_kit/profiles/vision_prescription_group.rb +39 -0
- data/lib/davinci_dtr_test_kit/read_test.rb +22 -0
- data/lib/davinci_dtr_test_kit/tags.rb +5 -6
- data/lib/davinci_dtr_test_kit/update_test.rb +25 -0
- data/lib/davinci_dtr_test_kit/urls.rb +13 -10
- data/lib/davinci_dtr_test_kit/validation_test.rb +21 -5
- data/lib/davinci_dtr_test_kit/version.rb +1 -1
- data/lib/davinci_dtr_test_kit.rb +1 -1
- metadata +129 -24
- data/lib/davinci_dtr_test_kit/client_groups/dinner_static/dtr_full_ehr_prepopulation_representation_attestation_test.rb +0 -33
- data/lib/davinci_dtr_test_kit/client_groups/resp_assist_device/dtr_full_ehr_questionnaire_workflow_group.rb +0 -19
- data/lib/davinci_dtr_test_kit/ext/inferno_core/record_response_route.rb +0 -98
- data/lib/davinci_dtr_test_kit/ext/inferno_core/request.rb +0 -19
- data/lib/davinci_dtr_test_kit/ext/inferno_core/runnable.rb +0 -35
- data/lib/davinci_dtr_test_kit/mock_auth_server.rb +0 -145
- data/lib/davinci_dtr_test_kit/mock_ehr.rb +0 -97
- data/lib/davinci_dtr_test_kit/mock_payer.rb +0 -123
- /data/lib/davinci_dtr_test_kit/fixtures/{pre_populated_questionnaire_response.json → respiratory_assist_device/pre_populated_questionnaire_response.json} +0 -0
- /data/lib/davinci_dtr_test_kit/fixtures/{questionnaire_package.json → respiratory_assist_device/questionnaire_package.json} +0 -0
@@ -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,11 +1,10 @@
|
|
1
|
-
require_relative 'dtr_full_ehr_launch_attestation_test'
|
2
|
-
require_relative '
|
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 '
|
6
|
-
require_relative '
|
7
|
-
require_relative '
|
8
|
-
require_relative 'dtr_full_ehr_prepopulation_representation_attestation_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'
|
9
8
|
|
10
9
|
module DaVinciDTRTestKit
|
11
10
|
class DTRFullEHRStaticDinnerQuestionnaireWorkflowGroup < Inferno::TestGroup
|
@@ -35,9 +34,9 @@ module DaVinciDTRTestKit
|
|
35
34
|
run_as_group
|
36
35
|
|
37
36
|
# Test 0: attest to launch
|
38
|
-
test from: :
|
37
|
+
test from: :dtr_full_ehr_launch_attestation
|
39
38
|
# Test 1: wait for the $questionnaire-package request
|
40
|
-
test from: :
|
39
|
+
test from: :dtr_full_ehr_questionnaire_package_request
|
41
40
|
# Test 2: validate the $questionnaire-package body
|
42
41
|
test from: :dtr_questionnaire_package_request_validation
|
43
42
|
end
|
@@ -54,28 +53,23 @@ module DaVinciDTRTestKit
|
|
54
53
|
run_as_group
|
55
54
|
|
56
55
|
# Test 1: attest to the pre-population of the name fields
|
57
|
-
test from: :
|
56
|
+
test from: :dtr_full_ehr_prepopulation_attestation
|
58
57
|
# Test 2: attest to the pre-population and edit of the first name field
|
59
|
-
test from: :
|
58
|
+
test from: :dtr_full_ehr_prepopulation_override_attestation
|
60
59
|
# Test 3: attest to the display of the toppings questions only when a dinner answer is selected
|
61
|
-
test from: :
|
60
|
+
test from: :dtr_full_ehr_rendering_enabled_questions_attestation
|
62
61
|
end
|
63
62
|
|
64
|
-
group
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
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
|
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
|
+
}
|
80
74
|
end
|
81
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 :
|
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
|
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 :
|
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
|
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 :
|
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
|
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
|
66
|
-
assert_valid_json(
|
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
|
74
|
-
assert_valid_json(
|
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(
|
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
|
@@ -83,7 +80,7 @@ module DaVinciDTRTestKit
|
|
83
80
|
launch_prompt = if smart_app_launch == 'ehr'
|
84
81
|
%(Launch the DTR SMART App from Inferno by right clicking
|
85
82
|
[this link](#{launch_uri}?iss=#{fhir_base_url}&launch=#{launch_uri})
|
86
|
-
and selecting
|
83
|
+
and selecting "Open in new window" or "Open in new tab".)
|
87
84
|
else
|
88
85
|
%(Launch the SMART App from your EHR.)
|
89
86
|
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 '
|
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
|
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: :
|
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: :
|
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: :
|
63
|
+
test from: :dtr_smart_app_rendering_enabled_questions_attestation
|
66
64
|
end
|
67
65
|
|
68
|
-
group
|
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
|
5
|
+
class DTRFullEHRLaunchAttestationTest < Inferno::Test
|
5
6
|
include URLs
|
6
7
|
|
7
|
-
id :
|
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:
|
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=#{
|
22
|
+
[Click here](#{resume_pass_url}?token=#{random_id}) if the above statement is **true**.
|
22
23
|
|
23
|
-
[Click here](#{resume_fail_url}?token=#{
|
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
|
5
|
+
class DTRFullEHRPrepopulationAttestationTest < Inferno::Test
|
5
6
|
include URLs
|
6
7
|
|
7
|
-
id :
|
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:
|
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=#{
|
23
|
+
[Click here](#{resume_pass_url}?token=#{random_id}) if the above statement is **true**.
|
24
24
|
|
25
|
-
[Click here](#{resume_fail_url}?token=#{
|
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
|
5
|
+
class DTRFullEHRPrepopulationOverrideAttestationTest < Inferno::Test
|
5
6
|
include URLs
|
6
7
|
|
7
|
-
id :
|
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:
|
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=#{
|
20
|
+
[Click here](#{resume_pass_url}?token=#{random_id}) if the above statement is **true**.
|
21
21
|
|
22
|
-
[Click here](#{resume_fail_url}?token=#{
|
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
|
4
|
+
class DTRFullEHRQuestionnairePackageRequestTest < Inferno::Test
|
6
5
|
include URLs
|
7
6
|
|
8
|
-
id :
|
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
|
@@ -0,0 +1,19 @@
|
|
1
|
+
require_relative '../../dtr_questionnaire_response_validation'
|
2
|
+
|
3
|
+
module DaVinciDTRTestKit
|
4
|
+
class DTRFullEHRQuestionnaireResponseConformanceTest < Inferno::Test
|
5
|
+
include DTRQuestionnaireResponseValidation
|
6
|
+
|
7
|
+
id :dtr_full_ehr_questionnaire_response_conformance
|
8
|
+
title 'QuestionnaireResponse is conformant'
|
9
|
+
|
10
|
+
def profile_url
|
11
|
+
config.options[:qr_profile_url]
|
12
|
+
end
|
13
|
+
|
14
|
+
run do
|
15
|
+
skip_if questionnaire_response.nil?, 'Completed QuestionnaireResponse input was blank'
|
16
|
+
verify_basic_conformance(questionnaire_response, profile_url)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
require_relative '../../dtr_questionnaire_response_validation'
|
2
|
+
|
3
|
+
module DaVinciDTRTestKit
|
4
|
+
class DTRFullEHRQuestionnaireResponseCorrectnessTest < Inferno::Test
|
5
|
+
include DTRQuestionnaireResponseValidation
|
6
|
+
|
7
|
+
id :dtr_full_ehr_questionnaire_response_correctness
|
8
|
+
title 'QuestionnaireResponse is correct for the workflow'
|
9
|
+
description %(
|
10
|
+
The QuestionnaireResponse aligns with the following expectations for the workflow. This includes checks for
|
11
|
+
the presence of the following answers and their appropriate origin source extensions:
|
12
|
+
|
13
|
+
- `PBD.1` (Last Name) and `LOC.1` (Location): `auto`
|
14
|
+
- PBD.2 (First Name): `override`
|
15
|
+
- `3` (all nested dinner questions): `manual`
|
16
|
+
)
|
17
|
+
|
18
|
+
run do
|
19
|
+
skip_if questionnaire_response.nil?, 'Completed QuestionnaireResponse input was blank'
|
20
|
+
check_is_questionnaire_response(questionnaire_response)
|
21
|
+
|
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')
|
31
|
+
check_origin_sources(questionnaire.item, qr.item, expected_overrides: ['PBD.2'])
|
32
|
+
required_link_ids = extract_required_link_ids(questionnaire.item)
|
33
|
+
check_answer_presence(qr.item, required_link_ids)
|
34
|
+
assert(messages.none? { |m| m[:type] == 'error' }, 'QuestionnaireResponse is not correct, see error message(s)')
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
@@ -1,28 +1,28 @@
|
|
1
|
+
require 'securerandom'
|
1
2
|
require_relative '../../urls'
|
2
3
|
|
3
4
|
module DaVinciDTRTestKit
|
4
|
-
class
|
5
|
+
class DTRFullEHRRenderingEnabledQuestionsAttestationTest < Inferno::Test
|
5
6
|
include URLs
|
6
7
|
|
7
|
-
id :
|
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:
|
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=#{
|
23
|
+
[Click here](#{resume_pass_url}?token=#{random_id}) if the above statement is **true**.
|
24
24
|
|
25
|
-
[Click here](#{resume_fail_url}?token=#{
|
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
|
5
|
+
class DTRFullEHRStoreAttestationTest < Inferno::Test
|
5
6
|
include URLs
|
6
7
|
|
7
|
-
id :
|
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:
|
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=#{
|
22
|
+
[Click here](#{resume_pass_url}?token=#{random_id}) if the above statement is **true**.
|
23
23
|
|
24
|
-
[Click here](#{resume_fail_url}?token=#{
|
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
|
-
|
11
|
-
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:
|
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}?
|
26
|
+
[Click here](#{resume_pass_url}?token=#{token}) if the above statement is **true**.
|
26
27
|
|
27
|
-
[Click here](#{resume_fail_url}?
|
28
|
+
[Click here](#{resume_fail_url}?token=#{token}) if the above statement is **false**.
|
28
29
|
)
|
29
30
|
)
|
30
31
|
end
|