Skip to content

Commit

Permalink
Merge pull request #1357 from hiqedme/surge_fix
Browse files Browse the repository at this point in the history
added week fix
  • Loading branch information
Alfred-Mutai authored Jan 11, 2024
2 parents d9a4883 + 9b90798 commit ac65d79
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion service/surge-reports/surge-report.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit ac65d79

Please sign in to comment.