davinci_dtr_test_kit 0.11.1 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/davinci_dtr_test_kit/auth_groups/token_request_test.rb +1 -1
- data/lib/davinci_dtr_test_kit/client_groups/dinner_static/dtr_full_ehr_dinner_questionnaire_package_request_test.rb +52 -0
- data/lib/davinci_dtr_test_kit/client_groups/dinner_static/dtr_full_ehr_dinner_static_questionnaire_response_conformance_test.rb +15 -0
- data/lib/davinci_dtr_test_kit/client_groups/dinner_static/dtr_full_ehr_dinner_static_questionnaire_response_correctness_test.rb +30 -0
- data/lib/davinci_dtr_test_kit/client_groups/dinner_static/dtr_full_ehr_launch_attestation_test.rb +28 -0
- data/lib/davinci_dtr_test_kit/client_groups/dinner_static/dtr_full_ehr_prepopulation_attestation_test.rb +30 -0
- data/lib/davinci_dtr_test_kit/client_groups/dinner_static/dtr_full_ehr_prepopulation_override_attestation_test.rb +27 -0
- data/lib/davinci_dtr_test_kit/client_groups/dinner_static/dtr_full_ehr_questionnaire_workflow_group.rb +91 -0
- data/lib/davinci_dtr_test_kit/client_groups/dinner_static/dtr_full_ehr_rendering_enabled_questions_attestation_test.rb +30 -0
- data/lib/davinci_dtr_test_kit/client_groups/dinner_static/dtr_full_ehr_store_attestation_test.rb +29 -0
- data/lib/davinci_dtr_test_kit/client_groups/dinner_static/{dtr_dinner_questionnaire_package_request_test.rb → dtr_smart_app_dinner_questionnaire_package_request_test.rb} +5 -5
- data/lib/davinci_dtr_test_kit/client_groups/dinner_static/{prepopulation_attestation_test.rb → dtr_smart_app_prepopulation_attestation_test.rb} +2 -2
- data/lib/davinci_dtr_test_kit/client_groups/dinner_static/{prepopulation_override_attestation_test.rb → dtr_smart_app_prepopulation_override_attestation_test.rb} +2 -2
- data/lib/davinci_dtr_test_kit/client_groups/dinner_static/{dtr_questionnaire_response_save_test.rb → dtr_smart_app_questionnaire_response_save_test.rb} +2 -2
- data/lib/davinci_dtr_test_kit/client_groups/dinner_static/dtr_smart_app_questionnaire_workflow_group.rb +13 -13
- data/lib/davinci_dtr_test_kit/client_groups/dinner_static/{rendering_enabled_questions_attestation_test.rb → dtr_smart_app_rendering_enabled_questions_attestation_test.rb} +2 -2
- data/lib/davinci_dtr_test_kit/client_groups/shared/dtr_questionnaire_package_request_validation_test.rb +1 -1
- data/lib/davinci_dtr_test_kit/client_groups/shared/dtr_questionnaire_response_basic_conformance_test.rb +3 -7
- data/lib/davinci_dtr_test_kit/client_groups/shared/dtr_questionnaire_response_pre_population_test.rb +9 -5
- data/lib/davinci_dtr_test_kit/cql_test.rb +182 -137
- data/lib/davinci_dtr_test_kit/docs/dtr_full_ehr_suite_description_v201.md +127 -0
- data/lib/davinci_dtr_test_kit/docs/dtr_light_ehr_suite_description_v201.md +29 -0
- data/lib/davinci_dtr_test_kit/dtr_full_ehr_suite.rb +4 -12
- data/lib/davinci_dtr_test_kit/dtr_light_ehr_suite.rb +38 -25
- data/lib/davinci_dtr_test_kit/dtr_options.rb +7 -0
- data/lib/davinci_dtr_test_kit/dtr_questionnaire_response_validation.rb +118 -75
- data/lib/davinci_dtr_test_kit/dtr_smart_app_suite.rb +6 -3
- data/lib/davinci_dtr_test_kit/fixture_loader.rb +6 -84
- data/lib/davinci_dtr_test_kit/fixtures.rb +43 -48
- data/lib/davinci_dtr_test_kit/mock_auth_server.rb +101 -18
- data/lib/davinci_dtr_test_kit/mock_ehr.rb +32 -24
- data/lib/davinci_dtr_test_kit/mock_payer.rb +41 -64
- data/lib/davinci_dtr_test_kit/payer_server_groups/adaptive_next_questionnaire_expressions_test.rb +2 -2
- data/lib/davinci_dtr_test_kit/payer_server_groups/payer_server_adaptive_request_validation_test.rb +11 -19
- data/lib/davinci_dtr_test_kit/payer_server_groups/payer_server_adaptive_response_bundles_validation_test.rb +6 -6
- data/lib/davinci_dtr_test_kit/payer_server_groups/payer_server_adaptive_response_search_validation_test.rb +6 -6
- data/lib/davinci_dtr_test_kit/payer_server_groups/payer_server_adaptive_response_validation_test.rb +17 -18
- data/lib/davinci_dtr_test_kit/payer_server_groups/payer_server_next_request_validation_test.rb +6 -7
- data/lib/davinci_dtr_test_kit/payer_server_groups/payer_server_next_response_validation_test.rb +3 -1
- data/lib/davinci_dtr_test_kit/payer_server_groups/static_form_request_validation_test.rb +10 -21
- data/lib/davinci_dtr_test_kit/payer_server_groups/static_form_response_validation_test.rb +7 -13
- data/lib/davinci_dtr_test_kit/tags.rb +1 -0
- data/lib/davinci_dtr_test_kit/urls.rb +13 -10
- data/lib/davinci_dtr_test_kit/validation_test.rb +8 -9
- data/lib/davinci_dtr_test_kit/version.rb +1 -1
- data/lib/davinci_dtr_test_kit.rb +2 -2
- metadata +37 -12
- 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/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
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 0a072f135a4057afa53b8836a3436fab457fc8c1ab15199e19608732b16d16cb
|
|
4
|
+
data.tar.gz: e4942f1af9755743eab89b7a0cc8b559929ad8b4be4bed00e7e1a33b4de1b0bd
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: aae323b007b88a564283b1fc946490e3c2330d6b3081de4783c0611c25afd732327e631d7e782743bab1fe1cab797dad84bcd9403accedcdb21f464278d05f0f
|
|
7
|
+
data.tar.gz: e68f011efaa3f0785d94c7a1f683a9986474dc887f3b99492b62ccdaf5f3ecb92387be39c909872a6f6448dfc6cb8dc1520de971557d8325cf725b3fe6853771
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
require 'base64'
|
|
2
|
+
require_relative '../../urls'
|
|
3
|
+
|
|
4
|
+
module DaVinciDTRTestKit
|
|
5
|
+
class DTRFullEHRDinnerQuestionnairePackageRequestTest < Inferno::Test
|
|
6
|
+
include URLs
|
|
7
|
+
|
|
8
|
+
id :dtr_full_ehr_dinner_questionnaire_package_request
|
|
9
|
+
title 'Invoke the DTR Questionnaire Package operation'
|
|
10
|
+
description %(
|
|
11
|
+
Inferno will wait for a DTR questionnaire package request from the client. Upon receipt, Inferno will generate and
|
|
12
|
+
send a response.
|
|
13
|
+
)
|
|
14
|
+
|
|
15
|
+
input :access_token,
|
|
16
|
+
description: %(
|
|
17
|
+
`Bearer` token that the client under test will send in the
|
|
18
|
+
`Authorization` header of each HTTP request to Inferno. Inferno
|
|
19
|
+
will look for this value to associate requests with this session.
|
|
20
|
+
)
|
|
21
|
+
|
|
22
|
+
run do
|
|
23
|
+
wait(
|
|
24
|
+
identifier: access_token,
|
|
25
|
+
message: %(
|
|
26
|
+
### Questionnaire Package
|
|
27
|
+
|
|
28
|
+
Inferno will wait for the Full EHR to invoke the DTR Questionnaire Package operation by sending a POST
|
|
29
|
+
request to
|
|
30
|
+
|
|
31
|
+
`#{questionnaire_package_url}`
|
|
32
|
+
|
|
33
|
+
A questionnaire package generated by Inferno will be returned.
|
|
34
|
+
|
|
35
|
+
### Request Identification
|
|
36
|
+
|
|
37
|
+
In order to identify requests for this session, Inferno will look for
|
|
38
|
+
an `Authorization` header with value:
|
|
39
|
+
|
|
40
|
+
```
|
|
41
|
+
Bearer #{access_token}
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### Continuing the Tests
|
|
45
|
+
|
|
46
|
+
When the DTR application has finished loading the Questionnaire
|
|
47
|
+
[Click here](#{resume_pass_url}?token=#{access_token}) to continue.
|
|
48
|
+
)
|
|
49
|
+
)
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
end
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
require_relative '../../dtr_questionnaire_response_validation'
|
|
2
|
+
|
|
3
|
+
module DaVinciDTRTestKit
|
|
4
|
+
class DTRFullEHRDinnerStaticQuestionnaireResponseConformanceTest < Inferno::Test
|
|
5
|
+
include DTRQuestionnaireResponseValidation
|
|
6
|
+
|
|
7
|
+
id :dtr_full_ehr_dinner_static_questionnaire_response_conformance
|
|
8
|
+
title 'QuestionnaireResponse is conformant'
|
|
9
|
+
|
|
10
|
+
run do
|
|
11
|
+
skip_if questionnaire_response.nil?, 'Completed QuestionnaireResponse input was blank'
|
|
12
|
+
verify_basic_conformance(questionnaire_response)
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
require_relative '../../dtr_questionnaire_response_validation'
|
|
2
|
+
|
|
3
|
+
module DaVinciDTRTestKit
|
|
4
|
+
class DTRFullEHRDinnerStaticQuestionnaireResponseCorrectnessTest < Inferno::Test
|
|
5
|
+
include DTRQuestionnaireResponseValidation
|
|
6
|
+
|
|
7
|
+
id :dtr_full_ehr_dinner_static_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): `auto`
|
|
14
|
+
- PBD.2 (First Name): `override`
|
|
15
|
+
- 3.1 (dinner choice): `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
|
+
questionnaire = Fixtures.questionnaire_for_test(id)
|
|
23
|
+
# questionnaire = Fixtures.find_questionnaire('DinnerOrderStatic')
|
|
24
|
+
qr = FHIR.from_contents(questionnaire_response)
|
|
25
|
+
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'])
|
|
27
|
+
assert(messages.none? { |m| m[:type] == 'error' }, 'QuestionnaireResponse is not correct, see error message(s)')
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
data/lib/davinci_dtr_test_kit/client_groups/dinner_static/dtr_full_ehr_launch_attestation_test.rb
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
require_relative '../../urls'
|
|
2
|
+
|
|
3
|
+
module DaVinciDTRTestKit
|
|
4
|
+
class DTRFullEHRStaticDinnerLaunchAttestationTest < Inferno::Test
|
|
5
|
+
include URLs
|
|
6
|
+
|
|
7
|
+
id :dtr_full_ehr_dinner_static_launch_attestation
|
|
8
|
+
title 'Launch DTR for a patient that has an official name (Attestation)'
|
|
9
|
+
description %(
|
|
10
|
+
Attest that DTR has been launched for a patient with data that will be used for prepopulation.
|
|
11
|
+
)
|
|
12
|
+
input :access_token
|
|
13
|
+
|
|
14
|
+
run do
|
|
15
|
+
wait(
|
|
16
|
+
identifier: access_token,
|
|
17
|
+
message: %(
|
|
18
|
+
I attest that DTR has been launched in the context of a patient with an official name, including
|
|
19
|
+
first and last.
|
|
20
|
+
|
|
21
|
+
[Click here](#{resume_pass_url}?token=#{access_token}) if the above statement is **true**.
|
|
22
|
+
|
|
23
|
+
[Click here](#{resume_fail_url}?token=#{access_token}) if the above statement is **false**.
|
|
24
|
+
)
|
|
25
|
+
)
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
require_relative '../../urls'
|
|
2
|
+
|
|
3
|
+
module DaVinciDTRTestKit
|
|
4
|
+
class DTRFullEHRStaticDinnerPrepopulationAttestationTest < Inferno::Test
|
|
5
|
+
include URLs
|
|
6
|
+
|
|
7
|
+
id :dtr_full_ehr_dinner_static_rendering_prepopulation_attestation
|
|
8
|
+
title 'Check that the client pre-populates the questionnaire (Attestation)'
|
|
9
|
+
description %(
|
|
10
|
+
Validate that pre-population of patient name information occurs as expected.
|
|
11
|
+
)
|
|
12
|
+
input :access_token
|
|
13
|
+
|
|
14
|
+
run do
|
|
15
|
+
wait(
|
|
16
|
+
identifier: access_token,
|
|
17
|
+
message: %(
|
|
18
|
+
I attest that the DTR application pre-populates the following questions with the respective
|
|
19
|
+
value for the official name of the patient:
|
|
20
|
+
- Last Name
|
|
21
|
+
- First Name
|
|
22
|
+
|
|
23
|
+
[Click here](#{resume_pass_url}?token=#{access_token}) if the above statement is **true**.
|
|
24
|
+
|
|
25
|
+
[Click here](#{resume_fail_url}?token=#{access_token}) if the above statement is **false**.
|
|
26
|
+
)
|
|
27
|
+
)
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
require_relative '../../urls'
|
|
2
|
+
|
|
3
|
+
module DaVinciDTRTestKit
|
|
4
|
+
class DTRFullEHRStaticDinnerPrepopulationOverrideAttestationTest < Inferno::Test
|
|
5
|
+
include URLs
|
|
6
|
+
|
|
7
|
+
id :dtr_full_ehr_dinner_static_prepopulation_override_attestation
|
|
8
|
+
title 'Validate the user can override pre-populated data (Attestation)'
|
|
9
|
+
description %(
|
|
10
|
+
Validate that the user can edit a pre-populated item and replace it with another value.
|
|
11
|
+
)
|
|
12
|
+
input :access_token
|
|
13
|
+
|
|
14
|
+
run do
|
|
15
|
+
wait(
|
|
16
|
+
identifier: access_token,
|
|
17
|
+
message: %(
|
|
18
|
+
I attest that I have changed the prepopulated value in the First Name field to a new value.
|
|
19
|
+
|
|
20
|
+
[Click here](#{resume_pass_url}?token=#{access_token}) if the above statement is **true**.
|
|
21
|
+
|
|
22
|
+
[Click here](#{resume_fail_url}?token=#{access_token}) if the above statement is **false**.
|
|
23
|
+
)
|
|
24
|
+
)
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
require_relative 'dtr_full_ehr_launch_attestation_test'
|
|
2
|
+
require_relative 'dtr_full_ehr_dinner_questionnaire_package_request_test'
|
|
3
|
+
require_relative '../shared/dtr_questionnaire_package_request_validation_test'
|
|
4
|
+
require_relative 'dtr_full_ehr_prepopulation_attestation_test'
|
|
5
|
+
require_relative 'dtr_full_ehr_prepopulation_override_attestation_test'
|
|
6
|
+
require_relative 'dtr_full_ehr_rendering_enabled_questions_attestation_test'
|
|
7
|
+
require_relative 'dtr_full_ehr_store_attestation_test'
|
|
8
|
+
require_relative 'dtr_full_ehr_dinner_static_questionnaire_response_conformance_test'
|
|
9
|
+
require_relative 'dtr_full_ehr_dinner_static_questionnaire_response_correctness_test'
|
|
10
|
+
|
|
11
|
+
module DaVinciDTRTestKit
|
|
12
|
+
class DTRFullEHRStaticDinnerQuestionnaireWorkflowGroup < Inferno::TestGroup
|
|
13
|
+
id :dtr_full_ehr_static_dinner_questionnaire_workflow
|
|
14
|
+
title 'Static Questionnaire Workflow'
|
|
15
|
+
description %(
|
|
16
|
+
This test validates that a DTR Full EHR client can perform a full DTR Static Questionnaire workflow
|
|
17
|
+
using a mocked questionnaire requesting what a patient wants for dinner. The client system must
|
|
18
|
+
demonstrate its ability to:
|
|
19
|
+
|
|
20
|
+
1. Fetch the static questionnaire package
|
|
21
|
+
([DinnerOrderStatic](https://github.com/inferno-framework/davinci-dtr-test-kit/blob/main/lib/davinci_dtr_test_kit/fixtures/dinner_static/questionnaire_dinner_order_static.json))
|
|
22
|
+
2. Render and pre-populate the questionnaire appropriately, including:
|
|
23
|
+
- pre-populate data as directed by the questionnaire
|
|
24
|
+
- display questions only when they are enabled by other answers
|
|
25
|
+
3. Complete and store the questionnaire response for future use.
|
|
26
|
+
)
|
|
27
|
+
|
|
28
|
+
group do
|
|
29
|
+
id :dtr_full_ehr_static_questionnaire_retrieval
|
|
30
|
+
title 'Retrieving the Static Questionnaire'
|
|
31
|
+
description %(
|
|
32
|
+
After DTR launch, Inferno will wait for the client system to request a questionnaire using the
|
|
33
|
+
$questionnaire-package operation and will return a static questionnaire for the
|
|
34
|
+
tester to complete. Inferno will then validate the the conformance of the request.
|
|
35
|
+
)
|
|
36
|
+
run_as_group
|
|
37
|
+
|
|
38
|
+
# Test 0: attest to launch
|
|
39
|
+
test from: :dtr_full_ehr_dinner_static_launch_attestation
|
|
40
|
+
# Test 1: wait for the $questionnaire-package request
|
|
41
|
+
test from: :dtr_full_ehr_dinner_questionnaire_package_request
|
|
42
|
+
# Test 2: validate the $questionnaire-package body
|
|
43
|
+
test from: :dtr_questionnaire_package_request_validation
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
group do
|
|
47
|
+
id :dtr_full_ehr_static_questionnaire_rendering
|
|
48
|
+
title 'Filling Out the Static Questionnaire'
|
|
49
|
+
description %(
|
|
50
|
+
The tester will interact with the questionnaire within their client system
|
|
51
|
+
such that pre-population steps are taken, the qustionnaire is rendered, and
|
|
52
|
+
they are able to fill it out. The tester will attest that questionnaire pre-population
|
|
53
|
+
and rendering directives were followed.
|
|
54
|
+
)
|
|
55
|
+
run_as_group
|
|
56
|
+
|
|
57
|
+
# Test 1: attest to the pre-population of the name fields
|
|
58
|
+
test from: :dtr_full_ehr_dinner_static_rendering_prepopulation_attestation
|
|
59
|
+
# 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
|
|
61
|
+
# 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
|
|
63
|
+
end
|
|
64
|
+
|
|
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
|
|
90
|
+
end
|
|
91
|
+
end
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
require_relative '../../urls'
|
|
2
|
+
|
|
3
|
+
module DaVinciDTRTestKit
|
|
4
|
+
class DTRFullEHRStaticDinnerRenderingAttestationTest < Inferno::Test
|
|
5
|
+
include URLs
|
|
6
|
+
|
|
7
|
+
id :dtr_full_ehr_dinner_static_rendering_enabledQs_attestation
|
|
8
|
+
title 'Check that the client renders enabled questions appropriately (Attestation)'
|
|
9
|
+
description %(
|
|
10
|
+
Validate that the rendering of the questionnaire includes only the "What would you like on..."
|
|
11
|
+
question appropriate for the dinner selection, if made.
|
|
12
|
+
)
|
|
13
|
+
input :access_token
|
|
14
|
+
|
|
15
|
+
run do
|
|
16
|
+
wait(
|
|
17
|
+
identifier: access_token,
|
|
18
|
+
message: %(
|
|
19
|
+
I attest that the client application does not display any "What would you like on..."
|
|
20
|
+
questions until I have selected a dinner choice and then only displays the
|
|
21
|
+
"What would you like on..." question relevant for the dinner request:
|
|
22
|
+
|
|
23
|
+
[Click here](#{resume_pass_url}?token=#{access_token}) if the above statement is **true**.
|
|
24
|
+
|
|
25
|
+
[Click here](#{resume_fail_url}?token=#{access_token}) if the above statement is **false**.
|
|
26
|
+
)
|
|
27
|
+
)
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
data/lib/davinci_dtr_test_kit/client_groups/dinner_static/dtr_full_ehr_store_attestation_test.rb
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
require_relative '../../urls'
|
|
2
|
+
|
|
3
|
+
module DaVinciDTRTestKit
|
|
4
|
+
class DTRFullEHRStaticDinnerStoreAttestationTest < Inferno::Test
|
|
5
|
+
include URLs
|
|
6
|
+
|
|
7
|
+
id :dtr_full_ehr_dinner_static_store_attestation
|
|
8
|
+
title 'Complete and Store the QuestionnaireResponse (Attestation)'
|
|
9
|
+
description %(
|
|
10
|
+
Attest that the questionnaire has been completed and the response has been persisted
|
|
11
|
+
and can be exported as a FHIR QuestionnaireResponse instance.
|
|
12
|
+
)
|
|
13
|
+
input :access_token
|
|
14
|
+
|
|
15
|
+
run do
|
|
16
|
+
wait(
|
|
17
|
+
identifier: access_token,
|
|
18
|
+
message: %(
|
|
19
|
+
I attest that the questionnaire has been completed and stored within the EHR for future
|
|
20
|
+
use and export as a FHIR QuestionnaireResponse instance.
|
|
21
|
+
|
|
22
|
+
[Click here](#{resume_pass_url}?token=#{access_token}) if the above statement is **true**.
|
|
23
|
+
|
|
24
|
+
[Click here](#{resume_fail_url}?token=#{access_token}) if the above statement is **false**.
|
|
25
|
+
)
|
|
26
|
+
)
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
|
@@ -2,10 +2,10 @@ require 'base64'
|
|
|
2
2
|
require_relative '../../urls'
|
|
3
3
|
|
|
4
4
|
module DaVinciDTRTestKit
|
|
5
|
-
class
|
|
5
|
+
class DTRSmartAppDinnerQuestionnairePackageRequestTest < Inferno::Test
|
|
6
6
|
include URLs
|
|
7
7
|
|
|
8
|
-
id :
|
|
8
|
+
id :dtr_smart_app_dinner_questionnaire_package_request
|
|
9
9
|
title 'Invoke the DTR Questionnaire Package operation'
|
|
10
10
|
description %(
|
|
11
11
|
Inferno will wait for a DTR questionnaire package request from the client. Upon receipt, Inferno will generate and
|
|
@@ -49,7 +49,7 @@ module DaVinciDTRTestKit
|
|
|
49
49
|
Resources available from the EHR needed to drive the dinner static workflow.
|
|
50
50
|
Formatted as a FHIR bundle that contains resources, each with an `id` property populated. Each
|
|
51
51
|
instance present will be available for retrieval from Inferno at the endpoint:
|
|
52
|
-
|
|
52
|
+
|
|
53
53
|
```
|
|
54
54
|
[fhir-base]/[resource type]/[instance id]
|
|
55
55
|
```
|
|
@@ -83,7 +83,7 @@ module DaVinciDTRTestKit
|
|
|
83
83
|
launch_prompt = if smart_app_launch == 'ehr'
|
|
84
84
|
%(Launch the DTR SMART App from Inferno by right clicking
|
|
85
85
|
[this link](#{launch_uri}?iss=#{fhir_base_url}&launch=#{launch_uri})
|
|
86
|
-
and selecting
|
|
86
|
+
and selecting "Open in new window" or "Open in new tab".)
|
|
87
87
|
else
|
|
88
88
|
%(Launch the SMART App from your EHR.)
|
|
89
89
|
end
|
|
@@ -119,7 +119,7 @@ module DaVinciDTRTestKit
|
|
|
119
119
|
an `Authorization` header with value:
|
|
120
120
|
|
|
121
121
|
```
|
|
122
|
-
Bearer
|
|
122
|
+
Bearer eyJhbGciOiJub25lIn0.#{example_client_jwt_payload_part}.
|
|
123
123
|
```
|
|
124
124
|
|
|
125
125
|
### Continuing the Tests
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
require_relative '../../urls'
|
|
2
2
|
|
|
3
3
|
module DaVinciDTRTestKit
|
|
4
|
-
class
|
|
4
|
+
class DTRSmartAppStaticDinnerPrepopulationAttestationTest < Inferno::Test
|
|
5
5
|
include URLs
|
|
6
6
|
|
|
7
|
-
id :
|
|
7
|
+
id :dtr_smart_app_dinner_static_rendering_prepopulation_attestation
|
|
8
8
|
title 'Check that the client pre-populates the questionnaire (Attestation)'
|
|
9
9
|
description %(
|
|
10
10
|
Validate that pre-population of patient name information occurs as expected.
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
require_relative '../../urls'
|
|
2
2
|
|
|
3
3
|
module DaVinciDTRTestKit
|
|
4
|
-
class
|
|
4
|
+
class DTRSmartAppStaticDinnerPrepopulationOverrideAttestationTest < Inferno::Test
|
|
5
5
|
include URLs
|
|
6
6
|
|
|
7
|
-
id :
|
|
7
|
+
id :dtr_smart_app_dinner_static_prepopulation_override_attestation
|
|
8
8
|
title 'Validate the user can override pre-populated data (Attestation)'
|
|
9
9
|
description %(
|
|
10
10
|
Validate that the user can edit a pre-populated item and replace it with another value.
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
require_relative '../../urls'
|
|
2
2
|
|
|
3
3
|
module DaVinciDTRTestKit
|
|
4
|
-
class
|
|
4
|
+
class DTRSmartAppStaticDinnerQuestionnaireResponseSaveTest < Inferno::Test
|
|
5
5
|
include URLs
|
|
6
6
|
|
|
7
|
-
id :
|
|
7
|
+
id :dtr_smart_app_static_dinner_questionnaire_response_save
|
|
8
8
|
title 'Save the QuestionnaireResponse after completing it'
|
|
9
9
|
description %(
|
|
10
10
|
Inferno, acting as the EHR, will wait for a request to save the QuestionnaireResponse from the client.
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
require_relative '
|
|
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 '
|
|
4
|
-
require_relative '
|
|
5
|
-
require_relative '
|
|
6
|
-
require_relative '
|
|
3
|
+
require_relative 'dtr_smart_app_prepopulation_attestation_test'
|
|
4
|
+
require_relative 'dtr_smart_app_prepopulation_override_attestation_test'
|
|
5
|
+
require_relative 'dtr_smart_app_rendering_enabled_questions_attestation_test'
|
|
6
|
+
require_relative 'dtr_smart_app_questionnaire_response_save_test'
|
|
7
7
|
require_relative '../shared/dtr_questionnaire_response_basic_conformance_test'
|
|
8
8
|
require_relative '../shared/dtr_questionnaire_response_pre_population_test'
|
|
9
9
|
|
|
@@ -27,7 +27,7 @@ module DaVinciDTRTestKit
|
|
|
27
27
|
)
|
|
28
28
|
|
|
29
29
|
group do
|
|
30
|
-
id :
|
|
30
|
+
id :dtr_smart_app_static_questionnaire_retrieval
|
|
31
31
|
title 'Retrieving the Static Questionnaire'
|
|
32
32
|
description %(
|
|
33
33
|
Inferno will wait for the client system to request a questionnaire using the
|
|
@@ -37,13 +37,13 @@ module DaVinciDTRTestKit
|
|
|
37
37
|
run_as_group
|
|
38
38
|
|
|
39
39
|
# Test 1: wait for the $questionnaire-package request
|
|
40
|
-
test from: :
|
|
40
|
+
test from: :dtr_smart_app_dinner_questionnaire_package_request
|
|
41
41
|
# Test 2: validate the $questionnaire-package body
|
|
42
42
|
test from: :dtr_questionnaire_package_request_validation
|
|
43
43
|
end
|
|
44
44
|
|
|
45
45
|
group do
|
|
46
|
-
id :
|
|
46
|
+
id :dtr_smart_app_static_questionnaire_rendering
|
|
47
47
|
title 'Filling Out the Static Questionnaire'
|
|
48
48
|
description %(
|
|
49
49
|
The tester will interact with the questionnaire within their client system
|
|
@@ -58,15 +58,15 @@ module DaVinciDTRTestKit
|
|
|
58
58
|
# since the questionnaire asks them to
|
|
59
59
|
# TODO: once Tom has gotten the reference server hooked up
|
|
60
60
|
# Test 2: attest to the pre-population of the name fields
|
|
61
|
-
test from: :
|
|
61
|
+
test from: :dtr_smart_app_dinner_static_rendering_prepopulation_attestation
|
|
62
62
|
# Test 3: attest to the pre-population and edit of the location field
|
|
63
|
-
test from: :
|
|
63
|
+
test from: :dtr_smart_app_dinner_static_prepopulation_override_attestation
|
|
64
64
|
# Test 4: attest to the display of the toppings questions only when a dinner answer is selected
|
|
65
|
-
test from: :
|
|
65
|
+
test from: :dtr_smart_app_dinner_static_rendering_enabledQs_attestation
|
|
66
66
|
end
|
|
67
67
|
|
|
68
68
|
group do
|
|
69
|
-
id :
|
|
69
|
+
id :dtr_smart_app_static_questionnaire_response
|
|
70
70
|
title 'Saving the QuestionnaireResponse'
|
|
71
71
|
description %(
|
|
72
72
|
The tester will complete the questionnaire such that a QuestionnaireResponse is stored
|
|
@@ -77,7 +77,7 @@ module DaVinciDTRTestKit
|
|
|
77
77
|
run_as_group
|
|
78
78
|
|
|
79
79
|
# Test 1: wait for a QuestionnaireResponse
|
|
80
|
-
test from: :
|
|
80
|
+
test from: :dtr_smart_app_static_dinner_questionnaire_response_save,
|
|
81
81
|
receives_request: :questionnaire_response_save
|
|
82
82
|
# Test 2: validate basic conformance of the QuestionnaireResponse
|
|
83
83
|
test from: :dtr_questionnaire_response_basic_conformance,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
require_relative '../../urls'
|
|
2
2
|
|
|
3
3
|
module DaVinciDTRTestKit
|
|
4
|
-
class
|
|
4
|
+
class DTRSmartAppStaticDinnerRenderingAttestationTest < Inferno::Test
|
|
5
5
|
include URLs
|
|
6
6
|
|
|
7
|
-
id :
|
|
7
|
+
id :dtr_smart_app_dinner_static_rendering_enabledQs_attestation
|
|
8
8
|
title 'Check that the client renders enabled questions appropriately (Attestation)'
|
|
9
9
|
description %(
|
|
10
10
|
Validate that the rendering of the questionnaire includes only the "What would you like on..."
|
|
@@ -29,7 +29,7 @@ module DaVinciDTRTestKit
|
|
|
29
29
|
assert input_params.present?, 'Request does not contain a recognized FHIR object'
|
|
30
30
|
assert_resource_type(:parameters, resource: input_params)
|
|
31
31
|
assert_valid_resource(resource: input_params,
|
|
32
|
-
profile_url: 'http://hl7.org/fhir/us/davinci-dtr/StructureDefinition/dtr-qpackage-input-parameters')
|
|
32
|
+
profile_url: 'http://hl7.org/fhir/us/davinci-dtr/StructureDefinition/dtr-qpackage-input-parameters|2.0.1')
|
|
33
33
|
end
|
|
34
34
|
end
|
|
35
35
|
end
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
require_relative '../../urls'
|
|
2
|
+
require_relative '../../dtr_questionnaire_response_validation'
|
|
2
3
|
|
|
3
4
|
module DaVinciDTRTestKit
|
|
4
5
|
class DTRQuestionnaireResponseBasicConformanceTest < Inferno::Test
|
|
5
6
|
include URLs
|
|
7
|
+
include DTRQuestionnaireResponseValidation
|
|
6
8
|
|
|
7
9
|
id :dtr_questionnaire_response_basic_conformance
|
|
8
10
|
title 'QuestionnaireResponse is conformant'
|
|
@@ -16,13 +18,7 @@ module DaVinciDTRTestKit
|
|
|
16
18
|
assert request.url == questionnaire_response_url,
|
|
17
19
|
"Request made to wrong URL: #{request.url}. Should instead be to #{questionnaire_response_url}"
|
|
18
20
|
|
|
19
|
-
|
|
20
|
-
questionnaire_response = FHIR.from_contents(request.request_body)
|
|
21
|
-
assert questionnaire_response.present?, 'Request does not contain a recognized FHIR object'
|
|
22
|
-
assert_resource_type(:questionnaire_response, resource: questionnaire_response)
|
|
23
|
-
|
|
24
|
-
assert_valid_resource(resource: questionnaire_response,
|
|
25
|
-
profile_url: 'http://hl7.org/fhir/us/davinci-dtr/StructureDefinition/dtr-questionnaireresponse')
|
|
21
|
+
verify_basic_conformance(request.request_body)
|
|
26
22
|
end
|
|
27
23
|
end
|
|
28
24
|
end
|
data/lib/davinci_dtr_test_kit/client_groups/shared/dtr_questionnaire_response_pre_population_test.rb
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
require_relative '../../dtr_questionnaire_response_validation'
|
|
4
|
+
require_relative '../../fixtures'
|
|
2
5
|
|
|
3
6
|
module DaVinciDTRTestKit
|
|
4
7
|
class DTRQuestionnaireResponsePrePopulationTest < Inferno::Test
|
|
@@ -21,11 +24,12 @@ module DaVinciDTRTestKit
|
|
|
21
24
|
)
|
|
22
25
|
|
|
23
26
|
run do
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
questionnaire_response_json = request.request_body
|
|
28
|
+
check_is_questionnaire_response(questionnaire_response_json)
|
|
29
|
+
questionnaire_response = FHIR.from_contents(questionnaire_response_json)
|
|
30
|
+
questionnaire = Fixtures.questionnaire_for_test(id)
|
|
31
|
+
response_template = Fixtures.questionnaire_response_for_test(id)
|
|
32
|
+
validate_questionnaire_pre_population(questionnaire, response_template, questionnaire_response)
|
|
29
33
|
end
|
|
30
34
|
end
|
|
31
35
|
end
|