ocupacao_hospitalar: Read COVID-19 hospital occupancy records

View source: R/contemporary-data.R

ocupacao_hospitalarR Documentation

Read COVID-19 hospital occupancy records

Description

Downloads annual records from the e-SUS Notifica Hospital Admissions module. The published files cover SUS clinical and intensive-care beds allocated to suspected or confirmed COVID-19 cases. Fields added in 2022 are not populated in earlier records.

Usage

ocupacao_hospitalar(
  ano = "last",
  formato = "CSV",
  destino = NULL,
  cache = TRUE,
  atualizar = FALSE,
  n_max = Inf,
  colunas = NULL,
  normalizar = FALSE,
  ...
)

Arguments

ano

Resource year or '"last"' for the latest year currently published.

formato

File format, '"CSV"' or '"JSON"'.

destino

Optional destination file or existing directory.

cache

Whether to reuse the local OpenDataSUS cache.

atualizar

Whether to force a fresh metadata query and download.

n_max

Maximum number of rows to read.

colunas

Optional character vector selecting columns during CSV parsing.

normalizar

Whether to apply the curated contemporary schema with [datasus_padronizar()].

...

Additional arguments passed to the underlying reader.

Value

The parsed OpenDataSUS resource with provenance metadata.

References

OpenDataSUS. Registro de Ocupação Hospitalar COVID-19. https://dadosabertos.saude.gov.br/dataset/registro-de-ocupacao-hospitalar-covid-19

Examples


old_options <- options(
  datasus.timeout = 5,
  datasus.download_timeout = 15,
  datasus.max_tries = 1
)
try({
leitos <- ocupacao_hospitalar(ano = 2022, n_max = 1000)
})
options(old_options)


datasus documentation built on Oct. 7, 2026, 1:07 a.m.