dhis2 2.1.0 → 2.2.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/lib/dhis2/api/organisation_unit.rb +2 -7
- data/lib/dhis2/status.rb +8 -7
- data/lib/dhis2/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a392c3f988989d0b3f6e14785464d5abba279cc3
|
4
|
+
data.tar.gz: 35acd3072f5a4ebdd7d47a136eb12e14dd5beade
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 79ac47b20d744f9cfa6e24b0dc23fc8bd923213d3aa358f22f48c2b544e807cf17cbfe7cc98378edd6072f7c6183f251cbc42c9ad5059c568b7829b02f73a453
|
7
|
+
data.tar.gz: 04a31d19f9097937e350fe6f29ec674cbcdcd8381d82deda6cc279f69670b19632a089d1509e32de3364b33d50b6194cec920a0acbfc7f59013f29e90109acc0
|
@@ -40,13 +40,8 @@ module Dhis2
|
|
40
40
|
|
41
41
|
payload = {
|
42
42
|
organisationUnits: orgunits.map do |orgunit|
|
43
|
-
|
44
|
-
|
45
|
-
short_name: orgunit[:short_name],
|
46
|
-
opening_date: orgunit[:opening_date]
|
47
|
-
}
|
48
|
-
organisation_unit[:parent] = {id: orgunit[:parent_id]} if orgunit[:parent_id]
|
49
|
-
organisation_unit
|
43
|
+
orgunit[:parent] = { id: orgunit[:parent_id] } if orgunit[:parent_id]
|
44
|
+
orgunit
|
50
45
|
end
|
51
46
|
}
|
52
47
|
|
data/lib/dhis2/status.rb
CHANGED
@@ -12,22 +12,23 @@ module Dhis2
|
|
12
12
|
summary["status"] == "SUCCESS"
|
13
13
|
end
|
14
14
|
end
|
15
|
-
@raw_status["status"]
|
16
|
-
end
|
17
|
-
|
18
|
-
def import_count
|
19
|
-
@raw_status["import_count"]
|
15
|
+
["SUCCESS", "OK"].include?(@raw_status["status"])
|
20
16
|
end
|
21
17
|
|
22
18
|
def total_imported
|
23
19
|
total = 0
|
24
|
-
import_count
|
25
|
-
|
20
|
+
if @raw_status["import_count"]
|
21
|
+
@raw_status["import_count"].each do |_, count|
|
22
|
+
total += count
|
23
|
+
end
|
24
|
+
elsif @raw_status["type_reports"]
|
25
|
+
total += @raw_status["type_reports"].first["stats"]["total"]
|
26
26
|
end
|
27
27
|
total
|
28
28
|
end
|
29
29
|
|
30
30
|
def last_imported_ids
|
31
|
+
return [] unless @raw_status["import_type_summaries"]
|
31
32
|
@raw_status["import_type_summaries"].map { |summary| summary["last_imported"] }
|
32
33
|
end
|
33
34
|
end
|
data/lib/dhis2/version.rb
CHANGED
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.
|
4
|
+
version: 2.2.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: 2016-10-
|
11
|
+
date: 2016-10-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|