get_sih: Get hospital admissions data from SIH

Description Usage Arguments Details Value Examples

View source: R/get_sih.R

Description

This function retrieves hospital admission data from PCDaS ElasticSearch cluster for a specified year.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
get_sih(
  conn,
  agr,
  ano = NULL,
  sexo = NULL,
  diag_princ = NULL,
  diag_princ_capitulo = NULL,
  diag_princ_grupo = NULL,
  diag_princ_categoria = NULL,
  diag_princ_subcategoria = NULL,
  idade_anos_min = NULL,
  idade_anos_max = NULL,
  proced_real = NULL,
  lucene_query = NULL
)

Arguments

conn

Connection object created with pcdas_connect.

ano

numeric. Year of death.

sexo

string. Sex of the patient Masculino for males or Feminino for females.

diag_princ

string. CID-10 code for the main diagnosis.

diag_princ_capitulo

string. Chapter of the main diagnosis.

diag_princ_grupo

string. Group of the main diagnosis.

diag_princ_categoria

string. Category of the main diagnosis.

diag_princ_subcategoria

string. Subcategory of the main diagnosis.

idade_anos_min

numeric. Minimum age of patient, in years.

idade_anos_max

numeric. Maximum age of patient, in years.

proced_real

numeric. Numeric code of the realized hospital procedure.

lucene_query

string. A more complex lucene query can be presented here. The string must be informed using sigle quotes. If used, all other filters will be ignored.

agg

string. Aggregation level. 'mun' for municipalities, 'uf' for "unidades federativas" or 'regsaude' for "regiões de saúde".

Details

This function uses raw data from the Sistema de Informações de Internações Hospitalares (SIH) available at the PCDaS ElasticSearch cluster. A documentation about this data can be found at https://bigdata-metadados.icict.fiocruz.br/dataset/sistema-de-informacoes-de-mortalidade-sim. The CID-10 codes and name for chapters, group, category and subcategories of basic cause of death can be inspected at the same address above.

Value

A data.frame containing number of hospital admission authorizations (sih) for the aggregation level.

Examples

1
2
3
4
5
sim <- get_sih(conn = conn, ano = 2010, agr = "mun", sexo = "Masculino")
sim <- get_sih(conn = conn, ano = 2010, agr = "mun", diag_princ = "J448")
sim <- get_sih(conn = conn, ano = 2010, agr = "mun", idade_anos_min = 0, idade_anos_max = 10)
sim <- get_sih(conn = conn, ano = 2010, agr = "mun", proced_real = 310010039)
sih <- get_sih(conn = conn, agr = "mun", lucene_query = 'ano_internacao: 2010 AND def_raca_cor: "Preta" or "Branca"')

bigdata-icict/pcdasindi documentation built on March 11, 2020, 5:15 p.m.