From bf0cd1a6a64847d38a4a2ecdf291b7887c22abda Mon Sep 17 00:00:00 2001 From: jeffeaton Date: Mon, 18 Nov 2024 18:31:34 -0500 Subject: [PATCH] patch DP read anc_already_art --- DESCRIPTION | 2 +- NEWS.md | 5 +++++ R/inputs-spectrum.R | 4 ++-- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index e5410070..4614b402 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: naomi Title: Naomi Model for Subnational HIV Estimates -Version: 2.10.0 +Version: 2.10.1 Authors@R: person(given = "Jeff", family = "Eaton", diff --git a/NEWS.md b/NEWS.md index efdbfee5..3e00f431 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,8 @@ +# naomi 2.10.1 + +* Patch error in reading `anc_already_art` from Spectrum PJNZ file (was errantly + reading number of women initiated ART <4 weeks before delivery). + # naomi 2.10.0 * Update Naomi example and test datasets to current example data for Malawi diff --git a/R/inputs-spectrum.R b/R/inputs-spectrum.R index 52b525e0..242a70f7 100644 --- a/R/inputs-spectrum.R +++ b/R/inputs-spectrum.R @@ -387,9 +387,9 @@ read_dp_anc_testing <- function(dp) { ## Note: these values start 1 column later than other arrays in the .DP file ## If value is 0, interpret as not entered (NA) if (exists_dptag("")) { - anc_already_art <- dpsub("", 13, timedat.idx+1) + anc_already_art <- dpsub("", 11, timedat.idx+1) } else if (exists_dptag("")) { - anc_already_art <- dpsub("", 13, timedat.idx+1) + anc_already_art <- dpsub("", 11, timedat.idx+1) } anc_already_art <- sapply(anc_already_art, as.integer) anc_already_art[anc_already_art == 0] <- NA