The hardware and bandwidth for this mirror is donated by METANET, the Webhosting and Full Service-Cloud Provider.
If you wish to report a bug, or if you are interested in having us mirror your free-software or open-source project, please feel free to contact us at mirror[@]metanet.ch.

DATASUS - Outpatient Procedures (SIASUS)

The load_outpatient_procedures function provides access to various SIASUS (Ambulatory Information System) datasets, covering a broad spectrum of outpatient services funded by the public health system (SUS). Each row in these datasets corresponds to a procedure performed at an outpatient level, including clinical, administrative, and financial details. The data is organized by type of service or procedure group.

Note: In all SIASUS datasets, variables related to the Cadastro Nacional de Saúde (CNS – National Health Card number) are encrypted by DATASUS.
This ensures patient confidentiality and means that individual-level CNS identifiers cannot be directly used for linkage across datasets. Because of this, this variable is removed when raw_data = FALSE.


The load_outpacient_procedures function offers the following parameters:

  1. dataset: Specifies the SIASUS dataset to download:

  2. time_period: a numeric value or vector indicating the year(s) of the data to be downloaded. For example, 2020 or 2015:2020.

  3. states: a string or vector of strings indicating the Brazilian state(s) for which the data should be downloaded. Use "all" to download data for the entire country. For specific states (valid only for the general dataset), use abbreviations like "SP" (São Paulo), "RJ" (Rio de Janeiro), or c("SP", "RJ").

  4. raw_data: Logical, default is FALSE.

  5. language: A string indicating the desired language of variable names and labels. Accepts "eng" (default) for English or "pt" for Portuguese (only when raw_data = FALSE).

Examples:

library(datazoom.saude)

# Download processed data for Post-Bariatric Surgery Follow-Up (ABO) – State of Acre, 2012.
bariatric_surgery_follow_up <- load_outpatient_procedures(
  dataset = "bariatric_surgery_follow_up",
  time_period = 2012,
  states = "AC",
  raw_data = FALSE,
  language = "eng"
)

# Download processed data for Consolidated Outpatient Procedures (PA) – State of Acre, 2022.
# Descriptions in Portuguese.
ambulatory_production <- load_outpatient_procedures(
  dataset = "ambulatory_production",
  time_period = 2022,
  states = "AC",
  raw_data = FALSE,
  language = "pt"
)

# Download raw data for High-Cost Medications (AM) - State of Pernambuco, 2021.
medicines_raw <- load_outpatient_procedures(
  dataset = "medicines",
  time_period = 2021,
  states = "PE",
  raw_data = TRUE,
  language = "eng"
)

# Download processed data for Psychosocial Care (PS) - State of Acre, 2022 to 2023.
psychosocial <- load_outpatient_procedures(
  dataset = "psychosocial",
  time_period = 2022:2023,
  states = "AC",
  raw_data = FALSE,
  language = "eng"
)

These binaries (installable software) and packages are in development.
They may not be fully stable and should be used with caution. We make no claims about them.