bulk_data_test_kit 0.10.0 → 0.11.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 (45) hide show
  1. checksums.yaml +4 -4
  2. data/config/presets/bulk_data_v101_bulk_data_server.json +43 -0
  3. data/config/presets/bulk_data_v101_inferno_reference_server.json +43 -0
  4. data/config/presets/bulk_data_v200_bulk_data_server.json +43 -0
  5. data/config/presets/bulk_data_v200_inferno_reference_server.json +43 -0
  6. data/lib/bulk_data_test_kit/igs/put_ig_package_dot_tgz_here +0 -0
  7. data/lib/bulk_data_test_kit/metadata.rb +45 -0
  8. data/lib/bulk_data_test_kit/requirements/bulk-data-test-kit_out_of_scope_requirements.csv +1 -0
  9. data/lib/bulk_data_test_kit/requirements/bulk-data-test-kit_requirements.csv +465 -0
  10. data/lib/bulk_data_test_kit/requirements/generated/bulk-data-test-kit_requirements_coverage.csv +442 -0
  11. data/lib/bulk_data_test_kit/requirements/hl7.fhir.uv.bulkdata_2.0.0_reqs.xlsx +0 -0
  12. data/lib/bulk_data_test_kit/v1.0.1/bulk_data_smart_backend_services_v101_group.rb +21 -0
  13. data/lib/bulk_data_test_kit/v1.0.1/bulk_data_smart_discovery_v101_contents_test.rb +77 -0
  14. data/lib/bulk_data_test_kit/v1.0.1/bulk_data_smart_discovery_v101_group.rb +15 -0
  15. data/lib/bulk_data_test_kit/v1.0.1/bulk_data_test_suite.rb +3 -5
  16. data/lib/bulk_data_test_kit/{v1.0.1/bulk_data_smart_backend_services_group.rb → v2.0.0/bulk_data_smart_backend_services_v200_group.rb} +3 -3
  17. data/lib/bulk_data_test_kit/v2.0.0/bulk_data_test_suite.rb +3 -5
  18. data/lib/bulk_data_test_kit/v2.0.0_client/bulk_data_client_delete_group.rb +27 -0
  19. data/lib/bulk_data_test_kit/v2.0.0_client/bulk_data_client_delete_test.rb +29 -0
  20. data/lib/bulk_data_test_kit/v2.0.0_client/bulk_data_client_delete_wait_test.rb +44 -0
  21. data/lib/bulk_data_test_kit/v2.0.0_client/bulk_data_client_export_group.rb +31 -0
  22. data/lib/bulk_data_test_kit/v2.0.0_client/bulk_data_client_export_wait_test.rb +45 -0
  23. data/lib/bulk_data_test_kit/v2.0.0_client/bulk_data_client_kick_off_test.rb +45 -0
  24. data/lib/bulk_data_test_kit/v2.0.0_client/bulk_data_client_output_test.rb +28 -0
  25. data/lib/bulk_data_test_kit/v2.0.0_client/bulk_data_client_status_test.rb +29 -0
  26. data/lib/bulk_data_test_kit/v2.0.0_client/bulk_data_client_test_suite.rb +92 -0
  27. data/lib/bulk_data_test_kit/v2.0.0_client/docs/suite_description.md +33 -0
  28. data/lib/bulk_data_test_kit/v2.0.0_client/endpoints/delete.rb +22 -0
  29. data/lib/bulk_data_test_kit/v2.0.0_client/endpoints/kick_off.rb +36 -0
  30. data/lib/bulk_data_test_kit/v2.0.0_client/endpoints/output.rb +31 -0
  31. data/lib/bulk_data_test_kit/v2.0.0_client/endpoints/status.rb +39 -0
  32. data/lib/bulk_data_test_kit/v2.0.0_client/export_types.rb +9 -0
  33. data/lib/bulk_data_test_kit/v2.0.0_client/postman/delete.postman_collection.json +133 -0
  34. data/lib/bulk_data_test_kit/v2.0.0_client/postman/system_export.postman_collection.json +181 -0
  35. data/lib/bulk_data_test_kit/v2.0.0_client/tags.rb +13 -0
  36. data/lib/bulk_data_test_kit/v2.0.0_client/urls.rb +45 -0
  37. data/lib/bulk_data_test_kit/version.rb +2 -1
  38. data/lib/bulk_data_test_kit.rb +3 -1
  39. data/lib/inferno_requirements_tools/ext/inferno_core/runnable.rb +22 -0
  40. data/lib/inferno_requirements_tools/rake/rakefile_template +37 -0
  41. data/lib/inferno_requirements_tools/tasks/collect_requirements.rb +233 -0
  42. data/lib/inferno_requirements_tools/tasks/requirements_coverage.rb +283 -0
  43. data/lib/requirements_config.yaml +14 -0
  44. data/lib/template_requirements_config.yaml +11 -0
  45. metadata +54 -15
@@ -0,0 +1,39 @@
1
+ # frozen_string_literal: true
2
+
3
+ module BulkDataTestKit
4
+ module BulkDataV200Client
5
+ module Endpoints
6
+ # Status Endpoint
7
+ class Status < Inferno::DSL::SuiteEndpoint
8
+ include URLs
9
+
10
+ def test_run_identifier
11
+ request.get_header('HTTP_AUTHORIZATION')&.split&.last
12
+ end
13
+
14
+ def make_response
15
+ response.status = 200
16
+ response.body = response_body.to_json
17
+ response.format = :json
18
+ end
19
+
20
+ def tags
21
+ [STATUS_TAG]
22
+ end
23
+
24
+ def response_body
25
+ {
26
+ transactionTime: DateTime.now.iso8601,
27
+ request: kickoff_url,
28
+ requiresAccessToken: true,
29
+ output: [{
30
+ type: 'Patient',
31
+ url: output_url
32
+ }],
33
+ error: []
34
+ }
35
+ end
36
+ end
37
+ end
38
+ end
39
+ end
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ module BulkDataTestKit
4
+ module BulkDataV200Client
5
+ PATIENT_EXPORT_TYPE = 'Patient'
6
+ GROUP_EXPORT_TYPE = 'Group'
7
+ SYSTEM_EXPORT_TYPE = 'System'
8
+ end
9
+ end
@@ -0,0 +1,133 @@
1
+ {
2
+ "info": {
3
+ "name": "Bulk Data Client - Delete",
4
+ "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
5
+ },
6
+ "item": [
7
+ {
8
+ "name": "Kickoff",
9
+ "event": [
10
+ {
11
+ "listen": "test",
12
+ "script": {
13
+ "exec": [
14
+ "pm.test(\"kick-off was accepted\", function () {",
15
+ " pm.response.to.have.status(202);",
16
+ "});",
17
+ "",
18
+ "pm.collectionVariables.set(\"status_url\", pm.response.headers.get('Content-Location'));",
19
+ ""
20
+ ],
21
+ "type": "text/javascript",
22
+ "packages": {}
23
+ }
24
+ }
25
+ ],
26
+ "request": {
27
+ "method": "GET",
28
+ "header": [],
29
+ "url": {
30
+ "raw": "{{base_url}}/custom/bulk_data_v200_client/fhir/$export",
31
+ "host": [
32
+ "{{base_url}}"
33
+ ],
34
+ "path": [
35
+ "custom",
36
+ "bulk_data_v200_client",
37
+ "fhir",
38
+ "$export"
39
+ ]
40
+ }
41
+ },
42
+ "response": []
43
+ },
44
+ {
45
+ "name": "Delete",
46
+ "event": [
47
+ {
48
+ "listen": "test",
49
+ "script": {
50
+ "exec": [
51
+ "pm.test(\"export was deleted\", function () {",
52
+ " pm.response.to.have.status(202);",
53
+ "});",
54
+ ""
55
+ ],
56
+ "type": "text/javascript",
57
+ "packages": {}
58
+ }
59
+ },
60
+ {
61
+ "listen": "prerequest",
62
+ "script": {
63
+ "exec": [
64
+ ""
65
+ ],
66
+ "type": "text/javascript",
67
+ "packages": {}
68
+ }
69
+ }
70
+ ],
71
+ "request": {
72
+ "method": "DELETE",
73
+ "header": [],
74
+ "url": {
75
+ "raw": "{{status_url}}",
76
+ "host": [
77
+ "{{status_url}}"
78
+ ]
79
+ }
80
+ },
81
+ "response": []
82
+ }
83
+ ],
84
+ "auth": {
85
+ "type": "bearer",
86
+ "bearer": [
87
+ {
88
+ "key": "token",
89
+ "value": "{{access_token}}",
90
+ "type": "string"
91
+ }
92
+ ]
93
+ },
94
+ "event": [
95
+ {
96
+ "listen": "prerequest",
97
+ "script": {
98
+ "type": "text/javascript",
99
+ "packages": {},
100
+ "exec": [
101
+ ""
102
+ ]
103
+ }
104
+ },
105
+ {
106
+ "listen": "test",
107
+ "script": {
108
+ "type": "text/javascript",
109
+ "packages": {},
110
+ "exec": [
111
+ ""
112
+ ]
113
+ }
114
+ }
115
+ ],
116
+ "variable": [
117
+ {
118
+ "key": "access_token",
119
+ "value": "SAMPLE_TOKEN",
120
+ "type": "string"
121
+ },
122
+ {
123
+ "key": "base_url",
124
+ "value": "http://localhost:4567",
125
+ "type": "string"
126
+ },
127
+ {
128
+ "key": "status_url",
129
+ "value": "",
130
+ "type": "string"
131
+ }
132
+ ]
133
+ }
@@ -0,0 +1,181 @@
1
+ {
2
+ "info": {
3
+ "name": "Bulk Data Client - System Export",
4
+ "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
5
+ },
6
+ "item": [
7
+ {
8
+ "name": "Kickoff",
9
+ "event": [
10
+ {
11
+ "listen": "test",
12
+ "script": {
13
+ "exec": [
14
+ "pm.test(\"kick-off was accepted\", function () {",
15
+ " pm.response.to.have.status(202);",
16
+ "});",
17
+ "",
18
+ "pm.collectionVariables.set(\"status_url\", pm.response.headers.get('Content-Location'));",
19
+ ""
20
+ ],
21
+ "type": "text/javascript",
22
+ "packages": {}
23
+ }
24
+ }
25
+ ],
26
+ "request": {
27
+ "method": "GET",
28
+ "header": [],
29
+ "url": {
30
+ "raw": "{{base_url}}/custom/bulk_data_v200_client/fhir/$export",
31
+ "host": [
32
+ "{{base_url}}"
33
+ ],
34
+ "path": [
35
+ "custom",
36
+ "bulk_data_v200_client",
37
+ "fhir",
38
+ "$export"
39
+ ]
40
+ }
41
+ },
42
+ "response": []
43
+ },
44
+ {
45
+ "name": "Status",
46
+ "event": [
47
+ {
48
+ "listen": "test",
49
+ "script": {
50
+ "exec": [
51
+ "let responseData = pm.response.json();",
52
+ "",
53
+ "pm.test(\"export is complete\", function () {",
54
+ " pm.response.to.have.status(200);",
55
+ "});",
56
+ "",
57
+ "pm.collectionVariables.set(\"download_url\", responseData.output[0].url);",
58
+ ""
59
+ ],
60
+ "type": "text/javascript",
61
+ "packages": {}
62
+ }
63
+ },
64
+ {
65
+ "listen": "prerequest",
66
+ "script": {
67
+ "exec": [
68
+ ""
69
+ ],
70
+ "type": "text/javascript",
71
+ "packages": {}
72
+ }
73
+ }
74
+ ],
75
+ "request": {
76
+ "method": "GET",
77
+ "header": [],
78
+ "url": {
79
+ "raw": "{{status_url}}",
80
+ "host": [
81
+ "{{status_url}}"
82
+ ]
83
+ }
84
+ },
85
+ "response": []
86
+ },
87
+ {
88
+ "name": "Download",
89
+ "event": [
90
+ {
91
+ "listen": "test",
92
+ "script": {
93
+ "exec": [
94
+ "pm.test(\"downlaod is successful\", function () {",
95
+ " pm.response.to.have.status(200);",
96
+ "});",
97
+ ""
98
+ ],
99
+ "type": "text/javascript",
100
+ "packages": {}
101
+ }
102
+ },
103
+ {
104
+ "listen": "prerequest",
105
+ "script": {
106
+ "exec": [
107
+ ""
108
+ ],
109
+ "type": "text/javascript",
110
+ "packages": {}
111
+ }
112
+ }
113
+ ],
114
+ "request": {
115
+ "method": "GET",
116
+ "header": [],
117
+ "url": {
118
+ "raw": "{{download_url}}",
119
+ "host": [
120
+ "{{download_url}}"
121
+ ]
122
+ }
123
+ },
124
+ "response": []
125
+ }
126
+ ],
127
+ "auth": {
128
+ "type": "bearer",
129
+ "bearer": [
130
+ {
131
+ "key": "token",
132
+ "value": "{{access_token}}",
133
+ "type": "string"
134
+ }
135
+ ]
136
+ },
137
+ "event": [
138
+ {
139
+ "listen": "prerequest",
140
+ "script": {
141
+ "type": "text/javascript",
142
+ "packages": {},
143
+ "exec": [
144
+ ""
145
+ ]
146
+ }
147
+ },
148
+ {
149
+ "listen": "test",
150
+ "script": {
151
+ "type": "text/javascript",
152
+ "packages": {},
153
+ "exec": [
154
+ ""
155
+ ]
156
+ }
157
+ }
158
+ ],
159
+ "variable": [
160
+ {
161
+ "key": "access_token",
162
+ "value": "SAMPLE_TOKEN",
163
+ "type": "string"
164
+ },
165
+ {
166
+ "key": "base_url",
167
+ "value": "http://localhost:4567",
168
+ "type": "string"
169
+ },
170
+ {
171
+ "key": "status_url",
172
+ "value": "",
173
+ "type": "string"
174
+ },
175
+ {
176
+ "key": "download_url",
177
+ "value": "",
178
+ "type": "string"
179
+ }
180
+ ]
181
+ }
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module BulkDataTestKit
4
+ module BulkDataV200Client
5
+ METADATA_TAG = 'bulk_data_metadata'
6
+ PATIENT_KICKOFF_TAG = 'bulk_data_kickoff_patient'
7
+ GROUP_KICKOFF_TAG = 'bulk_data_kickoff_group'
8
+ SYSTEM_KICKOFF_TAG = 'bulk_data_kickoff_system'
9
+ STATUS_TAG = 'bulk_data_status'
10
+ OUTPUT_TAG = 'bulk_data_output'
11
+ DELETE_TAG = 'bulk_data_delete'
12
+ end
13
+ end
@@ -0,0 +1,45 @@
1
+ # frozen_string_literal: true
2
+
3
+ module BulkDataTestKit
4
+ module BulkDataV200Client
5
+ RESUME_PASS_PATH = '/resume_pass'
6
+ BASE_ROUTE = '/fhir'
7
+ METADATA_ROUTE = "#{BASE_ROUTE}/metadata".freeze
8
+ PATIENT_KICKOFF_ROUTE = "#{BASE_ROUTE}/:type/$export".freeze
9
+ GROUP_KICKOFF_ROUTE = "#{BASE_ROUTE}/:type/:group_id/$export".freeze
10
+ SYSTEM_KICKOFF_ROUTE = "#{BASE_ROUTE}/$export".freeze
11
+ STATUS_ROUTE = '/status'
12
+ OUTPUT_ROUTE = '/output/example.ndjson'
13
+
14
+ # URLs for use in Bulk Data Client tests and endpoints
15
+ module URLs
16
+ def base_url
17
+ "#{Inferno::Application['base_url']}/custom/#{suite_id}"
18
+ end
19
+
20
+ def resume_pass_url
21
+ base_url + RESUME_PASS_PATH
22
+ end
23
+
24
+ def kickoff_url
25
+ base_url + BASE_ROUTE
26
+ end
27
+
28
+ def status_url
29
+ base_url + STATUS_ROUTE
30
+ end
31
+
32
+ def output_url
33
+ base_url + OUTPUT_ROUTE
34
+ end
35
+
36
+ def suite_id
37
+ if respond_to?('result') # If being used with a suite endpoint
38
+ result.test_id.split('-').first
39
+ elsif self.class.respond_to?('suite') # If being used with a test/group/suite
40
+ self.class.suite.id
41
+ end
42
+ end
43
+ end
44
+ end
45
+ end
@@ -1,5 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module BulkDataTestKit
4
- VERSION = '0.10.0'
4
+ VERSION = '0.11.0'
5
+ LAST_UPDATED = '2025-02-24'
5
6
  end
@@ -1,4 +1,6 @@
1
1
  # frozen_string_literal: true
2
-
2
+ require_relative 'bulk_data_test_kit/metadata.rb'
3
+ require_relative 'inferno_requirements_tools/ext/inferno_core/runnable'
3
4
  require_relative 'bulk_data_test_kit/v1.0.1/bulk_data_test_suite'
4
5
  require_relative 'bulk_data_test_kit/v2.0.0/bulk_data_test_suite'
6
+ require_relative 'bulk_data_test_kit/v2.0.0_client/bulk_data_client_test_suite'
@@ -0,0 +1,22 @@
1
+ module Inferno
2
+ module DSL
3
+ # This module contains the DSL for defining child entities in the test
4
+ # definition framework.
5
+ module Runnable
6
+ # Set/Get the IDs of requirements verifed by this runnable
7
+ # Set with [] to clear the list
8
+ #
9
+ # @param requirements [Array<String>]
10
+ # @return [Array<String>] the requirement IDs
11
+ def verifies_requirements(*requirement_ids)
12
+ if requirement_ids.empty?
13
+ @requirement_ids || []
14
+ elsif requirement_ids == [[]]
15
+ @requirement_ids = []
16
+ else
17
+ @requirement_ids = requirement_ids
18
+ end
19
+ end
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,37 @@
1
+ namespace :requirements do
2
+ desc 'Generate requirements coverage CSV'
3
+ task :generate_coverage do
4
+ require 'inferno'
5
+ Inferno::Application.start(:suites)
6
+
7
+ require_relative 'lib/inferno_requirements_tools/tasks/requirements_coverage'
8
+ InfernoRequirementsTools::Tasks::RequirementsCoverage.new.run
9
+ end
10
+ end
11
+
12
+ namespace :requirements do
13
+ desc 'Check if requirements coverage CSV is up-to-date'
14
+ task :check_coverage do
15
+ require 'inferno'
16
+ Inferno::Application.start(:suites)
17
+
18
+ require_relative 'lib/inferno_requirements_tools/tasks/requirements_coverage'
19
+ InfernoRequirementsTools::Tasks::RequirementsCoverage.new.run_check
20
+ end
21
+ end
22
+
23
+ namespace :requirements do
24
+ desc 'Collect requirements and planned not tested requirements into CSVs'
25
+ task :collect, [:input_directory] => [] do |_t, args|
26
+ require_relative 'lib/inferno_requirements_tools/tasks/collect_requirements'
27
+ InfernoRequirementsTools::Tasks::CollectRequirements.new.run(args.input_directory)
28
+ end
29
+ end
30
+
31
+ namespace :requirements do
32
+ desc 'Check if requirements and planned not tested CSVs are up-to-date'
33
+ task :check_collection, [:input_directory] => [] do |_t, args|
34
+ require_relative 'lib/inferno_requirements_tools/tasks/collect_requirements'
35
+ InfernoRequirementsTools::Tasks::CollectRequirements.new.run_check(args.input_directory)
36
+ end
37
+ end