davinci_dtr_test_kit 0.11.0 → 0.12.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/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
data/lib/davinci_dtr_test_kit/payer_server_groups/payer_server_adaptive_response_validation_test.rb
CHANGED
@@ -15,35 +15,33 @@ module DaVinciDTRTestKit
|
|
15
15
|
to the bound ValueSet. Quantity, Coding, and code element bindings will fail if their code/system are not found in
|
16
16
|
the valueset.
|
17
17
|
|
18
|
-
This test may process multiple resources, labeling messages with the corresponding tested resources
|
19
18
|
This test may process multiple resources, labeling messages with the corresponding tested resources
|
20
19
|
in the order that they were received.
|
21
20
|
)
|
22
21
|
|
23
22
|
run do
|
24
23
|
skip_if retrieval_method == 'Static', 'Performing only static flow tests - only one flow is required.'
|
24
|
+
profile_with_version = 'http://hl7.org/fhir/us/davinci-dtr/StructureDefinition/dtr-qpackage-output-parameters|2.0.1'
|
25
25
|
endpoint = custom_endpoint.blank? ? '/Questionnaire/$questionnaire-package' : custom_endpoint
|
26
26
|
if initial_adaptive_questionnaire_request.nil?
|
27
|
-
|
27
|
+
# making the assumption that only one response was received - if there were multiple, we are only validating the first
|
28
|
+
response = load_tagged_requests(QUESTIONNAIRE_TAG)[0]
|
29
|
+
scratch[:adaptive_responses] = [response]
|
30
|
+
resource = FHIR.from_contents(response.response[:body])
|
28
31
|
else
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
headers: { 'Content-Type': 'application/json' }))
|
34
|
-
end
|
35
|
-
else
|
36
|
-
resources.push(fhir_operation("#{url}#{endpoint}", body: JSON.parse(initial_adaptive_questionnaire_request),
|
37
|
-
headers: { 'Content-Type': 'application/json' }))
|
38
|
-
end
|
32
|
+
response = fhir_operation("#{url}#{endpoint}", body: JSON.parse(initial_adaptive_questionnaire_request),
|
33
|
+
headers: { 'Content-Type': 'application/json' })
|
34
|
+
resource = FHIR.from_contents(response.response[:body])
|
35
|
+
scratch[:adaptive_responses] = [response]
|
39
36
|
end
|
40
|
-
|
37
|
+
|
41
38
|
assert !scratch[:adaptive_responses].nil?, 'No resources to validate.'
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
39
|
+
assert_response_status([200, 201], response: response.response)
|
40
|
+
assert_resource_type(:parameters, resource: resource)
|
41
|
+
assert_valid_resource(resource: resource, profile_url: profile_with_version)
|
42
|
+
questionnaire_bundle = resource.parameter.find { |param| param.resource.resourceType == 'Bundle' }&.resource
|
43
|
+
assert questionnaire_bundle, 'No questionnaire bundle found in the response'
|
44
|
+
assert_valid_resource(resource: questionnaire_bundle, profile_url: 'http://hl7.org/fhir/us/davinci-dtr/StructureDefinition/DTR-QPackageBundle|2.0.1')
|
47
45
|
end
|
48
46
|
end
|
49
47
|
end
|
data/lib/davinci_dtr_test_kit/payer_server_groups/payer_server_next_request_validation_test.rb
CHANGED
@@ -3,7 +3,7 @@ module DaVinciDTRTestKit
|
|
3
3
|
class PayerAdaptiveFormNextRequestTest < Inferno::Test
|
4
4
|
include URLs
|
5
5
|
include DaVinciDTRTestKit::ValidationTest
|
6
|
-
title '
|
6
|
+
title 'User Input Validation: Next Question request is valid'
|
7
7
|
description %(
|
8
8
|
This test validates the conformance of the client's request to the
|
9
9
|
[SDC Parameters Next Question In](http://hl7.org/fhir/uv/sdc/StructureDefinition/parameters-questionnaire-next-question-in)
|
@@ -49,13 +49,12 @@ module DaVinciDTRTestKit
|
|
49
49
|
using_manual_entry
|
50
50
|
)
|
51
51
|
else
|
52
|
-
|
53
|
-
|
54
|
-
or http://hl7.org/fhir/uv/sdc/StructureDefinition/parameters-questionnaire-next-question-in"
|
52
|
+
messages << { type: 'error',
|
53
|
+
message: format_markdown("No resources were of type 'Parameters' or 'QuestionnaireResponse'") }
|
55
54
|
end
|
56
|
-
|
57
|
-
|
58
|
-
|
55
|
+
errors_found = messages.any? { |message| message[:type] == 'error' }
|
56
|
+
skip_if errors_found, "No resources conform to the profiles http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaireresponse-adapt
|
57
|
+
or http://hl7.org/fhir/uv/sdc/StructureDefinition/parameters-questionnaire-next-question-in"
|
59
58
|
end
|
60
59
|
end
|
61
60
|
end
|
data/lib/davinci_dtr_test_kit/payer_server_groups/payer_server_next_response_validation_test.rb
CHANGED
@@ -14,7 +14,6 @@ module DaVinciDTRTestKit
|
|
14
14
|
to the bound ValueSet. Quantity, Coding, and code element bindings will fail if their code/system are not found in
|
15
15
|
the valueset.
|
16
16
|
|
17
|
-
This test may process multiple resources, labeling messages with the corresponding tested resources
|
18
17
|
This test may process multiple resources, labeling messages with the corresponding tested resources
|
19
18
|
in the order that they were received.
|
20
19
|
)
|
@@ -38,6 +37,9 @@ module DaVinciDTRTestKit
|
|
38
37
|
:questionnaireResponse,
|
39
38
|
'http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaireresponse'
|
40
39
|
)
|
40
|
+
errors_found = messages.any? { |message| message[:type] == 'error' }
|
41
|
+
skip_if errors_found, "No resources conform to the profiles http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaireresponse-adapt
|
42
|
+
or http://hl7.org/fhir/uv/sdc/StructureDefinition/parameters-questionnaire-next-question-in"
|
41
43
|
end
|
42
44
|
end
|
43
45
|
end
|
@@ -5,7 +5,7 @@ module DaVinciDTRTestKit
|
|
5
5
|
include DaVinciDTRTestKit::ValidationTest
|
6
6
|
include URLs
|
7
7
|
id :dtr_v201_payer_static_form_request_validation_test
|
8
|
-
title '
|
8
|
+
title 'User Input Validation: Client sends payer server a request for a static form'
|
9
9
|
description %(
|
10
10
|
Inferno will validate that the request to the payer server conforms to the
|
11
11
|
[Input Parameters profile](http://hl7.org/fhir/us/davinci-dtr/StructureDefinition/dtr-qpackage-input-parameters).
|
@@ -14,35 +14,24 @@ module DaVinciDTRTestKit
|
|
14
14
|
values. CodeableConcept element bindings will fail if none of their codings have a code/system belonging
|
15
15
|
to the bound ValueSet. Quantity, Coding, and code element bindings will fail if their code/system
|
16
16
|
are not found in the valueset.
|
17
|
-
|
18
|
-
This test may process multiple resources, labeling messages with the corresponding tested resources
|
19
|
-
in the order that they were received.
|
20
17
|
)
|
21
18
|
input :initial_static_questionnaire_request, :access_token, :retrieval_method
|
22
19
|
|
23
20
|
run do
|
24
21
|
skip_if retrieval_method == 'Adaptive', 'Performing only adaptive flow tests - only one flow is required.'
|
22
|
+
profile_with_version = 'http://hl7.org/fhir/us/davinci-dtr/StructureDefinition/dtr-qpackage-input-parameters|2.0.1'
|
25
23
|
if initial_static_questionnaire_request.nil?
|
26
|
-
using_manual_entry = false
|
27
24
|
skip_if access_token.nil?, 'No access token provided - required for client flow.'
|
28
|
-
|
29
|
-
skip_if
|
30
|
-
|
31
|
-
|
32
|
-
:parameters,
|
33
|
-
'http://hl7.org/fhir/us/davinci-dtr/StructureDefinition/dtr-qpackage-input-parameters',
|
34
|
-
questionnaire_package_url,
|
35
|
-
using_manual_entry
|
36
|
-
)
|
25
|
+
requests = load_tagged_requests(QUESTIONNAIRE_TAG)
|
26
|
+
skip_if requests.blank?, 'No request resource received from the client.'
|
27
|
+
# making the assumption that only one request was made here - if there were multiple, we are only validating the first
|
28
|
+
resource_is_valid?(resource: FHIR.from_contents(requests[0].request[:body]), profile_url: profile_with_version)
|
37
29
|
else
|
38
|
-
# TODO: fix redundant logic here
|
39
|
-
skip_if initial_static_questionnaire_request.nil?, 'No request resource was provided - required for manual flow'
|
40
30
|
request = FHIR.from_contents(initial_static_questionnaire_request)
|
41
|
-
|
31
|
+
resource_is_valid?(resource: request, profile_url: profile_with_version)
|
42
32
|
end
|
43
|
-
|
44
|
-
|
45
|
-
skip msg
|
33
|
+
errors_found = messages.any? { |message| message[:type] == 'error' }
|
34
|
+
skip_if errors_found, "Resource does not conform to the profile #{profile_with_version}"
|
46
35
|
end
|
47
36
|
end
|
48
37
|
end
|
@@ -15,39 +15,32 @@ module DaVinciDTRTestKit
|
|
15
15
|
to the bound ValueSet. Quantity, Coding, and code element bindings will fail if their code/system are not found in
|
16
16
|
the valueset.
|
17
17
|
|
18
|
-
This test may process multiple resources, labeling messages with the corresponding tested resources
|
19
|
-
in the order that they were received.
|
20
18
|
)
|
21
19
|
input :url
|
22
20
|
|
23
21
|
run do
|
24
22
|
skip_if retrieval_method == 'Adaptive', 'Performing only adaptive flow tests - only one flow is required.'
|
23
|
+
profile_with_version = 'http://hl7.org/fhir/us/davinci-dtr/StructureDefinition/dtr-qpackage-output-parameters|2.0.1'
|
25
24
|
if initial_static_questionnaire_request.nil?
|
26
25
|
skip_if access_token.nil?, 'No access token provided - required for client flow.'
|
27
26
|
resources = load_tagged_requests(QUESTIONNAIRE_TAG)
|
28
27
|
skip_if resources.nil?, 'No request resource received from the client.'
|
29
28
|
scratch[:output_parameters] = resources
|
30
|
-
|
31
|
-
|
32
|
-
:parameters,
|
33
|
-
'http://hl7.org/fhir/us/davinci-dtr/StructureDefinition/dtr-qpackage-output-parameters'
|
34
|
-
)
|
29
|
+
# making the assumption that only one response was received- if there were multiple, we are only validating the first
|
30
|
+
assert_valid_resource(resource: FHIR.from_contents(resources[0].request[:body]), profile_url: profile_with_version)
|
35
31
|
else
|
36
32
|
request = fhir_operation("#{url}/Questionnaire/$questionnaire-package",
|
37
33
|
body: JSON.parse(initial_static_questionnaire_request),
|
38
34
|
headers: { 'Content-Type': 'application/json' })
|
35
|
+
assert_valid_json(request.response[:body])
|
39
36
|
resource = FHIR.from_contents(request.response[:body])
|
40
37
|
scratch[:output_parameters] = resource
|
41
38
|
assert_response_status([200, 201], response: request.response)
|
42
|
-
assert_resource_type(:parameters, resource:)
|
43
|
-
|
44
|
-
[request],
|
45
|
-
:parameters,
|
46
|
-
'http://hl7.org/fhir/us/davinci-dtr/StructureDefinition/dtr-qpackage-output-parameters'
|
47
|
-
)
|
39
|
+
assert_resource_type(:parameters, resource: resource)
|
40
|
+
assert_valid_resource(resource: resource, profile_url: profile_with_version)
|
48
41
|
questionnaire_bundle = resource.parameter.find { |param| param.resource.resourceType == 'Bundle' }&.resource
|
49
42
|
assert questionnaire_bundle, 'No questionnaire bundle found in the response'
|
50
|
-
assert_valid_resource(resource: questionnaire_bundle, profile_url: 'http://hl7.org/fhir/us/davinci-dtr/StructureDefinition/DTR-QPackageBundle')
|
43
|
+
assert_valid_resource(resource: questionnaire_bundle, profile_url: 'http://hl7.org/fhir/us/davinci-dtr/StructureDefinition/DTR-QPackageBundle|2.0.1')
|
51
44
|
end
|
52
45
|
end
|
53
46
|
end
|
@@ -5,14 +5,15 @@ module DaVinciDTRTestKit
|
|
5
5
|
end
|
6
6
|
|
7
7
|
def validate_resource(fhir_resource, resource_type, profile_url, index)
|
8
|
-
assert fhir_resource.present?, 'Resource does not contain a recognized FHIR object'
|
9
8
|
begin
|
9
|
+
assert fhir_resource.present?, 'Resource does not contain a recognized FHIR object'
|
10
10
|
assert_resource_type(resource_type, resource: fhir_resource)
|
11
11
|
assert_valid_resource(resource: fhir_resource,
|
12
12
|
profile_url:)
|
13
13
|
rescue StandardError => e
|
14
|
+
add_message('error', e.message)
|
14
15
|
messages.each do |message|
|
15
|
-
message[:message].prepend("[Resource #{index + 1}] ")
|
16
|
+
message[:message].prepend("[Resource #{index + 1}] ") unless message[:message].start_with? '[Resource'
|
16
17
|
end
|
17
18
|
if tests_failed[profile_url].blank?
|
18
19
|
tests_failed[profile_url] = [e]
|
@@ -37,19 +38,16 @@ module DaVinciDTRTestKit
|
|
37
38
|
resources = [resources] unless resources.is_a?(Array)
|
38
39
|
resources.each_with_index do |resource, index|
|
39
40
|
if using_manual_entry
|
40
|
-
assert_valid_json(resource.to_json)
|
41
41
|
fhir_resource = FHIR.from_contents(resource.to_json)
|
42
42
|
else
|
43
|
-
|
44
|
-
|
45
|
-
|
43
|
+
if resource.url != resource_url
|
44
|
+
messages << { type: 'warning',
|
45
|
+
message: format_markdown("Request made to wrong URL: #{resource.request[:url]}. Should instead be to #{resource_url}") }
|
46
|
+
end
|
46
47
|
fhir_resource = FHIR.from_contents(resource.request[:body])
|
47
48
|
end
|
48
49
|
validate_resource(fhir_resource, resource_type, profile_url, index)
|
49
50
|
end
|
50
|
-
return if tests_failed[profile_url].blank?
|
51
|
-
|
52
|
-
raise tests_failed[profile_url][0]
|
53
51
|
end
|
54
52
|
|
55
53
|
def perform_response_validation_test(
|
@@ -60,6 +58,7 @@ module DaVinciDTRTestKit
|
|
60
58
|
omit_if resources.blank?,
|
61
59
|
"No #{resource_type} resources provided so the #{profile_url} profile does not apply"
|
62
60
|
resources.each_with_index do |resource, index|
|
61
|
+
assert_valid_json(resource.response[:body])
|
63
62
|
fhir_resource = FHIR.from_contents(resource.response[:body])
|
64
63
|
assert_response_status([200, 202], request: resource, response: resource.response)
|
65
64
|
validate_resource(fhir_resource, resource_type, profile_url, index)
|
data/lib/davinci_dtr_test_kit.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
1
|
require_relative 'davinci_dtr_test_kit/dtr_payer_server_suite'
|
2
2
|
require_relative 'davinci_dtr_test_kit/dtr_smart_app_suite'
|
3
|
-
|
3
|
+
require_relative 'davinci_dtr_test_kit/dtr_full_ehr_suite'
|
4
4
|
# require_relative 'davinci_dtr_test_kit/dtr_light_ehr_suite'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: davinci_dtr_test_kit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.12.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Karl Naden
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2024-
|
13
|
+
date: 2024-09-19 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: inferno_core
|
@@ -18,14 +18,14 @@ dependencies:
|
|
18
18
|
requirements:
|
19
19
|
- - "~>"
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version: 0.4.
|
21
|
+
version: 0.4.42
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
24
|
version_requirements: !ruby/object:Gem::Requirement
|
25
25
|
requirements:
|
26
26
|
- - "~>"
|
27
27
|
- !ruby/object:Gem::Version
|
28
|
-
version: 0.4.
|
28
|
+
version: 0.4.42
|
29
29
|
- !ruby/object:Gem::Dependency
|
30
30
|
name: jwt
|
31
31
|
requirement: !ruby/object:Gem::Requirement
|
@@ -54,12 +54,20 @@ files:
|
|
54
54
|
- lib/davinci_dtr_test_kit/auth_groups/token_request_test.rb
|
55
55
|
- lib/davinci_dtr_test_kit/auth_groups/token_validation_test.rb
|
56
56
|
- lib/davinci_dtr_test_kit/client_groups/dinner_adaptive/dtr_smart_app_questionnaire_workflow_group.rb
|
57
|
-
- lib/davinci_dtr_test_kit/client_groups/dinner_static/
|
58
|
-
- lib/davinci_dtr_test_kit/client_groups/dinner_static/
|
57
|
+
- lib/davinci_dtr_test_kit/client_groups/dinner_static/dtr_full_ehr_dinner_questionnaire_package_request_test.rb
|
58
|
+
- lib/davinci_dtr_test_kit/client_groups/dinner_static/dtr_full_ehr_launch_attestation_test.rb
|
59
|
+
- lib/davinci_dtr_test_kit/client_groups/dinner_static/dtr_full_ehr_prepopulation_attestation_test.rb
|
60
|
+
- lib/davinci_dtr_test_kit/client_groups/dinner_static/dtr_full_ehr_prepopulation_override_attestation_test.rb
|
61
|
+
- lib/davinci_dtr_test_kit/client_groups/dinner_static/dtr_full_ehr_prepopulation_representation_attestation_test.rb
|
62
|
+
- lib/davinci_dtr_test_kit/client_groups/dinner_static/dtr_full_ehr_questionnaire_workflow_group.rb
|
63
|
+
- lib/davinci_dtr_test_kit/client_groups/dinner_static/dtr_full_ehr_rendering_enabled_questions_attestation_test.rb
|
64
|
+
- lib/davinci_dtr_test_kit/client_groups/dinner_static/dtr_full_ehr_store_attestation_test.rb
|
65
|
+
- lib/davinci_dtr_test_kit/client_groups/dinner_static/dtr_smart_app_dinner_questionnaire_package_request_test.rb
|
66
|
+
- lib/davinci_dtr_test_kit/client_groups/dinner_static/dtr_smart_app_prepopulation_attestation_test.rb
|
67
|
+
- lib/davinci_dtr_test_kit/client_groups/dinner_static/dtr_smart_app_prepopulation_override_attestation_test.rb
|
68
|
+
- lib/davinci_dtr_test_kit/client_groups/dinner_static/dtr_smart_app_questionnaire_response_save_test.rb
|
59
69
|
- lib/davinci_dtr_test_kit/client_groups/dinner_static/dtr_smart_app_questionnaire_workflow_group.rb
|
60
|
-
- lib/davinci_dtr_test_kit/client_groups/dinner_static/
|
61
|
-
- lib/davinci_dtr_test_kit/client_groups/dinner_static/prepopulation_override_attestation_test.rb
|
62
|
-
- lib/davinci_dtr_test_kit/client_groups/dinner_static/rendering_enabled_questions_attestation_test.rb
|
70
|
+
- lib/davinci_dtr_test_kit/client_groups/dinner_static/dtr_smart_app_rendering_enabled_questions_attestation_test.rb
|
63
71
|
- lib/davinci_dtr_test_kit/client_groups/resp_assist_device/dtr_full_ehr_questionnaire_workflow_group.rb
|
64
72
|
- lib/davinci_dtr_test_kit/client_groups/resp_assist_device/dtr_questionnaire_package_group.rb
|
65
73
|
- lib/davinci_dtr_test_kit/client_groups/resp_assist_device/dtr_questionnaire_rendering_attestation_test.rb
|
@@ -72,6 +80,7 @@ files:
|
|
72
80
|
- lib/davinci_dtr_test_kit/client_groups/shared/dtr_questionnaire_response_basic_conformance_test.rb
|
73
81
|
- lib/davinci_dtr_test_kit/client_groups/shared/dtr_questionnaire_response_pre_population_test.rb
|
74
82
|
- lib/davinci_dtr_test_kit/cql_test.rb
|
83
|
+
- lib/davinci_dtr_test_kit/docs/dtr_full_ehr_suite_description_v201.md
|
75
84
|
- lib/davinci_dtr_test_kit/docs/dtr_payer_server_suite_description_v201.md
|
76
85
|
- lib/davinci_dtr_test_kit/docs/dtr_smart_app_suite_description_v201.md
|
77
86
|
- lib/davinci_dtr_test_kit/dtr_full_ehr_suite.rb
|
@@ -1,97 +0,0 @@
|
|
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
|