Adds the stool adequacy, the follow-up status and the review screen of the
CDC desk review to each case. Every day count runs to as_of.
Usage
afp_followup_status(
cases,
as_of = Sys.Date(),
due_days = 60,
on_time_days = c(60, 90),
adequacy = "followup",
adequacy_args = list(),
compatible_classes = "COMPATIBLE",
review_classes = c("NPAFP", "PENDING", "LAB PENDING"),
review_findings = c("Residual weakness/paralysis", "Died before follow-up",
"Lost to follow-up"),
review_max_age_months = 60,
review_min_doses = 3,
dose_unknown = 99,
dose_reason_labels = c(no_opv = "0 OPV doses", no_routine =
"0 routine OPV doses, SIA doses missing", no_sia =
"0 SIA OPV doses, routine doses missing", few_doses = paste0("Fewer than ",
review_min_doses, " doses"), no_history = "Dose history missing"),
cols = list()
)Arguments
- cases
Cleaned AFP cases, one row per case (data.frame or tibble).
- as_of
The reporting date, as a
Dateor a string thatas.Date()reads. Defaults toSys.Date(). Every day count runs to it.- due_days
Days after onset from which follow-up of an inadequate case is due (default 60).
- on_time_days
First and last day after onset at which a follow-up is on time (default
c(60, 90)).- adequacy
Stool adequacy definition passed to
afp_stool_adequacy()(default"followup").- adequacy_args
Named list of further arguments for
afp_stool_adequacy(), for examplelist(adequate_value = "YES").- compatible_classes
Classifications counted as compatible, matched ignoring case (default
"COMPATIBLE").- review_classes
Classifications the review screen keeps, matched ignoring case (default
c("NPAFP", "PENDING", "LAB PENDING")). A blank classification is always kept.- review_findings
Follow-up findings that keep a case under review (default residual weakness or paralysis, died before follow-up, and lost to follow-up, in POLIS wording).
- review_max_age_months
Age in months at and above which the screen drops a case (default 60).
- review_min_doses
Fewest doses that count as vaccinated when routine and campaign OPV counts are missing (default 3).
- dose_unknown
Dose value that means unknown (default 99).
- dose_reason_labels
Named character vector of the
dose_reasontexts, with elementsno_opv,no_routine,no_sia,few_dosesandno_history.- cols
Named list overriding default column names, in the style of
calc_polio_indicators(), for examplelist(cases = list(stool1_condition = "s1_cond")). The defaults are the polished defaults plus the module columns listed under Details ofcalc_afp_timeliness().
Value
cases as a tibble with adequate, onset_month, days_since,
followup_days, finding, due, followed, on_time, no_followup,
overdue, compatible, dose_reason and review added.
Details
adequate:afp_stool_adequacy()underadequacy(default"followup", as on the rise-afg follow-up page).days_since: days from onset toas_of.followup_days: days from onset to the follow-up date.finding: the follow-up finding,NAwhen blank.due: inadequate, and at leastdue_days(default 60) days since onset.followed: a follow-up date or a finding is recorded.on_time: followed upon_time_days[1]toon_time_days[2]days after onset (default 60 to 90).no_followup: due and not followed up.overdue: no follow-up and more thanon_time_days[2]days since onset.compatible: classified incompatible_classes.dose_reason: why the dose history keeps the case under review, orNA. No OPV dose recorded keeps it; where the routine and campaign OPV counts are both missing, fewer thanreview_min_dosesdoses by the reported total, or failing that by the calculated total, keeps it.review: due, not compatible, classified inreview_classesor not yet classified, with a finding inreview_findingsor overdue, with adose_reason, and younger thanreview_max_age_months(or of unknown age).
A case adequacy cannot assess is never due.
Examples
cases <- tibble::tibble(
paralysis_onset_date = as.Date("2025-01-10"),
onset_to_stool1 = 20,
onset_to_stool2 = 21,
stool1_to_stool2 = 1,
stool1condition = "Good",
stool2condition = "Good",
classification_all = "NPAFP",
followup_date = as.Date(NA),
followup_findings = NA_character_,
age_months = 24,
doses_opv_routine = 0,
doses_opvsia = 0,
total_number_of_doses = 0,
calc_doses_risi = 0
)
afp_followup_status(cases, as_of = "2025-06-30")
#> # A tibble: 1 × 27
#> paralysis_onset_date onset_to_stool1 onset_to_stool2 stool1_to_stool2
#> <date> <dbl> <dbl> <dbl>
#> 1 2025-01-10 20 21 1
#> # ℹ 23 more variables: stool1condition <chr>, stool2condition <chr>,
#> # classification_all <chr>, followup_date <date>, followup_findings <chr>,
#> # age_months <dbl>, doses_opv_routine <dbl>, doses_opvsia <dbl>,
#> # total_number_of_doses <dbl>, calc_doses_risi <dbl>, adequate <lgl>,
#> # onset_month <date>, days_since <int>, followup_days <int>, finding <chr>,
#> # due <lgl>, followed <lgl>, on_time <lgl>, no_followup <lgl>, overdue <lgl>,
#> # compatible <lgl>, dose_reason <chr>, review <lgl>
