bulk_data_test_kit 0.9.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.
Files changed (50) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +201 -0
  3. data/lib/bulk_data_test_kit/bulk_data_jwks.json +58 -0
  4. data/lib/bulk_data_test_kit/bulk_data_test_kit_properties.rb +20 -0
  5. data/lib/bulk_data_test_kit/bulk_export_validation_tester.rb +214 -0
  6. data/lib/bulk_data_test_kit/export_cancel_tests.rb +43 -0
  7. data/lib/bulk_data_test_kit/export_kick_off_performer.rb +26 -0
  8. data/lib/bulk_data_test_kit/export_operation_tests.rb +171 -0
  9. data/lib/bulk_data_test_kit/export_parameters_tests.rb +49 -0
  10. data/lib/bulk_data_test_kit/v1.0.1/bulk_data_export_cancel_test.rb +35 -0
  11. data/lib/bulk_data_test_kit/v1.0.1/bulk_data_export_kick_off_test.rb +37 -0
  12. data/lib/bulk_data_test_kit/v1.0.1/bulk_data_export_operation_support_test.rb +46 -0
  13. data/lib/bulk_data_test_kit/v1.0.1/bulk_data_export_tests_test_group.rb +41 -0
  14. data/lib/bulk_data_test_kit/v1.0.1/bulk_data_group_export_test_group.rb +24 -0
  15. data/lib/bulk_data_test_kit/v1.0.1/bulk_data_multiple_patients_test.rb +23 -0
  16. data/lib/bulk_data_test_kit/v1.0.1/bulk_data_ndjson_download_test.rb +33 -0
  17. data/lib/bulk_data_test_kit/v1.0.1/bulk_data_no_auth_test.rb +35 -0
  18. data/lib/bulk_data_test_kit/v1.0.1/bulk_data_output_check_test.rb +45 -0
  19. data/lib/bulk_data_test_kit/v1.0.1/bulk_data_patient_export_test_group.rb +24 -0
  20. data/lib/bulk_data_test_kit/v1.0.1/bulk_data_smart_backend_services_group.rb +21 -0
  21. data/lib/bulk_data_test_kit/v1.0.1/bulk_data_status_check_test.rb +43 -0
  22. data/lib/bulk_data_test_kit/v1.0.1/bulk_data_system_export_test_group.rb +24 -0
  23. data/lib/bulk_data_test_kit/v1.0.1/bulk_data_test_suite.rb +166 -0
  24. data/lib/bulk_data_test_kit/v1.0.1/bulk_data_valid_resources_test.rb +30 -0
  25. data/lib/bulk_data_test_kit/v1.0.1/group/bulk_data_group_export_cancel_group.rb +32 -0
  26. data/lib/bulk_data_test_kit/v1.0.1/group/bulk_data_group_export_group.rb +102 -0
  27. data/lib/bulk_data_test_kit/v1.0.1/group/bulk_data_group_export_validation_group.rb +51 -0
  28. data/lib/bulk_data_test_kit/v1.0.1/patient/bulk_data_patient_export_cancel_group.rb +32 -0
  29. data/lib/bulk_data_test_kit/v1.0.1/patient/bulk_data_patient_export_group.rb +108 -0
  30. data/lib/bulk_data_test_kit/v1.0.1/patient/bulk_data_patient_export_validation_group.rb +63 -0
  31. data/lib/bulk_data_test_kit/v1.0.1/system_export/bulk_data_system_export_cancel_group.rb +32 -0
  32. data/lib/bulk_data_test_kit/v1.0.1/system_export/bulk_data_system_export_group.rb +108 -0
  33. data/lib/bulk_data_test_kit/v1.0.1/system_export/bulk_data_system_export_validation_group.rb +63 -0
  34. data/lib/bulk_data_test_kit/v2.0.0/bulk_data_export_cancel_test.rb +28 -0
  35. data/lib/bulk_data_test_kit/v2.0.0/bulk_data_export_tests_test_group.rb +41 -0
  36. data/lib/bulk_data_test_kit/v2.0.0/bulk_data_group_export_test_group.rb +35 -0
  37. data/lib/bulk_data_test_kit/v2.0.0/bulk_data_outputFormat_param_test.rb +36 -0
  38. data/lib/bulk_data_test_kit/v2.0.0/bulk_data_patient_export_test_group.rb +35 -0
  39. data/lib/bulk_data_test_kit/v2.0.0/bulk_data_since_param_test.rb +48 -0
  40. data/lib/bulk_data_test_kit/v2.0.0/bulk_data_system_export_test_group.rb +35 -0
  41. data/lib/bulk_data_test_kit/v2.0.0/bulk_data_test_suite.rb +165 -0
  42. data/lib/bulk_data_test_kit/v2.0.0/group/bulk_data_group_export_cancel_group.rb +15 -0
  43. data/lib/bulk_data_test_kit/v2.0.0/group/bulk_data_group_export_parameters_group.rb +40 -0
  44. data/lib/bulk_data_test_kit/v2.0.0/patient/bulk_data_patient_export_cancel_group.rb +18 -0
  45. data/lib/bulk_data_test_kit/v2.0.0/patient/bulk_data_patient_export_parameters_group.rb +37 -0
  46. data/lib/bulk_data_test_kit/v2.0.0/system_export/bulk_data_system_export_cancel_group.rb +18 -0
  47. data/lib/bulk_data_test_kit/v2.0.0/system_export/bulk_data_system_export_parameters_group.rb +37 -0
  48. data/lib/bulk_data_test_kit/version.rb +5 -0
  49. data/lib/bulk_data_test_kit.rb +4 -0
  50. metadata +289 -0
@@ -0,0 +1,166 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative '../version'
4
+ require_relative 'bulk_data_smart_backend_services_group'
5
+ require_relative 'bulk_data_export_tests_test_group'
6
+
7
+ module BulkDataTestKit
8
+ module BulkDataV101
9
+ class BulkDataTestSuite < Inferno::TestSuite
10
+ title 'Bulk Data Access v1.0.1'
11
+ version VERSION
12
+ id :bulk_data_v101
13
+ links [
14
+ {
15
+ label: 'Report Issue',
16
+ url: 'https://github.com/inferno-framework/bulk-data-test-kit/issues/'
17
+ },
18
+ {
19
+ label: 'Open Source',
20
+ url: 'https://github.com/inferno-framework/bulk-data-test-kit/'
21
+ },
22
+ {
23
+ label: 'Download',
24
+ url: 'https://github.com/inferno-framework/bulk-data-test-kit/releases'
25
+ }
26
+ ]
27
+
28
+ VALIDATION_MESSAGE_FILTERS = [
29
+ /Observation\.effective\.ofType\(Period\): .*vs-1:/ # Invalid invariant in FHIR v4.0.1
30
+ ].freeze
31
+
32
+ VERSION_SPECIFIC_MESSAGE_FILTERS = [].freeze
33
+
34
+ validator do
35
+ url ENV.fetch('BULK_DATA_VALIDATOR_URL', 'http://validator_service:4567')
36
+
37
+ message_filters = VALIDATION_MESSAGE_FILTERS + VERSION_SPECIFIC_MESSAGE_FILTERS
38
+
39
+ $num_messages = 0
40
+ $capped_message = false
41
+ $num_errors = 0
42
+ $capped_errors = false
43
+
44
+ exclude_message do |message|
45
+ if message.type != 'error'
46
+ $num_messages += 1
47
+ else
48
+ $num_errors += 1
49
+ end
50
+
51
+ message_filters.any? { |filter| filter.match? message.message } ||
52
+ (message.type != 'error' && $num_messages > 50 && !message.message.include?('Inferno is only showing the first')) ||
53
+ (message.type == 'error' && $num_errors > 20 && !message.message.include?('Inferno is only showing the first'))
54
+ end
55
+
56
+ perform_additional_validation do
57
+ if $num_messages > 50 && !$capped_message
58
+ $capped_message = true
59
+ { type: 'info', message: 'Inferno is only showing the first 50 validation info and warning messages.' }
60
+ elsif $num_errors > 20 && !$capped_errors
61
+ $capped_errors = true
62
+ { type: 'error', message: 'Inferno is only showing the first 20 validation error messages.' }
63
+ end
64
+ end
65
+ end
66
+
67
+ def self.jwks_json
68
+ bulk_data_jwks = JSON.parse(File.read(
69
+ ENV.fetch('BULK_DATA_JWKS',
70
+ File.join(File.expand_path('..', __dir__), 'bulk_data_jwks.json'))
71
+ ))
72
+ @jwks_json ||= JSON.pretty_generate(
73
+ { keys: bulk_data_jwks['keys'].select { |key| key['key_ops']&.include?('verify') } }
74
+ )
75
+ end
76
+
77
+ def self.well_known_route_handler
78
+ ->(_env) { [200, { 'Content-Type' => 'application/json' }, [jwks_json]] }
79
+ end
80
+
81
+ route(
82
+ :get,
83
+ '/.well-known/jwks.json',
84
+ well_known_route_handler
85
+ )
86
+
87
+ config(
88
+ inputs: {
89
+ client_auth_encryption_method: {
90
+ title: 'Client Authentication Encryption Method',
91
+ locked: true
92
+ }
93
+ },
94
+ options: {
95
+ post_authorization_uri: "#{Inferno::Application['base_url']}/custom/smart_stu2/post_auth"
96
+ }
97
+ )
98
+
99
+ description %(
100
+ The Bulk Data Access Test Kit is a testing tool that will demonstrate
101
+ the ability to exporting bulk data from a FHIR server to a
102
+ pre-authorized client following the criterion from the [FHIR Bulk Data
103
+ Access IG](http://hl7.org/fhir/uv/bulkdata/STU1.0.1).
104
+
105
+ This test kit is split into three different types of bulk data export:
106
+
107
+ - All Patients: FHIR Operation to obtain a detailed set of FHIR
108
+ resources of diverse resource types pertaining to all patients
109
+ - Group of Patients: FHIR Operation to obtain a detailed set of FHIR
110
+ resources of diverse resource types pertaining to all members of a
111
+ specified Group
112
+ - System Level Export: FHIR Operation to export data from a FHIR
113
+ server, whether or not it is associated with a patient
114
+
115
+ This test kit uses [Backend Services
116
+ Authorization](http://hl7.org/fhir/uv/bulkdata/STU1.0.1/authorization/index.html)
117
+ to obtain an access token from the server. After authorization, a group
118
+ level, patient level, and system level bulk data export request is
119
+ initialized, and for each type of export, the tests read exported NDJSON
120
+ files from the server and validate the resources in each file. It is
121
+ expected the server will provide Encounter, Location, Organization, and
122
+ Practitioner resources as they are referenced as must support elements
123
+ in required resources.
124
+
125
+ To get started, if your server supports SMART backend services
126
+ authorization, please first register Inferno with the following JWK Set
127
+ URL:
128
+
129
+ * `#{Inferno::Application[:base_url]}/custom/bulk_data_v101/.well-known/jwks.json`
130
+
131
+ Then, run the full Bulk Data Access test suite containing both the SMART
132
+ Backend Services test group and the Bulk Data Export Tests test group.
133
+ Otherwise, if your server does not support SMART Backend Services
134
+ authorization, only run the second test group, Bulk Data Export Tests.
135
+ )
136
+
137
+ input_instructions %(
138
+ Register Inferno as a bulk data client with the following information,
139
+ and enter the client id and client registration in the appropriate
140
+ fields. For the Group export tests, please enter the group export
141
+ information in the appropriate box.
142
+
143
+ Register Inferno with the following JWK Set Url:
144
+
145
+ * `#{Inferno::Application[:base_url]}/custom/bulk_data_v101/.well-known/jwks.json`
146
+ )
147
+
148
+ input :bulk_server_url,
149
+ title: 'Bulk Data FHIR URL',
150
+ description: 'The URL of the Bulk FHIR server.'
151
+
152
+ fhir_client :bulk_server do
153
+ url :bulk_server_url
154
+ end
155
+
156
+ http_client :bulk_server do
157
+ url :bulk_server_url
158
+ end
159
+
160
+ group from: :bulk_data_smart_backend_services,
161
+ id: :bulk_data_smart_backend_services_v101
162
+
163
+ group from: :bulk_data_export_tests_v101
164
+ end
165
+ end
166
+ end
@@ -0,0 +1,30 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative '../bulk_export_validation_tester'
4
+
5
+ module BulkDataTestKit
6
+ module BulkDataV101
7
+ class BulkDataValidResourcesTest < Inferno::Test
8
+ include BulkDataTestKit::BulkExportValidationTester
9
+
10
+ id :bulk_data_valid_resources
11
+
12
+ title 'All resources returned are valid FHIR resources'
13
+ description <<~DESCRIPTION
14
+ This test verifies that the resources returned from bulk data export
15
+ conform to the base FHIR standard. This includes checking for missing
16
+ data elements and value set verification. This test caps the number of
17
+ validation info and warning messages that it will display to 50 and the
18
+ number of error messages it will display to 20.
19
+ DESCRIPTION
20
+
21
+ input :status_output
22
+ input :requires_access_token
23
+
24
+ run do
25
+ perform_bulk_export_validation(bulk_status_output: status_output,
26
+ bulk_requires_access_token: requires_access_token)
27
+ end
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,32 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative '../../export_kick_off_performer'
4
+ require_relative '../bulk_data_export_cancel_test'
5
+
6
+ module BulkDataTestKit
7
+ module BulkDataV101
8
+ class BulkDataGroupExportCancelGroup < Inferno::TestGroup
9
+ id :bulk_data_group_export_cancel_group
10
+ title 'Group Compartment Export Cancel Tests'
11
+ description %(
12
+ Verify that the Bulk Data server supports cancelling requested group exports.
13
+ This group initiates a new export and immediately cancels it to verify
14
+ correct behavior.
15
+ )
16
+
17
+ input :bearer_token
18
+ input :bulk_server_url,
19
+ title: 'Bulk Data FHIR URL',
20
+ description: 'The URL of the Bulk FHIR server.'
21
+ input :group_id,
22
+ title: 'Group ID',
23
+ description: 'The Group ID associated with the group of patients to be exported.'
24
+
25
+ test from: :bulk_data_export_cancel,
26
+ id: :bulk_data_group_export_cancel,
27
+ config: {
28
+ options: { resource_type: 'Group', bulk_export_url: 'Group/[group_id]/$export' }
29
+ }
30
+ end
31
+ end
32
+ end
@@ -0,0 +1,102 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'tls_test_kit'
4
+ require_relative '../bulk_data_export_operation_support_test'
5
+ require_relative '../bulk_data_no_auth_test'
6
+ require_relative '../bulk_data_export_kick_off_test'
7
+ require_relative '../bulk_data_status_check_test'
8
+ require_relative '../bulk_data_output_check_test'
9
+
10
+ module BulkDataTestKit
11
+ module BulkDataV101
12
+ class BulkDataGroupExportGroup < Inferno::TestGroup
13
+ title 'Group Compartment Export Tests'
14
+ short_description 'Verify that the system supports Group compartment export.'
15
+ description <<~DESCRIPTION
16
+ Verify that group level export on the Bulk Data server follow the Bulk Data Access Implementation Guide
17
+ DESCRIPTION
18
+ id :bulk_data_group_export_group
19
+
20
+ input :bearer_token,
21
+ title: 'Bulk Data Authorization Bearer Token',
22
+ description: 'The authorization bearer token for the Bulk FHIR server. If not required, leave blank.',
23
+ optional: true
24
+ input :group_id,
25
+ title: 'Group ID',
26
+ description: 'The Group ID associated with the group of patients to be exported.'
27
+ input :bulk_server_url,
28
+ title: 'Bulk Data FHIR URL',
29
+ description: 'The URL of the Bulk FHIR server.'
30
+ input :bulk_timeout,
31
+ title: 'Export Times Out after (1-600)',
32
+ description: <<~DESCRIPTION,
33
+ While testing, Inferno waits for the server to complete the exporting task. If the calculated totalTime is
34
+ greater than the timeout value specified here, Inferno bulk client stops testing. Please enter an integer
35
+ for the maximum wait time in seconds. If timeout is less than 1, Inferno uses default value 180. If the
36
+ timeout is greater than 600 (10 minutes), Inferno uses the maximum value 600.
37
+ DESCRIPTION
38
+ default: 180
39
+
40
+ output :requires_access_token, :status_output, :bulk_download_url
41
+
42
+ run_as_group
43
+
44
+ test from: :bulk_data_export_operation_support do
45
+ title 'Bulk Data Server declares support for Group export operation in CapabilityStatement'
46
+ description <<~DESCRIPTION
47
+ This test verifies that the Bulk Data Server declares support for
48
+ `Group/[group_id]/$export` operation in its server CapabilityStatement.
49
+
50
+ Given flexibility in the FHIR specification for declaring constrained
51
+ OperationDefinitions, this test only verifies that the server declares
52
+ any operation on the Group resource. It does not verify that it
53
+ declares the standard Group export OperationDefinition provided in the
54
+ Bulk Data specification, nor does it attempt to resolve any non-standard
55
+ OperationDefinitions to verify if it is a constrained version of the
56
+ standard OperationDefintion.
57
+
58
+ This test will provide a warning if no operations are declared at
59
+ `Group/[group_id]/$export`, via the
60
+ `CapabilityStatement.rest.resource.operation.name` element. It will
61
+ also provide an informational message if an operation on the Group
62
+ resource exists, but does not point to the standard OperationDefinition
63
+ canonical URL:
64
+ http://hl7.org/fhir/uv/bulkdata/OperationDefinition/group-export
65
+
66
+ Additionally, this test provides a warning if the bulk data server does
67
+ not include the following URL in its `CapabilityStatement.instantiates`
68
+ element: http://hl7.org/fhir/uv/bulkdata/CapabilityStatement/bulk-data
69
+ DESCRIPTION
70
+ id :bulk_data_group_export_operation_support
71
+
72
+ config(
73
+ options: { resource_type: 'Group' }
74
+ )
75
+ end
76
+
77
+ test from: :bulk_data_no_auth_reject,
78
+ id: :bulk_data_group_no_auth_reject,
79
+ config: {
80
+ options: { resource_type: 'Group', bulk_export_url: 'Group/[group_id]/$export' }
81
+ }
82
+
83
+ test from: :bulk_data_kick_off,
84
+ id: :bulk_data_group_kick_off,
85
+ config: {
86
+ options: { resource_type: 'Group', bulk_export_url: 'Group/[group_id]/$export' }
87
+ }
88
+
89
+ test from: :bulk_data_status_check,
90
+ id: :bulk_data_group_status_check,
91
+ config: {
92
+ options: { resource_type: 'Group' }
93
+ }
94
+
95
+ test from: :bulk_data_output_check,
96
+ id: :bulk_data_group_output_check,
97
+ config: {
98
+ options: { resource_type: 'Group' }
99
+ }
100
+ end
101
+ end
102
+ end
@@ -0,0 +1,51 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative '../bulk_data_multiple_patients_test'
4
+ require_relative '../bulk_data_ndjson_download_test'
5
+ require_relative '../bulk_data_valid_resources_test'
6
+
7
+ module BulkDataTestKit
8
+ module BulkDataV101
9
+ class BulkDataGroupExportValidation < Inferno::TestGroup
10
+ title 'Group Compartment Export Validation Tests'
11
+ short_description 'Verify that the data from Group export conforms to the base FHIR standard.'
12
+ description <<~DESCRIPTION
13
+ Verify that Group compartment export from the Bulk Data server follow the base FHIR standard
14
+ DESCRIPTION
15
+
16
+ id :bulk_data_group_export_validation
17
+
18
+ input :status_output, :requires_access_token, :bearer_token, :bulk_download_url
19
+ input :lines_to_validate,
20
+ title: 'Limit validation to a maximum resource count',
21
+ description: 'To validate all, leave blank.',
22
+ optional: true
23
+
24
+ test from: :tls_version_test do
25
+ title 'Bulk Data Server is secured by transport layer security'
26
+ description <<~DESCRIPTION
27
+ [§170.315(g)(10) Test Procedure]
28
+ (https://www.healthit.gov/test-method/standardized-api-patient-and-population-services)
29
+ requires that all exchanges described herein between a client and a
30
+ server SHALL be secured using Transport Layer Security (TLS)
31
+ Protocol Version 1.2 (RFC5246).
32
+ DESCRIPTION
33
+ id :bulk_file_server_tls_version
34
+
35
+ config(
36
+ inputs: { url: { name: :bulk_download_url } },
37
+ options: { minimum_allowed_version: OpenSSL::SSL::TLS1_2_VERSION }
38
+ )
39
+ end
40
+
41
+ test from: :bulk_data_ndjson_download,
42
+ id: :bulk_data_group_ndjson_download
43
+
44
+ test from: :bulk_data_valid_resources,
45
+ id: :bulk_data_group_valid_resources
46
+
47
+ test from: :bulk_data_multiple_patients,
48
+ id: :bulk_data_group_multiple_patients
49
+ end
50
+ end
51
+ end
@@ -0,0 +1,32 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative '../../export_kick_off_performer'
4
+ require_relative '../bulk_data_export_cancel_test'
5
+
6
+ module BulkDataTestKit
7
+ module BulkDataV101
8
+ class BulkDataPatientExportCancelGroup < Inferno::TestGroup
9
+ id :bulk_data_patient_export_cancel_group
10
+ title 'Patient Export Cancel Tests'
11
+ description %(
12
+ Verify that the Bulk Data server supports cancelling requested exports of all Patients.
13
+ This group initiates a new export and immediately cancels it to verify
14
+ correct behavior.
15
+ )
16
+
17
+ input :bearer_token
18
+ input :bulk_server_url,
19
+ title: 'Bulk Data FHIR URL',
20
+ description: 'The URL of the Bulk FHIR server.'
21
+
22
+ output :patient_cancelled_polling_url
23
+
24
+ test from: :bulk_data_export_cancel,
25
+ id: :bulk_data_patient_export_cancel,
26
+ config: {
27
+ outputs: { cancelled_polling_url: { name: :patient_cancelled_polling_url } },
28
+ options: { resource_type: 'Patient', bulk_export_url: 'Patient/$export' }
29
+ }
30
+ end
31
+ end
32
+ end
@@ -0,0 +1,108 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'tls_test_kit'
4
+ require_relative '../bulk_data_export_operation_support_test'
5
+ require_relative '../bulk_data_no_auth_test'
6
+ require_relative '../bulk_data_export_kick_off_test'
7
+ require_relative '../bulk_data_status_check_test'
8
+ require_relative '../bulk_data_output_check_test'
9
+
10
+ module BulkDataTestKit
11
+ module BulkDataV101
12
+ class BulkDataPatientExportGroup < Inferno::TestGroup
13
+ title 'Patient Export Tests'
14
+ short_description 'Verify that the system supports bulk export of all Patients'
15
+ description <<~DESCRIPTION
16
+ Verify that patient level export on the Bulk Data server follow the Bulk Data Access Implementation Guide
17
+ DESCRIPTION
18
+ id :bulk_data_patient_export_group
19
+
20
+ input :bearer_token,
21
+ title: 'Bulk Data Authorization Bearer Token',
22
+ description: 'The authorization bearer token for the Bulk FHIR server. If not required, leave blank.',
23
+ optional: true
24
+ input :bulk_server_url,
25
+ title: 'Bulk Data FHIR URL',
26
+ description: 'The URL of the Bulk FHIR server.'
27
+ input :bulk_timeout,
28
+ title: 'Export Times Out after (1-600)',
29
+ description: <<~DESCRIPTION,
30
+ While testing, Inferno waits for the server to complete the exporting task. If the calculated totalTime is
31
+ greater than the timeout value specified here, Inferno bulk client stops testing. Please enter an integer
32
+ for the maximum wait time in seconds. If timeout is less than 1, Inferno uses default value 180. If the
33
+ timeout is greater than 600 (10 minutes), Inferno uses the maximum value 600.
34
+ DESCRIPTION
35
+ default: 180
36
+
37
+ output :patient_requires_access_token, :patient_status_output, :patient_bulk_download_url
38
+
39
+ test from: :bulk_data_export_operation_support do
40
+ title 'Bulk Data Server declares support for Patient export operation in CapabilityStatement'
41
+ description <<~DESCRIPTION
42
+ This test verifies that the Bulk Data Server declares support for
43
+ `Patient/$export` operation in its server CapabilityStatement.
44
+
45
+ Given flexibility in the FHIR specification for declaring constrained
46
+ OperationDefinitions, this test only verifies that the server declares
47
+ any operation on the Patient resource. It does not verify that it
48
+ declares the standard Patient export OperationDefinition provided in the
49
+ Bulk Data specification, nor does it attempt to resolve any non-standard
50
+ OperationDefinitions to verify if it is a constrained version of the
51
+ standard OperationDefintion.
52
+
53
+ This test will provide a warning if no operations are declared at
54
+ `Patient/$export`, via the
55
+ `CapabilityStatement.rest.resource.operation.name` element. It will
56
+ also provide an informational message if an operation on the Patient
57
+ resource exists, but does not point to the standard OperationDefinition
58
+ canonical URL:
59
+ http://hl7.org/fhir/uv/bulkdata/OperationDefinition/patient-export
60
+
61
+ Additionally, this test provides a warning if the bulk data server does
62
+ not include the following URL in its `CapabilityStatement.instantiates`
63
+ element: http://hl7.org/fhir/uv/bulkdata/CapabilityStatement/bulk-data
64
+ DESCRIPTION
65
+ id :bulk_data_patient_export_operation_support
66
+
67
+ config(
68
+ options: { resource_type: 'Patient' }
69
+ )
70
+ end
71
+
72
+ test from: :bulk_data_no_auth_reject,
73
+ id: :bulk_data_patient_no_auth_reject,
74
+ config: {
75
+ options: { resource_type: 'Patient', bulk_export_url: 'Patient/$export' }
76
+ }
77
+
78
+ test from: :bulk_data_kick_off,
79
+ id: :bulk_data_patient_kick_off,
80
+ config: {
81
+ outputs: { polling_url: { name: :patient_polling_url } },
82
+ options: { resource_type: 'Patient', bulk_export_url: 'Patient/$export' }
83
+ }
84
+
85
+ test from: :bulk_data_status_check,
86
+ id: :bulk_data_patient_status_check,
87
+ config: {
88
+ inputs: { polling_url: { name: :patient_polling_url } },
89
+ outputs: {
90
+ status_response: { name: :patient_status_response },
91
+ requires_access_token: { name: :patient_requires_access_token }
92
+ },
93
+ options: { resource_type: 'Patient' }
94
+ }
95
+
96
+ test from: :bulk_data_output_check,
97
+ id: :bulk_data_patient_output_check,
98
+ config: {
99
+ inputs: { status_response: { name: :patient_status_response } },
100
+ outputs: {
101
+ status_output: { name: :patient_status_output },
102
+ bulk_download_url: { name: :patient_bulk_download_url }
103
+ },
104
+ options: { resource_type: 'Patient' }
105
+ }
106
+ end
107
+ end
108
+ end
@@ -0,0 +1,63 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative '../bulk_data_multiple_patients_test'
4
+ require_relative '../bulk_data_ndjson_download_test'
5
+ require_relative '../bulk_data_valid_resources_test'
6
+
7
+ module BulkDataTestKit
8
+ module BulkDataV101
9
+ class BulkDataPatientExportValidation < Inferno::TestGroup
10
+ title 'Patient Export Validation Tests'
11
+ short_description 'Verify that the data from the export of all Patients conforms to the base FHIR standard.'
12
+ description <<~DESCRIPTION
13
+ Verify that All Patient export from the Bulk Data server follow the base FHIR standard
14
+ DESCRIPTION
15
+
16
+ id :bulk_data_patient_export_validation
17
+
18
+ input :patient_status_output, :patient_requires_access_token, :bearer_token, :patient_bulk_download_url
19
+ input :lines_to_validate,
20
+ title: 'Limit validation to a maximum resource count',
21
+ description: 'To validate all, leave blank.',
22
+ optional: true
23
+
24
+ test from: :tls_version_test do
25
+ title 'Bulk Data Server is secured by transport layer security'
26
+ description <<~DESCRIPTION
27
+ [§170.315(g)(10) Test Procedure]
28
+ (https://www.healthit.gov/test-method/standardized-api-patient-and-population-services)
29
+ requires that all exchanges described herein between a client and a
30
+ server SHALL be secured using Transport Layer Security (TLS)
31
+ Protocol Version 1.2 (RFC5246).
32
+ DESCRIPTION
33
+ id :bulk_file_server_tls_version
34
+
35
+ config(
36
+ inputs: { url: { name: :patient_bulk_download_url } },
37
+ options: { minimum_allowed_version: OpenSSL::SSL::TLS1_2_VERSION }
38
+ )
39
+ end
40
+
41
+ test from: :bulk_data_ndjson_download,
42
+ id: :bulk_data_patient_ndjson_download,
43
+ config: {
44
+ inputs: {
45
+ bulk_download_url: { name: :patient_bulk_download_url },
46
+ requires_access_token: { name: :patient_requires_access_token }
47
+ }
48
+ }
49
+
50
+ test from: :bulk_data_valid_resources,
51
+ id: :bulk_data_patient_valid_resources,
52
+ config: {
53
+ inputs: {
54
+ status_output: { name: :patient_status_output },
55
+ requires_access_token: { name: :patient_requires_access_token }
56
+ }
57
+ }
58
+
59
+ test from: :bulk_data_multiple_patients,
60
+ id: :bulk_data_patient_multiple_patients
61
+ end
62
+ end
63
+ end
@@ -0,0 +1,32 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative '../../export_kick_off_performer'
4
+ require_relative '../bulk_data_export_cancel_test'
5
+
6
+ module BulkDataTestKit
7
+ module BulkDataV101
8
+ class BulkDataSystemExportCancelGroup < Inferno::TestGroup
9
+ id :bulk_data_system_export_cancel_group
10
+ title 'System Level Export Cancel Tests'
11
+ description %(
12
+ Verify that the Bulk Data server supports cancelling requested system level exports.
13
+ This group initiates a new export and immediately cancels it to verify
14
+ correct behavior.
15
+ )
16
+
17
+ input :bearer_token
18
+ input :bulk_server_url,
19
+ title: 'Bulk Data FHIR URL',
20
+ description: 'The URL of the Bulk FHIR server.'
21
+
22
+ output :system_cancelled_polling_url
23
+
24
+ test from: :bulk_data_export_cancel,
25
+ id: :bulk_data_system_export_cancel,
26
+ config: {
27
+ outputs: { cancelled_polling_url: { name: :system_cancelled_polling_url } },
28
+ options: { resource_type: 'system', bulk_export_url: '$export' }
29
+ }
30
+ end
31
+ end
32
+ end