Skip to content

Commit

Permalink
Merge pull request #701 from pepfar-datim/DP-1041
Browse files Browse the repository at this point in the history
Fix issue with blank DP targets in unPackSNUxIM
  • Loading branch information
jason-p-pickering authored May 24, 2023
2 parents e63f00b + 7d265e0 commit c665122
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions R/unPackSNUxIM.R
Original file line number Diff line number Diff line change
Expand Up @@ -222,12 +222,11 @@ checkNonEqualTargets <- function(d, original_targets) {
#If the main tab value is missing and the DataPackTarget is zero, ignore
dplyr::mutate(are_equal = dplyr::case_when(is.na(MainTabsTarget) & DataPackTarget == 0 ~ TRUE,
is.na(MainTabsTarget) & DataPackTarget != 0 ~ FALSE,
!is.na(MainTabsTarget) & is.na(DataPackTarget) ~ FALSE,
TRUE ~ are_equal)) %>%
dplyr::filter(!are_equal | is.na(are_equal)) %>%
#Filter non-allocated data to prevent false positives with this test
#Other tests should catch whether there is data in the main tabs
#but which has not been allocated
dplyr::filter(!is.na(DataPackTarget)) %>%
#Filter instances where both the DP and PSNUxIM Target are NA
dplyr::filter(!(is.na(DataPackTarget) & is.na(MainTabsTarget))) %>%
dplyr::rename("PSNUxIM Target" = DataPackTarget)

attr(d$tests$non_equal_targets, "test_name") <- "Non-equal targets"
Expand Down

0 comments on commit c665122

Please sign in to comment.