Skip to content

Commit

Permalink
Merge pull request #403 from mrc-ide/patch-artneed15plus
Browse files Browse the repository at this point in the history
correct ART need 15plus for Spectrum 2023
  • Loading branch information
r-ash authored May 5, 2023
2 parents 1cd645b + 203bcfa commit 94d3424
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 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.9.9
Version: 2.9.10
Authors@R:
person(given = "Jeff",
family = "Eaton",
Expand Down
6 changes: 6 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# naomi 2.9.10

* Update PJNZ extraction for adult ART need Dec 31 for 2023 PJNZ files. Previously child ART was
note recorded in the .DP file tag `<NeedARTDec31 MV>`, and so it was fine to extract the total
value. Now child ART is recorded, and so need to sum the adult age groups only.

# naomi 2.9.9

* Add indicators `aware_plhiv_attend` and `unaware_plhiv_attend` for consistent facility attendance cascades.
Expand Down
12 changes: 11 additions & 1 deletion R/inputs-spectrum.R
Original file line number Diff line number Diff line change
Expand Up @@ -183,9 +183,19 @@ read_dp_art_dec31 <- function(dp) {
art15plus_num <- sapply(dpsub("<HAARTBySex MV>", 4:5, timedat.idx), as.numeric)
dimnames(art15plus_num) <- list(sex = c("male", "female"), year = proj.years)

art15plus_need <- sapply(dpsub("<NeedARTDec31 MV>", 3:4, timedat.idx), as.numeric)
## In Spectrum 2023, "<NeedARTDec31 MV>" was updated to include children in the totals
## -> now need to sum over 5-year age groups for age 15+ to get the adult ART need

male_15plus_needart <- dpsub("<NeedARTDec31 MV>", 4:17*3 + 3, timedat.idx)
male_15plus_needart <- vapply(lapply(male_15plus_needart, as.numeric), sum, numeric(1))

female_15plus_needart <- dpsub("<NeedARTDec31 MV>", 4:17*3 + 4, timedat.idx)
female_15plus_needart <- vapply(lapply(female_15plus_needart, as.numeric), sum, numeric(1))

art15plus_need <- rbind(male_15plus_needart, female_15plus_needart)
dimnames(art15plus_need) <- list(sex = c("male", "female"), year = proj.years)


if (any(art15plus_num[art15plus_isperc == 1] < 0 |
art15plus_num[art15plus_isperc == 1] > 100)) {
stop("Invalid percentage on ART entered for adult ART")
Expand Down

0 comments on commit 94d3424

Please sign in to comment.