roqua-rom-api 0.1.9 → 0.1.10
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 +4 -4
- data/ChangeLog.md +4 -0
- data/README.md +1 -0
- 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 +5 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5a95d8bfee28a8a954ee62dc31b632b5516ef7e4
|
4
|
+
data.tar.gz: 0b53e11f04d56494713177e82b0c636744df3262
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6b201635dbb748824913bb8be850b0288a4b1b6adaeac8af49e252fbdf25b495f54fe7112db0cabc2b0a67ce354edf82db8bd8fd09875c45f1c1371e9d8fa982
|
7
|
+
data.tar.gz: e6b8e553487c7ba0e70b1204c4618107c7e12246c90195b527876c3785a605654208030fa3ff643ec98764ced00c7e17139875da0b36413bf7df2b3ba3a705be
|
data/ChangeLog.md
CHANGED
data/README.md
CHANGED
@@ -98,6 +98,7 @@ To subscribe to a protocol run the following command:
|
|
98
98
|
* `dossier_id:` [Required] - Unique dossier identifier for the patient to be subscribed.
|
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
|
+
* `flags` - Boolean flags that are passed in when a questionnaire is being filled out.
|
101
102
|
|
102
103
|
When the subscription succeeds, the subscription object is available through the `#result` accessor:
|
103
104
|
|
@@ -5,9 +5,10 @@ module Roqua
|
|
5
5
|
string :dossier_id
|
6
6
|
string :protocol_key
|
7
7
|
time :start_at, default: nil
|
8
|
+
hash :flags, default: {}, strip: false
|
8
9
|
|
9
10
|
def execute
|
10
|
-
options = {protocol_key: protocol_key}
|
11
|
+
options = {protocol_key: protocol_key, flags: flags}
|
11
12
|
options[:start_at] = start_at.to_i if start_at
|
12
13
|
validate_response_for do
|
13
14
|
RomApi.basic_auth_session.post("/dossiers/#{dossier_id}/protocol_subscriptions", options)
|
@@ -1,7 +1,7 @@
|
|
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', flags: {some: 'flag'}} }
|
5
5
|
let(:session) { Sessions::BasicAuthSession.new }
|
6
6
|
let(:response) { httparty_response({}) }
|
7
7
|
before do
|
@@ -11,7 +11,8 @@ describe StartProtocolSubscription do
|
|
11
11
|
|
12
12
|
it 'does a post to the rom protocol_subscription api' do
|
13
13
|
expect(session).to receive(:post).with("/dossiers/#{options[:dossier_id]}/protocol_subscriptions",
|
14
|
-
protocol_key: options[:protocol_key]
|
14
|
+
protocol_key: options[:protocol_key],
|
15
|
+
flags: {some: 'flag'})
|
15
16
|
StartProtocolSubscription.run!(options)
|
16
17
|
end
|
17
18
|
|
@@ -19,7 +20,8 @@ describe StartProtocolSubscription do
|
|
19
20
|
start_at = Time.now
|
20
21
|
expect(session).to receive(:post).with("/dossiers/#{options[:dossier_id]}/protocol_subscriptions",
|
21
22
|
protocol_key: options[:protocol_key],
|
22
|
-
start_at: start_at.to_i
|
23
|
+
start_at: start_at.to_i,
|
24
|
+
flags: {some: 'flag'})
|
23
25
|
StartProtocolSubscription.run!(options.merge start_at: start_at)
|
24
26
|
end
|
25
27
|
|