roqua-rom-api 2.3.1 → 3.0.2

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a6305d7ff3907c4fca21f1a190bb9a3c7f7a1bb4339d293ae583e3408d867e67
4
- data.tar.gz: f1131052ed12fbda1448f9e1bb153800e3014d986c146faa51c91634bd1968cb
3
+ metadata.gz: 31364e35a8825ce3b39017a914af7cb91bca38ae29b4d42eec882dbba02dfa22
4
+ data.tar.gz: b78743c4a03b42d069ce3c56f8c807d8768a37d06e6dae28f553fa816c16a99c
5
5
  SHA512:
6
- metadata.gz: e857910e865e3500b471477c2e20b47fad57bb940673598b553badd36b9fce76badde2b451051bab5f5b8ba9af1e03682f243481283c52e6a755f5c158122113
7
- data.tar.gz: 9dca335cb25389136fc55b6efc9145a209300e916d653d99ba38ee7466344892a98f7f1cdff3fe94efa344992028859b78773ef8bac2884497df06099d08a1b1
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
- answer_data: {some: 'aswer_data'}
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::CreateResponse.run questionnaire_key: 'questionnaire_key',
119
+ outcome = Roqua::RomApi::UpdateResponse.run questionnaire_key: 'questionnaire_key',
119
120
  dossier_id: 'dossier_id',
120
- id: 230, # response id,
121
- answer_data: {some: 'aswer_data'}
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
- {response_ids: response_ids,
22
- respondent_type: respondent_type,
23
- status: status,
24
- questionnaire_keys: questionnaire_keys,
25
- completed_after: completed_after,
26
- completed_before: completed_before,
27
- protocol_subscription_id: protocol_subscription_id
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
 
@@ -15,8 +15,8 @@ module Roqua
15
15
  attribute :questions, Hash
16
16
  attribute :scores, Hash
17
17
  attribute :sbg_info, Hash
18
- attribute :textvars, Hash
19
- attribute :flags, Hash
18
+ attribute :textvars, Array
19
+ attribute :flags, Array
20
20
  attribute :charts, Array
21
21
  end
22
22
  end
@@ -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(*arguments, &block)
7
- Sessions::BasicAuthSession.new(*arguments, &block)
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 :questionnaire_key
6
- string :dossier_id
7
- integer :id
8
- hash :answer_data, strip: false
9
- time :filled_out_at, default: nil
10
- time :started_at, default: nil
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/#{id}",
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),
@@ -1,5 +1,5 @@
1
1
  module Roqua
2
2
  module RomApi
3
- VERSION = '2.3.1'
3
+ VERSION = '3.0.2'
4
4
  end
5
5
  end
@@ -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
- 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
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
- 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'})
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
- protocol_key: options[:protocol_key],
27
- protocol_id: options[:protocol_id],
28
- respondent_id: options[:respondent_id],
29
- start_at: start_at.to_i,
30
- flags: {some_flag: true},
31
- textvars: {some_var: 'string'})
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
- id: 230,
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
- id: 230
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: 2.3.1
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: 2022-08-03 00:00:00.000000000 Z
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: '6.2'
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: '6.2'
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.1.4
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/list_respondents_spec.rb
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/get_respondent_spec.rb
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/stop_protocol_subscription_spec.rb
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/create_response_spec.rb
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/get_measurement_spec.rb
304
- - spec/lib/roqua/rom_api/list_protocol_subscriptions_spec.rb
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