Sha256: c0c63df2e8f45d65f69b1717fa1fd00ec125bf1056110121105b83eeb352fabe
Contents?: true
Size: 1.17 KB
Versions: 42
Compression:
Stored size: 1.17 KB
Contents
module MalawiHivProgramReports module Pepfar # rubocop:disable Metrics/ClassLength class MaternalStatus include Utils include MalawiHivProgramReports::Utils::CommonSqlQueryUtils include MalawiHivProgramReports::Adapters::Moh::Custom include MalawiHivProgramReports::Utils::ModelUtils attr_reader :start_date, :end_date, :location def initialize(start_date:, end_date:, **kwargs) @start_date = start_date&.to_date raise InvalidParameterError, 'start_date is required' unless @start_date @end_date = end_date&.to_date || @start_date + 12.months raise InvalidParameterError, "start_date can't be greater than end_date" if @start_date > @end_date @occupation = kwargs.delete(:occupation) @type = kwargs.delete(:application) @location = kwargs.delete(:location) @patient_ids = kwargs.delete(:patient_ids)&.split(',') || [] end def find_report MalawiHivProgramReports::Pepfar::ViralLoadCoverage2.new(tx_curr_definition: 'pepfar', start_date: @start_date, end_date: @end_date, location: @location).vl_maternal_status(@patient_ids) end end end end
Version data entries
42 entries across 42 versions & 1 rubygems