quby-mongoid 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,5 @@
1
+ module Quby
2
+ module Mongoid
3
+ VERSION = "1.0.0"
4
+ end
5
+ end
@@ -0,0 +1,2 @@
1
+ require "quby/mongoid/version"
2
+ require "quby/answer_repos/mongoid_repo"
@@ -0,0 +1,32 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'quby/mongoid/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "quby-mongoid"
8
+ spec.version = Quby::Mongoid::VERSION
9
+ spec.authors = ["Marten Veldthuis"]
10
+ spec.email = ["marten@veldthuis.com"]
11
+ spec.summary = %q{Mongoid database adapter for the Quby questionnaire engine}
12
+ spec.description = ""
13
+ spec.homepage = ""
14
+ spec.license = "MIT"
15
+
16
+ spec.files = `git ls-files -z`.split("\x0")
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.require_paths = ["lib"]
20
+
21
+ spec.add_dependency 'quby'
22
+ spec.add_dependency "mongoid", ">= 2.2", '< 5.0'
23
+
24
+ spec.add_development_dependency "bundler", "~> 1.6"
25
+ spec.add_development_dependency "rake"
26
+ spec.add_development_dependency 'pry'
27
+
28
+ # Test dependencies
29
+ spec.add_development_dependency 'rspec', '~> 2.14.0'
30
+ spec.add_development_dependency "database_cleaner"
31
+ spec.add_development_dependency 'rubocop', '~> 0.19.0'
32
+ end
data/rubocop-todo.yml ADDED
@@ -0,0 +1,34 @@
1
+ # This configuration was generated by `rubocop --auto-gen-config`.
2
+ # The point is for the user to remove these configuration records
3
+ # one by one as the offences are removed from the code base.
4
+
5
+ AssignmentInCondition:
6
+ Enabled: false
7
+
8
+ # auto-correct says it fixes, but it doesn't fix all.
9
+ AndOr:
10
+ Enabled: false
11
+
12
+ ClassLength:
13
+ Enabled: false
14
+
15
+ Documentation:
16
+ Enabled: false
17
+
18
+ MethodLength:
19
+ Enabled: false
20
+
21
+ RescueException:
22
+ Enabled: false
23
+
24
+ RescueModifier:
25
+ Enabled: false
26
+
27
+ Semicolon:
28
+ Enabled: false
29
+
30
+ TrivialAccessors:
31
+ Enabled: false
32
+
33
+ IndentArray:
34
+ Enabled: false
@@ -0,0 +1,377 @@
1
+ title "Grote Vragenlijst"
2
+ short_description "Een vragenlijst met een heleboel vragen"
3
+ description ""
4
+ outcome_description ""
5
+
6
+ abortable
7
+ enable_previous_questionnaire_button
8
+ allow_hotkeys :all
9
+
10
+ css "#content .paged .panel .item.text { margin-bottom: -18px !important; margin-top: 36px !important;}
11
+ #content .paged .panel .item.text p { margin-bottom: 0; }"
12
+
13
+ default_question_options :score_header => :description, :show_values => true, :deselectable => true
14
+
15
+ panel do
16
+ title "Heel Veel Vragen (HVV)"
17
+
18
+ text "*Positieve Schaal*"
19
+ table :columns => 7 do
20
+ question :v_6, :type => :radio do
21
+ title "P1 Waanvoorstellingen"
22
+ description ""
23
+ option :a1, :value => 1, :description => "afwezig"
24
+ option :a2, :value => 2, :description => "minimaal"
25
+ option :a3, :value => 3, :description => "licht"
26
+ option :a4, :value => 4, :description => "matig", :hides_questions => [:v_50]
27
+ option :a5, :value => 5, :description => "matig ernstig", :hides_questions => [:v_50]
28
+ option :a6, :value => 6, :description => "ernstig", :hides_questions => [:v_50]
29
+ option :a7, :value => 7, :description => "extreem", :hides_questions => [:v_50]
30
+ end
31
+ question :v_7, :type => :radio do
32
+ title "P2 Conceptuele desorganisatie"
33
+ description ""
34
+ option :a1, :value => 1, :description => "afwezig"
35
+ option :a2, :value => 2, :description => "minimaal"
36
+ option :a3, :value => 3, :description => "licht"
37
+ option :a4, :value => 4, :description => "matig", :hides_questions => [:v_50]
38
+ option :a5, :value => 5, :description => "matig ernstig", :hides_questions => [:v_50]
39
+ option :a6, :value => 6, :description => "ernstig", :hides_questions => [:v_50]
40
+ option :a7, :value => 7, :description => "extreem", :hides_questions => [:v_50]
41
+ end
42
+ question :v_8, :type => :radio do
43
+ title "P3 Hallucinatoir gedrag"
44
+ description ""
45
+ option :a1, :value => 1, :description => "afwezig"
46
+ option :a2, :value => 2, :description => "minimaal"
47
+ option :a3, :value => 3, :description => "licht"
48
+ option :a4, :value => 4, :description => "matig", :hides_questions => [:v_50]
49
+ option :a5, :value => 5, :description => "matig ernstig", :hides_questions => [:v_50]
50
+ option :a6, :value => 6, :description => "ernstig", :hides_questions => [:v_50]
51
+ option :a7, :value => 7, :description => "extreem", :hides_questions => [:v_50]
52
+ end
53
+ question :v_9, :type => :radio do
54
+ title "P4 Opwinding"
55
+ description ""
56
+ option :a1, :value => 1, :description => "afwezig"
57
+ option :a2, :value => 2, :description => "minimaal"
58
+ option :a3, :value => 3, :description => "licht"
59
+ option :a4, :value => 4, :description => "matig"
60
+ option :a5, :value => 5, :description => "matig ernstig"
61
+ option :a6, :value => 6, :description => "ernstig"
62
+ option :a7, :value => 7, :description => "extreem"
63
+ end
64
+ question :v_10, :type => :radio do
65
+ title "P5 Pompeusheid"
66
+ description ""
67
+ option :a1, :value => 1, :description => "afwezig"
68
+ option :a2, :value => 2, :description => "minimaal"
69
+ option :a3, :value => 3, :description => "licht"
70
+ option :a4, :value => 4, :description => "matig"
71
+ option :a5, :value => 5, :description => "matig ernstig"
72
+ option :a6, :value => 6, :description => "ernstig"
73
+ option :a7, :value => 7, :description => "extreem"
74
+ end
75
+ question :v_11, :type => :radio do
76
+ title "P6 Achterdocht/ achtervolgingswaan"
77
+ description ""
78
+ option :a1, :value => 1, :description => "afwezig"
79
+ option :a2, :value => 2, :description => "minimaal"
80
+ option :a3, :value => 3, :description => "licht"
81
+ option :a4, :value => 4, :description => "matig"
82
+ option :a5, :value => 5, :description => "matig ernstig"
83
+ option :a6, :value => 6, :description => "ernstig"
84
+ option :a7, :value => 7, :description => "extreem"
85
+ end
86
+ question :v_12, :type => :radio do
87
+ title "P7 Vijandigheid"
88
+ description ""
89
+ option :a1, :value => 1, :description => "afwezig"
90
+ option :a2, :value => 2, :description => "minimaal"
91
+ option :a3, :value => 3, :description => "licht"
92
+ option :a4, :value => 4, :description => "matig"
93
+ option :a5, :value => 5, :description => "matig ernstig"
94
+ option :a6, :value => 6, :description => "ernstig"
95
+ option :a7, :value => 7, :description => "extreem"
96
+ end
97
+ end
98
+
99
+ text "*Negatieve Schaal*"
100
+ table :columns => 7 do
101
+ question :v_20, :type => :radio do
102
+ title "N1 Afgestompt gevoel"
103
+ description ""
104
+ option :a1, :value => 1, :description => "afwezig"
105
+ option :a2, :value => 2, :description => "minimaal"
106
+ option :a3, :value => 3, :description => "licht"
107
+ option :a4, :value => 4, :description => "matig", :hides_questions => [:v_50]
108
+ option :a5, :value => 5, :description => "matig ernstig", :hides_questions => [:v_50]
109
+ option :a6, :value => 6, :description => "ernstig", :hides_questions => [:v_50]
110
+ option :a7, :value => 7, :description => "extreem", :hides_questions => [:v_50]
111
+ end
112
+ question :v_21, :type => :radio do
113
+ title "N2 Emotionele teruggetrokkenheid"
114
+ description ""
115
+ option :a1, :value => 1, :description => "afwezig"
116
+ option :a2, :value => 2, :description => "minimaal"
117
+ option :a3, :value => 3, :description => "licht"
118
+ option :a4, :value => 4, :description => "matig"
119
+ option :a5, :value => 5, :description => "matig ernstig"
120
+ option :a6, :value => 6, :description => "ernstig"
121
+ option :a7, :value => 7, :description => "extreem"
122
+ end
123
+ question :v_22, :type => :radio do
124
+ title "N3 Contactgestoordheid"
125
+ description ""
126
+ option :a1, :value => 1, :description => "afwezig"
127
+ option :a2, :value => 2, :description => "minimaal"
128
+ option :a3, :value => 3, :description => "licht"
129
+ option :a4, :value => 4, :description => "matig"
130
+ option :a5, :value => 5, :description => "matig ernstig"
131
+ option :a6, :value => 6, :description => "ernstig"
132
+ option :a7, :value => 7, :description => "extreem"
133
+ end
134
+ question :v_23, :type => :radio do
135
+ title "N4 Passieve/ apathische sociale teruggetrokkenheid"
136
+ description ""
137
+ option :a1, :value => 1, :description => "afwezig"
138
+ option :a2, :value => 2, :description => "minimaal"
139
+ option :a3, :value => 3, :description => "licht"
140
+ option :a4, :value => 4, :description => "matig", :hides_questions => [:v_50]
141
+ option :a5, :value => 5, :description => "matig ernstig", :hides_questions => [:v_50]
142
+ option :a6, :value => 6, :description => "ernstig", :hides_questions => [:v_50]
143
+ option :a7, :value => 7, :description => "extreem", :hides_questions => [:v_50]
144
+ end
145
+ question :v_24, :type => :radio do
146
+ title "N5 Moeilijkheden bij het abstract denken"
147
+ description ""
148
+ option :a1, :value => 1, :description => "afwezig"
149
+ option :a2, :value => 2, :description => "minimaal"
150
+ option :a3, :value => 3, :description => "licht"
151
+ option :a4, :value => 4, :description => "matig"
152
+ option :a5, :value => 5, :description => "matig ernstig"
153
+ option :a6, :value => 6, :description => "ernstig"
154
+ option :a7, :value => 7, :description => "extreem"
155
+ end
156
+ question :v_25, :type => :radio do
157
+ title "N6 Gebrek aan spontaniteit en conversabiliteit"
158
+ description ""
159
+ option :a1, :value => 1, :description => "afwezig"
160
+ option :a2, :value => 2, :description => "minimaal"
161
+ option :a3, :value => 3, :description => "licht"
162
+ option :a4, :value => 4, :description => "matig", :hides_questions => [:v_50]
163
+ option :a5, :value => 5, :description => "matig ernstig", :hides_questions => [:v_50]
164
+ option :a6, :value => 6, :description => "ernstig", :hides_questions => [:v_50]
165
+ option :a7, :value => 7, :description => "extreem", :hides_questions => [:v_50]
166
+ end
167
+ question :v_26, :type => :radio do
168
+ title "N7 Stereotiep denkpatroon"
169
+ description ""
170
+ option :a1, :value => 1, :description => "afwezig"
171
+ option :a2, :value => 2, :description => "minimaal"
172
+ option :a3, :value => 3, :description => "licht"
173
+ option :a4, :value => 4, :description => "matig"
174
+ option :a5, :value => 5, :description => "matig ernstig"
175
+ option :a6, :value => 6, :description => "ernstig"
176
+ option :a7, :value => 7, :description => "extreem"
177
+ end
178
+ end
179
+ text "*Algemene Psychopathologie Schaal*"
180
+ table :columns => 7 do
181
+ question :v_34, :type => :radio do
182
+ title "G1 Somatische bezorgdheid"
183
+ description ""
184
+ option :a1, :value => 1, :description => "afwezig"
185
+ option :a2, :value => 2, :description => "minimaal"
186
+ option :a3, :value => 3, :description => "licht"
187
+ option :a4, :value => 4, :description => "matig"
188
+ option :a5, :value => 5, :description => "matig ernstig"
189
+ option :a6, :value => 6, :description => "ernstig"
190
+ option :a7, :value => 7, :description => "extreem"
191
+ end
192
+ question :v_35, :type => :radio do
193
+ title "G2 Angst"
194
+ description ""
195
+ option :a1, :value => 1, :description => "afwezig"
196
+ option :a2, :value => 2, :description => "minimaal"
197
+ option :a3, :value => 3, :description => "licht"
198
+ option :a4, :value => 4, :description => "matig"
199
+ option :a5, :value => 5, :description => "matig ernstig"
200
+ option :a6, :value => 6, :description => "ernstig"
201
+ option :a7, :value => 7, :description => "extreem"
202
+ end
203
+ question :v_36, :type => :radio do
204
+ title "G3 Schuldgevoelens"
205
+ description ""
206
+ option :a1, :value => 1, :description => "afwezig"
207
+ option :a2, :value => 2, :description => "minimaal"
208
+ option :a3, :value => 3, :description => "licht"
209
+ option :a4, :value => 4, :description => "matig"
210
+ option :a5, :value => 5, :description => "matig ernstig"
211
+ option :a6, :value => 6, :description => "ernstig"
212
+ option :a7, :value => 7, :description => "extreem"
213
+ end
214
+ question :v_37, :type => :radio do
215
+ title "G4 Spanning"
216
+ description ""
217
+ option :a1, :value => 1, :description => "afwezig"
218
+ option :a2, :value => 2, :description => "minimaal"
219
+ option :a3, :value => 3, :description => "licht"
220
+ option :a4, :value => 4, :description => "matig"
221
+ option :a5, :value => 5, :description => "matig ernstig"
222
+ option :a6, :value => 6, :description => "ernstig"
223
+ option :a7, :value => 7, :description => "extreem"
224
+ end
225
+ question :v_38, :type => :radio do
226
+ title "G5 Manierisme en poses"
227
+ description ""
228
+ option :a1, :value => 1, :description => "afwezig"
229
+ option :a2, :value => 2, :description => "minimaal"
230
+ option :a3, :value => 3, :description => "licht"
231
+ option :a4, :value => 4, :description => "matig", :hides_questions => [:v_50]
232
+ option :a5, :value => 5, :description => "matig ernstig", :hides_questions => [:v_50]
233
+ option :a6, :value => 6, :description => "ernstig", :hides_questions => [:v_50]
234
+ option :a7, :value => 7, :description => "extreem", :hides_questions => [:v_50]
235
+ end
236
+ question :v_39, :type => :radio do
237
+ title "G6 Depressie"
238
+ description ""
239
+ option :a1, :value => 1, :description => "afwezig"
240
+ option :a2, :value => 2, :description => "minimaal"
241
+ option :a3, :value => 3, :description => "licht"
242
+ option :a4, :value => 4, :description => "matig"
243
+ option :a5, :value => 5, :description => "matig ernstig"
244
+ option :a6, :value => 6, :description => "ernstig"
245
+ option :a7, :value => 7, :description => "extreem"
246
+ end
247
+ question :v_40, :type => :radio do
248
+ title "G7 Motorische retardatie"
249
+ description ""
250
+ option :a1, :value => 1, :description => "afwezig"
251
+ option :a2, :value => 2, :description => "minimaal"
252
+ option :a3, :value => 3, :description => "licht"
253
+ option :a4, :value => 4, :description => "matig"
254
+ option :a5, :value => 5, :description => "matig ernstig"
255
+ option :a6, :value => 6, :description => "ernstig"
256
+ option :a7, :value => 7, :description => "extreem"
257
+ end
258
+ question :v_41, :type => :radio do
259
+ title "G8 Gebrek aan samenwerking"
260
+ description ""
261
+ option :a1, :value => 1, :description => "afwezig"
262
+ option :a2, :value => 2, :description => "minimaal"
263
+ option :a3, :value => 3, :description => "licht"
264
+ option :a4, :value => 4, :description => "matig"
265
+ option :a5, :value => 5, :description => "matig ernstig"
266
+ option :a6, :value => 6, :description => "ernstig"
267
+ option :a7, :value => 7, :description => "extreem"
268
+ end
269
+ question :v_42, :type => :radio do
270
+ title "G9 Ongewone gedachteninhoud"
271
+ description ""
272
+ option :a1, :value => 1, :description => "afwezig"
273
+ option :a2, :value => 2, :description => "minimaal"
274
+ option :a3, :value => 3, :description => "licht"
275
+ option :a4, :value => 4, :description => "matig", :hides_questions => [:v_50]
276
+ option :a5, :value => 5, :description => "matig ernstig", :hides_questions => [:v_50]
277
+ option :a6, :value => 6, :description => "ernstig", :hides_questions => [:v_50]
278
+ option :a7, :value => 7, :description => "extreem", :hides_questions => [:v_50]
279
+ end
280
+ question :v_43, :type => :radio do
281
+ title "G10 Desorientatie"
282
+ description ""
283
+ option :a1, :value => 1, :description => "afwezig"
284
+ option :a2, :value => 2, :description => "minimaal"
285
+ option :a3, :value => 3, :description => "licht"
286
+ option :a4, :value => 4, :description => "matig"
287
+ option :a5, :value => 5, :description => "matig ernstig"
288
+ option :a6, :value => 6, :description => "ernstig"
289
+ option :a7, :value => 7, :description => "extreem"
290
+ end
291
+ question :v_44, :type => :radio do
292
+ title "G11 Zwakke aandacht"
293
+ description ""
294
+ option :a1, :value => 1, :description => "afwezig"
295
+ option :a2, :value => 2, :description => "minimaal"
296
+ option :a3, :value => 3, :description => "licht"
297
+ option :a4, :value => 4, :description => "matig"
298
+ option :a5, :value => 5, :description => "matig ernstig"
299
+ option :a6, :value => 6, :description => "ernstig"
300
+ option :a7, :value => 7, :description => "extreem"
301
+ end
302
+ question :v_45, :type => :radio do
303
+ title "G12 Zwak oordeel en inzicht"
304
+ description ""
305
+ option :a1, :value => 1, :description => "afwezig"
306
+ option :a2, :value => 2, :description => "minimaal"
307
+ option :a3, :value => 3, :description => "licht"
308
+ option :a4, :value => 4, :description => "matig"
309
+ option :a5, :value => 5, :description => "matig ernstig"
310
+ option :a6, :value => 6, :description => "ernstig"
311
+ option :a7, :value => 7, :description => "extreem"
312
+ end
313
+ question :v_46, :type => :radio do
314
+ title "G13 Gestoorde wilskracht"
315
+ description ""
316
+ option :a1, :value => 1, :description => "afwezig"
317
+ option :a2, :value => 2, :description => "minimaal"
318
+ option :a3, :value => 3, :description => "licht"
319
+ option :a4, :value => 4, :description => "matig"
320
+ option :a5, :value => 5, :description => "matig ernstig"
321
+ option :a6, :value => 6, :description => "ernstig"
322
+ option :a7, :value => 7, :description => "extreem"
323
+ end
324
+ question :v_47, :type => :radio do
325
+ title "G14 Zwakke beheersing van impulsen"
326
+ description ""
327
+ option :a1, :value => 1, :description => "afwezig"
328
+ option :a2, :value => 2, :description => "minimaal"
329
+ option :a3, :value => 3, :description => "licht"
330
+ option :a4, :value => 4, :description => "matig"
331
+ option :a5, :value => 5, :description => "matig ernstig"
332
+ option :a6, :value => 6, :description => "ernstig"
333
+ option :a7, :value => 7, :description => "extreem"
334
+ end
335
+ question :v_48, :type => :radio do
336
+ title "G15 Preoccupatie"
337
+ description ""
338
+ option :a1, :value => 1, :description => "afwezig"
339
+ option :a2, :value => 2, :description => "minimaal"
340
+ option :a3, :value => 3, :description => "licht"
341
+ option :a4, :value => 4, :description => "matig"
342
+ option :a5, :value => 5, :description => "matig ernstig"
343
+ option :a6, :value => 6, :description => "ernstig"
344
+ option :a7, :value => 7, :description => "extreem"
345
+ end
346
+ question :v_49, :type => :radio do
347
+ title "G16 Actieve asocialiteit"
348
+ description ""
349
+ option :a1, :value => 1, :description => "afwezig"
350
+ option :a2, :value => 2, :description => "minimaal"
351
+ option :a3, :value => 3, :description => "licht"
352
+ option :a4, :value => 4, :description => "matig"
353
+ option :a5, :value => 5, :description => "matig ernstig"
354
+ option :a6, :value => 6, :description => "ernstig"
355
+ option :a7, :value => 7, :description => "extreem"
356
+ end
357
+ end
358
+ question :v_50, :type => :radio, :show_values => false do
359
+ title "De ernst van de symptomen P1, P2, P3, N1, N4, N6, G5 en G9 is &le; 3. Gedurende welke periode is de ernst van deze symptomen al op dit lage niveau?"
360
+ description ""
361
+ option :a1, :value => 1, :description => "&lt; 6 maanden"
362
+ option :a2, :value => 2, :description => "&ge; 6 maanden (in remissie)"
363
+ end
364
+ end
365
+
366
+ score :tot, label: "Totaalscore" do
367
+ {
368
+ value: sum(values(:v_1, :v_2)),
369
+ interpretation: "Niet te best"
370
+ }
371
+ end
372
+
373
+ line_chart :tot do
374
+ range 0..100
375
+ plot :tot
376
+ plot :v_50, label: "Ernst"
377
+ end