dhis2 2.3.4 → 2.3.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +24 -21
- data/lib/dhis2/api/report.rb +6 -0
- data/lib/dhis2/api/report_table.rb +6 -0
- data/lib/dhis2/version.rb +1 -1
- data/lib/dhis2.rb +2 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ad9f8562a6b20e47968d07c3dbeae1abb92e8a51
|
4
|
+
data.tar.gz: ad3d24476b089f578204230cebcf0e6d2fc03447
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bccc7fa2eb369cbe48d08bc34676334b8663007ccbc5243f319d41d7f4c53fc2ec3fc7fd646719f9a9b84356d2431e0fdb214249b61440762981bffcc1492d22
|
7
|
+
data.tar.gz: bcd2e59e1452d68b5fcbd79bee0c5fa0872d0be4339c8e06e41a5a5a4b78a7571fbd6aee0983b6fe0c812e8be3ad3398443af1d892f607e5e910d196a5c0c534
|
data/README.md
CHANGED
@@ -86,7 +86,7 @@ Following the DHIS2 API, all calls are paginated - you can access the page info
|
|
86
86
|
org_units.pager.page_count # number of pages
|
87
87
|
org_units.pager.total # number of records
|
88
88
|
|
89
|
-
###
|
89
|
+
### Retrieve a single element
|
90
90
|
|
91
91
|
You can also retreive a single element using its id with `find`(in this case, all fields are returned by default):
|
92
92
|
|
@@ -126,7 +126,7 @@ You can retreive data values this way:
|
|
126
126
|
organisation_unit: organisation_unit.id, periods: [period]
|
127
127
|
)
|
128
128
|
|
129
|
-
## Supported
|
129
|
+
## Supported items
|
130
130
|
|
131
131
|
The API is currently limited to actions on the following elements:
|
132
132
|
|
@@ -145,25 +145,8 @@ The API is currently limited to actions on the following elements:
|
|
145
145
|
* `Indicator`
|
146
146
|
* `DataElementGroup`
|
147
147
|
* `User`
|
148
|
-
|
149
|
-
|
150
|
-
A very basic **write** use case exists for `DataElement` and `DataSet`:
|
151
|
-
|
152
|
-
elements = [
|
153
|
-
{ name: "TesTesT1", short_name: "TTT1" },
|
154
|
-
{ name: "TesTesT2", short_name: "TTT2" }
|
155
|
-
]
|
156
|
-
status = Dhis2.client.data_elements.create(elements)
|
157
|
-
status.success? # => true
|
158
|
-
status.total_imported # => 2
|
159
|
-
|
160
|
-
DHIS2 API does not return the ids of the created elements, but you can retreive them with their (unique) name or code.
|
161
|
-
|
162
|
-
elements = [
|
163
|
-
{ name: "TesTesT2", short_name: "TTT2" }
|
164
|
-
]
|
165
|
-
status = Dhis2.client.data_elements.create(elements)
|
166
|
-
element = Dhis2.client.data_elements.find_by(name: "TesTesT2")
|
148
|
+
* `Report`
|
149
|
+
* `ReportTable`
|
167
150
|
|
168
151
|
## Update
|
169
152
|
|
@@ -187,6 +170,26 @@ You can update a single or more attributes via the "update_attributes" method:
|
|
187
170
|
|
188
171
|
Note that partial updates will no work with custom attributes at this time (while the full update will)
|
189
172
|
|
173
|
+
## Create
|
174
|
+
|
175
|
+
A very basic **write** use case exists for `DataElement` and `DataSet`:
|
176
|
+
|
177
|
+
elements = [
|
178
|
+
{ name: "TesTesT1", short_name: "TTT1" },
|
179
|
+
{ name: "TesTesT2", short_name: "TTT2" }
|
180
|
+
]
|
181
|
+
status = Dhis2.client.data_elements.create(elements)
|
182
|
+
status.success? # => true
|
183
|
+
status.total_imported # => 2
|
184
|
+
|
185
|
+
DHIS2 API does not return the ids of the created elements, but you can retreive them with their (unique) name or code.
|
186
|
+
|
187
|
+
elements = [
|
188
|
+
{ name: "TesTesT2", short_name: "TTT2" }
|
189
|
+
]
|
190
|
+
status = Dhis2.client.data_elements.create(elements)
|
191
|
+
element = Dhis2.client.data_elements.find_by(name: "TesTesT2")
|
192
|
+
|
190
193
|
## Development
|
191
194
|
|
192
195
|
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. Note that the tests are using the DHIS2 demo server, which is reset every day but can be updated by anyone - so if someone change the password of the default user, the tests are going to fail.
|
data/lib/dhis2/version.rb
CHANGED
data/lib/dhis2.rb
CHANGED
@@ -30,6 +30,8 @@ require_relative "dhis2/api/organisation_unit_group"
|
|
30
30
|
require_relative "dhis2/api/system_info"
|
31
31
|
require_relative "dhis2/api/attribute"
|
32
32
|
require_relative "dhis2/api/user"
|
33
|
+
require_relative "dhis2/api/report_table"
|
34
|
+
require_relative "dhis2/api/report"
|
33
35
|
|
34
36
|
module Dhis2
|
35
37
|
class << self
|
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: 2.3.
|
4
|
+
version: 2.3.5
|
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: 2017-03-
|
11
|
+
date: 2017-03-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|
@@ -147,6 +147,8 @@ files:
|
|
147
147
|
- lib/dhis2/api/organisation_unit.rb
|
148
148
|
- lib/dhis2/api/organisation_unit_group.rb
|
149
149
|
- lib/dhis2/api/organisation_unit_level.rb
|
150
|
+
- lib/dhis2/api/report.rb
|
151
|
+
- lib/dhis2/api/report_table.rb
|
150
152
|
- lib/dhis2/api/system_info.rb
|
151
153
|
- lib/dhis2/api/user.rb
|
152
154
|
- lib/dhis2/client.rb
|