Skip to content

Commit

Permalink
Return all indicators for input time series
Browse files Browse the repository at this point in the history
  • Loading branch information
r-ash committed Dec 3, 2024
1 parent 5ddb5f0 commit 7d0f80e
Show file tree
Hide file tree
Showing 8 changed files with 37 additions and 11 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: naomi
Title: Naomi Model for Subnational HIV Estimates
Version: 2.10.2
Version: 2.10.3
Authors@R:
person(given = "Jeff",
family = "Eaton",
Expand Down
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# naomi 2.10.3

* Return `anc_already_art`, `anc_status`, `anc_art_among_known` and `anc_total_pos` indicators from ANC input time series data.

# naomi 2.10.2

* Add ANC testing outputs to T4 projection period for including in PEPFAR datapack output.
Expand Down
7 changes: 1 addition & 6 deletions R/input-time-series.R
Original file line number Diff line number Diff line change
Expand Up @@ -503,12 +503,7 @@ prepare_input_time_series_anc <- function(anc, shape) {

anc_plot_data_long <- anc_long |>
dplyr::mutate(!!!mutate_exprs) |>
dplyr::select(area_id, area_name, area_level, area_level_label, parent_area_id,
area_sort_order, age_group, time_period, year, quarter,
calendar_quarter, anc_clients, anc_tested, anc_tested_pos,
anc_prevalence, anc_known_pos, anc_known_neg,
anc_art_coverage, births_facility, births_clients_ratio,
area_hierarchy) |>
dplyr::select(-sex) |>
tidyr::pivot_longer(cols = c(dplyr::starts_with("anc"), "births_facility", "births_clients_ratio"),
names_to = "plot",
values_to = "value") |>
Expand Down
4 changes: 4 additions & 0 deletions inst/metadata/time_series_plot_metadata.csv
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ anc_tested,t_(ANC_TESTED),t_(ANC_TESTED_DESC),,"""0,0"""
anc_tested_pos,t_(ANC_TESTED_POS),t_(ANC_TESTED_POS_DESC),,"""0,0"""
anc_known_pos,t_(ANC_KNOWN_POS),t_(ANC_KNOWN_POS_DESC),,"""0,0"""
anc_known_neg,t_(ANC_KNOWN_NEG),t_(ANC_KNOWN_NEG_DESC),,"""0,0"""
anc_already_art,t_(ANC_ALREADY_ART),t_(ANC_ALREADY_ART_DESC),,"""0,0"""
anc_total_pos,t_(ANC_TOTAL_POS),t_(ANC_TOTAL_POS_DESC),,"""0,0"""
anc_status,t_(ANC_STATUS),t_(ANC_STATUS_DESC),,"""0,0"""
anc_art_among_known,t_(ANC_ART_AMONG_KNOWN),t_(ANC_ART_AMONG_KNOWN_DESC),,"""0,0"""
births_clients_ratio,t_(BIRTHS_CLIENTS_RATIO),t_(BIRTHS_CLIENTS_RATIO_DESC),,"""0%"""
births_facility,t_(BIRTHS_FACILITY),t_(BIRTHS_FACILITY_DESC),,"""0,0"""
art_new_total,t_(ART_NEW_TOTAL),t_(ART_NEW_TOTAL_DESC),,"""0,0"""
Expand Down
9 changes: 8 additions & 1 deletion inst/traduire/en-translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -276,5 +276,12 @@
"DOWNLOAD_AGYW_DESCRIPTION": "Naomi AGYW tool uploaded from Naomi web app",
"NUMBER_ON_ART": "Number on ART",
"NUMBER_ON_ART_DESC": "Number on ART description",
"POPULATION_PROPORTION": "Population proportion"
"POPULATION_PROPORTION": "Population proportion",
"ANC_TOTAL_POS": "Anc total pos",
"ANC_TOTAL_POS_DESC": "Anc total pos desc",
"ANC_ALREADY_ART_DESC": "ANC already ART desc",
"ANC_STATUS": "ANC status",
"ANC_STATUS_DESC": "ANC status desc",
"ANC_ART_AMONG_KNOWN": "ANC ART among known",
"ANC_ART_AMONG_KNOWN_DESC": "ANC ART among known desc"
}
9 changes: 8 additions & 1 deletion inst/traduire/fr-translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -273,5 +273,12 @@
"DOWNLOAD_COMPARISON_DESCRIPTION": "Rapport de comparaison Naomi téléchargé à partir de l'application web Naomi",
"NUMBER_ON_ART": "Nombre de personnes sous TARV",
"NUMBER_ON_ART_DESC": "Number on ART description",
"POPULATION_PROPORTION": "Proportion de la population"
"POPULATION_PROPORTION": "Proportion de la population",
"ANC_TOTAL_POS": "Anc total pos",
"ANC_TOTAL_POS_DESC": "Anc total pos desc",
"ANC_ALREADY_ART_DESC": "ANC already ART desc",
"ANC_STATUS": "ANC status",
"ANC_STATUS_DESC": "ANC status desc",
"ANC_ART_AMONG_KNOWN": "ANC ART among known",
"ANC_ART_AMONG_KNOWN_DESC": "ANC ART among known desc"
}
9 changes: 8 additions & 1 deletion inst/traduire/pt-translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -273,5 +273,12 @@
"DOWNLOAD_COMPARISON_DESCRIPTION": "Relatório de comparação Naomi carregado a partir da aplicação web Naomi",
"NUMBER_ON_ART": "Nombre de personnes sous TARV",
"NUMBER_ON_ART_DESC": "Number on ART description",
"POPULATION_PROPORTION": "Proporção da população"
"POPULATION_PROPORTION": "Proporção da população",
"ANC_TOTAL_POS": "Anc total pos",
"ANC_TOTAL_POS_DESC": "Anc total pos desc",
"ANC_ALREADY_ART_DESC": "ANC already ART desc",
"ANC_STATUS": "ANC status",
"ANC_STATUS_DESC": "ANC status desc",
"ANC_ART_AMONG_KNOWN": "ANC ART among known",
"ANC_ART_AMONG_KNOWN_DESC": "ANC ART among known desc"
}
4 changes: 3 additions & 1 deletion tests/testthat/test-input-time-series.R
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,9 @@ test_that("data can be formatted for ANC input time series", {
expect_setequal(unique(data$plot),
c("anc_clients", "anc_tested", "anc_tested_pos",
"anc_prevalence", "anc_known_pos", "anc_known_neg",
"anc_art_coverage", "births_clients_ratio", "births_facility"))
"anc_art_coverage", "births_clients_ratio",
"births_facility", "anc_already_art", "anc_status",
"anc_art_among_known", "anc_total_pos"))

# Time period has correct format
expect_match(as.character(data$time_period), "\\d{4}")
Expand Down

0 comments on commit 7d0f80e

Please sign in to comment.