Sha256: d634a1a01d04cce47a98f7ee2260e6648a74a350493dc93c09bb2cfdb5b00392

Contents?: true

Size: 577 Bytes

Versions: 1

Compression:

Stored size: 577 Bytes

Contents

# frozen_string_literal: true

module Dhis2
  module Api
    module Shared
      class Analytic
        def self.list(client, periods:, organisation_units:, data_elements: nil, filter: nil)
          params = [
            [:dimension, "ou:#{organisation_units}"],
            [:dimension, "pe:#{periods}"]
          ]
          params << [:dimension, "dx:#{data_elements}"] if data_elements
          params << [:filter, filter.to_s] if filter

          client.get(path: "analytics", query_params: RestClient::ParamsArray.new(params))
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
dhis2-3.0.0 lib/dhis2/api/shared/analytic.rb