process_sia: Prepare SIA outpatient-production microdata

View source: R/process_sia.R

process_siaR Documentation

Prepare SIA outpatient-production microdata

Description

Recodes supported fields from SIA individual outpatient-production records ("SIA-PA") into descriptive values and normalizes escaped Unicode text. Lookup joins can add procedure, occupation, team, and municipality descriptions.

Usage

process_sia(
  data,
  information_system = "SIA-PA",
  nome_proced = TRUE,
  nome_ocupacao = TRUE,
  nome_equipe = TRUE,
  municipality_data = TRUE
)

Arguments

data

A data frame returned by fetch_datasus() with information_system = "SIA-PA", or a compatible layout.

information_system

A single character string. Currently only "SIA-PA" is supported.

nome_proced

Logical scalar. If TRUE, download the current SIGTAB table with fetch_sigtab() and join procedure names. This requires network access.

nome_ocupacao

Logical scalar. If TRUE, join occupation descriptions for supported occupation-code columns.

nome_equipe

Logical scalar retained for API compatibility. Team descriptions are currently joined whenever PA_INE is present, regardless of this value.

municipality_data

Logical scalar. If TRUE, add municipality names and available territorial attributes for supported municipality-code columns.

Details

Columns not explicitly recoded are retained, but Unicode normalization is applied to every column and consequently the returned tibble contains character columns. Other SIA layouts downloadable with fetch_datasus() are not currently supported by this processing function.

Value

A tibble with character columns. Supported codes are replaced with descriptions, and requested lookup fields are added where applicable.

References

Saldanha, R. F. (2026). SIA – Sistema de Informações Ambulatoriais do SUS.

See Also

fetch_datasus(), fetch_sigtab()

Examples

process_sia(sia_pa_sample, nome_proced = FALSE)


microdatasus documentation built on July 29, 2026, 5:08 p.m.