Skip to content

Commit

Permalink
added a warning about wide format cells (2017-2019)
Browse files Browse the repository at this point in the history
  • Loading branch information
tvolegtv committed Apr 23, 2024
1 parent 9f8317f commit 4d07daf
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion R/read_product_data.R
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ reading_product_data_step1 <-
if (check_wide_format_columns(product_df)) {
logWarn(
log_to_json(
message = "Sheet {values['sheet']} has Mandalay Children's Hospital 2019-2021 wide-format columns. The wide-format area should be changed to long-format!",
message = "Sheet {values['sheet']} has Mandalay Children's Hospital data (2019-2021) wide-format columns. The wide-format area should be changed to long-format!",
values = list(sheet = curr_sheet),
script = "script1",
file = "read_product_data.R",
Expand All @@ -80,6 +80,19 @@ reading_product_data_step1 <-
product_df <- create_new_rows(product_df)
}

if (any(grepl("2017_Mandalay|2018_Mandalay|2019_Mandalay", basename(tracker_data_file)))) {
logWarn(
log_to_json(
message = "Sheet {values['sheet']} Tracker data file contains Mandalay Children's Hospital data (2017-2019), may contain wide-format cells. The wide-format cells should be changed to standart long-format!",
values = list(sheet = curr_sheet),
script = "script1",
file = "read_product_data.R",
functionName = "read_product_data_step1",
warningCode = "invalid_tracker"
)
)
}

# If after extraction, dataframe is empty, this iteration is also skipped.
if (all(is.na(product_df))) {
logWarn(
Expand Down

0 comments on commit 4d07daf

Please sign in to comment.