dhis2 2.3.4 → 2.3.5

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 66cf5849a25c1a4f9dc97664e086a02cdb30fb9e
4
- data.tar.gz: c4695d707a8b06dbaad62fb98047374100116ea0
3
+ metadata.gz: ad9f8562a6b20e47968d07c3dbeae1abb92e8a51
4
+ data.tar.gz: ad3d24476b089f578204230cebcf0e6d2fc03447
5
5
  SHA512:
6
- metadata.gz: 6b6b5229099449c13c93b7674125e6f6ddbb5df84f49b1b5ee7bb957077511317151b48920913639d127925f029cd9d947712b40a582865a713d5fc2ea494c86
7
- data.tar.gz: e1517df7e484908f8278cd45d8188fd4de111fb376617eab171f55eaf532a3fe258fff21ec597833340535894908fdeeea343957a78990ceb0d4490ac6dc6791
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
- ### Retreive a single element
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 features
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.
@@ -0,0 +1,6 @@
1
+ module Dhis2
2
+ module Api
3
+ class Report < Base
4
+ end
5
+ end
6
+ end
@@ -0,0 +1,6 @@
1
+ module Dhis2
2
+ module Api
3
+ class ReportTable < Base
4
+ end
5
+ end
6
+ end
data/lib/dhis2/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Dhis2
2
- VERSION = "2.3.4"
2
+ VERSION = "2.3.5"
3
3
  end
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
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-09 00:00:00.000000000 Z
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