Class: OpenmrsDataSanitizer::DataSanitizer
- Inherits:
-
Object
- Object
- OpenmrsDataSanitizer::DataSanitizer
- Defined in:
- app/services/openmrs_data_sanitizer/data_sanitizer.rb
Overview
rubocop:disable Metrics/ClassLength AWS DataSanitizer
Instance Attribute Summary collapse
-
#concept_names ⇒ Object
Returns the value of attribute concept_names.
-
#faker_names ⇒ Object
Returns the value of attribute faker_names.
-
#regimen_combinations ⇒ Object
Returns the value of attribute regimen_combinations.
-
#sites ⇒ Object
Returns the value of attribute sites.
-
#skip ⇒ Object
Returns the value of attribute skip.
Instance Method Summary collapse
-
#initialize(sites: [], skip: true) ⇒ DataSanitizer
constructor
A new instance of DataSanitizer.
- #start ⇒ Object
Constructor Details
#initialize(sites: [], skip: true) ⇒ DataSanitizer
Returns a new instance of DataSanitizer.
18 19 20 21 22 23 24 25 |
# File 'app/services/openmrs_data_sanitizer/data_sanitizer.rb', line 18 def initialize(sites: [], skip: true) @concept_names = Concurrent::Hash.new @faker_names = Concurrent::Hash.new @regimen_combinations = {} @sites = sites @skip = skip load_regimen_combinations end |
Instance Attribute Details
#concept_names ⇒ Object
Returns the value of attribute concept_names.
16 17 18 |
# File 'app/services/openmrs_data_sanitizer/data_sanitizer.rb', line 16 def concept_names @concept_names end |
#faker_names ⇒ Object
Returns the value of attribute faker_names.
16 17 18 |
# File 'app/services/openmrs_data_sanitizer/data_sanitizer.rb', line 16 def faker_names @faker_names end |
#regimen_combinations ⇒ Object
Returns the value of attribute regimen_combinations.
16 17 18 |
# File 'app/services/openmrs_data_sanitizer/data_sanitizer.rb', line 16 def regimen_combinations @regimen_combinations end |
#sites ⇒ Object
Returns the value of attribute sites.
16 17 18 |
# File 'app/services/openmrs_data_sanitizer/data_sanitizer.rb', line 16 def sites @sites end |
#skip ⇒ Object
Returns the value of attribute skip.
16 17 18 |
# File 'app/services/openmrs_data_sanitizer/data_sanitizer.rb', line 16 def skip @skip end |
Instance Method Details
#start ⇒ Object
27 28 29 30 31 32 33 34 35 36 |
# File 'app/services/openmrs_data_sanitizer/data_sanitizer.rb', line 27 def start start_time = Time.now Rails.logger.info("DataSanitizer started at #{start_time}") clear_directory process_data_request end_time = Time.now time_taken = (end_time - start_time) / 60 Rails.logger.info("DataSanitizer completed at #{end_time} and it took #{time_taken} minutes") { start_time:, end_time:, time_in_minutes: (end_time - start_time) / 60 } end |