datasus_padronizar: Standardize common fields in DATASUS microdata

View source: R/microdata.R

datasus_padronizarR Documentation

Standardize common fields in DATASUS microdata

Description

Renames curated fields and converts documented dates, identifiers, numeric measures and logical indicators. Unrecognized columns and coded category values are preserved exactly as published.

Usage

datasus_padronizar(dados, sistema, tipo = NULL)

Arguments

dados

A data frame containing raw DATASUS records.

sistema

System accepted by [datasus_dicionario()].

tipo

Optional raw file type. 'NULL' selects the default type.

Value

The input data frame with curated fields renamed and typed. Provenance is preserved and the applied dictionary is attached as attribute '"datasus_dicionario"'.

Examples

example <- data.frame(
  MUNIC_RES = "120040",
  DT_INTER = "20240110",
  DIAG_PRINC = "J18"
)
datasus_padronizar(example, "sih")

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