davinci_dtr_test_kit 0.9.0 → 0.10.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e84658427289327e910d38a2e24e50bfe15b0c7ae8096d358df3c45d30f6f6b5
4
- data.tar.gz: 6ecc074de82b8e0533edcfd99cb9e42a82e74b5a3fe7779e19ba6403782f4cae
3
+ metadata.gz: 940914e499d108663302b9df9fac473315dff874b8e6d1f7afa354a0fb02b412
4
+ data.tar.gz: 878e70bfea50b8458ad08cbe7ad4834ae05c1c34c21a883dd1cdce883d1c3500
5
5
  SHA512:
6
- metadata.gz: f97f96957563a2705899b6c3356ff127c8c5a55423730c26c69792ab441456acb3817245126008e764d867c6fea4a789a7bc9cb295c2d728910f98cd37798117
7
- data.tar.gz: 399594d80b1d9e118abdae646fb308d221240debf4495f185f36f82e09c35d8326016d9039f68da0d1fef7c76e88bbe7c879f789127157b7ac405e29463b9191
6
+ metadata.gz: 4b6888ef1ce9334ced832a2816c614ae4fd846c376181fcb7ff698e4069afe197db2f7305ff0100de94518ef22cd6d043ddd6516e965839e4acc7d836b9d98e2
7
+ data.tar.gz: 5a4003c46adfd4f682979ef22bdf7d97dbff6c7be12416e744851eada2ece766f4dbceaa77a01468d7a5f2a4567f65e1d5885dcabfca1d42eddbc66ef575dafe
@@ -85,7 +85,7 @@ Note: authentication options for these tests have not been finalized and are sub
85
85
  ### Postman-based Demo
86
86
 
87
87
  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%20Test%20Kit.postman_collection.json)
88
+ [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
89
  to make requests against Inferno. This does not include the capability to render the complete the
90
90
  questionnaires, but does have samples of correctly and incorrectly completed QuestionnaireResponses.
91
91
  The following is a list of tests with the Postman requests that can be used with them:
@@ -25,9 +25,32 @@ module DaVinciDTRTestKit
25
25
 
26
26
  version VERSION
27
27
 
28
- # All FHIR validation requsets will use this FHIR validator
29
- validator do
30
- url ENV.fetch('VALIDATOR_URL')
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
@@ -16,6 +16,25 @@ module DaVinciDTRTestKit
16
16
 
17
17
  version VERSION
18
18
 
19
+ links [
20
+ {
21
+ label: 'Report Issue',
22
+ url: 'https://github.com/inferno-framework/davinci-dtr-test-kit/issues'
23
+ },
24
+ {
25
+ label: 'Open Source',
26
+ url: 'https://github.com/inferno-framework/davinci-dtr-test-kit'
27
+ },
28
+ {
29
+ label: 'Download',
30
+ url: 'https://github.com/inferno-framework/davinci-dtr-test-kit/releases'
31
+ },
32
+ {
33
+ label: 'Implementation Guide',
34
+ url: 'https://hl7.org/fhir/us/davinci-dtr/STU2/'
35
+ }
36
+ ]
37
+
19
38
  # These inputs will be available to all tests in this suite
20
39
  input :url,
21
40
  title: 'FHIR Server Base Url'
@@ -31,9 +50,13 @@ module DaVinciDTRTestKit
31
50
  oauth_credentials :credentials
32
51
  end
33
52
 
34
- # All FHIR validation requsets will use this FHIR validator
35
- validator do
36
- url ENV.fetch('VALIDATOR_URL')
53
+ # Hl7 Validator Wrapper:
54
+ fhir_resource_validator do
55
+ igs 'hl7.fhir.us.davinci-dtr#2.0.1'
56
+
57
+ exclude_message do |message|
58
+ message.message.match?(/\A\S+: \S+: URL value '.*' does not resolve/)
59
+ end
37
60
  end
38
61
  end
39
62
  end
@@ -16,6 +16,26 @@ module DaVinciDTRTestKit
16
16
  description File.read(File.join(__dir__, 'docs', 'dtr_payer_server_suite_description_v201.md'))
17
17
 
18
18
  version VERSION
19
+
20
+ links [
21
+ {
22
+ label: 'Report Issue',
23
+ url: 'https://github.com/inferno-framework/davinci-dtr-test-kit/issues'
24
+ },
25
+ {
26
+ label: 'Open Source',
27
+ url: 'https://github.com/inferno-framework/davinci-dtr-test-kit'
28
+ },
29
+ {
30
+ label: 'Download',
31
+ url: 'https://github.com/inferno-framework/davinci-dtr-test-kit/releases'
32
+ },
33
+ {
34
+ label: 'Implementation Guide',
35
+ url: 'https://hl7.org/fhir/us/davinci-dtr/STU2/'
36
+ }
37
+ ]
38
+
19
39
  # These inputs will be available to all tests in this suite
20
40
 
21
41
  input :retrieval_method,
@@ -73,9 +93,13 @@ module DaVinciDTRTestKit
73
93
  oauth_credentials :credentials
74
94
  end
75
95
 
76
- # All FHIR validation requsets will use this FHIR validator
77
- validator do
78
- url ENV.fetch('VALIDATOR_URL')
96
+ # Hl7 Validator Wrapper:
97
+ fhir_resource_validator do
98
+ igs 'hl7.fhir.us.davinci-dtr#2.0.1'
99
+
100
+ exclude_message do |message|
101
+ message.message.match?(/\A\S+: \S+: URL value '.*' does not resolve/)
102
+ end
79
103
  end
80
104
 
81
105
  allow_cors QUESTIONNAIRE_PACKAGE_PATH, NEXT_PATH
@@ -20,9 +20,32 @@ module DaVinciDTRTestKit
20
20
 
21
21
  version VERSION
22
22
 
23
- # All FHIR validation requsets will use this FHIR validator
24
- validator do
25
- url ENV.fetch('VALIDATOR_URL')
23
+ links [
24
+ {
25
+ label: 'Report Issue',
26
+ url: 'https://github.com/inferno-framework/davinci-dtr-test-kit/issues'
27
+ },
28
+ {
29
+ label: 'Open Source',
30
+ url: 'https://github.com/inferno-framework/davinci-dtr-test-kit'
31
+ },
32
+ {
33
+ label: 'Download',
34
+ url: 'https://github.com/inferno-framework/davinci-dtr-test-kit/releases'
35
+ },
36
+ {
37
+ label: 'Implementation Guide',
38
+ url: 'https://hl7.org/fhir/us/davinci-dtr/STU2/'
39
+ }
40
+ ]
41
+
42
+ # Hl7 Validator Wrapper:
43
+ fhir_resource_validator do
44
+ igs 'hl7.fhir.us.davinci-dtr#2.0.1'
45
+
46
+ exclude_message do |message|
47
+ message.message.match?(/\A\S+: \S+: URL value '.*' does not resolve/)
48
+ end
26
49
  end
27
50
 
28
51
  allow_cors QUESTIONNAIRE_PACKAGE_PATH, QUESTIONNAIRE_RESPONSE_PATH, FHIR_RESOURCE_PATH, FHIR_SEARCH_PATH
@@ -25,7 +25,7 @@ module DaVinciDTRTestKit
25
25
  url_input = JSON.parse(test_result.input_json).find { |input| input['name'] == 'url' }
26
26
  client = FHIR::Client.new(url_input['value'])
27
27
  client.default_json
28
- endpoint = endpoint_input['value'].nil? ? '/Questionnaire/$questionnaire-package' : endpoint_input['value']
28
+ endpoint = endpoint_input.to_h['value'].nil? ? '/Questionnaire/$questionnaire-package' : endpoint_input['value']
29
29
  payer_response = client.send(:post, endpoint, JSON.parse(request.request_body),
30
30
  { 'Content-Type' => 'application/json' })
31
31
 
@@ -37,11 +37,13 @@ module DaVinciDTRTestKit
37
37
  description: 'Manual Flow',
38
38
  type: 'textarea'
39
39
 
40
+ input :access_token, :retrieval_method
41
+
40
42
  input_order :retrieval_method,
41
- :url,
43
+ :access_token,
42
44
  :initial_static_questionnaire_request
43
45
 
44
- test from: :dtr_v201_payer_static_questionnaire_request_test, receives_request: :statice_questionnaire_request
46
+ test from: :dtr_v201_payer_static_questionnaire_request_test, receives_request: :static_questionnaire_request
45
47
  test from: :dtr_v201_payer_static_form_request_validation_test
46
48
  test from: :dtr_v201_payer_static_form_response_test
47
49
  test from: :dtr_v201_payer_static_form_libraries_test
@@ -12,8 +12,8 @@ module DaVinciDTRTestKit
12
12
 
13
13
  run do
14
14
  skip_if retrieval_method == 'Adaptive', 'Performing only adaptive flow tests - only one flow is required.'
15
- skip_if scratch[:questionnaire_bundle].nil?, 'No questionnaire bundle returned.'
16
- check_libraries(scratch[:questionnaire_bundle])
15
+ skip_if scratch[:output_parameters].nil?, 'No questionnaire bundle returned.'
16
+ check_libraries(scratch[:output_parameters])
17
17
  end
18
18
  end
19
19
  end
@@ -12,9 +12,9 @@ module DaVinciDTRTestKit
12
12
 
13
13
  run do
14
14
  skip_if retrieval_method == 'Adaptive', 'Performing only adaptive flow tests - only one flow is required.'
15
- skip_if scratch[:questionnaire_bundle].nil?, 'No questionnaire bundle returned.'
16
- questionnaire_items_test(scratch[:questionnaire_bundle], final_cql_test: true)
17
- scratch[:questionnaire_bundle] = nil
15
+ skip_if scratch[:output_parameters].nil?, 'No questionnaire bundle returned.'
16
+ questionnaire_items_test(scratch[:output_parameters], final_cql_test: true)
17
+ scratch[:output_parameters] = nil
18
18
  end
19
19
  end
20
20
  end
@@ -12,8 +12,8 @@ module DaVinciDTRTestKit
12
12
 
13
13
  run do
14
14
  skip_if retrieval_method == 'Adaptive', 'Performing only adaptive flow tests - only one flow is required.'
15
- skip_if scratch[:questionnaire_bundle].nil?, 'No questionnaire bundle returned.'
16
- questionnaire_extensions_test(scratch[:questionnaire_bundle])
15
+ skip_if scratch[:output_parameters].nil?, 'No questionnaire bundle returned.'
16
+ questionnaire_extensions_test(scratch[:output_parameters])
17
17
  end
18
18
  end
19
19
  end
@@ -9,6 +9,7 @@ module DaVinciDTRTestKit
9
9
  )
10
10
  id :dtr_v201_payer_static_questionnaire_request_test
11
11
  config options: { accepts_multiple_requests: false }
12
+ input :initial_static_questionnaire_request, :access_token, :retrieval_method, :url
12
13
 
13
14
  run do
14
15
  skip_if retrieval_method == 'Adaptive', 'Performing only adaptive flow tests - only one flow is required.'
@@ -18,6 +18,7 @@ module DaVinciDTRTestKit
18
18
  This test may process multiple resources, labeling messages with the corresponding tested resources
19
19
  in the order that they were received.
20
20
  )
21
+ input :initial_static_questionnaire_request, :access_token, :retrieval_method
21
22
 
22
23
  run do
23
24
  skip_if retrieval_method == 'Adaptive', 'Performing only adaptive flow tests - only one flow is required.'
@@ -25,8 +26,8 @@ module DaVinciDTRTestKit
25
26
  using_manual_entry = false
26
27
  skip_if access_token.nil?, 'No access token provided - required for client flow.'
27
28
  resources = load_tagged_requests(QUESTIONNAIRE_TAG)
28
- skip_if resources.nil?, 'No request resource received from the client.'
29
- perform_request_validation_test(
29
+ skip_if resources.blank?, 'No request resource received from the client.'
30
+ assert perform_request_validation_test(
30
31
  resources,
31
32
  :parameters,
32
33
  'http://hl7.org/fhir/us/davinci-dtr/StructureDefinition/dtr-qpackage-input-parameters',
@@ -34,9 +35,10 @@ module DaVinciDTRTestKit
34
35
  using_manual_entry
35
36
  )
36
37
  else
38
+ # TODO: fix redundant logic here
37
39
  skip_if initial_static_questionnaire_request.nil?, 'No request resource was provided - required for manual flow'
38
40
  request = FHIR.from_contents(initial_static_questionnaire_request)
39
- assert_valid_resource(resource: request, profile_url: 'http://hl7.org/fhir/us/davinci-dtr/StructureDefinition/dtr-qpackage-input-parameters')
41
+ assert assert_valid_resource(resource: request, profile_url: 'http://hl7.org/fhir/us/davinci-dtr/StructureDefinition/dtr-qpackage-input-parameters')
40
42
  end
41
43
  rescue Inferno::Exceptions::AssertionException => e
42
44
  msg = e.message.to_s.strip
@@ -18,30 +18,34 @@ module DaVinciDTRTestKit
18
18
  This test may process multiple resources, labeling messages with the corresponding tested resources
19
19
  in the order that they were received.
20
20
  )
21
+ input :url
21
22
 
22
23
  run do
23
24
  skip_if retrieval_method == 'Adaptive', 'Performing only adaptive flow tests - only one flow is required.'
24
-
25
25
  if initial_static_questionnaire_request.nil?
26
26
  skip_if access_token.nil?, 'No access token provided - required for client flow.'
27
27
  resources = load_tagged_requests(QUESTIONNAIRE_TAG)
28
28
  skip_if resources.nil?, 'No request resource received from the client.'
29
- scratch[:questionnaire_bundle] = resources
29
+ scratch[:output_parameters] = resources
30
30
  perform_response_validation_test(
31
31
  resources,
32
32
  :parameters,
33
33
  'http://hl7.org/fhir/us/davinci-dtr/StructureDefinition/dtr-qpackage-output-parameters'
34
34
  )
35
35
  else
36
- FHIR.from_contents(initial_static_questionnaire_request)
37
- fhir_operation("#{url}/Questionnaire/$questionnaire-package",
38
- body: JSON.parse(initial_static_questionnaire_request),
39
- headers: { 'Content-Type': 'application/json' })
40
- scratch[:questionnaire_bundle] = resource
41
-
42
- assert_response_status(200)
43
- assert_resource_type(:parameters)
44
- questionnaire_bundle = resource.parameter.find { |param| param.name == 'return' }&.resource
36
+ request = fhir_operation("#{url}/Questionnaire/$questionnaire-package",
37
+ body: JSON.parse(initial_static_questionnaire_request),
38
+ headers: { 'Content-Type': 'application/json' })
39
+ resource = FHIR.from_contents(request.response[:body])
40
+ scratch[:output_parameters] = resource
41
+ assert_response_status([200, 201], response: request.response)
42
+ assert_resource_type(:parameters, resource:)
43
+ perform_response_validation_test(
44
+ [request],
45
+ :parameters,
46
+ 'http://hl7.org/fhir/us/davinci-dtr/StructureDefinition/dtr-qpackage-output-parameters'
47
+ )
48
+ questionnaire_bundle = resource.parameter.find { |param| param.resource.resourceType == 'Bundle' }&.resource
45
49
  assert questionnaire_bundle, 'No questionnaire bundle found in the response'
46
50
  assert_valid_resource(resource: questionnaire_bundle, profile_url: 'http://hl7.org/fhir/us/davinci-dtr/StructureDefinition/DTR-QPackageBundle')
47
51
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DaVinciDTRTestKit
4
- VERSION = '0.9.0'.freeze
4
+ VERSION = '0.10.0'
5
5
  end
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.9.0
4
+ version: 0.10.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-06-07 00:00:00.000000000 Z
13
+ date: 2024-07-08 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: inferno_core