inferno_core 0.4.16 → 0.4.18
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/inferno/dsl/fhir_client.rb +79 -3
- data/lib/inferno/entities/test_suite.rb +10 -1
- data/lib/inferno/public/bundle.js +15 -15
- data/lib/inferno/public/bundle.js.LICENSE.txt +14 -3
- data/lib/inferno/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9fc795a49145b262a250f35b8653e39c506313af4788f1b82ef274c4c4ea7960
|
4
|
+
data.tar.gz: 29214802809c59187e4923eaa9f8b1844ebab5f0dffa32738242721de55b4b85
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 71c77cd25ddef3ea505359a81b1e979fdcf528e87587ad3b518e5389418a423bacd1965396d7a31f7b7ad3bef3b70465c63654dbb95bd7290e7e35d9f906f7dc
|
7
|
+
data.tar.gz: fc5abb31735fbc351084ee8ed8d385dbcfab4637bcea8338c58fa79bebcf5bb65314e33cc3e619b96b83b495aadd1225b4cf9f8267ff0c92b0394fad0f2cb57d
|
@@ -130,6 +130,78 @@ module Inferno
|
|
130
130
|
end
|
131
131
|
end
|
132
132
|
|
133
|
+
# Perform a FHIR vread interaction.
|
134
|
+
#
|
135
|
+
# @param resource_type [String, Symbol, Class]
|
136
|
+
# @param id [String]
|
137
|
+
# @param version_id [String]
|
138
|
+
# @param client [Symbol]
|
139
|
+
# @param name [Symbol] Name for this request to allow it to be used by
|
140
|
+
# other tests
|
141
|
+
# @return [Inferno::Entities::Request]
|
142
|
+
def fhir_vread(resource_type, id, version_id, client: :default, name: nil)
|
143
|
+
store_request_and_refresh_token(fhir_client(client), name) do
|
144
|
+
tcp_exception_handler do
|
145
|
+
fhir_client(client).vread(fhir_class_from_resource_type(resource_type), id, version_id)
|
146
|
+
end
|
147
|
+
end
|
148
|
+
end
|
149
|
+
|
150
|
+
# Perform a FHIR update interaction.
|
151
|
+
#
|
152
|
+
# @param resource [FHIR::Model]
|
153
|
+
# @param id [String]
|
154
|
+
# @param client [Symbol]
|
155
|
+
# @param name [Symbol] Name for this request to allow it to be used by
|
156
|
+
# other tests
|
157
|
+
# @return [Inferno::Entities::Request]
|
158
|
+
def fhir_update(resource, id, client: :default, name: nil)
|
159
|
+
store_request_and_refresh_token(fhir_client(client), name) do
|
160
|
+
tcp_exception_handler do
|
161
|
+
fhir_client(client).update(resource, id)
|
162
|
+
end
|
163
|
+
end
|
164
|
+
end
|
165
|
+
|
166
|
+
# Perform a FHIR patch interaction.
|
167
|
+
#
|
168
|
+
# @param resource_type [String, Symbol, Class]
|
169
|
+
# @param id [String]
|
170
|
+
# @param patchset [Array]
|
171
|
+
# @param client [Symbol]
|
172
|
+
# @param name [Symbol] Name for this request to allow it to be used by
|
173
|
+
# other tests
|
174
|
+
# @return [Inferno::Entities::Request]
|
175
|
+
def fhir_patch(resource_type, id, patchset, client: :default, name: nil)
|
176
|
+
store_request_and_refresh_token(fhir_client(client), name) do
|
177
|
+
tcp_exception_handler do
|
178
|
+
fhir_client(client).partial_update(fhir_class_from_resource_type(resource_type), id, patchset)
|
179
|
+
end
|
180
|
+
end
|
181
|
+
end
|
182
|
+
|
183
|
+
# Perform a FHIR history interaction.
|
184
|
+
#
|
185
|
+
# @param resource_type [String, Symbol, Class]
|
186
|
+
# @param id [String]
|
187
|
+
# @param client [Symbol]
|
188
|
+
# @param name [Symbol] Name for this request to allow it to be used by
|
189
|
+
# other tests
|
190
|
+
# @return [Inferno::Entities::Request]
|
191
|
+
def fhir_history(resource_type = nil, id = nil, client: :default, name: nil)
|
192
|
+
store_request_and_refresh_token(fhir_client(client), name) do
|
193
|
+
tcp_exception_handler do
|
194
|
+
if id
|
195
|
+
fhir_client(client).resource_instance_history(fhir_class_from_resource_type(resource_type), id)
|
196
|
+
elsif resource_type
|
197
|
+
fhir_client(client).resource_history(fhir_class_from_resource_type(resource_type))
|
198
|
+
else
|
199
|
+
fhir_client(client).all_history
|
200
|
+
end
|
201
|
+
end
|
202
|
+
end
|
203
|
+
end
|
204
|
+
|
133
205
|
# Perform a FHIR search interaction.
|
134
206
|
#
|
135
207
|
# @param resource_type [String, Symbol, Class]
|
@@ -139,7 +211,7 @@ module Inferno
|
|
139
211
|
# other tests
|
140
212
|
# @param search_method [Symbol] Use `:post` to search via POST
|
141
213
|
# @return [Inferno::Entities::Request]
|
142
|
-
def fhir_search(resource_type, client: :default, params: {}, name: nil, search_method: :get)
|
214
|
+
def fhir_search(resource_type = nil, client: :default, params: {}, name: nil, search_method: :get)
|
143
215
|
search =
|
144
216
|
if search_method == :post
|
145
217
|
{ body: params }
|
@@ -149,8 +221,12 @@ module Inferno
|
|
149
221
|
|
150
222
|
store_request_and_refresh_token(fhir_client(client), name) do
|
151
223
|
tcp_exception_handler do
|
152
|
-
|
153
|
-
|
224
|
+
if resource_type
|
225
|
+
fhir_client(client)
|
226
|
+
.search(fhir_class_from_resource_type(resource_type), { search: })
|
227
|
+
else
|
228
|
+
fhir_client(client).search_all({ search: })
|
229
|
+
end
|
154
230
|
end
|
155
231
|
end
|
156
232
|
end
|
@@ -97,7 +97,16 @@ module Inferno
|
|
97
97
|
# `error`.
|
98
98
|
# @return [void]
|
99
99
|
def check_configuration(&block)
|
100
|
-
@check_configuration_block =
|
100
|
+
@check_configuration_block = lambda do
|
101
|
+
block.call&.each do |configuration_message|
|
102
|
+
case configuration_message[:type]
|
103
|
+
when 'warning'
|
104
|
+
Application[:logger].warn(configuration_message[:message])
|
105
|
+
when 'error'
|
106
|
+
Application[:logger].error(configuration_message[:message])
|
107
|
+
end
|
108
|
+
end
|
109
|
+
end
|
101
110
|
end
|
102
111
|
|
103
112
|
# @private
|