dhis2 2.3.8 → 3.0.0
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/.github/PULL_REQUEST_TEMPLATE.md +11 -0
- data/Gemfile +2 -1
- data/README.md +208 -68
- data/Rakefile +4 -2
- data/bin/console +1 -0
- data/changelog.md +7 -0
- data/dhis2.gemspec +8 -8
- data/lib/dhis2/api/base.rb +5 -94
- data/lib/dhis2/api/bulk_creatable.rb +28 -0
- data/lib/dhis2/api/constants.rb +13 -0
- data/lib/dhis2/api/creatable.rb +47 -0
- data/lib/dhis2/api/deletable.rb +12 -0
- data/lib/dhis2/api/event_creation_status.rb +58 -0
- data/lib/dhis2/api/findable.rb +52 -0
- data/lib/dhis2/api/import_summary.rb +61 -0
- data/lib/dhis2/api/listable.rb +78 -0
- data/lib/dhis2/api/query_parameters_formatter.rb +50 -0
- data/lib/dhis2/api/shared/analytic.rb +20 -0
- data/lib/dhis2/api/shared/category_combo.rb +29 -0
- data/lib/dhis2/api/shared/category_option_combo.rb +23 -0
- data/lib/dhis2/api/shared/constants.rb +35 -0
- data/lib/dhis2/api/shared/data_element_group.rb +25 -0
- data/lib/dhis2/api/shared/data_set.rb +22 -0
- data/lib/dhis2/api/shared/data_value.rb +26 -0
- data/lib/dhis2/api/shared/data_value_set.rb +58 -0
- data/lib/dhis2/api/shared/event.rb +54 -0
- data/lib/dhis2/api/shared/organisation_unit.rb +17 -0
- data/lib/dhis2/api/shared/organisation_unit_group.rb +21 -0
- data/lib/dhis2/api/shared/report_tables.rb +32 -0
- data/lib/dhis2/api/shared/resource_table.rb +19 -0
- data/lib/dhis2/api/shared/save_validator.rb +47 -0
- data/lib/dhis2/api/shared/system_info.rb +19 -0
- data/lib/dhis2/api/updatable.rb +33 -0
- data/lib/dhis2/api/version224/analytic.rb +10 -0
- data/lib/dhis2/api/version224/attribute.rb +23 -0
- data/lib/dhis2/api/version224/category_combo.rb +25 -0
- data/lib/dhis2/api/version224/category_option_combo.rb +23 -0
- data/lib/dhis2/api/version224/constants.rb +22 -0
- data/lib/dhis2/api/version224/data_element.rb +45 -0
- data/lib/dhis2/api/version224/data_element_group.rb +22 -0
- data/lib/dhis2/api/version224/data_set.rb +53 -0
- data/lib/dhis2/api/version224/data_value.rb +11 -0
- data/lib/dhis2/api/version224/data_value_set.rb +25 -0
- data/lib/dhis2/api/version224/event.rb +31 -0
- data/lib/dhis2/api/version224/index.rb +27 -0
- data/lib/dhis2/api/version224/indicator.rb +24 -0
- data/lib/dhis2/api/version224/indicator_group.rb +20 -0
- data/lib/dhis2/api/version224/indicator_type.rb +20 -0
- data/lib/dhis2/api/version224/organisation_unit.rb +24 -0
- data/lib/dhis2/api/version224/organisation_unit_group.rb +22 -0
- data/lib/dhis2/api/version224/organisation_unit_group_set.rb +20 -0
- data/lib/dhis2/api/version224/organisation_unit_level.rb +21 -0
- data/lib/dhis2/api/version224/program.rb +26 -0
- data/lib/dhis2/api/version224/report.rb +20 -0
- data/lib/dhis2/api/version224/report_table.rb +21 -0
- data/lib/dhis2/api/version224/resource_table.rb +11 -0
- data/lib/dhis2/api/version224/save_validator.rb +48 -0
- data/lib/dhis2/api/version224/system_info.rb +11 -0
- data/lib/dhis2/api/version224/user.rb +15 -0
- data/lib/dhis2/api/version225/analytic.rb +10 -0
- data/lib/dhis2/api/version225/attribute.rb +23 -0
- data/lib/dhis2/api/version225/category_combo.rb +25 -0
- data/lib/dhis2/api/version225/category_option_combo.rb +23 -0
- data/lib/dhis2/api/version225/constants.rb +22 -0
- data/lib/dhis2/api/version225/data_element.rb +45 -0
- data/lib/dhis2/api/version225/data_element_group.rb +22 -0
- data/lib/dhis2/api/version225/data_set.rb +35 -0
- data/lib/dhis2/api/version225/data_value.rb +11 -0
- data/lib/dhis2/api/version225/data_value_set.rb +25 -0
- data/lib/dhis2/api/version225/event.rb +31 -0
- data/lib/dhis2/api/version225/index.rb +26 -0
- data/lib/dhis2/api/version225/indicator.rb +24 -0
- data/lib/dhis2/api/version225/indicator_group.rb +20 -0
- data/lib/dhis2/api/version225/indicator_type.rb +20 -0
- data/lib/dhis2/api/version225/organisation_unit.rb +24 -0
- data/lib/dhis2/api/version225/organisation_unit_group.rb +22 -0
- data/lib/dhis2/api/version225/organisation_unit_group_set.rb +20 -0
- data/lib/dhis2/api/version225/organisation_unit_level.rb +21 -0
- data/lib/dhis2/api/version225/program.rb +26 -0
- data/lib/dhis2/api/version225/report.rb +20 -0
- data/lib/dhis2/api/version225/report_table.rb +21 -0
- data/lib/dhis2/api/version225/resource_table.rb +11 -0
- data/lib/dhis2/api/version225/system_info.rb +11 -0
- data/lib/dhis2/api/version225/user.rb +15 -0
- data/lib/dhis2/api/version226/analytic.rb +10 -0
- data/lib/dhis2/api/version226/attribute.rb +23 -0
- data/lib/dhis2/api/version226/category_combo.rb +25 -0
- data/lib/dhis2/api/version226/category_option_combo.rb +23 -0
- data/lib/dhis2/api/version226/constants.rb +22 -0
- data/lib/dhis2/api/version226/data_element.rb +42 -0
- data/lib/dhis2/api/version226/data_element_group.rb +22 -0
- data/lib/dhis2/api/version226/data_set.rb +32 -0
- data/lib/dhis2/api/version226/data_value.rb +11 -0
- data/lib/dhis2/api/version226/data_value_set.rb +25 -0
- data/lib/dhis2/api/version226/event.rb +31 -0
- data/lib/dhis2/api/version226/index.rb +26 -0
- data/lib/dhis2/api/version226/indicator.rb +24 -0
- data/lib/dhis2/api/version226/indicator_group.rb +20 -0
- data/lib/dhis2/api/version226/indicator_type.rb +20 -0
- data/lib/dhis2/api/version226/organisation_unit.rb +24 -0
- data/lib/dhis2/api/version226/organisation_unit_group.rb +22 -0
- data/lib/dhis2/api/version226/organisation_unit_group_set.rb +20 -0
- data/lib/dhis2/api/version226/organisation_unit_level.rb +21 -0
- data/lib/dhis2/api/version226/program.rb +24 -0
- data/lib/dhis2/api/version226/report.rb +20 -0
- data/lib/dhis2/api/version226/report_table.rb +21 -0
- data/lib/dhis2/api/version226/resource_table.rb +11 -0
- data/lib/dhis2/api/version226/system_info.rb +11 -0
- data/lib/dhis2/api/version226/user.rb +15 -0
- data/lib/dhis2/api/version227/analytic.rb +10 -0
- data/lib/dhis2/api/version227/attribute.rb +23 -0
- data/lib/dhis2/api/version227/category_combo.rb +25 -0
- data/lib/dhis2/api/version227/category_option_combo.rb +23 -0
- data/lib/dhis2/api/version227/constants.rb +22 -0
- data/lib/dhis2/api/version227/data_element.rb +42 -0
- data/lib/dhis2/api/version227/data_element_group.rb +22 -0
- data/lib/dhis2/api/version227/data_set.rb +32 -0
- data/lib/dhis2/api/version227/data_value.rb +11 -0
- data/lib/dhis2/api/version227/data_value_set.rb +25 -0
- data/lib/dhis2/api/version227/event.rb +31 -0
- data/lib/dhis2/api/version227/index.rb +26 -0
- data/lib/dhis2/api/version227/indicator.rb +24 -0
- data/lib/dhis2/api/version227/indicator_group.rb +20 -0
- data/lib/dhis2/api/version227/indicator_type.rb +20 -0
- data/lib/dhis2/api/version227/organisation_unit.rb +24 -0
- data/lib/dhis2/api/version227/organisation_unit_group.rb +22 -0
- data/lib/dhis2/api/version227/organisation_unit_group_set.rb +20 -0
- data/lib/dhis2/api/version227/organisation_unit_level.rb +21 -0
- data/lib/dhis2/api/version227/program.rb +24 -0
- data/lib/dhis2/api/version227/report.rb +20 -0
- data/lib/dhis2/api/version227/report_table.rb +21 -0
- data/lib/dhis2/api/version227/resource_table.rb +11 -0
- data/lib/dhis2/api/version227/system_info.rb +11 -0
- data/lib/dhis2/api/version227/user.rb +15 -0
- data/lib/dhis2/api/version228/analytic.rb +10 -0
- data/lib/dhis2/api/version228/attribute.rb +23 -0
- data/lib/dhis2/api/version228/category_combo.rb +25 -0
- data/lib/dhis2/api/version228/category_option_combo.rb +23 -0
- data/lib/dhis2/api/version228/constants.rb +22 -0
- data/lib/dhis2/api/version228/data_element.rb +41 -0
- data/lib/dhis2/api/version228/data_element_group.rb +22 -0
- data/lib/dhis2/api/version228/data_set.rb +32 -0
- data/lib/dhis2/api/version228/data_value.rb +11 -0
- data/lib/dhis2/api/version228/data_value_set.rb +25 -0
- data/lib/dhis2/api/version228/event.rb +31 -0
- data/lib/dhis2/api/version228/index.rb +26 -0
- data/lib/dhis2/api/version228/indicator.rb +24 -0
- data/lib/dhis2/api/version228/indicator_group.rb +20 -0
- data/lib/dhis2/api/version228/indicator_type.rb +20 -0
- data/lib/dhis2/api/version228/organisation_unit.rb +24 -0
- data/lib/dhis2/api/version228/organisation_unit_group.rb +22 -0
- data/lib/dhis2/api/version228/organisation_unit_group_set.rb +20 -0
- data/lib/dhis2/api/version228/organisation_unit_level.rb +21 -0
- data/lib/dhis2/api/version228/program.rb +24 -0
- data/lib/dhis2/api/version228/report.rb +20 -0
- data/lib/dhis2/api/version228/report_table.rb +21 -0
- data/lib/dhis2/api/version228/resource_table.rb +11 -0
- data/lib/dhis2/api/version228/system_info.rb +11 -0
- data/lib/dhis2/api/version228/user.rb +15 -0
- data/lib/dhis2/case.rb +46 -0
- data/lib/dhis2/classes.rb +44 -0
- data/lib/dhis2/client.rb +152 -89
- data/lib/dhis2/collection_wrapper.rb +13 -3
- data/lib/dhis2/configuration.rb +55 -1
- data/lib/dhis2/error.rb +19 -0
- data/lib/dhis2/pager.rb +8 -3
- data/lib/dhis2/version.rb +1 -1
- data/lib/dhis2.rb +51 -42
- metadata +168 -50
- data/lib/dhis2/api/analytic.rb +0 -20
- data/lib/dhis2/api/attribute.rb +0 -8
- data/lib/dhis2/api/category_combo.rb +0 -28
- data/lib/dhis2/api/category_option_combo.rb +0 -8
- data/lib/dhis2/api/data_element.rb +0 -34
- data/lib/dhis2/api/data_element_group.rb +0 -32
- data/lib/dhis2/api/data_set.rb +0 -33
- data/lib/dhis2/api/data_value.rb +0 -15
- data/lib/dhis2/api/data_value_set.rb +0 -71
- data/lib/dhis2/api/event.rb +0 -36
- data/lib/dhis2/api/indicator.rb +0 -8
- data/lib/dhis2/api/indicator_group.rb +0 -8
- data/lib/dhis2/api/organisation_unit.rb +0 -66
- data/lib/dhis2/api/organisation_unit_group.rb +0 -38
- data/lib/dhis2/api/organisation_unit_group_set.rb +0 -6
- data/lib/dhis2/api/organisation_unit_level.rb +0 -8
- data/lib/dhis2/api/program.rb +0 -8
- data/lib/dhis2/api/report.rb +0 -8
- data/lib/dhis2/api/report_table.rb +0 -8
- data/lib/dhis2/api/resource_table.rb +0 -14
- data/lib/dhis2/api/system_info.rb +0 -13
- data/lib/dhis2/api/user.rb +0 -8
- data/lib/dhis2/import_error.rb +0 -6
- data/lib/dhis2/status.rb +0 -42
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: dhis2
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version:
|
|
4
|
+
version: 3.0.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Martin Van Aken
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2018-03-01 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rest-client
|
|
@@ -25,33 +25,19 @@ dependencies:
|
|
|
25
25
|
- !ruby/object:Gem::Version
|
|
26
26
|
version: '0'
|
|
27
27
|
- !ruby/object:Gem::Dependency
|
|
28
|
-
name:
|
|
28
|
+
name: dry-validation
|
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
|
30
30
|
requirements:
|
|
31
|
-
- -
|
|
32
|
-
- !ruby/object:Gem::Version
|
|
33
|
-
version: '1.12'
|
|
34
|
-
type: :development
|
|
35
|
-
prerelease: false
|
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
37
|
-
requirements:
|
|
38
|
-
- - "~>"
|
|
31
|
+
- - '='
|
|
39
32
|
- !ruby/object:Gem::Version
|
|
40
|
-
version:
|
|
41
|
-
|
|
42
|
-
name: rake
|
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
|
44
|
-
requirements:
|
|
45
|
-
- - "~>"
|
|
46
|
-
- !ruby/object:Gem::Version
|
|
47
|
-
version: '10.0'
|
|
48
|
-
type: :development
|
|
33
|
+
version: 0.11.1
|
|
34
|
+
type: :runtime
|
|
49
35
|
prerelease: false
|
|
50
36
|
version_requirements: !ruby/object:Gem::Requirement
|
|
51
37
|
requirements:
|
|
52
|
-
- -
|
|
38
|
+
- - '='
|
|
53
39
|
- !ruby/object:Gem::Version
|
|
54
|
-
version:
|
|
40
|
+
version: 0.11.1
|
|
55
41
|
- !ruby/object:Gem::Dependency
|
|
56
42
|
name: minitest
|
|
57
43
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -132,16 +118,16 @@ dependencies:
|
|
|
132
118
|
name: webmock
|
|
133
119
|
requirement: !ruby/object:Gem::Requirement
|
|
134
120
|
requirements:
|
|
135
|
-
- -
|
|
121
|
+
- - '='
|
|
136
122
|
- !ruby/object:Gem::Version
|
|
137
|
-
version:
|
|
123
|
+
version: 3.1.0
|
|
138
124
|
type: :development
|
|
139
125
|
prerelease: false
|
|
140
126
|
version_requirements: !ruby/object:Gem::Requirement
|
|
141
127
|
requirements:
|
|
142
|
-
- -
|
|
128
|
+
- - '='
|
|
143
129
|
- !ruby/object:Gem::Version
|
|
144
|
-
version:
|
|
130
|
+
version: 3.1.0
|
|
145
131
|
- !ruby/object:Gem::Dependency
|
|
146
132
|
name: simplecov
|
|
147
133
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -177,6 +163,7 @@ executables: []
|
|
|
177
163
|
extensions: []
|
|
178
164
|
extra_rdoc_files: []
|
|
179
165
|
files:
|
|
166
|
+
- ".github/PULL_REQUEST_TEMPLATE.md"
|
|
180
167
|
- ".gitignore"
|
|
181
168
|
- ".rspec"
|
|
182
169
|
- ".rubocop.yml"
|
|
@@ -189,39 +176,170 @@ files:
|
|
|
189
176
|
- Rakefile
|
|
190
177
|
- bin/console
|
|
191
178
|
- bin/setup
|
|
179
|
+
- changelog.md
|
|
192
180
|
- design.md
|
|
193
181
|
- dhis2.gemspec
|
|
194
182
|
- lib/dhis2.rb
|
|
195
|
-
- lib/dhis2/api/analytic.rb
|
|
196
|
-
- lib/dhis2/api/attribute.rb
|
|
197
183
|
- lib/dhis2/api/base.rb
|
|
198
|
-
- lib/dhis2/api/
|
|
199
|
-
- lib/dhis2/api/
|
|
200
|
-
- lib/dhis2/api/
|
|
201
|
-
- lib/dhis2/api/
|
|
202
|
-
- lib/dhis2/api/
|
|
203
|
-
- lib/dhis2/api/
|
|
204
|
-
- lib/dhis2/api/
|
|
205
|
-
- lib/dhis2/api/
|
|
206
|
-
- lib/dhis2/api/
|
|
207
|
-
- lib/dhis2/api/
|
|
208
|
-
- lib/dhis2/api/
|
|
209
|
-
- lib/dhis2/api/
|
|
210
|
-
- lib/dhis2/api/
|
|
211
|
-
- lib/dhis2/api/
|
|
212
|
-
- lib/dhis2/api/
|
|
213
|
-
- lib/dhis2/api/
|
|
214
|
-
- lib/dhis2/api/
|
|
215
|
-
- lib/dhis2/api/
|
|
216
|
-
- lib/dhis2/api/
|
|
217
|
-
- lib/dhis2/api/
|
|
184
|
+
- lib/dhis2/api/bulk_creatable.rb
|
|
185
|
+
- lib/dhis2/api/constants.rb
|
|
186
|
+
- lib/dhis2/api/creatable.rb
|
|
187
|
+
- lib/dhis2/api/deletable.rb
|
|
188
|
+
- lib/dhis2/api/event_creation_status.rb
|
|
189
|
+
- lib/dhis2/api/findable.rb
|
|
190
|
+
- lib/dhis2/api/import_summary.rb
|
|
191
|
+
- lib/dhis2/api/listable.rb
|
|
192
|
+
- lib/dhis2/api/query_parameters_formatter.rb
|
|
193
|
+
- lib/dhis2/api/shared/analytic.rb
|
|
194
|
+
- lib/dhis2/api/shared/category_combo.rb
|
|
195
|
+
- lib/dhis2/api/shared/category_option_combo.rb
|
|
196
|
+
- lib/dhis2/api/shared/constants.rb
|
|
197
|
+
- lib/dhis2/api/shared/data_element_group.rb
|
|
198
|
+
- lib/dhis2/api/shared/data_set.rb
|
|
199
|
+
- lib/dhis2/api/shared/data_value.rb
|
|
200
|
+
- lib/dhis2/api/shared/data_value_set.rb
|
|
201
|
+
- lib/dhis2/api/shared/event.rb
|
|
202
|
+
- lib/dhis2/api/shared/organisation_unit.rb
|
|
203
|
+
- lib/dhis2/api/shared/organisation_unit_group.rb
|
|
204
|
+
- lib/dhis2/api/shared/report_tables.rb
|
|
205
|
+
- lib/dhis2/api/shared/resource_table.rb
|
|
206
|
+
- lib/dhis2/api/shared/save_validator.rb
|
|
207
|
+
- lib/dhis2/api/shared/system_info.rb
|
|
208
|
+
- lib/dhis2/api/updatable.rb
|
|
209
|
+
- lib/dhis2/api/version224/analytic.rb
|
|
210
|
+
- lib/dhis2/api/version224/attribute.rb
|
|
211
|
+
- lib/dhis2/api/version224/category_combo.rb
|
|
212
|
+
- lib/dhis2/api/version224/category_option_combo.rb
|
|
213
|
+
- lib/dhis2/api/version224/constants.rb
|
|
214
|
+
- lib/dhis2/api/version224/data_element.rb
|
|
215
|
+
- lib/dhis2/api/version224/data_element_group.rb
|
|
216
|
+
- lib/dhis2/api/version224/data_set.rb
|
|
217
|
+
- lib/dhis2/api/version224/data_value.rb
|
|
218
|
+
- lib/dhis2/api/version224/data_value_set.rb
|
|
219
|
+
- lib/dhis2/api/version224/event.rb
|
|
220
|
+
- lib/dhis2/api/version224/index.rb
|
|
221
|
+
- lib/dhis2/api/version224/indicator.rb
|
|
222
|
+
- lib/dhis2/api/version224/indicator_group.rb
|
|
223
|
+
- lib/dhis2/api/version224/indicator_type.rb
|
|
224
|
+
- lib/dhis2/api/version224/organisation_unit.rb
|
|
225
|
+
- lib/dhis2/api/version224/organisation_unit_group.rb
|
|
226
|
+
- lib/dhis2/api/version224/organisation_unit_group_set.rb
|
|
227
|
+
- lib/dhis2/api/version224/organisation_unit_level.rb
|
|
228
|
+
- lib/dhis2/api/version224/program.rb
|
|
229
|
+
- lib/dhis2/api/version224/report.rb
|
|
230
|
+
- lib/dhis2/api/version224/report_table.rb
|
|
231
|
+
- lib/dhis2/api/version224/resource_table.rb
|
|
232
|
+
- lib/dhis2/api/version224/save_validator.rb
|
|
233
|
+
- lib/dhis2/api/version224/system_info.rb
|
|
234
|
+
- lib/dhis2/api/version224/user.rb
|
|
235
|
+
- lib/dhis2/api/version225/analytic.rb
|
|
236
|
+
- lib/dhis2/api/version225/attribute.rb
|
|
237
|
+
- lib/dhis2/api/version225/category_combo.rb
|
|
238
|
+
- lib/dhis2/api/version225/category_option_combo.rb
|
|
239
|
+
- lib/dhis2/api/version225/constants.rb
|
|
240
|
+
- lib/dhis2/api/version225/data_element.rb
|
|
241
|
+
- lib/dhis2/api/version225/data_element_group.rb
|
|
242
|
+
- lib/dhis2/api/version225/data_set.rb
|
|
243
|
+
- lib/dhis2/api/version225/data_value.rb
|
|
244
|
+
- lib/dhis2/api/version225/data_value_set.rb
|
|
245
|
+
- lib/dhis2/api/version225/event.rb
|
|
246
|
+
- lib/dhis2/api/version225/index.rb
|
|
247
|
+
- lib/dhis2/api/version225/indicator.rb
|
|
248
|
+
- lib/dhis2/api/version225/indicator_group.rb
|
|
249
|
+
- lib/dhis2/api/version225/indicator_type.rb
|
|
250
|
+
- lib/dhis2/api/version225/organisation_unit.rb
|
|
251
|
+
- lib/dhis2/api/version225/organisation_unit_group.rb
|
|
252
|
+
- lib/dhis2/api/version225/organisation_unit_group_set.rb
|
|
253
|
+
- lib/dhis2/api/version225/organisation_unit_level.rb
|
|
254
|
+
- lib/dhis2/api/version225/program.rb
|
|
255
|
+
- lib/dhis2/api/version225/report.rb
|
|
256
|
+
- lib/dhis2/api/version225/report_table.rb
|
|
257
|
+
- lib/dhis2/api/version225/resource_table.rb
|
|
258
|
+
- lib/dhis2/api/version225/system_info.rb
|
|
259
|
+
- lib/dhis2/api/version225/user.rb
|
|
260
|
+
- lib/dhis2/api/version226/analytic.rb
|
|
261
|
+
- lib/dhis2/api/version226/attribute.rb
|
|
262
|
+
- lib/dhis2/api/version226/category_combo.rb
|
|
263
|
+
- lib/dhis2/api/version226/category_option_combo.rb
|
|
264
|
+
- lib/dhis2/api/version226/constants.rb
|
|
265
|
+
- lib/dhis2/api/version226/data_element.rb
|
|
266
|
+
- lib/dhis2/api/version226/data_element_group.rb
|
|
267
|
+
- lib/dhis2/api/version226/data_set.rb
|
|
268
|
+
- lib/dhis2/api/version226/data_value.rb
|
|
269
|
+
- lib/dhis2/api/version226/data_value_set.rb
|
|
270
|
+
- lib/dhis2/api/version226/event.rb
|
|
271
|
+
- lib/dhis2/api/version226/index.rb
|
|
272
|
+
- lib/dhis2/api/version226/indicator.rb
|
|
273
|
+
- lib/dhis2/api/version226/indicator_group.rb
|
|
274
|
+
- lib/dhis2/api/version226/indicator_type.rb
|
|
275
|
+
- lib/dhis2/api/version226/organisation_unit.rb
|
|
276
|
+
- lib/dhis2/api/version226/organisation_unit_group.rb
|
|
277
|
+
- lib/dhis2/api/version226/organisation_unit_group_set.rb
|
|
278
|
+
- lib/dhis2/api/version226/organisation_unit_level.rb
|
|
279
|
+
- lib/dhis2/api/version226/program.rb
|
|
280
|
+
- lib/dhis2/api/version226/report.rb
|
|
281
|
+
- lib/dhis2/api/version226/report_table.rb
|
|
282
|
+
- lib/dhis2/api/version226/resource_table.rb
|
|
283
|
+
- lib/dhis2/api/version226/system_info.rb
|
|
284
|
+
- lib/dhis2/api/version226/user.rb
|
|
285
|
+
- lib/dhis2/api/version227/analytic.rb
|
|
286
|
+
- lib/dhis2/api/version227/attribute.rb
|
|
287
|
+
- lib/dhis2/api/version227/category_combo.rb
|
|
288
|
+
- lib/dhis2/api/version227/category_option_combo.rb
|
|
289
|
+
- lib/dhis2/api/version227/constants.rb
|
|
290
|
+
- lib/dhis2/api/version227/data_element.rb
|
|
291
|
+
- lib/dhis2/api/version227/data_element_group.rb
|
|
292
|
+
- lib/dhis2/api/version227/data_set.rb
|
|
293
|
+
- lib/dhis2/api/version227/data_value.rb
|
|
294
|
+
- lib/dhis2/api/version227/data_value_set.rb
|
|
295
|
+
- lib/dhis2/api/version227/event.rb
|
|
296
|
+
- lib/dhis2/api/version227/index.rb
|
|
297
|
+
- lib/dhis2/api/version227/indicator.rb
|
|
298
|
+
- lib/dhis2/api/version227/indicator_group.rb
|
|
299
|
+
- lib/dhis2/api/version227/indicator_type.rb
|
|
300
|
+
- lib/dhis2/api/version227/organisation_unit.rb
|
|
301
|
+
- lib/dhis2/api/version227/organisation_unit_group.rb
|
|
302
|
+
- lib/dhis2/api/version227/organisation_unit_group_set.rb
|
|
303
|
+
- lib/dhis2/api/version227/organisation_unit_level.rb
|
|
304
|
+
- lib/dhis2/api/version227/program.rb
|
|
305
|
+
- lib/dhis2/api/version227/report.rb
|
|
306
|
+
- lib/dhis2/api/version227/report_table.rb
|
|
307
|
+
- lib/dhis2/api/version227/resource_table.rb
|
|
308
|
+
- lib/dhis2/api/version227/system_info.rb
|
|
309
|
+
- lib/dhis2/api/version227/user.rb
|
|
310
|
+
- lib/dhis2/api/version228/analytic.rb
|
|
311
|
+
- lib/dhis2/api/version228/attribute.rb
|
|
312
|
+
- lib/dhis2/api/version228/category_combo.rb
|
|
313
|
+
- lib/dhis2/api/version228/category_option_combo.rb
|
|
314
|
+
- lib/dhis2/api/version228/constants.rb
|
|
315
|
+
- lib/dhis2/api/version228/data_element.rb
|
|
316
|
+
- lib/dhis2/api/version228/data_element_group.rb
|
|
317
|
+
- lib/dhis2/api/version228/data_set.rb
|
|
318
|
+
- lib/dhis2/api/version228/data_value.rb
|
|
319
|
+
- lib/dhis2/api/version228/data_value_set.rb
|
|
320
|
+
- lib/dhis2/api/version228/event.rb
|
|
321
|
+
- lib/dhis2/api/version228/index.rb
|
|
322
|
+
- lib/dhis2/api/version228/indicator.rb
|
|
323
|
+
- lib/dhis2/api/version228/indicator_group.rb
|
|
324
|
+
- lib/dhis2/api/version228/indicator_type.rb
|
|
325
|
+
- lib/dhis2/api/version228/organisation_unit.rb
|
|
326
|
+
- lib/dhis2/api/version228/organisation_unit_group.rb
|
|
327
|
+
- lib/dhis2/api/version228/organisation_unit_group_set.rb
|
|
328
|
+
- lib/dhis2/api/version228/organisation_unit_level.rb
|
|
329
|
+
- lib/dhis2/api/version228/program.rb
|
|
330
|
+
- lib/dhis2/api/version228/report.rb
|
|
331
|
+
- lib/dhis2/api/version228/report_table.rb
|
|
332
|
+
- lib/dhis2/api/version228/resource_table.rb
|
|
333
|
+
- lib/dhis2/api/version228/system_info.rb
|
|
334
|
+
- lib/dhis2/api/version228/user.rb
|
|
335
|
+
- lib/dhis2/case.rb
|
|
336
|
+
- lib/dhis2/classes.rb
|
|
218
337
|
- lib/dhis2/client.rb
|
|
219
338
|
- lib/dhis2/collection_wrapper.rb
|
|
220
339
|
- lib/dhis2/configuration.rb
|
|
221
|
-
- lib/dhis2/
|
|
340
|
+
- lib/dhis2/error.rb
|
|
222
341
|
- lib/dhis2/pager.rb
|
|
223
342
|
- lib/dhis2/paginated_array.rb
|
|
224
|
-
- lib/dhis2/status.rb
|
|
225
343
|
- lib/dhis2/version.rb
|
|
226
344
|
homepage: http://github.com/blsq/dhis2
|
|
227
345
|
licenses:
|
data/lib/dhis2/api/analytic.rb
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Dhis2
|
|
4
|
-
module Api
|
|
5
|
-
class Analytic < Base
|
|
6
|
-
class << self
|
|
7
|
-
def list(client, periods:, organisation_units:, data_elements:, filter: nil)
|
|
8
|
-
params = [
|
|
9
|
-
[:dimension, "ou:#{organisation_units}"],
|
|
10
|
-
[:dimension, "dx:#{data_elements}"],
|
|
11
|
-
[:dimension, "pe:#{periods}"]
|
|
12
|
-
]
|
|
13
|
-
params << [:filter, filter.to_s] if filter
|
|
14
|
-
|
|
15
|
-
client.get(resource_name, RestClient::ParamsArray.new(params))
|
|
16
|
-
end
|
|
17
|
-
end
|
|
18
|
-
end
|
|
19
|
-
end
|
|
20
|
-
end
|
data/lib/dhis2/api/attribute.rb
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Dhis2
|
|
4
|
-
module Api
|
|
5
|
-
class CategoryCombo < Base
|
|
6
|
-
class << self
|
|
7
|
-
def defaut
|
|
8
|
-
find_by(name: "default")
|
|
9
|
-
end
|
|
10
|
-
|
|
11
|
-
def create(client, combos)
|
|
12
|
-
combos = [combos].flatten
|
|
13
|
-
category_combo = {
|
|
14
|
-
categoryCombos: combos.map do |combo|
|
|
15
|
-
{
|
|
16
|
-
name: combo[:name],
|
|
17
|
-
data_dimension_type: combo[:aggregation_type] || "DISAGGREGATION"
|
|
18
|
-
}
|
|
19
|
-
end
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
response = client.post("metadata", category_combo)
|
|
23
|
-
Dhis2::Status.new(response)
|
|
24
|
-
end
|
|
25
|
-
end
|
|
26
|
-
end
|
|
27
|
-
end
|
|
28
|
-
end
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Dhis2
|
|
4
|
-
module Api
|
|
5
|
-
class DataElement < Base
|
|
6
|
-
class << self
|
|
7
|
-
def create(client, elements, query_params = { preheat_cache: false })
|
|
8
|
-
elements = [elements].flatten
|
|
9
|
-
category_combo = client.category_combos.find_by(name: "default")
|
|
10
|
-
|
|
11
|
-
data_element = {
|
|
12
|
-
data_elements: elements.map do |element|
|
|
13
|
-
{
|
|
14
|
-
name: element[:name],
|
|
15
|
-
short_name: element[:short_name],
|
|
16
|
-
code: element[:code] || element[:short_name],
|
|
17
|
-
domain_type: element[:domain_type] || "AGGREGATE",
|
|
18
|
-
value_type: element[:value_type] || "NUMBER",
|
|
19
|
-
aggregation_type: element[:aggregation_type] || "SUM",
|
|
20
|
-
type: element[:type] || "int", # for backward compatbility
|
|
21
|
-
aggregation_operator: element[:aggregation_type] || "SUM", # for backward compatbility
|
|
22
|
-
zero_is_significant: element[:zero_is_significant] || true,
|
|
23
|
-
category_combo: { id: category_combo.id, name: category_combo.name }
|
|
24
|
-
}
|
|
25
|
-
end
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
response = client.post("metadata", data_element, client.class.deep_change_case(query_params, :camelize))
|
|
29
|
-
Dhis2::Status.new(response)
|
|
30
|
-
end
|
|
31
|
-
end
|
|
32
|
-
end
|
|
33
|
-
end
|
|
34
|
-
end
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Dhis2
|
|
4
|
-
module Api
|
|
5
|
-
class DataElementGroup < Base
|
|
6
|
-
class << self
|
|
7
|
-
def create(client, groups)
|
|
8
|
-
groups = [groups].flatten
|
|
9
|
-
de_groups = {
|
|
10
|
-
data_element_groups: groups.map do |group|
|
|
11
|
-
mapped_group = {
|
|
12
|
-
name: group[:name],
|
|
13
|
-
short_name: group[:short_name],
|
|
14
|
-
code: group[:code] || group[:short_name]
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
if group[:data_elements]
|
|
18
|
-
data_elements = group[:data_elements].map do |element|
|
|
19
|
-
{ id: element[:id] }
|
|
20
|
-
end
|
|
21
|
-
mapped_group[:data_elements] = data_elements
|
|
22
|
-
end
|
|
23
|
-
mapped_group
|
|
24
|
-
end
|
|
25
|
-
}
|
|
26
|
-
response = client.post("metadata", de_groups)
|
|
27
|
-
Dhis2::Status.new(response)
|
|
28
|
-
end
|
|
29
|
-
end
|
|
30
|
-
end
|
|
31
|
-
end
|
|
32
|
-
end
|
data/lib/dhis2/api/data_set.rb
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Dhis2
|
|
4
|
-
module Api
|
|
5
|
-
class DataSet < Base
|
|
6
|
-
class << self
|
|
7
|
-
def create(client, sets)
|
|
8
|
-
sets = [sets].flatten
|
|
9
|
-
|
|
10
|
-
category_combo = client.category_combos.find_by(name: "default")
|
|
11
|
-
|
|
12
|
-
data_set = {
|
|
13
|
-
data_sets: sets.map do |set|
|
|
14
|
-
dataset = {
|
|
15
|
-
name: set[:name],
|
|
16
|
-
short_name: set[:short_name],
|
|
17
|
-
code: set[:code],
|
|
18
|
-
period_type: "Monthly",
|
|
19
|
-
data_elements: set[:data_element_ids] ? set[:data_element_ids].map { |id| { id: id } } : [],
|
|
20
|
-
organisation_units: set[:organisation_unit_ids] ? set[:organisation_unit_ids].map { |id| { id: id } } : [],
|
|
21
|
-
category_combo: { id: category_combo.id, name: category_combo.name }
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
dataset
|
|
25
|
-
end
|
|
26
|
-
}
|
|
27
|
-
response = client.post("metadata", data_set)
|
|
28
|
-
Dhis2::Status.new(response)
|
|
29
|
-
end
|
|
30
|
-
end
|
|
31
|
-
end
|
|
32
|
-
end
|
|
33
|
-
end
|
data/lib/dhis2/api/data_value.rb
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Dhis2
|
|
4
|
-
module Api
|
|
5
|
-
class DataValue < Base
|
|
6
|
-
class << self
|
|
7
|
-
def find(client, period:, organisation_unit:, data_element:)
|
|
8
|
-
params = { pe: period, ou: organisation_unit, de: data_element }
|
|
9
|
-
|
|
10
|
-
client.get(resource_name, params).first
|
|
11
|
-
end
|
|
12
|
-
end
|
|
13
|
-
end
|
|
14
|
-
end
|
|
15
|
-
end
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Dhis2
|
|
4
|
-
module Api
|
|
5
|
-
class DataValueSet < Base
|
|
6
|
-
def values
|
|
7
|
-
data_values.map do |data_value|
|
|
8
|
-
OpenStruct.new(data_value)
|
|
9
|
-
end
|
|
10
|
-
end
|
|
11
|
-
|
|
12
|
-
class << self
|
|
13
|
-
def create(client, tuples)
|
|
14
|
-
body = { dataValues: tuples }
|
|
15
|
-
response = client.post(resource_name, body)
|
|
16
|
-
Dhis2::Status.new(response)
|
|
17
|
-
end
|
|
18
|
-
|
|
19
|
-
def list(client, options)
|
|
20
|
-
new(client, client.get(build_list_url(client, options)))
|
|
21
|
-
end
|
|
22
|
-
|
|
23
|
-
def build_list_url(_client, options)
|
|
24
|
-
params = [build_what_url(options), build_when_url(options), build_where_url(options)].join("&")
|
|
25
|
-
resource_name + "?" + params
|
|
26
|
-
end
|
|
27
|
-
|
|
28
|
-
def build_what_url(options)
|
|
29
|
-
data_set_ids = options[:data_sets]
|
|
30
|
-
if data_set_ids
|
|
31
|
-
data_sets_url = data_set_ids.map { |ds| "dataSet=#{ds}" }.join("&")
|
|
32
|
-
else
|
|
33
|
-
data_element_groups = options[:data_element_groups]
|
|
34
|
-
data_sets_url = data_element_groups.map { |deg| "dataElementGroup=#{deg}" }.join("&") if data_element_groups
|
|
35
|
-
end
|
|
36
|
-
end
|
|
37
|
-
|
|
38
|
-
def build_when_url(options)
|
|
39
|
-
periods = options[:periods]
|
|
40
|
-
if periods
|
|
41
|
-
periods = periods.map { |period| "period=#{period}" }.join("&")
|
|
42
|
-
else
|
|
43
|
-
start_date = options[:start_date]
|
|
44
|
-
end_date = options[:end_date]
|
|
45
|
-
date_args = []
|
|
46
|
-
date_args.push "startDate=#{start_date}" if start_date
|
|
47
|
-
date_args.push "endDate=#{end_date}" if end_date
|
|
48
|
-
periods = date_args.join("&")
|
|
49
|
-
end
|
|
50
|
-
periods
|
|
51
|
-
end
|
|
52
|
-
|
|
53
|
-
def build_where_url(options)
|
|
54
|
-
children = options[:children].nil? ? true : options[:children]
|
|
55
|
-
organisation_unit_id = options[:organisation_unit]
|
|
56
|
-
organisation_unit_group = options[:organisation_unit_group]
|
|
57
|
-
if organisation_unit_id
|
|
58
|
-
if organisation_unit_id.class == Array
|
|
59
|
-
ou_url = organisation_unit_id.map { |ou_id| "orgUnit=#{ou_id}" }.join("&") + "&children=#{children}"
|
|
60
|
-
else
|
|
61
|
-
ou_url = "orgUnit=#{organisation_unit_id}&children=#{children}"
|
|
62
|
-
end
|
|
63
|
-
else
|
|
64
|
-
ou_url = "orgUnitGroup=#{organisation_unit_group}"
|
|
65
|
-
end
|
|
66
|
-
ou_url
|
|
67
|
-
end
|
|
68
|
-
end
|
|
69
|
-
end
|
|
70
|
-
end
|
|
71
|
-
end
|
data/lib/dhis2/api/event.rb
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Dhis2
|
|
4
|
-
module Api
|
|
5
|
-
class Event < Base
|
|
6
|
-
def id
|
|
7
|
-
event
|
|
8
|
-
end
|
|
9
|
-
class << self
|
|
10
|
-
def format_query_parameters(options)
|
|
11
|
-
|
|
12
|
-
params = []
|
|
13
|
-
params.push([:page, options[:page]]) if options[:page]
|
|
14
|
-
params.push([:pageSize, options[:page_size]]) if options[:page_size]
|
|
15
|
-
params.push([:fields, format_fields(options[:fields])]) if options[:fields]
|
|
16
|
-
params.concat(format_filter(options[:filter])) if options[:filter]
|
|
17
|
-
params.push([:program, options[:program]]) if options[:program]
|
|
18
|
-
params.push([:orgUnit, options[:org_unit]]) if options[:org_unit]
|
|
19
|
-
params.push([:trackedEntityInstance, options[:tracked_entity_instance]]) if options[:tracked_entity_instance]
|
|
20
|
-
|
|
21
|
-
RestClient::ParamsArray.new(params)
|
|
22
|
-
end
|
|
23
|
-
|
|
24
|
-
def create(client, tuples)
|
|
25
|
-
begin
|
|
26
|
-
body = { resource_name.to_sym => tuples }
|
|
27
|
-
response = client.post(resource_name, body)
|
|
28
|
-
rescue RestClient::Conflict => e
|
|
29
|
-
response = Dhis2::Client.deep_change_case(JSON.parse(e.response.body), :underscore)
|
|
30
|
-
end
|
|
31
|
-
Dhis2::Status.new(response)
|
|
32
|
-
end
|
|
33
|
-
end
|
|
34
|
-
end
|
|
35
|
-
end
|
|
36
|
-
end
|
data/lib/dhis2/api/indicator.rb
DELETED
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Dhis2
|
|
4
|
-
module Api
|
|
5
|
-
class OrganisationUnit < Base
|
|
6
|
-
def initialize(client, params)
|
|
7
|
-
super
|
|
8
|
-
self.parent_id = params["parent"]["id"] if params["parent"]
|
|
9
|
-
self.children_ids = params["children"] ? params["children"].map { |raw| raw["id"] } : []
|
|
10
|
-
end
|
|
11
|
-
|
|
12
|
-
class << self
|
|
13
|
-
def find(client, id, options = {})
|
|
14
|
-
raise "Missing id" if id.nil?
|
|
15
|
-
if id.class == Array
|
|
16
|
-
list(client, filter: "id:in:[#{id.join(',')}]", fields: :all, page_size: id.size)
|
|
17
|
-
elsif options.any?
|
|
18
|
-
params = []
|
|
19
|
-
options.each do |name, value|
|
|
20
|
-
params << [client.class.camelize(name.to_s, false), value]
|
|
21
|
-
end
|
|
22
|
-
params = client.class.deep_change_case(params, :camelize)
|
|
23
|
-
json_response = client.get("#{resource_name}/#{id}", RestClient::ParamsArray.new(params))
|
|
24
|
-
if options[:include_descendants] || options[:include_children]
|
|
25
|
-
json_response = client.get(resource_name, format_query_parameters(options))
|
|
26
|
-
resource_key = client.class.underscore(resource_name)
|
|
27
|
-
PaginatedArray.new(
|
|
28
|
-
json_response[resource_key].map { |raw_resource| new(client, raw_resource) },
|
|
29
|
-
json_response["pager"]
|
|
30
|
-
)
|
|
31
|
-
else
|
|
32
|
-
new(client, json_response)
|
|
33
|
-
end
|
|
34
|
-
else
|
|
35
|
-
response = client.get("#{resource_name}/#{id}")
|
|
36
|
-
new(client, response)
|
|
37
|
-
end
|
|
38
|
-
end
|
|
39
|
-
|
|
40
|
-
def create(client, orgunits)
|
|
41
|
-
orgunits = [orgunits].flatten
|
|
42
|
-
|
|
43
|
-
payload = {
|
|
44
|
-
organisationUnits: orgunits.map do |orgunit|
|
|
45
|
-
orgunit[:parent] = { id: orgunit[:parent_id] } if orgunit[:parent_id]
|
|
46
|
-
orgunit[:id] = orgunit[:id] if orgunit[:id]
|
|
47
|
-
orgunit
|
|
48
|
-
end
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
response = client.post("metadata", payload)
|
|
52
|
-
Dhis2::Status.new(response)
|
|
53
|
-
end
|
|
54
|
-
|
|
55
|
-
def last_level_descendants(client, id)
|
|
56
|
-
levels = client.organisation_unit_levels.list(fields: :all)
|
|
57
|
-
last_level = levels.map(&:level).sort.last
|
|
58
|
-
|
|
59
|
-
client.organisation_units.find(id, include_descendants: true).select do |ou|
|
|
60
|
-
ou.level == last_level
|
|
61
|
-
end
|
|
62
|
-
end
|
|
63
|
-
end
|
|
64
|
-
end
|
|
65
|
-
end
|
|
66
|
-
end
|