diff --git a/service/surge-reports/surge-report.service.js b/service/surge-reports/surge-report.service.js index dbfd172d4..1aa800ff4 100644 --- a/service/surge-reports/surge-report.service.js +++ b/service/surge-reports/surge-report.service.js @@ -163,7 +163,14 @@ export class SurgeService extends SurgeMultiDatasetPatientlistReport { determineSurgeReportSourceTables(yearWeek) { const self = this; - if (yearWeek >= moment().year() + '' + moment().week() - 1) { + var currentYear = moment().year(); + var currentWeek = moment().week() - 1; + if (currentWeek < 10) { + currentWeek = '0' + currentWeek; + } + + const diffWeek = currentYear + '' + currentWeek; + if (yearWeek >= diffWeek) { return (self.params.surgeWeeklyDatasetSource = 'etl.surge_weekly_report_dataset_2022'); } else {