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
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Dhis2
|
|
4
|
+
module Api
|
|
5
|
+
module Version225
|
|
6
|
+
class ReportTable < ::Dhis2::Api::Base
|
|
7
|
+
include ::Dhis2::Api::Listable
|
|
8
|
+
include ::Dhis2::Api::Findable
|
|
9
|
+
include ::Dhis2::Api::Creatable
|
|
10
|
+
include ::Dhis2::Api::Updatable
|
|
11
|
+
include ::Dhis2::Api::Deletable
|
|
12
|
+
include ::Dhis2::Api::Shared::SaveValidator
|
|
13
|
+
include ::Dhis2::Api::Shared::ReportTable
|
|
14
|
+
|
|
15
|
+
Schema = Dry::Validation.Schema do
|
|
16
|
+
required(:name).filled
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Dhis2
|
|
4
|
+
module Api
|
|
5
|
+
module Version225
|
|
6
|
+
class User < ::Dhis2::Api::Base
|
|
7
|
+
include ::Dhis2::Api::Listable
|
|
8
|
+
include ::Dhis2::Api::Findable
|
|
9
|
+
include ::Dhis2::Api::Updatable
|
|
10
|
+
include ::Dhis2::Api::Deletable
|
|
11
|
+
include ::Dhis2::Api::Shared::SaveValidator
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Dhis2
|
|
4
|
+
module Api
|
|
5
|
+
module Version226
|
|
6
|
+
class Attribute < ::Dhis2::Api::Base
|
|
7
|
+
include ::Dhis2::Api::Listable
|
|
8
|
+
include ::Dhis2::Api::Findable
|
|
9
|
+
include ::Dhis2::Api::Creatable
|
|
10
|
+
include ::Dhis2::Api::Updatable
|
|
11
|
+
include ::Dhis2::Api::Deletable
|
|
12
|
+
include ::Dhis2::Api::Shared::SaveValidator
|
|
13
|
+
|
|
14
|
+
Schema = Dry::Validation.Schema do
|
|
15
|
+
required(:name).filled
|
|
16
|
+
required(:value_type).value(
|
|
17
|
+
included_in?: ::Dhis2::Api::Version226::Constants.value_types
|
|
18
|
+
)
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Dhis2
|
|
4
|
+
module Api
|
|
5
|
+
module Version226
|
|
6
|
+
class CategoryCombo < ::Dhis2::Api::Base
|
|
7
|
+
include ::Dhis2::Api::Listable
|
|
8
|
+
include ::Dhis2::Api::Findable
|
|
9
|
+
include ::Dhis2::Api::Creatable
|
|
10
|
+
include ::Dhis2::Api::BulkCreatable
|
|
11
|
+
include ::Dhis2::Api::Updatable
|
|
12
|
+
include ::Dhis2::Api::Deletable
|
|
13
|
+
include ::Dhis2::Api::Shared::SaveValidator
|
|
14
|
+
include ::Dhis2::Api::Shared::CategoryCombo
|
|
15
|
+
|
|
16
|
+
Schema = Dry::Validation.Schema do
|
|
17
|
+
required(:name).filled
|
|
18
|
+
required(:data_dimension_type).value(
|
|
19
|
+
included_in?: ::Dhis2::Api::Version226::Constants.data_dimension_types
|
|
20
|
+
)
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Dhis2
|
|
4
|
+
module Api
|
|
5
|
+
module Version226
|
|
6
|
+
class CategoryOptionCombo < ::Dhis2::Api::Base
|
|
7
|
+
include ::Dhis2::Api::Listable
|
|
8
|
+
include ::Dhis2::Api::Findable
|
|
9
|
+
include ::Dhis2::Api::Creatable
|
|
10
|
+
include ::Dhis2::Api::Updatable
|
|
11
|
+
include ::Dhis2::Api::Deletable
|
|
12
|
+
include ::Dhis2::Api::Shared::SaveValidator
|
|
13
|
+
include ::Dhis2::Api::Shared::CategoryOptionCombo
|
|
14
|
+
|
|
15
|
+
Schema = Dry::Validation.Schema do
|
|
16
|
+
required(:category_combo).schema do
|
|
17
|
+
required(:id).filled
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Dhis2
|
|
4
|
+
module Api
|
|
5
|
+
module Version226
|
|
6
|
+
module Constants
|
|
7
|
+
include ::Dhis2::Api::Shared::Constants
|
|
8
|
+
|
|
9
|
+
VALUE_TYPES = %w(UNIT_INTERVAL LETTER BOOLEAN NUMBER TEXT DATE LONG_TEXT FILE_RESOURCE USERNAME TRACKER_ASSOCIATE COORDINATE INTEGER_POSITIVE DATETIME EMAIL TRUE_ONLY INTEGER INTEGER_ZERO_OR_POSITIVE ORGANISATION_UNIT TIME INTEGER_NEGATIVE PERCENTAGE AGE PHONE_NUMBER).freeze
|
|
10
|
+
AGGREGATION_TYPES = %w(DEFAULT MAX AVERAGE_INT_DISAGGREGATION SUM AVERAGE_BOOL AVERAGE_INT COUNT CUSTOM STDDEV AVERAGE_SUM_ORG_UNIT NONE AVERAGE_SUM_INT AVERAGE_SUM_INT_DISAGGREGATION AVERAGE VARIANCE MIN).freeze
|
|
11
|
+
|
|
12
|
+
def self.value_types
|
|
13
|
+
VALUE_TYPES
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
def self.aggregation_types
|
|
17
|
+
AGGREGATION_TYPES
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Dhis2
|
|
4
|
+
module Api
|
|
5
|
+
module Version226
|
|
6
|
+
class DataElement < ::Dhis2::Api::Base
|
|
7
|
+
include ::Dhis2::Api::Listable
|
|
8
|
+
include ::Dhis2::Api::Findable
|
|
9
|
+
include ::Dhis2::Api::Creatable
|
|
10
|
+
include ::Dhis2::Api::BulkCreatable
|
|
11
|
+
include ::Dhis2::Api::Updatable
|
|
12
|
+
include ::Dhis2::Api::Deletable
|
|
13
|
+
include ::Dhis2::Api::Shared::SaveValidator
|
|
14
|
+
|
|
15
|
+
Schema = Dry::Validation.Schema do
|
|
16
|
+
required(:name).filled
|
|
17
|
+
required(:short_name).filled
|
|
18
|
+
required(:aggregation_type).value(
|
|
19
|
+
included_in?: ::Dhis2::Api::Version226::Constants.aggregation_types
|
|
20
|
+
)
|
|
21
|
+
required(:domain_type).value(
|
|
22
|
+
included_in?: ::Dhis2::Api::Version226::Constants.domain_types
|
|
23
|
+
)
|
|
24
|
+
required(:value_type).value(
|
|
25
|
+
included_in?: ::Dhis2::Api::Version226::Constants.value_types
|
|
26
|
+
)
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
def self.creation_defaults(args)
|
|
30
|
+
{
|
|
31
|
+
aggregation_type: "SUM",
|
|
32
|
+
code: args[:short_name],
|
|
33
|
+
domain_type: "AGGREGATE",
|
|
34
|
+
type: "int",
|
|
35
|
+
value_type: "NUMBER",
|
|
36
|
+
zero_is_significant: true
|
|
37
|
+
}
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
end
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Dhis2
|
|
4
|
+
module Api
|
|
5
|
+
module Version226
|
|
6
|
+
class DataElementGroup < ::Dhis2::Api::Base
|
|
7
|
+
include ::Dhis2::Api::Listable
|
|
8
|
+
include ::Dhis2::Api::Findable
|
|
9
|
+
include ::Dhis2::Api::Creatable
|
|
10
|
+
include ::Dhis2::Api::BulkCreatable
|
|
11
|
+
include ::Dhis2::Api::Updatable
|
|
12
|
+
include ::Dhis2::Api::Deletable
|
|
13
|
+
include ::Dhis2::Api::Shared::SaveValidator
|
|
14
|
+
include ::Dhis2::Api::Shared::DataElementGroup
|
|
15
|
+
|
|
16
|
+
Schema = Dry::Validation.Schema do
|
|
17
|
+
required(:name).filled
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Dhis2
|
|
4
|
+
module Api
|
|
5
|
+
module Version226
|
|
6
|
+
class DataSet < ::Dhis2::Api::Base
|
|
7
|
+
include ::Dhis2::Api::Listable
|
|
8
|
+
include ::Dhis2::Api::Findable
|
|
9
|
+
include ::Dhis2::Api::Creatable
|
|
10
|
+
include ::Dhis2::Api::BulkCreatable
|
|
11
|
+
include ::Dhis2::Api::Updatable
|
|
12
|
+
include ::Dhis2::Api::Deletable
|
|
13
|
+
include ::Dhis2::Api::Shared::SaveValidator
|
|
14
|
+
include ::Dhis2::Api::Shared::DataSet
|
|
15
|
+
|
|
16
|
+
Schema = Dry::Validation.Schema do
|
|
17
|
+
required(:name).filled
|
|
18
|
+
required(:period_type).value(
|
|
19
|
+
included_in?: ::Dhis2::Api::Version226::Constants.period_types
|
|
20
|
+
)
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
def self.creation_defaults(args)
|
|
24
|
+
{
|
|
25
|
+
code: args[:short_name],
|
|
26
|
+
period_type: "Monthly"
|
|
27
|
+
}
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Dhis2
|
|
4
|
+
module Api
|
|
5
|
+
module Version226
|
|
6
|
+
class DataValueSet < ::Dhis2::Api::Base
|
|
7
|
+
include ::Dhis2::Api::Creatable
|
|
8
|
+
include ::Dhis2::Api::Listable
|
|
9
|
+
include ::Dhis2::Api::Shared::SaveValidator
|
|
10
|
+
include ::Dhis2::Api::Shared::DataValueSet
|
|
11
|
+
|
|
12
|
+
Schema = Dry::Validation.Schema do
|
|
13
|
+
required(:data_values).each do
|
|
14
|
+
schema do
|
|
15
|
+
required(:value).filled
|
|
16
|
+
required(:period).filled
|
|
17
|
+
required(:org_unit).filled
|
|
18
|
+
required(:data_element).filled
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Dhis2
|
|
4
|
+
module Api
|
|
5
|
+
module Version226
|
|
6
|
+
class Event < ::Dhis2::Api::Base
|
|
7
|
+
include ::Dhis2::Api::Listable
|
|
8
|
+
include ::Dhis2::Api::Findable
|
|
9
|
+
include ::Dhis2::Api::BulkCreatable
|
|
10
|
+
include ::Dhis2::Api::Creatable
|
|
11
|
+
include ::Dhis2::Api::Deletable
|
|
12
|
+
include ::Dhis2::Api::Shared::SaveValidator
|
|
13
|
+
include ::Dhis2::Api::Shared::Event
|
|
14
|
+
|
|
15
|
+
BulkCreationStatusClass = ::Dhis2::Api::EventCreationStatus
|
|
16
|
+
|
|
17
|
+
# args for a program without registration
|
|
18
|
+
# and a program with a program_stage
|
|
19
|
+
Schema = Dry::Validation.Schema do
|
|
20
|
+
required(:program).filled # program must be linked to the org unit
|
|
21
|
+
required(:org_unit).filled
|
|
22
|
+
required(:event_date).filled
|
|
23
|
+
required(:data_values).each do
|
|
24
|
+
required(:data_element).filled
|
|
25
|
+
required(:value).filled
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require_relative "constants"
|
|
4
|
+
require_relative "analytic"
|
|
5
|
+
require_relative "attribute"
|
|
6
|
+
require_relative "category_combo"
|
|
7
|
+
require_relative "category_option_combo"
|
|
8
|
+
require_relative "data_element"
|
|
9
|
+
require_relative "data_element_group"
|
|
10
|
+
require_relative "data_set"
|
|
11
|
+
require_relative "data_value"
|
|
12
|
+
require_relative "data_value_set"
|
|
13
|
+
require_relative "event"
|
|
14
|
+
require_relative "indicator"
|
|
15
|
+
require_relative "indicator_group"
|
|
16
|
+
require_relative "indicator_type"
|
|
17
|
+
require_relative "organisation_unit"
|
|
18
|
+
require_relative "organisation_unit_group"
|
|
19
|
+
require_relative "organisation_unit_group_set"
|
|
20
|
+
require_relative "organisation_unit_level"
|
|
21
|
+
require_relative "program"
|
|
22
|
+
require_relative "report_table"
|
|
23
|
+
require_relative "resource_table"
|
|
24
|
+
require_relative "report"
|
|
25
|
+
require_relative "system_info"
|
|
26
|
+
require_relative "user"
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Dhis2
|
|
4
|
+
module Api
|
|
5
|
+
module Version226
|
|
6
|
+
class Indicator < ::Dhis2::Api::Base
|
|
7
|
+
include ::Dhis2::Api::Listable
|
|
8
|
+
include ::Dhis2::Api::Findable
|
|
9
|
+
include ::Dhis2::Api::Creatable
|
|
10
|
+
include ::Dhis2::Api::Updatable
|
|
11
|
+
include ::Dhis2::Api::Deletable
|
|
12
|
+
include ::Dhis2::Api::Shared::SaveValidator
|
|
13
|
+
|
|
14
|
+
Schema = Dry::Validation.Schema do
|
|
15
|
+
required(:name).filled
|
|
16
|
+
required(:short_name).filled
|
|
17
|
+
required(:numerator).filled
|
|
18
|
+
required(:denominator).filled
|
|
19
|
+
required(:indicator_type).filled
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Dhis2
|
|
4
|
+
module Api
|
|
5
|
+
module Version226
|
|
6
|
+
class IndicatorGroup < ::Dhis2::Api::Base
|
|
7
|
+
include ::Dhis2::Api::Listable
|
|
8
|
+
include ::Dhis2::Api::Findable
|
|
9
|
+
include ::Dhis2::Api::Creatable
|
|
10
|
+
include ::Dhis2::Api::Updatable
|
|
11
|
+
include ::Dhis2::Api::Deletable
|
|
12
|
+
include ::Dhis2::Api::Shared::SaveValidator
|
|
13
|
+
|
|
14
|
+
Schema = Dry::Validation.Schema do
|
|
15
|
+
required(:name).filled
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Dhis2
|
|
4
|
+
module Api
|
|
5
|
+
module Version226
|
|
6
|
+
class IndicatorType < ::Dhis2::Api::Base
|
|
7
|
+
include ::Dhis2::Api::Listable
|
|
8
|
+
include ::Dhis2::Api::Findable
|
|
9
|
+
include ::Dhis2::Api::Creatable
|
|
10
|
+
include ::Dhis2::Api::Updatable
|
|
11
|
+
include ::Dhis2::Api::Deletable
|
|
12
|
+
include ::Dhis2::Api::Shared::SaveValidator
|
|
13
|
+
|
|
14
|
+
Schema = Dry::Validation.Schema do
|
|
15
|
+
required(:name).filled
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Dhis2
|
|
4
|
+
module Api
|
|
5
|
+
module Version226
|
|
6
|
+
class OrganisationUnit < ::Dhis2::Api::Base
|
|
7
|
+
include ::Dhis2::Api::Listable
|
|
8
|
+
include ::Dhis2::Api::Findable
|
|
9
|
+
include ::Dhis2::Api::Creatable
|
|
10
|
+
include ::Dhis2::Api::BulkCreatable
|
|
11
|
+
include ::Dhis2::Api::Updatable
|
|
12
|
+
include ::Dhis2::Api::Deletable
|
|
13
|
+
include ::Dhis2::Api::Shared::SaveValidator
|
|
14
|
+
include ::Dhis2::Api::Shared::OrganisationUnit
|
|
15
|
+
|
|
16
|
+
Schema = Dry::Validation.Schema do
|
|
17
|
+
required(:name).filled
|
|
18
|
+
required(:short_name).filled
|
|
19
|
+
required(:opening_date).filled
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Dhis2
|
|
4
|
+
module Api
|
|
5
|
+
module Version226
|
|
6
|
+
class OrganisationUnitGroup < ::Dhis2::Api::Base
|
|
7
|
+
include ::Dhis2::Api::Listable
|
|
8
|
+
include ::Dhis2::Api::Findable
|
|
9
|
+
include ::Dhis2::Api::Creatable
|
|
10
|
+
include ::Dhis2::Api::BulkCreatable
|
|
11
|
+
include ::Dhis2::Api::Updatable
|
|
12
|
+
include ::Dhis2::Api::Deletable
|
|
13
|
+
include ::Dhis2::Api::Shared::SaveValidator
|
|
14
|
+
include ::Dhis2::Api::Shared::OrganisationUnitGroup
|
|
15
|
+
|
|
16
|
+
Schema = Dry::Validation.Schema do
|
|
17
|
+
required(:name).filled
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Dhis2
|
|
4
|
+
module Api
|
|
5
|
+
module Version226
|
|
6
|
+
class OrganisationUnitGroupSet < ::Dhis2::Api::Base
|
|
7
|
+
include ::Dhis2::Api::Listable
|
|
8
|
+
include ::Dhis2::Api::Findable
|
|
9
|
+
include ::Dhis2::Api::Creatable
|
|
10
|
+
include ::Dhis2::Api::Updatable
|
|
11
|
+
include ::Dhis2::Api::Deletable
|
|
12
|
+
include ::Dhis2::Api::Shared::SaveValidator
|
|
13
|
+
|
|
14
|
+
Schema = Dry::Validation.Schema do
|
|
15
|
+
required(:name).filled
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Dhis2
|
|
4
|
+
module Api
|
|
5
|
+
module Version226
|
|
6
|
+
class OrganisationUnitLevel < ::Dhis2::Api::Base
|
|
7
|
+
include ::Dhis2::Api::Listable
|
|
8
|
+
include ::Dhis2::Api::Findable
|
|
9
|
+
include ::Dhis2::Api::Creatable
|
|
10
|
+
include ::Dhis2::Api::Updatable
|
|
11
|
+
include ::Dhis2::Api::Deletable
|
|
12
|
+
include ::Dhis2::Api::Shared::SaveValidator
|
|
13
|
+
|
|
14
|
+
Schema = Dry::Validation.Schema do
|
|
15
|
+
required(:name).filled
|
|
16
|
+
required(:level).filled
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Dhis2
|
|
4
|
+
module Api
|
|
5
|
+
module Version226
|
|
6
|
+
class Program < ::Dhis2::Api::Base
|
|
7
|
+
include ::Dhis2::Api::Listable
|
|
8
|
+
include ::Dhis2::Api::Findable
|
|
9
|
+
include ::Dhis2::Api::Creatable
|
|
10
|
+
include ::Dhis2::Api::Updatable
|
|
11
|
+
include ::Dhis2::Api::Deletable
|
|
12
|
+
include ::Dhis2::Api::Shared::SaveValidator
|
|
13
|
+
|
|
14
|
+
Schema = Dry::Validation.Schema do
|
|
15
|
+
required(:name).filled
|
|
16
|
+
required(:short_name).filled
|
|
17
|
+
required(:program_type).value(
|
|
18
|
+
included_in?: ::Dhis2::Api::Version226::Constants.program_types
|
|
19
|
+
)
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Dhis2
|
|
4
|
+
module Api
|
|
5
|
+
module Version226
|
|
6
|
+
class Report < ::Dhis2::Api::Base
|
|
7
|
+
include ::Dhis2::Api::Listable
|
|
8
|
+
include ::Dhis2::Api::Findable
|
|
9
|
+
include ::Dhis2::Api::Creatable
|
|
10
|
+
include ::Dhis2::Api::Updatable
|
|
11
|
+
include ::Dhis2::Api::Deletable
|
|
12
|
+
include ::Dhis2::Api::Shared::SaveValidator
|
|
13
|
+
|
|
14
|
+
Schema = Dry::Validation.Schema do
|
|
15
|
+
required(:name).filled
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Dhis2
|
|
4
|
+
module Api
|
|
5
|
+
module Version226
|
|
6
|
+
class ReportTable < ::Dhis2::Api::Base
|
|
7
|
+
include ::Dhis2::Api::Listable
|
|
8
|
+
include ::Dhis2::Api::Findable
|
|
9
|
+
include ::Dhis2::Api::Creatable
|
|
10
|
+
include ::Dhis2::Api::Updatable
|
|
11
|
+
include ::Dhis2::Api::Deletable
|
|
12
|
+
include ::Dhis2::Api::Shared::SaveValidator
|
|
13
|
+
include ::Dhis2::Api::Shared::ReportTable
|
|
14
|
+
|
|
15
|
+
Schema = Dry::Validation.Schema do
|
|
16
|
+
required(:name).filled
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Dhis2
|
|
4
|
+
module Api
|
|
5
|
+
module Version226
|
|
6
|
+
class User < ::Dhis2::Api::Base
|
|
7
|
+
include ::Dhis2::Api::Listable
|
|
8
|
+
include ::Dhis2::Api::Findable
|
|
9
|
+
include ::Dhis2::Api::Updatable
|
|
10
|
+
include ::Dhis2::Api::Deletable
|
|
11
|
+
include ::Dhis2::Api::Shared::SaveValidator
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Dhis2
|
|
4
|
+
module Api
|
|
5
|
+
module Version227
|
|
6
|
+
class Attribute < ::Dhis2::Api::Base
|
|
7
|
+
include ::Dhis2::Api::Listable
|
|
8
|
+
include ::Dhis2::Api::Findable
|
|
9
|
+
include ::Dhis2::Api::Creatable
|
|
10
|
+
include ::Dhis2::Api::Updatable
|
|
11
|
+
include ::Dhis2::Api::Deletable
|
|
12
|
+
include ::Dhis2::Api::Shared::SaveValidator
|
|
13
|
+
|
|
14
|
+
Schema = Dry::Validation.Schema do
|
|
15
|
+
required(:name).filled
|
|
16
|
+
required(:value_type).value(
|
|
17
|
+
included_in?: ::Dhis2::Api::Version227::Constants.value_types
|
|
18
|
+
)
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|