Class: OpenmrsDataSanitizer::DataAggregator

Inherits:
Object
  • Object
show all
Defined in:
app/services/openmrs_data_sanitizer/data_aggregator.rb

Overview

rubocop:disable Metrics/ClassLength This class is responsible for aggregating data FROM ##schema.the OpenMRS database

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(schema:) ⇒ DataAggregator

Returns a new instance of DataAggregator.



9
10
11
# File 'app/services/openmrs_data_sanitizer/data_aggregator.rb', line 9

def initialize(schema:)
  @schema = schema
end

Instance Attribute Details

#schemaObject

Returns the value of attribute schema.



7
8
9
# File 'app/services/openmrs_data_sanitizer/data_aggregator.rb', line 7

def schema
  @schema
end

Instance Method Details

#aggregateObject



13
14
15
16
17
18
# File 'app/services/openmrs_data_sanitizer/data_aggregator.rb', line 13

def aggregate
  prepare_tables
  prepare_table_based_on_columns
  truncate_tables
  process_data
end