davinci_dtr_test_kit 0.9.0 → 0.11.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_static/dtr_dinner_questionnaire_package_request_test.rb +97 -0
- data/lib/davinci_dtr_test_kit/client_groups/dinner_static/dtr_questionnaire_response_save_test.rb +2 -2
- data/lib/davinci_dtr_test_kit/client_groups/dinner_static/dtr_smart_app_questionnaire_workflow_group.rb +3 -2
- data/lib/davinci_dtr_test_kit/client_groups/dinner_static/prepopulation_attestation_test.rb +4 -4
- data/lib/davinci_dtr_test_kit/client_groups/dinner_static/prepopulation_override_attestation_test.rb +4 -4
- data/lib/davinci_dtr_test_kit/client_groups/dinner_static/rendering_enabled_questions_attestation_test.rb +4 -4
- data/lib/davinci_dtr_test_kit/client_groups/resp_assist_device/dtr_questionnaire_package_group.rb +2 -2
- data/lib/davinci_dtr_test_kit/client_groups/resp_assist_device/dtr_questionnaire_rendering_attestation_test.rb +4 -4
- data/lib/davinci_dtr_test_kit/client_groups/resp_assist_device/dtr_questionnaire_response_save_test.rb +2 -2
- data/lib/davinci_dtr_test_kit/client_groups/resp_assist_device/dtr_resp_questionnaire_package_request_test.rb +95 -0
- data/lib/davinci_dtr_test_kit/client_groups/resp_assist_device/dtr_smart_app_questionnaire_workflow_group.rb +4 -3
- data/lib/davinci_dtr_test_kit/docs/dtr_smart_app_suite_description_v201.md +107 -43
- data/lib/davinci_dtr_test_kit/dtr_full_ehr_suite.rb +30 -6
- data/lib/davinci_dtr_test_kit/dtr_light_ehr_suite.rb +26 -3
- data/lib/davinci_dtr_test_kit/dtr_payer_server_suite.rb +33 -7
- data/lib/davinci_dtr_test_kit/dtr_questionnaire_response_validation.rb +26 -10
- data/lib/davinci_dtr_test_kit/dtr_smart_app_suite.rb +59 -14
- data/lib/davinci_dtr_test_kit/fixtures/dinner_static/questionnaire_dinner_order_static.json +1 -1
- data/lib/davinci_dtr_test_kit/fixtures/questionnaire_package.json +1 -1
- data/lib/davinci_dtr_test_kit/mock_auth_server.rb +135 -0
- data/lib/davinci_dtr_test_kit/mock_ehr.rb +32 -12
- data/lib/davinci_dtr_test_kit/mock_payer.rb +2 -21
- data/lib/davinci_dtr_test_kit/payer_server_groups/payer_server_static_group.rb +4 -2
- 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 +3 -3
- data/lib/davinci_dtr_test_kit/payer_server_groups/static_form_questionnaire_extensions_test.rb +2 -2
- data/lib/davinci_dtr_test_kit/payer_server_groups/static_form_request_test.rb +1 -0
- data/lib/davinci_dtr_test_kit/payer_server_groups/static_form_request_validation_test.rb +5 -3
- data/lib/davinci_dtr_test_kit/payer_server_groups/static_form_response_validation_test.rb +15 -11
- data/lib/davinci_dtr_test_kit/urls.rb +14 -3
- data/lib/davinci_dtr_test_kit/version.rb +1 -1
- metadata +19 -3
- data/lib/davinci_dtr_test_kit/client_groups/shared/dtr_questionnaire_package_request_test.rb +0 -36
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e95ac1a81ec266133aa196823f9c4af450b6ff0c628b2ca9dccbb0fcd3b32863
|
4
|
+
data.tar.gz: d4ac1d46eadaa7f1067d07b4811e00803308f8d1c91cf9165f6e17534a280449
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 22b65864b0795e2355b17d19b78d262524b29a9c0b1352603cd226a8d5c135a5bb0566c6c8449ce4ea0516ebedbee1e7a94965d7448e98a927b07716bd65c049
|
7
|
+
data.tar.gz: 0daaae716b201d20f99c768e5a7bc9d6ae997f953ab2d238862298ab00a39d82746b5e1a71537f13eeb09ea260c097955a22487405128aa5cbe9339cc1860fce
|
@@ -0,0 +1,97 @@
|
|
1
|
+
require 'base64'
|
2
|
+
require_relative '../../urls'
|
3
|
+
|
4
|
+
module DaVinciDTRTestKit
|
5
|
+
class DTRDinnerQuestionnairePackageRequestTest < Inferno::Test
|
6
|
+
include URLs
|
7
|
+
|
8
|
+
id :dtr_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, type: 'radio', title: 'SMART App Launch',
|
15
|
+
description: 'How will the DTR SMART App launch?',
|
16
|
+
options: { list_options: [{ label: 'Launch from Inferno', value: 'inferno' },
|
17
|
+
{ label: 'Launch from EHR', value: 'ehr' }] }
|
18
|
+
input :client_id
|
19
|
+
input :launch_uri, optional: true, description: 'Required if "Launch from Inferno" is selected'
|
20
|
+
input :smart_patient_id, optional: true, title: 'SMART App Launch Patient ID (Dinner Static)',
|
21
|
+
type: 'text',
|
22
|
+
description: %(
|
23
|
+
Patient instance id to be provided by Inferno as the `patient` as a part of the SMART app
|
24
|
+
launch.
|
25
|
+
)
|
26
|
+
input :smart_fhir_context, optional: true, title: 'SMART App Launch fhirContext (Dinner Static)',
|
27
|
+
type: 'textarea',
|
28
|
+
description: %(
|
29
|
+
References to be provided by Inferno as the `fhirContext` as a part of the SMART app
|
30
|
+
launch. These references help determine the behavior of the app. Referenced instances
|
31
|
+
may be providedin the "EHR-available resources" input.
|
32
|
+
)
|
33
|
+
input :ehr_bundle, optional: true, title: 'EHR-available resources (Dinner Static)', type: 'textarea',
|
34
|
+
description: %(
|
35
|
+
Resources available from the EHR needed to drive the dinner static workflow.
|
36
|
+
Formatted as a FHIR bundle that contains resources, each with an `id` property populated. Each
|
37
|
+
instance present will be available for retrieval from Inferno at the endpoint
|
38
|
+
`[fhir-base]/[resource type]/[instance id].`
|
39
|
+
)
|
40
|
+
|
41
|
+
def example_client_jwt_payload_part
|
42
|
+
Base64.strict_encode64({ inferno_client_id: client_id }.to_json).delete('=')
|
43
|
+
end
|
44
|
+
|
45
|
+
run do
|
46
|
+
launch_prompt = if smart_app_launch == 'inferno'
|
47
|
+
%(Launch the DTR SMART App from Inferno by right clicking
|
48
|
+
[this link](#{launch_uri}?iss=#{fhir_base_url}&launch=#{launch_uri})
|
49
|
+
and selecting or "Open in new window" or "Open in new tab".)
|
50
|
+
else
|
51
|
+
%(Launch the SMART App from your EHR.)
|
52
|
+
end
|
53
|
+
inferno_prompt_cont = %(As the DTR app steps through the launch steps, Inferno will wait and respond to the app's
|
54
|
+
requests for SMART configuration, authorization and access token.)
|
55
|
+
|
56
|
+
wait(
|
57
|
+
identifier: client_id,
|
58
|
+
message: %(
|
59
|
+
### SMART App Launch
|
60
|
+
|
61
|
+
#{launch_prompt}
|
62
|
+
|
63
|
+
#{inferno_prompt_cont if smart_app_launch == 'inferno'}
|
64
|
+
|
65
|
+
Then, Inferno will expect the SMART App to invoke the DTR Questionnaire Package operation by sending a POST
|
66
|
+
request to
|
67
|
+
|
68
|
+
`#{questionnaire_package_url}`
|
69
|
+
|
70
|
+
A questionnaire package generated by Inferno will be returned.
|
71
|
+
|
72
|
+
### Pre-population
|
73
|
+
|
74
|
+
Inferno will then wait for the client to complete Questionnaire pre-population. The client should make FHIR
|
75
|
+
GET requests using service base path:
|
76
|
+
|
77
|
+
`#{fhir_base_url}`
|
78
|
+
|
79
|
+
### Request Identification
|
80
|
+
|
81
|
+
In order to identify requests for this session, Inferno will look for
|
82
|
+
an `Authorization` header with value:
|
83
|
+
|
84
|
+
```
|
85
|
+
Bearer eyJhbGcmOiJub25lIn0.#{example_client_jwt_payload_part}.
|
86
|
+
```
|
87
|
+
|
88
|
+
### Continuing the Tests
|
89
|
+
|
90
|
+
When the DTR application has finished loading the Questionnaire,
|
91
|
+
including any clinical data requests to support pre-population,
|
92
|
+
[Click here](#{resume_pass_url}?client_id=#{client_id}) to continue.
|
93
|
+
)
|
94
|
+
)
|
95
|
+
end
|
96
|
+
end
|
97
|
+
end
|
data/lib/davinci_dtr_test_kit/client_groups/dinner_static/dtr_questionnaire_response_save_test.rb
CHANGED
@@ -9,11 +9,11 @@ module DaVinciDTRTestKit
|
|
9
9
|
description %(
|
10
10
|
Inferno, acting as the EHR, will wait for a request to save the QuestionnaireResponse from the client.
|
11
11
|
)
|
12
|
-
input :
|
12
|
+
input :client_id
|
13
13
|
|
14
14
|
run do
|
15
15
|
wait(
|
16
|
-
identifier:
|
16
|
+
identifier: client_id,
|
17
17
|
message: %(
|
18
18
|
Complete the questionnaire, leaving the following items unmodified, because a subsequent test will expect
|
19
19
|
their pre-populated values:
|
@@ -1,4 +1,4 @@
|
|
1
|
-
require_relative '
|
1
|
+
require_relative 'dtr_dinner_questionnaire_package_request_test'
|
2
2
|
require_relative '../shared/dtr_questionnaire_package_request_validation_test'
|
3
3
|
require_relative 'prepopulation_attestation_test'
|
4
4
|
require_relative 'prepopulation_override_attestation_test'
|
@@ -17,6 +17,7 @@ module DaVinciDTRTestKit
|
|
17
17
|
demonstrate their ability to:
|
18
18
|
|
19
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))
|
20
21
|
2. Render and pre-populate the questionnaire appropriately, including:
|
21
22
|
- fetch additional data needed for pre-population
|
22
23
|
- pre-populate data as directed by the questionnaire
|
@@ -36,7 +37,7 @@ module DaVinciDTRTestKit
|
|
36
37
|
run_as_group
|
37
38
|
|
38
39
|
# Test 1: wait for the $questionnaire-package request
|
39
|
-
test from: :
|
40
|
+
test from: :dtr_dinner_questionnaire_package_request
|
40
41
|
# Test 2: validate the $questionnaire-package body
|
41
42
|
test from: :dtr_questionnaire_package_request_validation
|
42
43
|
end
|
@@ -9,19 +9,19 @@ module DaVinciDTRTestKit
|
|
9
9
|
description %(
|
10
10
|
Validate that pre-population of patient name information occurs as expected.
|
11
11
|
)
|
12
|
-
input :
|
12
|
+
input :client_id
|
13
13
|
|
14
14
|
run do
|
15
15
|
wait(
|
16
|
-
identifier:
|
16
|
+
identifier: client_id,
|
17
17
|
message: %(
|
18
18
|
I attest that the client application pre-populates the following questions with the respective values:
|
19
19
|
- Last Name: Oster
|
20
20
|
- First Name: William
|
21
21
|
|
22
|
-
[Click here](#{resume_pass_url}?
|
22
|
+
[Click here](#{resume_pass_url}?client_id=#{client_id}) if the above statement is **true**.
|
23
23
|
|
24
|
-
[Click here](#{resume_fail_url}?
|
24
|
+
[Click here](#{resume_fail_url}?client_id=#{client_id}) if the above statement is **false**.
|
25
25
|
)
|
26
26
|
)
|
27
27
|
end
|
data/lib/davinci_dtr_test_kit/client_groups/dinner_static/prepopulation_override_attestation_test.rb
CHANGED
@@ -9,20 +9,20 @@ module DaVinciDTRTestKit
|
|
9
9
|
description %(
|
10
10
|
Validate that the user can edit a pre-populated item and replace it with another value.
|
11
11
|
)
|
12
|
-
input :
|
12
|
+
input :client_id
|
13
13
|
|
14
14
|
run do
|
15
15
|
wait(
|
16
|
-
identifier:
|
16
|
+
identifier: client_id,
|
17
17
|
message: %(
|
18
18
|
I attest that
|
19
19
|
|
20
20
|
1. The client pre-populated an answer for question 'Location'.
|
21
21
|
2. I have changed the answer to a different value.
|
22
22
|
|
23
|
-
[Click here](#{resume_pass_url}?
|
23
|
+
[Click here](#{resume_pass_url}?client_id=#{client_id}) if the above statement is **true**.
|
24
24
|
|
25
|
-
[Click here](#{resume_fail_url}?
|
25
|
+
[Click here](#{resume_fail_url}?client_id=#{client_id}) if the above statement is **false**.
|
26
26
|
)
|
27
27
|
)
|
28
28
|
end
|
@@ -10,19 +10,19 @@ module DaVinciDTRTestKit
|
|
10
10
|
Validate that the rendering of the questionnaire includes only the "What would you like on..."
|
11
11
|
question appropriate for the dinner selection, if made.
|
12
12
|
)
|
13
|
-
input :
|
13
|
+
input :client_id
|
14
14
|
|
15
15
|
run do
|
16
16
|
wait(
|
17
|
-
identifier:
|
17
|
+
identifier: client_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}?
|
23
|
+
[Click here](#{resume_pass_url}?client_id=#{client_id}) if the above statement is **true**.
|
24
24
|
|
25
|
-
[Click here](#{resume_fail_url}?
|
25
|
+
[Click here](#{resume_fail_url}?client_id=#{client_id}) if the above statement is **false**.
|
26
26
|
)
|
27
27
|
)
|
28
28
|
end
|
data/lib/davinci_dtr_test_kit/client_groups/resp_assist_device/dtr_questionnaire_package_group.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
require_relative '
|
1
|
+
require_relative 'dtr_resp_questionnaire_package_request_test'
|
2
2
|
require_relative '../shared/dtr_questionnaire_package_request_validation_test'
|
3
3
|
|
4
4
|
module DaVinciDTRTestKit
|
@@ -10,7 +10,7 @@ module DaVinciDTRTestKit
|
|
10
10
|
)
|
11
11
|
run_as_group
|
12
12
|
|
13
|
-
test from: :
|
13
|
+
test from: :dtr_resp_questionnaire_package_request
|
14
14
|
test from: :dtr_questionnaire_package_request_validation
|
15
15
|
end
|
16
16
|
end
|
@@ -10,21 +10,21 @@ module DaVinciDTRTestKit
|
|
10
10
|
Thist test provides the tester an opportunity to observe their client application following the receipt of the
|
11
11
|
questionnaire pacakage and attest that the application renders the questionnaire.
|
12
12
|
)
|
13
|
-
input :
|
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
18
|
|
19
19
|
wait(
|
20
|
-
identifier:
|
20
|
+
identifier: client_id,
|
21
21
|
message: %(
|
22
22
|
I attest that the client application displays the questionnaire and respects the following rendering style:
|
23
23
|
- The "Signature" field label is rendered with green text
|
24
24
|
|
25
|
-
[Click here](#{resume_pass_url}?
|
25
|
+
[Click here](#{resume_pass_url}?client_id=#{client_id}) if the above statement is **true**.
|
26
26
|
|
27
|
-
[Click here](#{resume_fail_url}?
|
27
|
+
[Click here](#{resume_fail_url}?client_id=#{client_id}) if the above statement is **false**.
|
28
28
|
)
|
29
29
|
)
|
30
30
|
end
|
@@ -9,11 +9,11 @@ module DaVinciDTRTestKit
|
|
9
9
|
description %(
|
10
10
|
Inferno, acting as the EHR, will wait for a request to save the QuestionnaireResponse from the client.
|
11
11
|
)
|
12
|
-
input :
|
12
|
+
input :client_id
|
13
13
|
|
14
14
|
run do
|
15
15
|
wait(
|
16
|
-
identifier:
|
16
|
+
identifier: client_id,
|
17
17
|
message: %(
|
18
18
|
Complete the questionnaire, leaving the following items unmodified, because a subsequent test will expect
|
19
19
|
their pre-populated values:
|
@@ -0,0 +1,95 @@
|
|
1
|
+
require_relative '../../urls'
|
2
|
+
|
3
|
+
module DaVinciDTRTestKit
|
4
|
+
class DTRRespQuestionnairePackageRequestTest < Inferno::Test
|
5
|
+
include URLs
|
6
|
+
|
7
|
+
id :dtr_resp_questionnaire_package_request
|
8
|
+
title 'Invoke the DTR Questionnaire Package operation'
|
9
|
+
description %(
|
10
|
+
Inferno will wait for a DTR questionnaire package request from the client. Upon receipt, Inferno will generate and
|
11
|
+
send a response.
|
12
|
+
)
|
13
|
+
input :smart_app_launch, type: 'radio', title: 'SMART App Launch',
|
14
|
+
description: 'How will the DTR SMART App launch?',
|
15
|
+
options: { list_options: [{ label: 'Launch from Inferno', value: 'inferno' },
|
16
|
+
{ label: 'Launch from EHR', value: 'ehr' }] }
|
17
|
+
input :client_id
|
18
|
+
input :launch_uri, optional: true, description: 'Required if "Launch from Inferno" is selected'
|
19
|
+
input :smart_patient_id, optional: true, title: 'SMART App Launch Patient ID (Respiratory Assist Device)',
|
20
|
+
type: 'text',
|
21
|
+
description: %(
|
22
|
+
Patient instance id to be provided by Inferno as the `patient` as a part of the SMART app
|
23
|
+
launch.
|
24
|
+
)
|
25
|
+
input :smart_fhir_context, optional: true, title: 'SMART App Launch fhirContext (Respiratory Assist Device)',
|
26
|
+
type: 'textarea',
|
27
|
+
description: %(
|
28
|
+
References to be provided by Inferno as the `fhirContext` as a part of the SMART app
|
29
|
+
launch. These references help determine the behavior of the app. Referenced instances
|
30
|
+
may be providedin the "EHR-available resources" input.
|
31
|
+
)
|
32
|
+
input :ehr_bundle, optional: true, title: 'EHR-available resources (Respiratory Assist Device)', type: 'textarea',
|
33
|
+
description: %(
|
34
|
+
Resources available from the EHR needed to drive the respiratory assist device
|
35
|
+
workflow. Formatted as a FHIR bundle that contains resources, each with an `id`
|
36
|
+
property populated. Each instance present will be available for retrieval from
|
37
|
+
Inferno at the endpoint `[fhir-base]/[resource type]/[instance id].`
|
38
|
+
)
|
39
|
+
|
40
|
+
def example_client_jwt_payload_part
|
41
|
+
Base64.strict_encode64({ inferno_client_id: client_id }.to_json).delete('=')
|
42
|
+
end
|
43
|
+
|
44
|
+
run do
|
45
|
+
launch_prompt = if smart_app_launch == 'inferno'
|
46
|
+
%(Launch the DTR SMART App from Inferno by right clicking
|
47
|
+
[this link](#{launch_uri}?iss=#{fhir_base_url}&launch=#{launch_uri})
|
48
|
+
and selecting or "Open in new window" or "Open in new tab".)
|
49
|
+
else
|
50
|
+
%(Launch the SMART App from your EHR.)
|
51
|
+
end
|
52
|
+
inferno_prompt_cont = %(As the DTR app steps through the launch steps, Inferno will wait and respond to the app's
|
53
|
+
requests for SMART configuration, authorization and access token.)
|
54
|
+
wait(
|
55
|
+
identifier: client_id,
|
56
|
+
message: %(
|
57
|
+
### SMART App Launch
|
58
|
+
|
59
|
+
#{launch_prompt}
|
60
|
+
|
61
|
+
#{inferno_prompt_cont if smart_app_launch == 'inferno'}
|
62
|
+
|
63
|
+
Then, Inferno will expect the SMART App to invoke the DTR Questionnaire Package operation by sending a POST
|
64
|
+
request to
|
65
|
+
|
66
|
+
`#{questionnaire_package_url}`
|
67
|
+
|
68
|
+
A questionnaire package generated by Inferno will be returned.
|
69
|
+
|
70
|
+
### Pre-population
|
71
|
+
|
72
|
+
Inferno will then wait for the client to complete Questionnaire pre-population. The client should make FHIR
|
73
|
+
GET requests using service base path:
|
74
|
+
|
75
|
+
`#{fhir_base_url}`
|
76
|
+
|
77
|
+
### Request Identification
|
78
|
+
|
79
|
+
In order to identify requests for this session, Inferno will look for
|
80
|
+
an `Authorization` header with value:
|
81
|
+
|
82
|
+
```
|
83
|
+
Bearer eyJhbGcmOiJub25lIn0.#{example_client_jwt_payload_part}.
|
84
|
+
```
|
85
|
+
|
86
|
+
### Continuing the Tests
|
87
|
+
|
88
|
+
When the DTR application has finished loading the Questionnaire,
|
89
|
+
including any clinical data requests to support pre-population,
|
90
|
+
[Click here](#{resume_pass_url}?client_id=#{client_id}) to continue.
|
91
|
+
)
|
92
|
+
)
|
93
|
+
end
|
94
|
+
end
|
95
|
+
end
|
@@ -7,10 +7,11 @@ module DaVinciDTRTestKit
|
|
7
7
|
id :dtr_smart_app_questionnaire_workflow
|
8
8
|
title 'Respiratory Assist Device Questionnaire Workflow'
|
9
9
|
description %(
|
10
|
-
This workflow validates that a DTR SMART App can perform a full DTR
|
11
|
-
Questionnaire
|
10
|
+
This workflow validates that a DTR SMART App can perform a full DTR
|
11
|
+
Questionnaire workflow using a canned Questionnaire
|
12
|
+
for a respiratory assist device order:
|
12
13
|
|
13
|
-
1. Fetch the questionnaire package
|
14
|
+
1. Fetch the questionnaire package ([RespiratoryAssistDevices](https://github.com/inferno-framework/davinci-dtr-test-kit/blob/main/lib/davinci_dtr_test_kit/fixtures/questionnaire_package.json))
|
14
15
|
2. Render the questionnaire
|
15
16
|
3. Pre-populate the questionnaire response
|
16
17
|
)
|
@@ -52,64 +52,128 @@ validated with the Java validator using `tx.fhir.org` as the terminology server.
|
|
52
52
|
|
53
53
|
### Quick Start
|
54
54
|
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
55
|
+
This test suite can be run in two modes, each described below:
|
56
|
+
1. [EHR launch mode](#ehr-launch)
|
57
|
+
2. [Standalone launch mode](#standalone-launch)
|
58
|
+
|
59
|
+
At this time, Inferno's simulation of the payer server that provides the questionnaires
|
60
|
+
uses the same base server url and access token, and apps will need to be configured to
|
61
|
+
connect to it as well. See the "Combined payer and EHR FHIR servers" section below for details.
|
62
|
+
|
63
|
+
The DTR specification allows apps and their partners significant leeway in terms of
|
64
|
+
what information is provided on launch and how that information gets used by the app
|
65
|
+
to determine the `$questionnaire-package` endpoint and what details to submit as a
|
66
|
+
part of that operation. Inferno cannot know ahead of time what data needs to be
|
67
|
+
available for the app under test to successfully request, pre-populate, and render
|
68
|
+
a questionnaire. See the "`fhirContext` and available instances"
|
69
|
+
section below for details on how to enable Inferno to meet the needs of your application.
|
70
|
+
|
71
|
+
#### EHR Launch
|
72
|
+
|
73
|
+
In this mode Inferno will launch the app under test using the SMART App Launch
|
74
|
+
[EHR launch](https://hl7.org/fhir/smart-app-launch/STU2.1/app-launch.html#launch-app-ehr-launch)
|
75
|
+
flow.
|
76
|
+
|
77
|
+
The tester must provide
|
78
|
+
1. a `client_id`: can be any string and will uniquely identify the testing session.
|
79
|
+
2. a `launch_uri`: will be used by Inferno to generate a link to launch the app under test.
|
80
|
+
|
81
|
+
All the details needed to access clinical data from Inferno's simulated EHR are provided
|
82
|
+
as a part of the SMART flow, including
|
83
|
+
- the FHIR base server URL to request data from
|
84
|
+
- a bearer token to provide on all requests
|
85
|
+
|
86
|
+
#### Standalone Launch
|
87
|
+
|
88
|
+
In this mode the app under test will launch and on its own and reach out to Inferno to
|
89
|
+
begin the workflow as described in the
|
90
|
+
[standalone launch section](https://hl7.org/fhir/smart-app-launch/STU2.1/app-launch.html#launch-app-standalone-launch).
|
91
|
+
|
92
|
+
The tester must provide
|
93
|
+
1. a `client_id`: can be any string and will uniquely identify the testing session.
|
94
|
+
|
95
|
+
The app will then need to connect to Inferno as directed to initiate the SMART and DTR
|
96
|
+
workflow. The FHIR base server url that app will connect to is
|
97
|
+
`[URL prefix]/custom/dtr_smart_app/fhir` where `[URL prefix]` comes from the URL of the
|
98
|
+
test session which will be of the form `[URL prefix]/dtr_smart_app/[session id]`
|
84
99
|
|
85
100
|
### Postman-based Demo
|
86
101
|
|
87
102
|
If you do not have a DTR SMART app but would like to try the tests out, you can use
|
88
|
-
[this Postman collection](https://github.com/inferno-framework/davinci-dtr-test-kit/blob/main/config/DTR%
|
103
|
+
[this Postman collection](https://github.com/inferno-framework/davinci-dtr-test-kit/blob/main/config/DTR%20SMART%20App%20Tests%20Postman%20Demo.postman_collection.json)
|
89
104
|
to make requests against Inferno. This does not include the capability to render the complete the
|
90
105
|
questionnaires, but does have samples of correctly and incorrectly completed QuestionnaireResponses.
|
91
106
|
The following is a list of tests with the Postman requests that can be used with them:
|
92
107
|
|
93
|
-
- **
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
- **
|
108
|
+
- **Standalone launch sequence**: use requests in the `SMART App Launch` folder during
|
109
|
+
tests **1.1.1.01** or **2.1.1.01** to simulate the SMART Launch flow and obtain an access
|
110
|
+
token to use for subsequent requests. See the collection's Overview for details on the
|
111
|
+
access token's generation.
|
112
|
+
- **1.1** *Static Questionnaire Workflow*: use requests in the `Static Dinner` folder
|
113
|
+
- **1.1.1.01** *Invoke the DTR Questionnaire Package operation*: submit request `Questionnaire Package for Dinner (Static)` while this test is waiting.
|
114
|
+
- **1.1.3.01** *Save the QuestionnaireResponse after completing it*: submit request `Save QuestionnaireResponse for Dinner (Static)` while this test is waiting. If you want to see a failure, submit request `Save QuestionnaireResponse for Dinner (Static) - missing origin extension` instead.
|
115
|
+
- **2.1** *Respiratory Assist Device Questionnaire Workflow*: use requests in the `Respiratory Assist Device` folder
|
116
|
+
- **2.1.1.01** *Invoke the DTR Questionnaire Package operation*: submit request `Questionnaire Package for Resp Assist Device` while this test is waiting.
|
117
|
+
- **2.1.3.01** *Save the QuestionnaireResponse after completing it*: submit request `Save Questionnaire Response for Resp Assist Device` while this test is waiting. If you want to see a failure, submit request `Save Questionnaire Response for Resp Assist Device - unexpected override` instead.
|
118
|
+
|
119
|
+
## Configuration Details
|
120
|
+
|
121
|
+
### `fhirContext` and available instances
|
122
|
+
|
123
|
+
Once they have launched, DTR SMART Apps obtain details that drive their retrieval of questionnaires
|
124
|
+
and relevant clinical data from the payer and the EHR from [context that is passed with
|
125
|
+
the access token](https://hl7.org/fhir/smart-app-launch/STU2.1/scopes-and-launch-context.html)
|
126
|
+
provided by the EHR. Inferno cannot know ahead of time what information to provide and
|
127
|
+
what instances to make available to direct the app under test to request and render a
|
128
|
+
particular questionnaire.
|
129
|
+
|
130
|
+
Therefore, use of this test suite requests that the tester provide this information so that the
|
131
|
+
app can demonstrate its capabilities based on whatever business logic is present. These tests
|
132
|
+
currently support two context parameters that contain references to instance in the EHR and provides
|
133
|
+
testers with a way to provide those instances to Inferno so it can serve them to the app. These are
|
134
|
+
controlled by the following inputs present on each group associated with a questionnaire:
|
135
|
+
|
136
|
+
- **SMART App Launch Patient ID**: provide an `id` for the subject Patient FHIR instance.
|
137
|
+
- **SMART App Launch `fhirContext`**: provide a JSON object containing FHIR references to instances
|
138
|
+
relevant to the DTR workflow, e.g.
|
139
|
+
|
140
|
+
```
|
141
|
+
[{reference: 'Coverage/cov015'}, {reference: 'DeviceRequest/devreqe0470'}]
|
142
|
+
```
|
143
|
+
This will be included under the `fhirContext` key of the token response.
|
144
|
+
- **EHR-available resources**: provide a Bundle containing FHIR instances referenced in and from the
|
145
|
+
previous two inputs. Each instance must include an `id` element that Inferno will use in conjunction
|
146
|
+
with the `resourceType` to make the instances available at the `[server base url]/[resourceType]/[id]`.
|
147
|
+
|
148
|
+
Each questionnaire workflow group description includes a link to the questionnaire package that Inferno will return
|
149
|
+
(e.g., [here](https://github.com/inferno-framework/davinci-dtr-test-kit/blob/main/lib/davinci_dtr_test_kit/fixtures/dinner_static/questionnaire_dinner_order_static.json))
|
150
|
+
where you can find `id` and `url` values and any other details needed to determine what inputs
|
151
|
+
will allow the app under test to work with that questionnaire. Note additionally that Inferno will always
|
152
|
+
return that questionnaire in response to `$questionnaire-package` requests made during that test.
|
153
|
+
|
154
|
+
These inputs can be cumbersome to create and if you have suggestions about how to improve this process
|
155
|
+
while keeping the flexibility of Inferno to run with any app, submit a ticket
|
156
|
+
[here](https://github.com/inferno-framework/davinci-pas-test-kit/issues).
|
99
157
|
|
100
158
|
## Limitations
|
101
159
|
|
102
|
-
The DTR IG is a complex specification and these tests currently validate
|
103
|
-
|
160
|
+
The DTR IG is a complex specification and these tests currently validate conformance to only
|
161
|
+
a subset of IG requirements. Future versions of the test suite will test further
|
104
162
|
features. A few specific features of interest are listed below.
|
105
163
|
|
106
164
|
### Launching and security
|
107
165
|
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
166
|
+
This test kit contains basic SMART App Launch cabilities that may not be complete. In particular,
|
167
|
+
refresh tokens are not currently supported and scopes are not precise. To provide feedback and
|
168
|
+
input on the design of this feature and help us priortize improvements, submit a ticket
|
169
|
+
[here](https://github.com/inferno-framework/davinci-pas-test-kit/issues).
|
170
|
+
|
171
|
+
### Combined payer and EHR FHIR servers
|
172
|
+
|
173
|
+
At this time, the test suite simulates a single FHIR server that uses the same access token
|
174
|
+
for both the payer server and the EHR server. Apps under test must use the FHIR server base url
|
175
|
+
and access token identified during the SMART App Launch sequence when making requests
|
176
|
+
to retrieve questionnaires.
|
113
177
|
|
114
178
|
### Questionnaire Feature Coverage
|
115
179
|
|
@@ -25,18 +25,42 @@ module DaVinciDTRTestKit
|
|
25
25
|
|
26
26
|
version VERSION
|
27
27
|
|
28
|
-
|
29
|
-
|
30
|
-
|
28
|
+
links [
|
29
|
+
{
|
30
|
+
label: 'Report Issue',
|
31
|
+
url: 'https://github.com/inferno-framework/davinci-dtr-test-kit/issues'
|
32
|
+
},
|
33
|
+
{
|
34
|
+
label: 'Open Source',
|
35
|
+
url: 'https://github.com/inferno-framework/davinci-dtr-test-kit'
|
36
|
+
},
|
37
|
+
{
|
38
|
+
label: 'Download',
|
39
|
+
url: 'https://github.com/inferno-framework/davinci-dtr-test-kit/releases'
|
40
|
+
},
|
41
|
+
{
|
42
|
+
label: 'Implementation Guide',
|
43
|
+
url: 'https://hl7.org/fhir/us/davinci-dtr/STU2/'
|
44
|
+
}
|
45
|
+
]
|
46
|
+
|
47
|
+
# Hl7 Validator Wrapper:
|
48
|
+
fhir_resource_validator do
|
49
|
+
igs 'hl7.fhir.us.davinci-dtr#2.0.1'
|
50
|
+
|
51
|
+
exclude_message do |message|
|
52
|
+
message.message.match?(/\A\S+: \S+: URL value '.*' does not resolve/)
|
53
|
+
end
|
31
54
|
end
|
32
55
|
|
33
56
|
allow_cors QUESTIONNAIRE_PACKAGE_PATH
|
34
57
|
|
35
|
-
record_response_route :post,
|
36
|
-
|
58
|
+
record_response_route :post, PAYER_TOKEN_PATH, 'dtr_full_ehr_payer_token',
|
59
|
+
method(:payer_token_response) do |request|
|
60
|
+
DTRFullEHRSuite.extract_client_id_from_form_params(request)
|
37
61
|
end
|
38
62
|
|
39
|
-
record_response_route :post,
|
63
|
+
record_response_route :post, QUESTIONNAIRE_PACKAGE_PATH, QUESTIONNAIRE_PACKAGE_TAG,
|
40
64
|
method(:questionnaire_package_response) do |request|
|
41
65
|
DTRFullEHRSuite.extract_bearer_token(request)
|
42
66
|
end
|