Skip to content

Commit

Permalink
HOT FIX Update memo structure for TX PVLS (#580)
Browse files Browse the repository at this point in the history
* Update memo structure for TX PVLS

* Fix memo structure

* Fix partners table

* Fix partners table

* Fix failing tests

* Linting

* updated description and news file for quick release

Co-authored-by: Jordan <Jordan>
  • Loading branch information
jason-p-pickering authored Dec 16, 2022
1 parent b46dfd9 commit ecb9f59
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 13 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Package: datapackr
Type: Package
Title: A Package that Packs and Unpacks all Data Packs
Version: 5.5.0
Date: 2022-12-07
Version: 5.5.1
Date: 2022-12-16
Authors@R: c(
person("Scott", "Jackson", email = "sjackson@baosystems.com",
role = c("aut", "cre")),
Expand Down
10 changes: 10 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
# datapackr 5.5.1

## Breaking changes

## New features

## Minor improvements and fixes
* Added TX_PVLS(D) to memo


# datapackr 5.5.0

## Breaking changes
Expand Down
4 changes: 1 addition & 3 deletions R/generateApprovalMemo.R
Original file line number Diff line number Diff line change
Expand Up @@ -265,9 +265,7 @@ renderPartnerTable <- function(memo_doc, partners_table, memoStructure, source_t
dplyr::mutate_if(is.numeric, zerosToDashes)

sub_heading <- names(partners_table)[4:length(partners_table)] %>%
stringr::str_split(., " ") %>%
purrr::map(purrr::pluck(2)) %>%
unlist() %>%
stringr::str_extract(., "<15|15\\+|<18|18\\+|Total") %>%
c("Funding Agency", "Partner", "Mechanism", .)

group_heading <- names(partners_table)[4:length(partners_table)] %>%
Expand Down
19 changes: 11 additions & 8 deletions R/memoStructure.R
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ memoStructure <- function(d, d2_session = dynGet("d2_default_session",
"TX_CURR", "<15", 1,
"TX_CURR", "15+", 1,
"TX_CURR", "Total", NA,
"TX_PVLS", "<15", 1,
"TX_PVLS", "15+", 1,
"TX_PVLS", "Total", NA,
"TX_PVLS_(N)", "<15", 1,
"TX_PVLS_(N)", "15+", 1,
"TX_PVLS_(N)", "Total", NA,
"CXCA_SCRN", "Total", 2,
"OVC_SERV", "<18", 2,
"OVC_SERV", "18+", 2,
Expand Down Expand Up @@ -86,11 +86,14 @@ memoStructure <- function(d, d2_session = dynGet("d2_default_session",
"TX_CURR", "<15", 1,
"TX_CURR", "15+", 1,
"TX_CURR", "Total", NA,
"TX_PVLS", "<15", 1,
"TX_PVLS", "15+", 1,
"TX_PVLS", "Total", NA,
"HTS_SELF", "<15", 1,
"HTS_SELF", "15+", 1,
"TX_PVLS_(D)", "<15", 1,
"TX_PVLS_(D)", "15+", 1,
"TX_PVLS_(D)", "Total", NA,
"TX_PVLS_(N)", "<15", 1,
"TX_PVLS_(N)", "15+", 1,
"TX_PVLS_(N)", "Total", NA,
"HTS_SELF", "<15", 2,
"HTS_SELF", "15+", 2,
"HTS_SELF", "Total", NA,
"HTS_TST", "<15", 2,
"HTS_TST", "15+", 2,
Expand Down
2 changes: 2 additions & 0 deletions R/prepareMemoData.R
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,8 @@ prepareMemoDataByPSNU <- function(analytics,
"GEND_GBV Physical and Emotional Violence",
Indicator == "GEND_GBV" & N_OR_D == "Sexual" ~
"GEND_GBV Sexual Violence",
Indicator == "TX_PVLS" & N_OR_D == "(D)" ~ "TX_PVLS_(D)",
Indicator == "TX_PVLS" & N_OR_D == "(N)" ~ "TX_PVLS_(N)",
TRUE ~ Indicator)) %>%
dplyr::select(-"N_OR_D") %>%
dplyr::mutate(Age = dplyr::case_when(Age == "15-" ~ "<15",
Expand Down

0 comments on commit ecb9f59

Please sign in to comment.