roqua-rom-api 0.1.10 → 0.1.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ChangeLog.md +8 -0
- data/README.md +1 -0
- data/config/locales/nl.yml +4 -4
- data/lib/roqua/rom_api/models/protocol_subscription.rb +1 -0
- data/lib/roqua/rom_api/start_protocol_subscription.rb +2 -1
- data/lib/roqua/rom_api/version.rb +1 -1
- data/spec/lib/roqua/rom_api/start_protocol_subscription_spec.rb +6 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2c0f791ffb54619a1c58c609cdba40d5bd3d7398
|
4
|
+
data.tar.gz: e33f8f99892cbda235533616f39f2fb79ac08bbf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e7751a11b6a9b5baa9a9cbeee9c7d5cf43d75447f43900654f3e77e573c531d6097117230e769011634c9dbef4ba217ea02cb9d6448d96d045740dc6a7cd7f91
|
7
|
+
data.tar.gz: 5c7cc83c86d705afe41537b6b32d5a758df1150e3d85bbfb0d04e77f1b2f0cb47f84d5baf3ce1832626fffcbbeb64d004835cdb35b0064a08457ac3fe1339e3b
|
data/ChangeLog.md
CHANGED
data/README.md
CHANGED
@@ -99,6 +99,7 @@ To subscribe to a protocol run the following command:
|
|
99
99
|
* `protocol_key:` [Required] - Key uniquely identifying the protocol of interest as specified in RoQua.
|
100
100
|
* `start_at:` [Defaults to the present] - Timestamp specifying when the first measurement should be prepared.
|
101
101
|
* `flags` - Boolean flags that are passed in when a questionnaire is being filled out.
|
102
|
+
* `textvars` - String variables that are passed in when a questionnaire is being filled out.
|
102
103
|
|
103
104
|
When the subscription succeeds, the subscription object is available through the `#result` accessor:
|
104
105
|
|
data/config/locales/nl.yml
CHANGED
@@ -6,11 +6,11 @@ nl:
|
|
6
6
|
attributes:
|
7
7
|
roqua/rom_api/start_protocol_subscription:
|
8
8
|
attributes:
|
9
|
-
|
10
|
-
|
9
|
+
base:
|
10
|
+
flag_does_not_exist: Een van de opgegeven vlaggen bestaat niet.
|
11
|
+
flag_value_invalid: Een van de opgegeven vlaggen bevat een waarde anders dan true, false of nil.
|
12
|
+
|
11
13
|
attributes:
|
12
14
|
roqua/rom_api/start_fill_out_session:
|
13
15
|
questionnaire_keys: Vragenlijsten
|
14
16
|
return_to: Return url
|
15
|
-
roqua/rom_api/start_protocol_subscription:
|
16
|
-
protocol_key: Protocol
|
@@ -6,9 +6,10 @@ module Roqua
|
|
6
6
|
string :protocol_key
|
7
7
|
time :start_at, default: nil
|
8
8
|
hash :flags, default: {}, strip: false
|
9
|
+
hash :textvars, default: {}, strip: false
|
9
10
|
|
10
11
|
def execute
|
11
|
-
options = {protocol_key: protocol_key, flags: flags}
|
12
|
+
options = {protocol_key: protocol_key, flags: flags, textvars: textvars}
|
12
13
|
options[:start_at] = start_at.to_i if start_at
|
13
14
|
validate_response_for do
|
14
15
|
RomApi.basic_auth_session.post("/dossiers/#{dossier_id}/protocol_subscriptions", options)
|
@@ -1,7 +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',
|
4
|
+
let(:options) { {dossier_id: 'some_dossier_id', protocol_key: 'some_key',
|
5
|
+
flags: {some_flag: true}, textvars: {some_var: 'string'}} }
|
5
6
|
let(:session) { Sessions::BasicAuthSession.new }
|
6
7
|
let(:response) { httparty_response({}) }
|
7
8
|
before do
|
@@ -12,7 +13,8 @@ describe StartProtocolSubscription do
|
|
12
13
|
it 'does a post to the rom protocol_subscription api' do
|
13
14
|
expect(session).to receive(:post).with("/dossiers/#{options[:dossier_id]}/protocol_subscriptions",
|
14
15
|
protocol_key: options[:protocol_key],
|
15
|
-
flags: {
|
16
|
+
flags: {some_flag: true},
|
17
|
+
textvars: {some_var: 'string'})
|
16
18
|
StartProtocolSubscription.run!(options)
|
17
19
|
end
|
18
20
|
|
@@ -21,7 +23,8 @@ describe StartProtocolSubscription do
|
|
21
23
|
expect(session).to receive(:post).with("/dossiers/#{options[:dossier_id]}/protocol_subscriptions",
|
22
24
|
protocol_key: options[:protocol_key],
|
23
25
|
start_at: start_at.to_i,
|
24
|
-
flags: {
|
26
|
+
flags: {some_flag: true},
|
27
|
+
textvars: {some_var: 'string'})
|
25
28
|
StartProtocolSubscription.run!(options.merge start_at: start_at)
|
26
29
|
end
|
27
30
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: roqua-rom-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Esposito
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-10-
|
11
|
+
date: 2014-10-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|