roqua-rom-api 2.3.1 → 3.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +6 -5
- data/lib/roqua/rom_api/list_responses.rb +8 -7
- data/lib/roqua/rom_api/models/questionnaire.rb +2 -2
- data/lib/roqua/rom_api/sessions.rb +2 -2
- data/lib/roqua/rom_api/update_response.rb +7 -7
- data/lib/roqua/rom_api/version.rb +1 -1
- data/spec/lib/roqua/rom_api/list_dossier_stats_spec.rb +1 -1
- data/spec/lib/roqua/rom_api/list_responses_spec.rb +9 -9
- data/spec/lib/roqua/rom_api/report_calculations_spec.rb +1 -1
- data/spec/lib/roqua/rom_api/start_protocol_subscription_spec.rb +15 -13
- data/spec/lib/roqua/rom_api/update_response_spec.rb +2 -2
- metadata +33 -41
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 31364e35a8825ce3b39017a914af7cb91bca38ae29b4d42eec882dbba02dfa22
|
4
|
+
data.tar.gz: b78743c4a03b42d069ce3c56f8c807d8768a37d06e6dae28f553fa816c16a99c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7dd680aa99c9757caafb5af382e813818fa986bc27f6c8cbb4b36d38b27aa13c31135cbc2eb89a2416571c1089a74bd73a75892161b25ef31d70bba91f268b51
|
7
|
+
data.tar.gz: 3a85d40c4f565d055569bfb1f9b571ce5b8886888b25210dd4c4ae4d275396a5637b24c04e618489b4de96c2ca8aad33b22b83d427e3fed3726c931d39276d81
|
data/README.md
CHANGED
@@ -109,17 +109,18 @@ To store an externally filled out questionnaire run:
|
|
109
109
|
|
110
110
|
outcome = Roqua::RomApi::CreateResponse.run questionnaire_key: 'questionnaire_key',
|
111
111
|
dossier_id: 'dossier_id',
|
112
|
-
|
112
|
+
external_id: '230',
|
113
|
+
answer_data: {some: 'answer_data'}
|
113
114
|
|
114
115
|
### [Update](http://docs.roqua.net/developer/rom/dossier/responses/#update-a-response)
|
115
116
|
|
116
117
|
To store external data on an existing pending response:
|
117
118
|
|
118
|
-
outcome = Roqua::RomApi::
|
119
|
+
outcome = Roqua::RomApi::UpdateResponse.run questionnaire_key: 'questionnaire_key',
|
119
120
|
dossier_id: 'dossier_id',
|
120
|
-
|
121
|
-
answer_data: {some: '
|
122
|
-
|
121
|
+
external_id: "230", # response id,
|
122
|
+
answer_data: {some: 'answer_data'}
|
123
|
+
n
|
123
124
|
## [NonResponses](http://docs.roqua.net/developer/rom/dossier/non_responses/)
|
124
125
|
|
125
126
|
* [List](Roqua/RomApi/ListNonResponses.html)
|
@@ -18,13 +18,14 @@ module Roqua
|
|
18
18
|
end
|
19
19
|
|
20
20
|
def filter_params
|
21
|
-
{
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
21
|
+
{
|
22
|
+
response_ids: response_ids,
|
23
|
+
respondent_type: respondent_type,
|
24
|
+
status: status,
|
25
|
+
questionnaire_keys: questionnaire_keys,
|
26
|
+
completed_after: completed_after,
|
27
|
+
completed_before: completed_before,
|
28
|
+
protocol_subscription_id: protocol_subscription_id
|
28
29
|
}.keep_if { |_k, v| v.present? }
|
29
30
|
end
|
30
31
|
|
@@ -3,8 +3,8 @@ require 'roqua/rom_api/sessions/basic_auth_session'
|
|
3
3
|
|
4
4
|
module Roqua
|
5
5
|
module RomApi
|
6
|
-
def self.basic_auth_session(
|
7
|
-
Sessions::BasicAuthSession.new(
|
6
|
+
def self.basic_auth_session(...)
|
7
|
+
Sessions::BasicAuthSession.new(...)
|
8
8
|
end
|
9
9
|
end
|
10
10
|
end
|
@@ -2,16 +2,16 @@ module Roqua
|
|
2
2
|
module RomApi
|
3
3
|
# @api private
|
4
4
|
class UpdateResponse < Endpoint
|
5
|
-
string
|
6
|
-
string
|
7
|
-
|
8
|
-
hash
|
9
|
-
time
|
10
|
-
time
|
5
|
+
string :questionnaire_key
|
6
|
+
string :dossier_id
|
7
|
+
string :external_id
|
8
|
+
hash :answer_data, strip: false
|
9
|
+
time :filled_out_at, default: nil
|
10
|
+
time :started_at, default: nil
|
11
11
|
|
12
12
|
def execute
|
13
13
|
validate_response_for do
|
14
|
-
basic_auth_session.patch "/dossiers/#{dossier_id}/responses/#{
|
14
|
+
basic_auth_session.patch "/dossiers/#{dossier_id}/responses/#{external_id}",
|
15
15
|
questionnaire_key: questionnaire_key,
|
16
16
|
answer_data: answer_data,
|
17
17
|
filled_out_at: (filled_out_at.to_i if filled_out_at),
|
@@ -17,7 +17,7 @@ describe ListDossierStats do
|
|
17
17
|
describe 'with epd_ids provided' do
|
18
18
|
let(:response) { {'foo' => {}, 'bar' => {}} }
|
19
19
|
before do
|
20
|
-
allow(session).to receive(:get).with('/stats', epd_ids: ['foo', 'bar']).and_return httparty_response(response)
|
20
|
+
allow(session).to receive(:get).with('/stats', {epd_ids: ['foo', 'bar']}).and_return httparty_response(response)
|
21
21
|
end
|
22
22
|
|
23
23
|
subject { ListDossierStats.run! epd_ids: ['foo', 'bar'] }
|
@@ -8,14 +8,14 @@ describe ListResponses do
|
|
8
8
|
before { allow(BasicAuthSession).to receive(:new).and_return session }
|
9
9
|
|
10
10
|
it 'performs a GET on the responses API' do
|
11
|
-
expect(session).to receive(:get).with(api_path,
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
11
|
+
expect(session).to receive(:get).with(api_path, {
|
12
|
+
respondent_type: 'respondent_type',
|
13
|
+
status: :status,
|
14
|
+
questionnaire_keys: ['questionnaire_key'],
|
15
|
+
completed_after: Time.new(2014, 1, 1),
|
16
|
+
completed_before: Time.new(2014, 1, 31),
|
17
|
+
protocol_subscription_id: 'protocol_subscription_id'
|
18
|
+
}).and_return response
|
19
19
|
ListResponses.run(dossier_id: options[:dossier_id],
|
20
20
|
respondent_type: 'respondent_type',
|
21
21
|
status: :status,
|
@@ -26,7 +26,7 @@ describe ListResponses do
|
|
26
26
|
end
|
27
27
|
|
28
28
|
it 'can get responses by id' do
|
29
|
-
expect(session).to receive(:get).with(api_path, response_ids: ['1', '5', '7'])
|
29
|
+
expect(session).to receive(:get).with(api_path, {response_ids: ['1', '5', '7']})
|
30
30
|
.and_return response
|
31
31
|
ListResponses.run!(dossier_id: options[:dossier_id],
|
32
32
|
response_ids: ['1', '5', '7'])
|
@@ -37,7 +37,7 @@ describe ReportCalculations do
|
|
37
37
|
completed_after: filters[:completed_after].to_i,
|
38
38
|
completed_before: filters[:completed_before].to_i
|
39
39
|
}
|
40
|
-
expect(session).to receive(:get).with(api_path, calculator: 'test', filters: filter_hash)
|
40
|
+
expect(session).to receive(:get).with(api_path, {calculator: 'test', filters: filter_hash})
|
41
41
|
subject
|
42
42
|
end
|
43
43
|
end
|
@@ -11,24 +11,26 @@ describe StartProtocolSubscription do
|
|
11
11
|
end
|
12
12
|
|
13
13
|
it 'does a post to the rom protocol_subscription api' do
|
14
|
-
expect(session).to receive(:post).with("/dossiers/#{options[:dossier_id]}/protocol_subscriptions",
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
14
|
+
expect(session).to receive(:post).with("/dossiers/#{options[:dossier_id]}/protocol_subscriptions", {
|
15
|
+
protocol_key: options[:protocol_key],
|
16
|
+
protocol_id: options[:protocol_id],
|
17
|
+
respondent_id: options[:respondent_id],
|
18
|
+
flags: {"some_flag" => true},
|
19
|
+
textvars: {"some_var" => 'string'}
|
20
|
+
})
|
20
21
|
StartProtocolSubscription.run!(options)
|
21
22
|
end
|
22
23
|
|
23
24
|
it 'passes in the start_at option when provided' do
|
24
25
|
start_at = Time.current
|
25
|
-
expect(session).to receive(:post).with("/dossiers/#{options[:dossier_id]}/protocol_subscriptions",
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
26
|
+
expect(session).to receive(:post).with("/dossiers/#{options[:dossier_id]}/protocol_subscriptions", {
|
27
|
+
protocol_key: options[:protocol_key],
|
28
|
+
protocol_id: options[:protocol_id],
|
29
|
+
respondent_id: options[:respondent_id],
|
30
|
+
start_at: start_at.to_i,
|
31
|
+
flags: {"some_flag" => true},
|
32
|
+
textvars: {"some_var" => 'string'}
|
33
|
+
})
|
32
34
|
StartProtocolSubscription.run!(options.merge start_at: start_at)
|
33
35
|
end
|
34
36
|
|
@@ -18,7 +18,7 @@ describe UpdateResponse do
|
|
18
18
|
started_at: started_at.to_i
|
19
19
|
UpdateResponse.run! dossier_id: 'some_dossier_id',
|
20
20
|
questionnaire_key: 'some_questionnaire_key',
|
21
|
-
|
21
|
+
external_id: "230",
|
22
22
|
answer_data: {some: 'answer_data'},
|
23
23
|
filled_out_at: filled_out_at,
|
24
24
|
started_at: started_at
|
@@ -30,7 +30,7 @@ describe UpdateResponse do
|
|
30
30
|
answer_data: {some: 'answer_data'},
|
31
31
|
respondent: 'patient',
|
32
32
|
started_at: started_at,
|
33
|
-
|
33
|
+
external_id: "230"
|
34
34
|
expect(response).to be_a(Response)
|
35
35
|
expect(response.questionnaire_name).to eq('Some Questionnaire')
|
36
36
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: roqua-rom-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 3.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Esposito
|
@@ -12,7 +12,7 @@ authors:
|
|
12
12
|
autorequire:
|
13
13
|
bindir: bin
|
14
14
|
cert_chain: []
|
15
|
-
date:
|
15
|
+
date: 2023-11-21 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: httparty
|
@@ -32,30 +32,36 @@ dependencies:
|
|
32
32
|
name: active_interaction
|
33
33
|
requirement: !ruby/object:Gem::Requirement
|
34
34
|
requirements:
|
35
|
-
- - "
|
35
|
+
- - ">="
|
36
36
|
- !ruby/object:Gem::Version
|
37
37
|
version: '4.0'
|
38
|
+
- - "<"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '6'
|
38
41
|
type: :runtime
|
39
42
|
prerelease: false
|
40
43
|
version_requirements: !ruby/object:Gem::Requirement
|
41
44
|
requirements:
|
42
|
-
- - "
|
45
|
+
- - ">="
|
43
46
|
- !ruby/object:Gem::Version
|
44
47
|
version: '4.0'
|
48
|
+
- - "<"
|
49
|
+
- !ruby/object:Gem::Version
|
50
|
+
version: '6'
|
45
51
|
- !ruby/object:Gem::Dependency
|
46
52
|
name: activemodel
|
47
53
|
requirement: !ruby/object:Gem::Requirement
|
48
54
|
requirements:
|
49
|
-
- - "
|
55
|
+
- - ">="
|
50
56
|
- !ruby/object:Gem::Version
|
51
|
-
version: '
|
57
|
+
version: '0'
|
52
58
|
type: :runtime
|
53
59
|
prerelease: false
|
54
60
|
version_requirements: !ruby/object:Gem::Requirement
|
55
61
|
requirements:
|
56
|
-
- - "
|
62
|
+
- - ">="
|
57
63
|
- !ruby/object:Gem::Version
|
58
|
-
version: '
|
64
|
+
version: '0'
|
59
65
|
- !ruby/object:Gem::Dependency
|
60
66
|
name: virtus
|
61
67
|
requirement: !ruby/object:Gem::Requirement
|
@@ -154,20 +160,6 @@ dependencies:
|
|
154
160
|
- - "~>"
|
155
161
|
- !ruby/object:Gem::Version
|
156
162
|
version: '2.9'
|
157
|
-
- !ruby/object:Gem::Dependency
|
158
|
-
name: ruby_dep
|
159
|
-
requirement: !ruby/object:Gem::Requirement
|
160
|
-
requirements:
|
161
|
-
- - "~>"
|
162
|
-
- !ruby/object:Gem::Version
|
163
|
-
version: '1.5'
|
164
|
-
type: :development
|
165
|
-
prerelease: false
|
166
|
-
version_requirements: !ruby/object:Gem::Requirement
|
167
|
-
requirements:
|
168
|
-
- - "~>"
|
169
|
-
- !ruby/object:Gem::Version
|
170
|
-
version: '1.5'
|
171
163
|
description: Provides authenticated access to ROM utilities
|
172
164
|
email: support@roqua.nl
|
173
165
|
executables: []
|
@@ -268,39 +260,39 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
268
260
|
- !ruby/object:Gem::Version
|
269
261
|
version: '0'
|
270
262
|
requirements: []
|
271
|
-
rubygems_version: 3.
|
263
|
+
rubygems_version: 3.4.19
|
272
264
|
signing_key:
|
273
265
|
specification_version: 4
|
274
266
|
summary: API wrapper gem around RoQua's ROM API
|
275
267
|
test_files:
|
276
|
-
- spec/spec_helper.rb
|
277
|
-
- spec/support/test.yml
|
278
|
-
- spec/support/httparty_helpers.rb
|
279
268
|
- spec/fabricators/basic_auth_session_fabricator.rb
|
280
|
-
- spec/lib/roqua/rom_api/
|
281
|
-
- spec/lib/roqua/rom_api/update_response_spec.rb
|
269
|
+
- spec/lib/roqua/rom_api/cancel_fill_out_request_spec.rb
|
282
270
|
- spec/lib/roqua/rom_api/create_fill_out_request_spec.rb
|
271
|
+
- spec/lib/roqua/rom_api/create_response_spec.rb
|
283
272
|
- spec/lib/roqua/rom_api/endpoint_spec.rb
|
284
|
-
- spec/lib/roqua/rom_api/
|
273
|
+
- spec/lib/roqua/rom_api/get_measurement_spec.rb
|
274
|
+
- spec/lib/roqua/rom_api/get_non_response_spec.rb
|
285
275
|
- spec/lib/roqua/rom_api/get_protocol_spec.rb
|
286
|
-
- spec/lib/roqua/rom_api/
|
276
|
+
- spec/lib/roqua/rom_api/get_respondent_spec.rb
|
277
|
+
- spec/lib/roqua/rom_api/list_dossier_stats_spec.rb
|
287
278
|
- spec/lib/roqua/rom_api/list_non_responses_spec.rb
|
288
|
-
- spec/lib/roqua/rom_api/
|
279
|
+
- spec/lib/roqua/rom_api/list_protocol_subscriptions_spec.rb
|
280
|
+
- spec/lib/roqua/rom_api/list_protocols_spec.rb
|
281
|
+
- spec/lib/roqua/rom_api/list_respondents_spec.rb
|
289
282
|
- spec/lib/roqua/rom_api/list_responses_spec.rb
|
290
|
-
- spec/lib/roqua/rom_api/report_calculations_spec.rb
|
291
|
-
- spec/lib/roqua/rom_api/cancel_fill_out_request_spec.rb
|
292
|
-
- spec/lib/roqua/rom_api/get_non_response_spec.rb
|
293
|
-
- spec/lib/roqua/rom_api/models/stats_spec.rb
|
294
283
|
- spec/lib/roqua/rom_api/models/dossier_stats_spec.rb
|
295
|
-
- spec/lib/roqua/rom_api/models/respondent_spec.rb
|
296
284
|
- spec/lib/roqua/rom_api/models/fill_out_request_spec.rb
|
297
|
-
- spec/lib/roqua/rom_api/models/response_spec.rb
|
298
285
|
- spec/lib/roqua/rom_api/models/protocol_subscription_spec.rb
|
286
|
+
- spec/lib/roqua/rom_api/models/respondent_spec.rb
|
287
|
+
- spec/lib/roqua/rom_api/models/response_spec.rb
|
288
|
+
- spec/lib/roqua/rom_api/models/stats_spec.rb
|
289
|
+
- spec/lib/roqua/rom_api/report_calculations_spec.rb
|
299
290
|
- spec/lib/roqua/rom_api/sessions/basic_auth_session_spec.rb
|
300
291
|
- spec/lib/roqua/rom_api/start_fill_out_session_spec.rb
|
301
|
-
- spec/lib/roqua/rom_api/list_protocols_spec.rb
|
302
292
|
- spec/lib/roqua/rom_api/start_protocol_subscription_spec.rb
|
303
|
-
- spec/lib/roqua/rom_api/
|
304
|
-
- spec/lib/roqua/rom_api/
|
305
|
-
- spec/lib/roqua/rom_api/list_dossier_stats_spec.rb
|
293
|
+
- spec/lib/roqua/rom_api/stop_protocol_subscription_spec.rb
|
294
|
+
- spec/lib/roqua/rom_api/update_response_spec.rb
|
306
295
|
- spec/lib/roqua_rom_api_spec.rb
|
296
|
+
- spec/spec_helper.rb
|
297
|
+
- spec/support/httparty_helpers.rb
|
298
|
+
- spec/support/test.yml
|