roqua-rom-api 0.3.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ChangeLog.md +1 -1
- data/README.md +19 -12
- data/lib/roqua/rom_api.rb +1 -0
- data/lib/roqua/rom_api/cancel_fill_out_request.rb +15 -0
- data/lib/roqua/rom_api/version.rb +1 -1
- data/spec/lib/roqua/rom_api/cancel_fill_out_request_spec.rb +21 -0
- metadata +6 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8fdae5cd03021f42ee36e88231c17528bce92494
|
4
|
+
data.tar.gz: 60d8978308dc7272f69ff4052497db5cee26cb9d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2fcfa215e3a6d850f226cacd2bbb7ff5b3ad429645cedae36d95633fea487c40c53fb14b3d4fe610e5acd67d167ca5acc8e92e0e0cf35f10977dcb4c308799ec
|
7
|
+
data.tar.gz: cf2b41dc88d3ca60cd004f9a5b188f34e6d6346f27a0b5f2dafb9d0f0616acda3b88b1cf78b840b70ba33f017e2c332d8383182854f69063faeead272847c858
|
data/ChangeLog.md
CHANGED
@@ -81,7 +81,7 @@
|
|
81
81
|
* 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.
|
82
82
|
|
83
83
|
#### Validations
|
84
|
-
* 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://roqua.
|
84
|
+
* 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.
|
85
85
|
|
86
86
|
### 0.1.1 / 2014-04-23
|
87
87
|
|
data/README.md
CHANGED
@@ -30,7 +30,7 @@ this means that you'll usually write a pattern like this:
|
|
30
30
|
end
|
31
31
|
|
32
32
|
|
33
|
-
## [Fill Out Requests](http://roqua.
|
33
|
+
## [Fill Out Requests](http://docs.roqua.net/developer/rom/dossier/fill_out_requests/)
|
34
34
|
|
35
35
|
To create a fill out request run:
|
36
36
|
|
@@ -38,11 +38,11 @@ To create a fill out request run:
|
|
38
38
|
questionnaire_keys: ['key1', 'key2'],
|
39
39
|
callback_url: notify_callback_path(token: 'secret')
|
40
40
|
|
41
|
-
See [api](http://roqua.
|
41
|
+
See [api](http://docs.roqua.net/developer/rom/dossier/fill_out_requests/) for more info on how callbacks work.
|
42
42
|
|
43
43
|
|
44
44
|
|
45
|
-
## [Fill Out Sessions](http://roqua.
|
45
|
+
## [Fill Out Sessions](http://docs.roqua.net/developer/rom/dossier/fill_out_sessions/)
|
46
46
|
|
47
47
|
To start filling out a set of questionnaires run:
|
48
48
|
|
@@ -58,15 +58,15 @@ Redirect to the fill_out url received when the outcome is valid:
|
|
58
58
|
log_or_display outcome.errors.full_messages
|
59
59
|
end
|
60
60
|
|
61
|
-
## [Protocol Subscriptions](http://roqua.
|
61
|
+
## [Protocol Subscriptions](http://docs.roqua.net/developer/rom/dossier/protocol_subscriptions/)
|
62
62
|
|
63
|
-
### [List](http://roqua.
|
63
|
+
### [List](http://docs.roqua.net/developer/rom/dossier/protocol_subscriptions/#list-active-protocol-subscriptions-for-a-patient)
|
64
64
|
|
65
65
|
To retrieve active protocol subscriptions run:
|
66
66
|
|
67
67
|
outcome = Roqua::RomApi::ListProtocolSubscriptions.run dossier_id: dossier_id
|
68
68
|
|
69
|
-
### [Start](http://roqua.
|
69
|
+
### [Start](http://docs.roqua.net/developer/rom/dossier/protocol_subscriptions/#start-a-protocol-subscription)
|
70
70
|
|
71
71
|
To subscribe to a protocol run the following command:
|
72
72
|
|
@@ -74,22 +74,22 @@ To subscribe to a protocol run the following command:
|
|
74
74
|
protocol_key: protocol_key,
|
75
75
|
start_at: start_at
|
76
76
|
|
77
|
-
### [Stop](http://roqua.
|
77
|
+
### [Stop](http://docs.roqua.net/developer/rom/dossier/protocol_subscriptions/#stop-a-protocol-subscription)
|
78
78
|
|
79
79
|
To unsubscribe from a protocol run the command:
|
80
80
|
|
81
81
|
outcome = Roqua::RomApi::StopProtocolSubscription.run dossier_id: dossier_id,
|
82
82
|
protocol_subscription_id: subscription_id
|
83
83
|
|
84
|
-
## [Responses](http://roqua.
|
84
|
+
## [Responses](http://docs.roqua.net/developer/rom/dossier/responses/)
|
85
85
|
|
86
|
-
### [List](http://roqua.
|
86
|
+
### [List](http://docs.roqua.net/developer/rom/dossier/responses/#list-all-responses-for-dossier)
|
87
87
|
|
88
88
|
To retrieve filled out, pending or scheduled questionnaires run:
|
89
89
|
|
90
90
|
outcome = Roqua::RomApi::ListResponses.run dossier_id: dossier_id
|
91
91
|
|
92
|
-
### [Create](http://roqua.
|
92
|
+
### [Create](http://docs.roqua.net/developer/rom/dossier/responses/#store-a-new-response)
|
93
93
|
|
94
94
|
To store an externally filled out questionnaire run:
|
95
95
|
|
@@ -97,7 +97,7 @@ To store an externally filled out questionnaire run:
|
|
97
97
|
dossier_id: 'dossier_id',
|
98
98
|
answer_data: {some: 'aswer_data'}
|
99
99
|
|
100
|
-
### [Update](http://roqua.
|
100
|
+
### [Update](http://docs.roqua.net/developer/rom/dossier/responses/#update-a-response)
|
101
101
|
|
102
102
|
To store external data on an existing pending response:
|
103
103
|
|
@@ -106,6 +106,14 @@ To store external data on an existing pending response:
|
|
106
106
|
id: 230, # response id,
|
107
107
|
answer_data: {some: 'aswer_data'}
|
108
108
|
|
109
|
+
## [Stats](http://docs.roqua.net/developer/rom/dossier/stats/#stats)
|
110
|
+
|
111
|
+
### [List](http://docs.roqua.net/developer/rom/dossier/stats/#stats)
|
112
|
+
|
113
|
+
outcome = Roqua::RomApi::ListDossierStats.run epd_ids: "comma,separated,list,of,epd,ids"
|
114
|
+
|
115
|
+
To get stats for epd_ids:
|
116
|
+
|
109
117
|
## Contributing to roqua-rom-api
|
110
118
|
|
111
119
|
* Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet.
|
@@ -119,4 +127,3 @@ To store external data on an existing pending response:
|
|
119
127
|
## Copyright
|
120
128
|
|
121
129
|
Copyright (c) 2014 RoQua. See LICENSE.txt for further details.
|
122
|
-
|
data/lib/roqua/rom_api.rb
CHANGED
@@ -10,6 +10,7 @@ require 'roqua/rom_api/update_response'
|
|
10
10
|
require 'roqua/rom_api/create_measurement_sequence'
|
11
11
|
require 'roqua/rom_api/start_fill_out_session'
|
12
12
|
require 'roqua/rom_api/create_fill_out_request'
|
13
|
+
require 'roqua/rom_api/cancel_fill_out_request'
|
13
14
|
require 'roqua/rom_api/start_protocol_subscription'
|
14
15
|
require 'roqua/rom_api/stop_protocol_subscription'
|
15
16
|
require 'roqua/rom_api/report_calculations'
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module Roqua
|
2
|
+
module RomApi
|
3
|
+
# @api private
|
4
|
+
class CancelFillOutRequest < Endpoint
|
5
|
+
string :dossier_id
|
6
|
+
string :fill_out_request_id
|
7
|
+
|
8
|
+
def execute
|
9
|
+
validate_response_for do
|
10
|
+
RomApi.basic_auth_session.delete("/dossiers/#{dossier_id}/fill_out_requests/#{fill_out_request_id}")
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe CancelFillOutRequest do
|
4
|
+
let(:options) { {dossier_id: 'some_dossier_id', fill_out_request_id: 'some_fill_out_request_id'} }
|
5
|
+
let(:response) { httparty_response({}) }
|
6
|
+
let(:session) { Fabricate :basic_auth_session }
|
7
|
+
before do
|
8
|
+
allow(Sessions::BasicAuthSession).to receive(:new).and_return session
|
9
|
+
allow(session).to receive(:delete).and_return response
|
10
|
+
end
|
11
|
+
|
12
|
+
it 'does a post to the rom protocol_subscription api' do
|
13
|
+
url = "/dossiers/#{options[:dossier_id]}/fill_out_requests/#{options[:fill_out_request_id]}"
|
14
|
+
expect(session).to receive(:delete).with(url)
|
15
|
+
CancelFillOutRequest.run!(options)
|
16
|
+
end
|
17
|
+
|
18
|
+
it 'returns the response' do
|
19
|
+
expect(CancelFillOutRequest.run!(options)).to eq(response)
|
20
|
+
end
|
21
|
+
end
|
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.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Esposito
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-02
|
11
|
+
date: 2015-06-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|
@@ -141,6 +141,7 @@ files:
|
|
141
141
|
- lib/i18n/i18n.rb
|
142
142
|
- lib/roqua-rom-api.rb
|
143
143
|
- lib/roqua/rom_api.rb
|
144
|
+
- lib/roqua/rom_api/cancel_fill_out_request.rb
|
144
145
|
- lib/roqua/rom_api/create_fill_out_request.rb
|
145
146
|
- lib/roqua/rom_api/create_measurement_sequence.rb
|
146
147
|
- lib/roqua/rom_api/create_response.rb
|
@@ -167,6 +168,7 @@ files:
|
|
167
168
|
- lib/roqua/rom_api/version.rb
|
168
169
|
- roqua_rom_api.gemspec
|
169
170
|
- spec/fabricators/basic_auth_session_fabricator.rb
|
171
|
+
- spec/lib/roqua/rom_api/cancel_fill_out_request_spec.rb
|
170
172
|
- spec/lib/roqua/rom_api/create_fill_out_request_spec.rb
|
171
173
|
- spec/lib/roqua/rom_api/create_response_spec.rb
|
172
174
|
- spec/lib/roqua/rom_api/endpoint_spec.rb
|
@@ -208,12 +210,13 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
208
210
|
version: '0'
|
209
211
|
requirements: []
|
210
212
|
rubyforge_project:
|
211
|
-
rubygems_version: 2.
|
213
|
+
rubygems_version: 2.4.6
|
212
214
|
signing_key:
|
213
215
|
specification_version: 4
|
214
216
|
summary: API wrapper gem around RoQua's ROM API
|
215
217
|
test_files:
|
216
218
|
- spec/fabricators/basic_auth_session_fabricator.rb
|
219
|
+
- spec/lib/roqua/rom_api/cancel_fill_out_request_spec.rb
|
217
220
|
- spec/lib/roqua/rom_api/create_fill_out_request_spec.rb
|
218
221
|
- spec/lib/roqua/rom_api/create_response_spec.rb
|
219
222
|
- spec/lib/roqua/rom_api/endpoint_spec.rb
|