davinci_dtr_test_kit 0.11.0 → 0.12.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_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_prepopulation_representation_attestation_test.rb +33 -0
- data/lib/davinci_dtr_test_kit/client_groups/dinner_static/dtr_full_ehr_questionnaire_workflow_group.rb +81 -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_smart_app_dinner_questionnaire_package_request_test.rb +134 -0
- 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/resp_assist_device/dtr_resp_questionnaire_package_request_test.rb +64 -27
- 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 +1 -1
- data/lib/davinci_dtr_test_kit/client_groups/shared/dtr_questionnaire_response_pre_population_test.rb +1 -0
- data/lib/davinci_dtr_test_kit/docs/dtr_full_ehr_suite_description_v201.md +127 -0
- data/lib/davinci_dtr_test_kit/docs/dtr_payer_server_suite_description_v201.md +2 -2
- data/lib/davinci_dtr_test_kit/dtr_full_ehr_suite.rb +4 -12
- data/lib/davinci_dtr_test_kit/dtr_questionnaire_response_validation.rb +2 -2
- data/lib/davinci_dtr_test_kit/dtr_smart_app_suite.rb +1 -1
- data/lib/davinci_dtr_test_kit/fixture_loader.rb +1 -1
- data/lib/davinci_dtr_test_kit/fixtures/dinner_adaptive/dinner_order_adaptive_next_question_hamburger.json +1 -1
- data/lib/davinci_dtr_test_kit/fixtures/dinner_static/questionnaire_dinner_order_static.json +1 -1
- data/lib/davinci_dtr_test_kit/mock_auth_server.rb +25 -15
- data/lib/davinci_dtr_test_kit/mock_ehr.rb +8 -3
- data/lib/davinci_dtr_test_kit/payer_server_groups/adaptive_next_questionnaire_expressions_test.rb +1 -1
- data/lib/davinci_dtr_test_kit/payer_server_groups/payer_server_adaptive_request_validation_test.rb +10 -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 +16 -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 +9 -20
- data/lib/davinci_dtr_test_kit/payer_server_groups/static_form_response_validation_test.rb +7 -14
- 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 +1 -1
- metadata +18 -9
- data/lib/davinci_dtr_test_kit/client_groups/dinner_static/dtr_dinner_questionnaire_package_request_test.rb +0 -97
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 5120a6592cc4d31933d917e3214c89c8d505cdf6f8c3d5065d000588988052a8
|
|
4
|
+
data.tar.gz: c850d248ab0ae414fe399d03749d781e9f8c186525d67ba76c0d9cbad509aa17
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 852190bb650b3f15d3fe25e79a08ba78778aeb85f836f32f6ed5e925859f14196cfb9d5719246a625c85803db6a606526ee2e735669bed0d574adaac3b23b8d9
|
|
7
|
+
data.tar.gz: 30e796f34e0b3e6b9088a2883af8bda32f8ac26d945c66cc6d4070b925c0eb40b362b9f76036d62b07aef6cc89d41e8c133efbb95d1bfb01233aa0289bd5889b
|
|
@@ -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
|
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,33 @@
|
|
|
1
|
+
require_relative '../../urls'
|
|
2
|
+
|
|
3
|
+
module DaVinciDTRTestKit
|
|
4
|
+
class DTRFullEHRStaticDinnerPrepopulationRepresentationAttestationTest < Inferno::Test
|
|
5
|
+
include URLs
|
|
6
|
+
|
|
7
|
+
id :dtr_full_ehr_dinner_static_prepopulation_representation_attestation
|
|
8
|
+
title 'Verify the QuestionnaireResponse representation of the item data sources (Attestation)'
|
|
9
|
+
description %(
|
|
10
|
+
Attest that the QuestionnaireResponse representation of the stored answers includes the required
|
|
11
|
+
source indicators, including `auto`, `override`, and `manual`.
|
|
12
|
+
)
|
|
13
|
+
input :access_token
|
|
14
|
+
|
|
15
|
+
run do
|
|
16
|
+
wait(
|
|
17
|
+
identifier: access_token,
|
|
18
|
+
message: %(
|
|
19
|
+
I attest that the QuestionnaireResponse representation of the stored answers includes the
|
|
20
|
+
[orgin extension with source details](https://build.fhir.org/ig/HL7/davinci-dtr/StructureDefinition-information-origin.html),
|
|
21
|
+
including on the following fields entered during the tests:
|
|
22
|
+
- PBD.1 (Last Name): `auto`
|
|
23
|
+
- PBD.2 (First Name): `override`
|
|
24
|
+
- 3.1 (dinner choice): `manual`
|
|
25
|
+
|
|
26
|
+
[Click here](#{resume_pass_url}?token=#{access_token}) if the above statement is **true**.
|
|
27
|
+
|
|
28
|
+
[Click here](#{resume_fail_url}?token=#{access_token}) if the above statement is **false**.
|
|
29
|
+
)
|
|
30
|
+
)
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
require_relative 'dtr_full_ehr_launch_attestation_test'
|
|
2
|
+
require_relative 'dtr_full_ehr_dinner_questionnaire_package_request_test'
|
|
3
|
+
require_relative '../shared/dtr_questionnaire_package_request_validation_test'
|
|
4
|
+
require_relative 'dtr_full_ehr_prepopulation_attestation_test'
|
|
5
|
+
require_relative 'dtr_full_ehr_prepopulation_override_attestation_test'
|
|
6
|
+
require_relative 'dtr_full_ehr_rendering_enabled_questions_attestation_test'
|
|
7
|
+
require_relative 'dtr_full_ehr_store_attestation_test'
|
|
8
|
+
require_relative 'dtr_full_ehr_prepopulation_representation_attestation_test'
|
|
9
|
+
|
|
10
|
+
module DaVinciDTRTestKit
|
|
11
|
+
class DTRFullEHRStaticDinnerQuestionnaireWorkflowGroup < Inferno::TestGroup
|
|
12
|
+
id :dtr_full_ehr_static_dinner_questionnaire_workflow
|
|
13
|
+
title 'Static Questionnaire Workflow'
|
|
14
|
+
description %(
|
|
15
|
+
This test validates that a DTR Full EHR client can perform a full DTR Static Questionnaire workflow
|
|
16
|
+
using a mocked questionnaire requesting what a patient wants for dinner. The client system must
|
|
17
|
+
demonstrate its ability to:
|
|
18
|
+
|
|
19
|
+
1. Fetch the static questionnaire package
|
|
20
|
+
([DinnerOrderStatic](https://github.com/inferno-framework/davinci-dtr-test-kit/blob/main/lib/davinci_dtr_test_kit/fixtures/dinner_static/questionnaire_dinner_order_static.json))
|
|
21
|
+
2. Render and pre-populate the questionnaire appropriately, including:
|
|
22
|
+
- pre-populate data as directed by the questionnaire
|
|
23
|
+
- display questions only when they are enabled by other answers
|
|
24
|
+
3. Complete and store the questionnaire response for future use.
|
|
25
|
+
)
|
|
26
|
+
|
|
27
|
+
group do
|
|
28
|
+
id :dtr_full_ehr_static_questionnaire_retrieval
|
|
29
|
+
title 'Retrieving the Static Questionnaire'
|
|
30
|
+
description %(
|
|
31
|
+
After DTR launch, Inferno will wait for the client system to request a questionnaire using the
|
|
32
|
+
$questionnaire-package operation and will return a static questionnaire for the
|
|
33
|
+
tester to complete. Inferno will then validate the the conformance of the request.
|
|
34
|
+
)
|
|
35
|
+
run_as_group
|
|
36
|
+
|
|
37
|
+
# Test 0: attest to launch
|
|
38
|
+
test from: :dtr_full_ehr_dinner_static_launch_attestation
|
|
39
|
+
# Test 1: wait for the $questionnaire-package request
|
|
40
|
+
test from: :dtr_full_ehr_dinner_questionnaire_package_request
|
|
41
|
+
# Test 2: validate the $questionnaire-package body
|
|
42
|
+
test from: :dtr_questionnaire_package_request_validation
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
group do
|
|
46
|
+
id :dtr_full_ehr_static_questionnaire_rendering
|
|
47
|
+
title 'Filling Out the Static Questionnaire'
|
|
48
|
+
description %(
|
|
49
|
+
The tester will interact with the questionnaire within their client system
|
|
50
|
+
such that pre-population steps are taken, the qustionnaire is rendered, and
|
|
51
|
+
they are able to fill it out. The tester will attest that questionnaire pre-population
|
|
52
|
+
and rendering directives were followed.
|
|
53
|
+
)
|
|
54
|
+
run_as_group
|
|
55
|
+
|
|
56
|
+
# Test 1: attest to the pre-population of the name fields
|
|
57
|
+
test from: :dtr_full_ehr_dinner_static_rendering_prepopulation_attestation
|
|
58
|
+
# Test 2: attest to the pre-population and edit of the first name field
|
|
59
|
+
test from: :dtr_full_ehr_dinner_static_prepopulation_override_attestation
|
|
60
|
+
# Test 3: attest to the display of the toppings questions only when a dinner answer is selected
|
|
61
|
+
test from: :dtr_full_ehr_dinner_static_rendering_enabledQs_attestation
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
group do
|
|
65
|
+
id :dtr_full_ehr_static_questionnaire_response
|
|
66
|
+
title 'Saving the QuestionnaireResponse'
|
|
67
|
+
description %(
|
|
68
|
+
The tester will attest to the completion of the questionnaire such that
|
|
69
|
+
the results are stored for later use.
|
|
70
|
+
)
|
|
71
|
+
run_as_group
|
|
72
|
+
|
|
73
|
+
# Test 1: attest QuestionnaireResponse saved
|
|
74
|
+
test from: :dtr_full_ehr_dinner_static_store_attestation
|
|
75
|
+
# Test 2: validate basic conformance of the QuestionnaireResponse
|
|
76
|
+
# - not using currently
|
|
77
|
+
# Test 3: validate workflow-specific details such as pre-population and overrides
|
|
78
|
+
test from: :dtr_full_ehr_dinner_static_prepopulation_representation_attestation
|
|
79
|
+
end
|
|
80
|
+
end
|
|
81
|
+
end
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
require_relative '../../urls'
|
|
2
|
+
|
|
3
|
+
module DaVinciDTRTestKit
|
|
4
|
+
class DTRFullEHRStaticDinnerRenderingAttestationTest < Inferno::Test
|
|
5
|
+
include URLs
|
|
6
|
+
|
|
7
|
+
id :dtr_full_ehr_dinner_static_rendering_enabledQs_attestation
|
|
8
|
+
title 'Check that the client renders enabled questions appropriately (Attestation)'
|
|
9
|
+
description %(
|
|
10
|
+
Validate that the rendering of the questionnaire includes only the "What would you like on..."
|
|
11
|
+
question appropriate for the dinner selection, if made.
|
|
12
|
+
)
|
|
13
|
+
input :access_token
|
|
14
|
+
|
|
15
|
+
run do
|
|
16
|
+
wait(
|
|
17
|
+
identifier: access_token,
|
|
18
|
+
message: %(
|
|
19
|
+
I attest that the client application does not display any "What would you like on..."
|
|
20
|
+
questions until I have selected a dinner choice and then only displays the
|
|
21
|
+
"What would you like on..." question relevant for the dinner request:
|
|
22
|
+
|
|
23
|
+
[Click here](#{resume_pass_url}?token=#{access_token}) if the above statement is **true**.
|
|
24
|
+
|
|
25
|
+
[Click here](#{resume_fail_url}?token=#{access_token}) if the above statement is **false**.
|
|
26
|
+
)
|
|
27
|
+
)
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
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
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
require 'base64'
|
|
2
|
+
require_relative '../../urls'
|
|
3
|
+
|
|
4
|
+
module DaVinciDTRTestKit
|
|
5
|
+
class DTRSmartAppDinnerQuestionnairePackageRequestTest < Inferno::Test
|
|
6
|
+
include URLs
|
|
7
|
+
|
|
8
|
+
id :dtr_smart_app_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
|
+
input :smart_app_launch,
|
|
15
|
+
type: 'radio',
|
|
16
|
+
title: 'SMART App Launch',
|
|
17
|
+
description: 'How will the DTR SMART App launch?',
|
|
18
|
+
options: { list_options: [{ label: 'EHR Launch from Inferno', value: 'ehr' },
|
|
19
|
+
{ label: 'Standalone Launch', value: 'standalone' }] }
|
|
20
|
+
input :client_id
|
|
21
|
+
input :launch_uri,
|
|
22
|
+
optional: true,
|
|
23
|
+
description: 'Required if "Launch from Inferno" is selected'
|
|
24
|
+
input :smart_patient_id,
|
|
25
|
+
optional: true,
|
|
26
|
+
title: 'SMART App Launch Patient ID (Dinner Static)',
|
|
27
|
+
type: 'text',
|
|
28
|
+
description: %(
|
|
29
|
+
Patient instance `id` to be provided by Inferno as the `patient` as a part of the SMART App
|
|
30
|
+
Launch.
|
|
31
|
+
),
|
|
32
|
+
default: 'pat015'
|
|
33
|
+
input :smart_fhir_context,
|
|
34
|
+
optional: true,
|
|
35
|
+
title: 'SMART App Launch fhirContext (Dinner Static)',
|
|
36
|
+
type: 'textarea',
|
|
37
|
+
description: %(
|
|
38
|
+
References to be provided by Inferno as the `fhirContext` as a part of the SMART App
|
|
39
|
+
Launch. These references help determine the behavior of the app. Referenced instances
|
|
40
|
+
may be provided in the "EHR-available resources" input.
|
|
41
|
+
),
|
|
42
|
+
default: JSON.pretty_generate([{ reference: 'Coverage/cov015' },
|
|
43
|
+
{ reference: 'DeviceRequest/devreqe0470' }])
|
|
44
|
+
input :ehr_bundle,
|
|
45
|
+
optional: true,
|
|
46
|
+
title: 'EHR-available resources (Dinner Static)',
|
|
47
|
+
type: 'textarea',
|
|
48
|
+
description: %(
|
|
49
|
+
Resources available from the EHR needed to drive the dinner static workflow.
|
|
50
|
+
Formatted as a FHIR bundle that contains resources, each with an `id` property populated. Each
|
|
51
|
+
instance present will be available for retrieval from Inferno at the endpoint:
|
|
52
|
+
|
|
53
|
+
```
|
|
54
|
+
[fhir-base]/[resource type]/[instance id]
|
|
55
|
+
```
|
|
56
|
+
)
|
|
57
|
+
|
|
58
|
+
def example_client_jwt_payload_part
|
|
59
|
+
Base64.strict_encode64({ inferno_client_id: client_id }.to_json).delete('=')
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
run do
|
|
63
|
+
# validate relevant inputs and provide warnings if they are bad
|
|
64
|
+
warning do
|
|
65
|
+
if smart_fhir_context
|
|
66
|
+
assert_valid_json(smart_fhir_context,
|
|
67
|
+
'The **SMART App Launch fhirContext** input is not valid JSON, so it will not be included in
|
|
68
|
+
the access token response.')
|
|
69
|
+
end
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
warning do
|
|
73
|
+
if ehr_bundle
|
|
74
|
+
assert_valid_json(ehr_bundle,
|
|
75
|
+
'The **EHR-available resources** input is not valid JSON, so no tester-specified instances
|
|
76
|
+
will be available to access from Inferno.')
|
|
77
|
+
assert(FHIR.from_contents(ehr_bundle).is_a?(FHIR::Bundle),
|
|
78
|
+
'The **EHR-available resources** input does not contain a FHIR Bundle, so no tester-specified instances
|
|
79
|
+
will be available to access from Inferno.')
|
|
80
|
+
end
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
launch_prompt = if smart_app_launch == 'ehr'
|
|
84
|
+
%(Launch the DTR SMART App from Inferno by right clicking
|
|
85
|
+
[this link](#{launch_uri}?iss=#{fhir_base_url}&launch=#{launch_uri})
|
|
86
|
+
and selecting or "Open in new window" or "Open in new tab".)
|
|
87
|
+
else
|
|
88
|
+
%(Launch the SMART App from your EHR.)
|
|
89
|
+
end
|
|
90
|
+
inferno_prompt_cont = %(As the DTR app steps through the launch steps, Inferno will wait and respond to the app's
|
|
91
|
+
requests for SMART configuration, authorization and access token.)
|
|
92
|
+
|
|
93
|
+
wait(
|
|
94
|
+
identifier: client_id,
|
|
95
|
+
message: %(
|
|
96
|
+
### SMART App Launch
|
|
97
|
+
|
|
98
|
+
#{launch_prompt}
|
|
99
|
+
|
|
100
|
+
#{inferno_prompt_cont if smart_app_launch == 'ehr'}
|
|
101
|
+
|
|
102
|
+
Then, Inferno will expect the SMART App to invoke the DTR Questionnaire Package operation by sending a POST
|
|
103
|
+
request to
|
|
104
|
+
|
|
105
|
+
`#{questionnaire_package_url}`
|
|
106
|
+
|
|
107
|
+
A questionnaire package generated by Inferno will be returned.
|
|
108
|
+
|
|
109
|
+
### Pre-population
|
|
110
|
+
|
|
111
|
+
Inferno will then wait for the client to complete Questionnaire pre-population. The client should make FHIR
|
|
112
|
+
GET requests using service base path:
|
|
113
|
+
|
|
114
|
+
`#{fhir_base_url}`
|
|
115
|
+
|
|
116
|
+
### Request Identification
|
|
117
|
+
|
|
118
|
+
In order to identify requests for this session, Inferno will look for
|
|
119
|
+
an `Authorization` header with value:
|
|
120
|
+
|
|
121
|
+
```
|
|
122
|
+
Bearer eyJhbGciOiJub25lIn0.#{example_client_jwt_payload_part}.
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
### Continuing the Tests
|
|
126
|
+
|
|
127
|
+
When the DTR application has finished loading the Questionnaire,
|
|
128
|
+
including any clinical data requests to support pre-population,
|
|
129
|
+
[Click here](#{resume_pass_url}?client_id=#{client_id}) to continue.
|
|
130
|
+
)
|
|
131
|
+
)
|
|
132
|
+
end
|
|
133
|
+
end
|
|
134
|
+
end
|
|
@@ -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..."
|