Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NM-99] Return all indicators for input time series #456

Merged
merged 2 commits into from
Dec 4, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is anc_status? Is that the total denominator? I usually use anc_hiv_status for that. Doesn't matter too much


# 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) |>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any risk that anc_long has other columns dangling around, or are the columns of that table rigidly specified by an earlier step?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So the indicators are specified by mutate_exprs. So not selecting specific columns here means if we add any more then they should come straight through. Are you worried about some new non-indicator column though?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Double checked, no that shouldn't happen. We read the anc file in and specify the columns we want to read. So that should filter out any unwanted stuff. This should just mean all the columns we create during the aggregation get returned automatically

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"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"ANC total HIV positive"
"Total HIV positive women at ANC (known positive and tested positive)"
"Women already on lifelong ART before first ANC visit during this pregnancy"
"ANC HIV status ascertained"
"Number of women with HIV status ascertained during ANC (either known or tested at least once)"
"ANC ART coverage among known positive" this might be too long?
"Proportion of women known HIV positive at first ANC visit who were already on ART"

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These look good to me

}
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
Loading