Skip to contents

Wrapper around fetch_nhsn_data() that reshapes and converts the output to a long format suitable for reporting triangle construction. Uses reference_week_day = 7 by default to return Saturday week-ending dates, matching both MMWR epiweek and forecast hub conventions.

Usage

fetch_reporting_data_epidatr(
  signal = "confirmed_admissions_covid_ew_prelim",
  geo_type = "state",
  geo_values = "*",
  reference_dates = "*",
  report_dates = "*",
  ...
)

Arguments

signal

Character string specifying the NHSN signal to fetch. Default is "confirmed_admissions_covid_ew_prelim".

geo_type

Character string specifying geographic resolution. Options: "state", "hhs", "nation". Default is "state".

geo_values

Character vector of geography codes, or "*" for all geographies. Default is "*".

reference_dates

A timeset object (e.g., epirange(202401, 202404)) or "*" for all available dates. Default is "*".

report_dates

A timeset object for specific report dates, or "*" for most all. Default is "*".

...

Additional arguments passed to epidatr::pub_covidcast() via fetch_nhsn_data(), such as fetch_args for controlling caching behavior.

Value

A data frame in long format suitable for reporting triangle construction with columns:

  • reference_date: Date of the event (epiweek-ending Saturday)

  • report_date: Date when data was reported (epiweek-ending Saturday)

  • count: Cumulative confirmed admissions reported as of that report date

  • location: Geographic identifier

  • signal: Signal name