Skip to content

Commit

Permalink
fix NA MeasureQualifierCode bug
Browse files Browse the repository at this point in the history
  • Loading branch information
cristinamullin committed Nov 21, 2024
1 parent b64513d commit 6013d13
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions R/ResultFlagsDependent.R
Original file line number Diff line number Diff line change
Expand Up @@ -804,6 +804,18 @@ TADA_FlagMeasureQualifierCode <- function(.data, clean = FALSE, flaggedonly = FA
TADA_CheckType(flaggedonly, "logical")
# check .data has required columns
TADA_CheckColumns(.data, "MeasureQualifierCode")
# check .data MeasureQualifierCode is not all NA. If it is, don't run function and return .data
if (all(is.na(.data$MeasureQualifierCode))) {
print("Data frame does not include any information (all NA's) in MeasureQualifierCode.")

.data = .data %>%
dplyr::mutate(TADA.MeasureQualifierCode.Flag = "Pass") %>%
dplyr::mutate(TADA.MeasureQualifierCode.Def = "NA - Not Applicable")

.data <- TADA_OrderCols(.data)

return(.data)
}

# execute function after checks are passed
# delete existing flag column
Expand Down

0 comments on commit 6013d13

Please sign in to comment.