roqua-rom-api 2.2.0 → 2.2.5

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
- SHA1:
3
- metadata.gz: 1232ec18176d8cb41e579dadce78775014e70034
4
- data.tar.gz: 94bd0b445ebc2ea4cd317312ca3e2c2c410753fe
2
+ SHA256:
3
+ metadata.gz: 0a4869fe5ebc3afa012ae97feda45d62c09971c983cf7c5b88367e395aec3cee
4
+ data.tar.gz: 3985167ea4cd4d54cd2b6c5aec7ddd9af7323486394c890bc47c32f9cb2bb003
5
5
  SHA512:
6
- metadata.gz: d37f46dface65bab1ce4a1607dda74d34285b48187f8d5982a5df0702355c8bd9cf03dfd86582fdce61b8b7a79d66af5d1b31a0ca0b82f4c9a5a9a8c36d5c220
7
- data.tar.gz: a3dbaf436487a0951aa6dd1ea0bed1b145142f7f05db105ade285950bc4b709857b95b1509fbb935e9c39e72628726256808ef7e87062813d701eddf61291704
6
+ metadata.gz: e8805936a42535dbc65de31820f49fba939b9e5e2bfd289ad087754d13a488653f5592695819269305e67e9df1c6019ce261a55751969f5eaa0e8b90d200f5dc
7
+ data.tar.gz: 609dcc6e850ea64f6747e113fc23dc4dfd2ca437f27febf5f1fb552522d5728c3bd2350538a9433a555ee2b93c6a0c7d51eb76b64fb8d2f4aac8bdfda99cd013
@@ -1,10 +1,15 @@
1
1
  module Roqua
2
2
  module RomApi
3
- # @api private
3
+ # @example To create a fill out request run:
4
+ # Roqua::RomApi::CancelFillOutRequest.run! \
5
+ # dossier_id: dossier_id,
6
+ # fill_out_request_id: for_id
4
7
  class CancelFillOutRequest < Endpoint
5
8
  string :dossier_id
6
9
  string :fill_out_request_id
7
10
 
11
+ private
12
+
8
13
  def execute
9
14
  validate_response_for do
10
15
  basic_auth_session.delete("/dossiers/#{dossier_id}/fill_out_requests/#{fill_out_request_id}")
@@ -1,18 +1,26 @@
1
1
  module Roqua
2
2
  module RomApi
3
- # @api private
3
+ # @example To create a fill out request run:
4
+ # Roqua::RomApi::CreateFillOutRequest.run! \
5
+ # dossier_id: dossier_id,
6
+ # questionnaire_keys: ['key1', 'key2'],
7
+ # callback_url: notify_callback_path(token: 'secret')
8
+ #
9
+ # @see http://docs.roqua.net/developer/rom/dossier/fill_out_requests/ for more info on how callbacks work.
4
10
  class CreateFillOutRequest < Endpoint
5
11
  string :dossier_id
6
12
  integer :measurement_sequence_id, default: nil
7
- array :questionnaire_keys, default: [] { string }
13
+ array :questionnaire_keys, default: [] do string end
8
14
  string :respondent_type, default: nil
9
15
  string :callback_url, default: nil
10
16
  array :reminders, default: []
11
- time :open_from, default: nil, allow_nil: true
12
- time :open_till, default: nil, allow_nil: true
17
+ time :open_from, default: nil, allow_nil: true
18
+ time :open_till, default: nil, allow_nil: true
13
19
 
14
20
  validates :dossier_id, presence: {allow_blank: false}
15
21
 
22
+ private
23
+
16
24
  def execute
17
25
  validate_response_for do
18
26
  fill_out_request = {
@@ -3,8 +3,8 @@ module Roqua
3
3
  # @api private
4
4
  class ListResponses < Endpoint
5
5
  string :dossier_id
6
- array :response_ids, default: [] { string }
7
- array :questionnaire_keys, default: [] { string }
6
+ array :response_ids, default: [] do string end
7
+ array :questionnaire_keys, default: [] do string end
8
8
  time :completed_before, default: nil
9
9
  time :completed_after, default: nil
10
10
  string :respondent_type, default: nil
@@ -6,11 +6,26 @@ module Roqua
6
6
  class Protocol
7
7
  include Virtus.model
8
8
 
9
+ # @!attribute [r] id
10
+ # @return [Integer]
9
11
  attribute :id, Integer
12
+ # @!attribute key
13
+ # @return [String]
14
+ attribute :key, String
15
+ # @!attribute name
16
+ # @return [String]
10
17
  attribute :name, String
18
+ # @!attribute description
19
+ # @return [String]
11
20
  attribute :description, String
21
+ # @!attribute active
22
+ # @return [Boolean]
12
23
  attribute :active, Boolean
24
+ # @!attribute automatic
25
+ # @return [Boolean]
13
26
  attribute :automatic, Boolean
27
+ # @!attribute measurements
28
+ # @return [Array<Measurement>]
14
29
  attribute :measurements, Array[Models::Measurement]
15
30
  end
16
31
  end
@@ -9,6 +9,7 @@ module Roqua
9
9
  attribute :id, Integer
10
10
  attribute :label, String
11
11
  attribute :respondent_type, String
12
+ attribute :sbg_code, String
12
13
  end
13
14
  end
14
15
  end
@@ -4,12 +4,12 @@ module Roqua
4
4
  class ReportCalculations < Endpoint
5
5
  string :dossier_id
6
6
  string :calculator
7
- array(:response_ids, default: nil) { string }
8
- array(:questionnaire_keys, default: nil) { string }
7
+ array :response_ids, default: nil do string end
8
+ array :questionnaire_keys, default: nil do string end
9
9
  time :completed_after, default: nil
10
10
  time :completed_before, default: nil
11
11
 
12
- validates :questionnaire_keys, presence: true, unless: 'response_ids.present?'
12
+ validates :questionnaire_keys, presence: true, unless: -> { response_ids.present? }
13
13
 
14
14
  def execute
15
15
  validate_response_for do
@@ -58,7 +58,11 @@ module Roqua
58
58
  when 401
59
59
  access_denied(response)
60
60
  else
61
- fail response.parsed_response || "Received HTTP response code #{response.code}!"
61
+ msg = response.parsed_response
62
+ if msg.is_a? Hash
63
+ msg = msg.fetch('error', nil)
64
+ end
65
+ fail msg || "Received HTTP response code #{response.code}!"
62
66
  end
63
67
  end
64
68
 
@@ -3,8 +3,8 @@ module Roqua
3
3
  # @api private
4
4
  class StartFillOutSession < Endpoint
5
5
  string :dossier_id
6
- array :questionnaire_keys, default: [] { string }
7
- array :response_ids, default: [] { integer }
6
+ array :questionnaire_keys, default: [] do string end
7
+ array :response_ids, default: [] do integer end
8
8
  string :return_to
9
9
  string :progress_url, default: nil
10
10
  string :stylesheet, default: nil
@@ -3,13 +3,15 @@ module Roqua
3
3
  # @api private
4
4
  class StartProtocolSubscription < Endpoint
5
5
  string :dossier_id
6
- string :protocol_key
6
+ string :protocol_key, default: nil # Pass the key
7
+ integer :protocol_id, default: nil # or the id
8
+ integer :respondent_id, default: nil
7
9
  time :start_at, default: nil
8
10
  hash :flags, default: {}, strip: false
9
11
  hash :textvars, default: {}, strip: false
10
12
 
11
13
  def execute
12
- options = {protocol_key: protocol_key, flags: flags, textvars: textvars}
14
+ options = {protocol_key: protocol_key, protocol_id: protocol_id, respondent_id: respondent_id, flags: flags, textvars: textvars}
13
15
  options[:start_at] = start_at.to_i if start_at
14
16
  validate_response_for do
15
17
  basic_auth_session.post("/dossiers/#{dossier_id}/protocol_subscriptions", options)
@@ -1,5 +1,5 @@
1
1
  module Roqua
2
2
  module RomApi
3
- VERSION = '2.2.0'
3
+ VERSION = '2.2.5'
4
4
  end
5
5
  end
@@ -2,6 +2,6 @@ Fabricator(:basic_auth_session, from: Roqua::RomApi::Sessions::BasicAuthSession)
2
2
  initialize_with do
3
3
  Roqua::RomApi::Sessions::BasicAuthSession.new username: 'some_username',
4
4
  password: 'some_password',
5
- rom_host: 'http://roqua.dev'
5
+ rom_host: 'http://test.rom.roqua.eu'
6
6
  end
7
7
  end
@@ -8,8 +8,8 @@ describe CreateFillOutRequest do
8
8
  respondent_type: 'patient_version',
9
9
  callback_url: 'http://callback.url',
10
10
  reminders: [1000, 2000],
11
- open_from: Time.now,
12
- open_till: Time.now + 100_000
11
+ open_from: Time.current,
12
+ open_till: Time.current + 100_000
13
13
  }
14
14
  end
15
15
  let(:session) { Sessions::BasicAuthSession.new }
@@ -9,7 +9,7 @@ describe CreateResponse do
9
9
  end
10
10
 
11
11
  it 'does a post to the rom responses api' do
12
- filled_out_at = Time.now
12
+ filled_out_at = Time.current
13
13
  expect(session).to receive(:post).with '/dossiers/some_dossier_id/responses',
14
14
  questionnaire_key: 'some_questionnaire_key',
15
15
  answer_data: {some: 'answer_data'},
@@ -4,7 +4,7 @@ describe FillOutRequest do
4
4
  let(:response_body) do
5
5
  {'id' => 123,
6
6
  'respondent_type' => 'patient_version',
7
- 'completing_url' => 'http://roqua.dev/client/session/new?token=26aee9a4'
7
+ 'completing_url' => 'http://test.rom.roqua.eu/client/session/new?token=26aee9a4'
8
8
  }
9
9
  end
10
10
 
@@ -12,6 +12,6 @@ describe FillOutRequest do
12
12
  response = FillOutRequest.new response_body
13
13
  expect(response.id).to eq 123
14
14
  expect(response.respondent_type).to eq 'patient_version'
15
- expect(response.completing_url).to eq 'http://roqua.dev/client/session/new?token=26aee9a4'
15
+ expect(response.completing_url).to eq 'http://test.rom.roqua.eu/client/session/new?token=26aee9a4'
16
16
  end
17
17
  end
@@ -13,7 +13,7 @@ describe Response do
13
13
  'completer_type' => 'patient',
14
14
  'completed_at' => nil,
15
15
  'status' => 'open',
16
- 'completing_url' => 'http://roqua.dev/client/session/new?token=26aee9a4',
16
+ 'completing_url' => 'http://test.rom.roqua.eu/client/session/new?token=26aee9a4',
17
17
  'values' => {'some' => 'values'},
18
18
  'outcome' => {'some' => 'outcome'}}
19
19
  end
@@ -31,7 +31,7 @@ describe Response do
31
31
  expect(response.completed_at).to eq nil
32
32
  expect(response.completer_type).to eq 'patient'
33
33
  expect(response.status).to eq 'open'
34
- expect(response.completing_url).to eq 'http://roqua.dev/client/session/new?token=26aee9a4'
34
+ expect(response.completing_url).to eq 'http://test.rom.roqua.eu/client/session/new?token=26aee9a4'
35
35
  expect(response.values).to eq('some' => 'values')
36
36
  expect(response.outcome).to eq('some' => 'outcome')
37
37
  end
@@ -28,7 +28,7 @@ describe ReportCalculations do
28
28
 
29
29
  describe 'given a list of questionnaire_keys' do
30
30
  let(:filters) { {questionnaire_keys: ['q1', 'q2'],
31
- completed_after: Time.now - 100_000, completed_before: Time.now} }
31
+ completed_after: Time.current - 100_000, completed_before: Time.current} }
32
32
  let(:options) { {dossier_id: '1', calculator: 'test'}.merge(filters) }
33
33
 
34
34
  it 'calls the right url' do
@@ -48,7 +48,7 @@ describe BasicAuthSession do
48
48
 
49
49
  describe '#get' do
50
50
  it 'performs a get request' do
51
- expect(HTTParty).to receive(:get).with('http://roqua.dev/api/v1/some_path.json',
51
+ expect(HTTParty).to receive(:get).with('http://test.rom.roqua.eu/api/v1/some_path.json',
52
52
  query: {some: 'param'},
53
53
  basic_auth: {username: 'some_username', password: 'some_password'})
54
54
  .and_return(response)
@@ -61,6 +61,12 @@ describe BasicAuthSession do
61
61
  expect { session.get '/some_path' }.to raise_error(RuntimeError, 'some_response')
62
62
  end
63
63
 
64
+ it 'throws an error if the reponse is not within the 200 range with json message' do
65
+ response = double('response', code: 500, parsed_response: {'error' => 'the error'})
66
+ allow(HTTParty).to receive(:get).and_return(response)
67
+ expect { session.get '/some_path' }.to raise_error(RuntimeError, 'the error')
68
+ end
69
+
64
70
  it 'throws a NoSession error if the basic auth is incorrect' do
65
71
  allow(response).to receive(:code).and_return(401)
66
72
  allow(HTTParty).to receive(:get).and_return(response)
@@ -1,8 +1,8 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe StartProtocolSubscription do
4
- let(:options) { {dossier_id: 'some_dossier_id', protocol_key: 'some_key',
5
- flags: {some_flag: true}, textvars: {some_var: 'string'}} }
4
+ let(:options) { {dossier_id: 'some_dossier_id', protocol_key: 'some_key', protocol_id: nil,
5
+ respondent_id: 123, flags: {some_flag: true}, textvars: {some_var: 'string'}} }
6
6
  let(:session) { Sessions::BasicAuthSession.new }
7
7
  let(:response) { httparty_response({}) }
8
8
  before do
@@ -13,15 +13,19 @@ describe StartProtocolSubscription do
13
13
  it 'does a post to the rom protocol_subscription api' do
14
14
  expect(session).to receive(:post).with("/dossiers/#{options[:dossier_id]}/protocol_subscriptions",
15
15
  protocol_key: options[:protocol_key],
16
+ protocol_id: options[:protocol_id],
17
+ respondent_id: options[:respondent_id],
16
18
  flags: {some_flag: true},
17
19
  textvars: {some_var: 'string'})
18
20
  StartProtocolSubscription.run!(options)
19
21
  end
20
22
 
21
23
  it 'passes in the start_at option when provided' do
22
- start_at = Time.now
24
+ start_at = Time.current
23
25
  expect(session).to receive(:post).with("/dossiers/#{options[:dossier_id]}/protocol_subscriptions",
24
26
  protocol_key: options[:protocol_key],
27
+ protocol_id: options[:protocol_id],
28
+ respondent_id: options[:respondent_id],
25
29
  start_at: start_at.to_i,
26
30
  flags: {some_flag: true},
27
31
  textvars: {some_var: 'string'})
@@ -10,7 +10,7 @@ describe UpdateResponse do
10
10
  end
11
11
 
12
12
  it 'does a post to the rom responses api' do
13
- filled_out_at = Time.now
13
+ filled_out_at = Time.current
14
14
  expect(session).to receive(:patch).with '/dossiers/some_dossier_id/responses/230',
15
15
  questionnaire_key: 'some_questionnaire_key',
16
16
  answer_data: {some: 'answer_data'},
data/spec/spec_helper.rb CHANGED
@@ -6,6 +6,11 @@ include Roqua::RomApi
6
6
  include Roqua::RomApi::Sessions
7
7
  include Roqua::RomApi::Models
8
8
 
9
+ # It seems sometimes the Rails constant is defined and Rails.root is injected (which is nil at that moment) resulting
10
+ # in missing fabricators. Let's just set the path to the current directory to fix this. See:
11
+ # https://github.com/paulelliott/fabrication/blob/42db96f11cbf80d22bd9c87dbf6740894c2b2bdc/lib/fabrication/config.rb#L42
12
+ Fabrication::Config.path_prefix = ['.']
13
+
9
14
  Dir[File.join(File.expand_path(File.dirname(__FILE__)), 'support', '*.rb')].each {|f| require f}
10
15
 
11
16
  I18n.load_path << Dir[File.join(File.expand_path(File.dirname(__FILE__)), 'support', '*.yml')]
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.2.0
4
+ version: 2.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Esposito
@@ -9,10 +9,10 @@ authors:
9
9
  - Ivan Malykh
10
10
  - Henk van der Veen
11
11
  - Jorn van de Beek
12
- autorequire:
12
+ autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
- date: 2017-02-12 00:00:00.000000000 Z
15
+ date: 2021-10-19 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: httparty
@@ -20,14 +20,14 @@ dependencies:
20
20
  requirements:
21
21
  - - "~>"
22
22
  - !ruby/object:Gem::Version
23
- version: 0.14.0
23
+ version: '0.14'
24
24
  type: :runtime
25
25
  prerelease: false
26
26
  version_requirements: !ruby/object:Gem::Requirement
27
27
  requirements:
28
28
  - - "~>"
29
29
  - !ruby/object:Gem::Version
30
- version: 0.14.0
30
+ version: '0.14'
31
31
  - !ruby/object:Gem::Dependency
32
32
  name: active_interaction
33
33
  requirement: !ruby/object:Gem::Requirement
@@ -42,6 +42,20 @@ dependencies:
42
42
  - - "~>"
43
43
  - !ruby/object:Gem::Version
44
44
  version: '3.2'
45
+ - !ruby/object:Gem::Dependency
46
+ name: activemodel
47
+ requirement: !ruby/object:Gem::Requirement
48
+ requirements:
49
+ - - "<"
50
+ - !ruby/object:Gem::Version
51
+ version: '6.1'
52
+ type: :runtime
53
+ prerelease: false
54
+ version_requirements: !ruby/object:Gem::Requirement
55
+ requirements:
56
+ - - "<"
57
+ - !ruby/object:Gem::Version
58
+ version: '6.1'
45
59
  - !ruby/object:Gem::Dependency
46
60
  name: virtus
47
61
  requirement: !ruby/object:Gem::Requirement
@@ -56,34 +70,48 @@ dependencies:
56
70
  - - "~>"
57
71
  - !ruby/object:Gem::Version
58
72
  version: '1.0'
73
+ - !ruby/object:Gem::Dependency
74
+ name: appraisal
75
+ requirement: !ruby/object:Gem::Requirement
76
+ requirements:
77
+ - - ">="
78
+ - !ruby/object:Gem::Version
79
+ version: '0'
80
+ type: :development
81
+ prerelease: false
82
+ version_requirements: !ruby/object:Gem::Requirement
83
+ requirements:
84
+ - - ">="
85
+ - !ruby/object:Gem::Version
86
+ version: '0'
59
87
  - !ruby/object:Gem::Dependency
60
88
  name: bundler
61
89
  requirement: !ruby/object:Gem::Requirement
62
90
  requirements:
63
- - - "~>"
91
+ - - ">="
64
92
  - !ruby/object:Gem::Version
65
- version: '1.6'
93
+ version: '0'
66
94
  type: :development
67
95
  prerelease: false
68
96
  version_requirements: !ruby/object:Gem::Requirement
69
97
  requirements:
70
- - - "~>"
98
+ - - ">="
71
99
  - !ruby/object:Gem::Version
72
- version: '1.6'
100
+ version: '0'
73
101
  - !ruby/object:Gem::Dependency
74
102
  name: rake
75
103
  requirement: !ruby/object:Gem::Requirement
76
104
  requirements:
77
105
  - - "~>"
78
106
  - !ruby/object:Gem::Version
79
- version: '10.2'
107
+ version: '13.0'
80
108
  type: :development
81
109
  prerelease: false
82
110
  version_requirements: !ruby/object:Gem::Requirement
83
111
  requirements:
84
112
  - - "~>"
85
113
  - !ruby/object:Gem::Version
86
- version: '10.2'
114
+ version: '13.0'
87
115
  - !ruby/object:Gem::Dependency
88
116
  name: yard
89
117
  requirement: !ruby/object:Gem::Requirement
@@ -104,14 +132,14 @@ dependencies:
104
132
  requirements:
105
133
  - - "~>"
106
134
  - !ruby/object:Gem::Version
107
- version: 3.0.0
135
+ version: '3.0'
108
136
  type: :development
109
137
  prerelease: false
110
138
  version_requirements: !ruby/object:Gem::Requirement
111
139
  requirements:
112
140
  - - "~>"
113
141
  - !ruby/object:Gem::Version
114
- version: 3.0.0
142
+ version: '3.0'
115
143
  - !ruby/object:Gem::Dependency
116
144
  name: fabrication
117
145
  requirement: !ruby/object:Gem::Requirement
@@ -132,25 +160,20 @@ dependencies:
132
160
  requirements:
133
161
  - - "~>"
134
162
  - !ruby/object:Gem::Version
135
- version: 1.3.1
163
+ version: '1.5'
136
164
  type: :development
137
165
  prerelease: false
138
166
  version_requirements: !ruby/object:Gem::Requirement
139
167
  requirements:
140
168
  - - "~>"
141
169
  - !ruby/object:Gem::Version
142
- version: 1.3.1
170
+ version: '1.5'
143
171
  description: Provides authenticated access to ROM utilities
144
172
  email: support@roqua.nl
145
173
  executables: []
146
174
  extensions: []
147
175
  extra_rdoc_files: []
148
176
  files:
149
- - ".document"
150
- - ".gitignore"
151
- - CHANGELOG.md
152
- - Gemfile
153
- - Guardfile
154
177
  - LICENSE.txt
155
178
  - README.md
156
179
  - Rakefile
@@ -195,7 +218,6 @@ files:
195
218
  - lib/roqua/rom_api/stop_protocol_subscription.rb
196
219
  - lib/roqua/rom_api/update_response.rb
197
220
  - lib/roqua/rom_api/version.rb
198
- - roqua_rom_api.gemspec
199
221
  - spec/fabricators/basic_auth_session_fabricator.rb
200
222
  - spec/lib/roqua/rom_api/cancel_fill_out_request_spec.rb
201
223
  - spec/lib/roqua/rom_api/create_fill_out_request_spec.rb
@@ -231,7 +253,7 @@ homepage: https://github.com/roqua/roqua/blob/master/rom_api/README.md
231
253
  licenses:
232
254
  - MIT
233
255
  metadata: {}
234
- post_install_message:
256
+ post_install_message:
235
257
  rdoc_options: []
236
258
  require_paths:
237
259
  - lib
@@ -246,41 +268,39 @@ required_rubygems_version: !ruby/object:Gem::Requirement
246
268
  - !ruby/object:Gem::Version
247
269
  version: '0'
248
270
  requirements: []
249
- rubyforge_project:
250
- rubygems_version: 2.5.1
251
- signing_key:
271
+ rubygems_version: 3.1.6
272
+ signing_key:
252
273
  specification_version: 4
253
274
  summary: API wrapper gem around RoQua's ROM API
254
275
  test_files:
276
+ - spec/spec_helper.rb
277
+ - spec/support/test.yml
278
+ - spec/support/httparty_helpers.rb
255
279
  - spec/fabricators/basic_auth_session_fabricator.rb
256
- - spec/lib/roqua/rom_api/cancel_fill_out_request_spec.rb
280
+ - spec/lib/roqua/rom_api/list_respondents_spec.rb
281
+ - spec/lib/roqua/rom_api/update_response_spec.rb
257
282
  - spec/lib/roqua/rom_api/create_fill_out_request_spec.rb
258
- - spec/lib/roqua/rom_api/create_response_spec.rb
259
283
  - spec/lib/roqua/rom_api/endpoint_spec.rb
260
- - spec/lib/roqua/rom_api/get_measurement_spec.rb
261
- - spec/lib/roqua/rom_api/get_non_response_spec.rb
262
- - spec/lib/roqua/rom_api/get_protocol_spec.rb
263
284
  - spec/lib/roqua/rom_api/get_respondent_spec.rb
264
- - spec/lib/roqua/rom_api/list_dossier_stats_spec.rb
285
+ - spec/lib/roqua/rom_api/get_protocol_spec.rb
286
+ - spec/lib/roqua/rom_api/stop_protocol_subscription_spec.rb
265
287
  - spec/lib/roqua/rom_api/list_non_responses_spec.rb
266
- - spec/lib/roqua/rom_api/list_protocol_subscriptions_spec.rb
267
- - spec/lib/roqua/rom_api/list_protocols_spec.rb
268
- - spec/lib/roqua/rom_api/list_respondents_spec.rb
288
+ - spec/lib/roqua/rom_api/create_response_spec.rb
269
289
  - 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
270
294
  - spec/lib/roqua/rom_api/models/dossier_stats_spec.rb
271
- - spec/lib/roqua/rom_api/models/fill_out_request_spec.rb
272
- - spec/lib/roqua/rom_api/models/protocol_subscription_spec.rb
273
295
  - spec/lib/roqua/rom_api/models/respondent_spec.rb
296
+ - spec/lib/roqua/rom_api/models/fill_out_request_spec.rb
274
297
  - spec/lib/roqua/rom_api/models/response_spec.rb
275
- - spec/lib/roqua/rom_api/models/stats_spec.rb
276
- - spec/lib/roqua/rom_api/report_calculations_spec.rb
298
+ - spec/lib/roqua/rom_api/models/protocol_subscription_spec.rb
277
299
  - spec/lib/roqua/rom_api/sessions/basic_auth_session_spec.rb
278
300
  - spec/lib/roqua/rom_api/start_fill_out_session_spec.rb
301
+ - spec/lib/roqua/rom_api/list_protocols_spec.rb
279
302
  - spec/lib/roqua/rom_api/start_protocol_subscription_spec.rb
280
- - spec/lib/roqua/rom_api/stop_protocol_subscription_spec.rb
281
- - spec/lib/roqua/rom_api/update_response_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
282
306
  - spec/lib/roqua_rom_api_spec.rb
283
- - spec/spec_helper.rb
284
- - spec/support/httparty_helpers.rb
285
- - spec/support/test.yml
286
- has_rdoc:
data/.document DELETED
@@ -1,5 +0,0 @@
1
- lib/**/*.rb
2
- bin/*
3
- -
4
- features/**/*.feature
5
- LICENSE.txt
data/.gitignore DELETED
@@ -1,51 +0,0 @@
1
- Gemfile.lock
2
-
3
- # rcov generated
4
- coverage
5
- coverage.data
6
-
7
- # rdoc generated
8
- rdoc
9
-
10
- # yard generated
11
- doc
12
- .yardoc
13
-
14
- # bundler
15
- .bundle
16
-
17
- # jeweler generated
18
- pkg
19
-
20
- # Have editor/IDE/OS specific files you need to ignore? Consider using a global gitignore:
21
- #
22
- # * Create a file at ~/.gitignore
23
- # * Include files you want ignored
24
- # * Run: git config --global core.excludesfile ~/.gitignore
25
- #
26
- # After doing this, these files will be ignored in all your git projects,
27
- # saving you from having to 'pollute' every project you touch with them
28
- #
29
- # Not sure what to needs to be ignored for particular editors/OSes? Here's some ideas to get you started. (Remember, remove the leading # of the line)
30
- #
31
- # For MacOS:
32
- #
33
- #.DS_Store
34
-
35
- # For TextMate
36
- #*.tmproj
37
- #tmtags
38
-
39
- # For emacs:
40
- #*~
41
- #\#*
42
- #.\#*
43
-
44
- # For vim:
45
- #*.swp
46
-
47
- # For redcar:
48
- #.redcar
49
-
50
- # For rubinius:
51
- #*.rbc
data/CHANGELOG.md DELETED
@@ -1,175 +0,0 @@
1
- ### HEAD
2
-
3
- ### 2.2.0 / 2017-02-12
4
-
5
- * Added ListNonResponses
6
- * Added GetNonResponse
7
- * Added sbg_info to responses
8
-
9
- ### 2.1.0 / 2017-02-07
10
-
11
- * Added ListProtocollen
12
- * Added GetProtocol
13
- * Added GetMeasurement
14
- * Added ListRespondents
15
- * Added GetRespondent
16
-
17
- ### 2.0.1 / 2016-08-15
18
-
19
- * Updated httparty gem to 0.14.0 to fix Virtus incompatibility
20
-
21
- ### 2.0.0 / 2016-08-03
22
-
23
- * Updated ActiveInteraction to version 3.2. See: https://github.com/orgsync/active_interaction/releases/tag/v3.2.0
24
-
25
- ### 1.0.0 / 2015-12-08
26
-
27
- * Updated ActiveInteraction to version 2.1. AI 2 has various breaking changes, see http://taylor.fausak.me/2015/05/07/announcing-active-interaction-2/
28
-
29
- ### 0.4.2 / 2015-8-20
30
-
31
- * Add ability to use different basic_auth_sessions than the global one
32
-
33
- ### 0.4.1 / 2015-8-12
34
-
35
- * Add charts to questionnaire model
36
- * Add internal quby_key to questionnaire model
37
-
38
- ### 0.4.0 / 2015-6-2
39
-
40
- * Add CancelFillOutRequest api
41
-
42
- ### 0.3.0 / 2015-2-13
43
-
44
- * Add dossier stats api
45
- * Retrieve responses by response_ids.
46
-
47
- ### 0.2.2 / 2014-12-15
48
-
49
- * Improve validation errors for protocol_subscriptions
50
- * Add API endpoint for retrieving questionnaires
51
- * Pass textvar and flag definitions of questionnaires
52
- * Pass textvars and flags of responses
53
-
54
- ### 0.2.1 / 2014-11-17
55
-
56
- * Add progress url to fill_out session api endpoint
57
-
58
- ### 0.2.0 / 2014-11-11
59
-
60
- * Added CreateMeasurementSequence
61
- * BACKWARD INCOMPATIBLE: Starting a protocol subscription now returns ProtocolSubscription model
62
- * Add responses to protocol subscriptions
63
-
64
- ### 0.1.12 / 2014-10-28
65
-
66
- * Add started_at timestamp to response create and update api endpoint
67
-
68
- ### 0.1.11 / 2014-10-20
69
-
70
- * Add textvars parameter to protocol subscriptions
71
-
72
- ### 0.1.10 / 2014-10-07
73
-
74
- * Add flags parameter to protocol subscriptions
75
-
76
- ### 0.1.9 / 2014-10-07
77
-
78
- * Add API endpoint for updating responses
79
-
80
- ### 0.1.8 / 2014-09-22
81
-
82
- * Add API endpoint for creating responses
83
-
84
- ### 0.1.7 / 2014-07-10
85
-
86
- * Add id to responses api
87
-
88
- ### 0.1.6 / 2014-07-02
89
-
90
- * Implement start\_fill\_out session for aborted answers
91
- * Add id to the responses api
92
- * Add 'aborted' status to the responses api
93
- * Allow multiple questionnaires in start\_fill\_out_session api
94
-
95
- ### 0.1.5 / 2014-06-10
96
-
97
- * Added CreateFillOutRequest
98
-
99
- ### 0.1.4 / 2014-05-26
100
-
101
- * add answers and outcome to rom responses api
102
-
103
- ### 0.1.3 / 2014-05-20
104
-
105
- * remove next_run_time from protocol_subscriptions api
106
-
107
- ### 0.1.2 / 2014-05-13
108
-
109
- #### Responses API
110
- * rename Responses to ListResponses
111
- * return responses through `result` accessor
112
-
113
- #### ProtocolSubscriptions API
114
- * rename ProtocolSubscriptions to ListProtocolSubscriptions
115
- * return protocol_subscriptions through `result` accessor
116
- * remove `state` from ProtocolSubscriptions API
117
- * only list active ProtocolSubscriptions
118
-
119
- #### FillOutSessions API
120
- * return questionnaire_url through `result` accessor
121
-
122
- #### Localization
123
- * Instead of full messages the HTTP API returns hashes with attribute and error keys. The Ruby Gem uses these keys to compile localized messages using I18n.
124
-
125
- #### Validations
126
- * Some of the 422 response codes are changed to 404 and will now raise an exception when using the Ruby Gem. See the [HTTP API documentation](http://docs.roqua.net/developer/rom_v1/dossier/) for more info.
127
-
128
- ### 0.1.1 / 2014-04-23
129
-
130
- * Validate api responses
131
- * From now on the Responses API is accessible through the Responses interactor. The received responses can be obtained through the `#responses` accessor when the interactor outcome is valid.
132
- * Similarly the the ProtocolSubscriptions API is hence forth accessible through the ProtocolSubscriptions interactor. The received protocol subscriptions can be obtained through the `#protocol_subscriptions` accessor when the interactor outcome is valid.
133
- * Add accessor for fill_out_session api questionnaire_url
134
- * Update documentation in README
135
-
136
- ### 0.0.9 / 2014-04-14
137
-
138
- * Added Virtus to the gemspec
139
- * Model::Response date attributes are DateTimes now.
140
- * Added list_protocol_subscriptions
141
- * Add fill_out sessions api
142
-
143
- ### 0.0.8 / 2014-03-13
144
-
145
- * rename env vars for consistency with roqua-core-api gem
146
-
147
- ### 0.0.7 / 2014-03-13
148
-
149
- * relax active-interaction version requirement
150
-
151
- ### 0.0.6 / 2014-03-12
152
-
153
- * Fix ProtocolSubscription api return value
154
-
155
- ### 0.0.5 / 2014-03-12
156
-
157
- * Remove RoQua prefix from env vars
158
-
159
- ### 0.0.4 / 2014-03-06
160
-
161
- * Use BasicAuthSession for http requests instead of RomApi::Base class
162
-
163
- ### 0.0.3 / 2014-02-18
164
-
165
- * Remove daily start time from api
166
-
167
- ### 0.0.2 / 2014-02-17
168
-
169
- * Raise when API response is not in 200 range
170
-
171
- ### 0.0.1 / 2014-02-14
172
-
173
- * Initial release:
174
-
175
- Here be dragons
data/Gemfile DELETED
@@ -1,10 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- gemspec
4
-
5
- group :test do
6
- gem 'guard-bundler'
7
- gem 'guard-rspec', '~> 4.3'
8
- gem 'rb-readline', '~> 0.5.1'
9
- gem 'fuubar', '~> 2.0.0'
10
- end
data/Guardfile DELETED
@@ -1,28 +0,0 @@
1
- guard :bundler do
2
- require 'guard/bundler'
3
- require 'guard/bundler/verify'
4
- helper = Guard::Bundler::Verify.new
5
-
6
- files = ['Gemfile']
7
- files += Dir['*.gemspec'] if files.any? { |f| helper.uses_gemspec?(f) }
8
-
9
- # Assume files are symlinked from somewhere
10
- files.each { |file| watch(helper.real_path(file)) }
11
- end
12
-
13
- guard :rspec, cmd: "bundle exec rspec" do
14
- require "guard/rspec/dsl"
15
- dsl = Guard::RSpec::Dsl.new(self)
16
-
17
- # Feel free to open issues for suggestions and improvements
18
-
19
- # RSpec files
20
- rspec = dsl.rspec
21
- watch(rspec.spec_helper) { rspec.spec_dir }
22
- watch(rspec.spec_support) { rspec.spec_dir }
23
- watch(rspec.spec_files)
24
-
25
- # Ruby files
26
- ruby = dsl.ruby
27
- dsl.watch_spec_files_for(ruby.lib_files)
28
- end
@@ -1,29 +0,0 @@
1
- # encoding: utf-8
2
- require File.expand_path('../lib/roqua/rom_api/version', __FILE__)
3
-
4
- Gem::Specification.new do |gem|
5
- gem.name = "roqua-rom-api"
6
- gem.version = Roqua::RomApi::VERSION
7
- gem.summary = "API wrapper gem around RoQua's ROM API"
8
- gem.description = 'Provides authenticated access to ROM utilities'
9
- gem.license = "MIT"
10
- gem.authors = ['Samuel Esposito', 'Marten Veldthuis', 'Ivan Malykh', 'Henk van der Veen', 'Jorn van de Beek']
11
- gem.email = "support@roqua.nl"
12
- gem.homepage = "https://github.com/roqua/roqua/blob/master/rom_api/README.md"
13
-
14
- gem.files = `git ls-files`.split($INPUT_RECORD_SEPARATOR)
15
- gem.executables = gem.files.grep(%r{^bin/}).map { |f| File.basename(f) }
16
- gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
17
- gem.require_paths = ['lib']
18
-
19
- gem.add_dependency 'httparty', '~> 0.14.0'
20
- gem.add_dependency 'active_interaction', '~> 3.2'
21
- gem.add_dependency 'virtus', '~> 1.0'
22
-
23
- gem.add_development_dependency 'bundler', '~> 1.6'
24
- gem.add_development_dependency 'rake', '~> 10.2'
25
- gem.add_development_dependency 'yard', '~> 0.8'
26
- gem.add_development_dependency 'rspec', '~> 3.0.0'
27
- gem.add_development_dependency 'fabrication', '~> 2.9'
28
- gem.add_development_dependency 'ruby_dep', '~> 1.3.1' # updgrade to 1.4 when switched to Ruby 2.2.5 or 2.3
29
- end