From a4a0aaa9b0a5d29fb4e0102dd71e9a6d35714ce8 Mon Sep 17 00:00:00 2001 From: Faith Kamau <121166087+hiqedme@users.noreply.github.com> Date: Thu, 11 Jan 2024 12:32:41 +0300 Subject: [PATCH 1/2] added week fix --- service/surge-reports/surge-report.service.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/service/surge-reports/surge-report.service.js b/service/surge-reports/surge-report.service.js index dbfd172d4..d56608519 100644 --- a/service/surge-reports/surge-report.service.js +++ b/service/surge-reports/surge-report.service.js @@ -163,7 +163,17 @@ 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; + + console.log('yearWeek: ', yearWeek); + console.log('oldYear: ', diffWeek); + if (yearWeek >= diffWeek) { return (self.params.surgeWeeklyDatasetSource = 'etl.surge_weekly_report_dataset_2022'); } else { From 9b90798f553ee97d663b90d1fad0b7b2e52a4c7b Mon Sep 17 00:00:00 2001 From: Faith Kamau <121166087+hiqedme@users.noreply.github.com> Date: Thu, 11 Jan 2024 12:39:11 +0300 Subject: [PATCH 2/2] added week fix --- service/surge-reports/surge-report.service.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/service/surge-reports/surge-report.service.js b/service/surge-reports/surge-report.service.js index d56608519..1aa800ff4 100644 --- a/service/surge-reports/surge-report.service.js +++ b/service/surge-reports/surge-report.service.js @@ -170,9 +170,6 @@ export class SurgeService extends SurgeMultiDatasetPatientlistReport { } const diffWeek = currentYear + '' + currentWeek; - - console.log('yearWeek: ', yearWeek); - console.log('oldYear: ', diffWeek); if (yearWeek >= diffWeek) { return (self.params.surgeWeeklyDatasetSource = 'etl.surge_weekly_report_dataset_2022');