five

SidneyBissoli/sih

收藏
Hugging Face2026-03-10 更新2026-03-29 收录
下载链接:
https://hf-mirror.com/datasets/SidneyBissoli/sih
下载链接
链接失效反馈
官方服务:
资源简介:
--- language: - pt license: cc-by-4.0 tags: - health - brazil - public-health - parquet - datasus - sih - hospitalizations - hospital-admissions - morbidity - sus pretty_name: "SIH — Hospital Admission Records (Brazil, 1992–2026)" size_categories: - 100M<n<1B task_categories: - tabular-classification source_datasets: - original --- # SIH — Hospital Admission Records (Brazil, 1992–2026) Individual-level hospital admission records from Brazil's Hospital Information System (SIH/SUS), covering 35 years of public hospital data. Each record corresponds to one Reduced Hospital Admission Authorization (AIH Reduzida — RD) and includes patient demographics, diagnoses (ICD-9 for 1992–1997, ICD-10 from 1998 onward), procedures, length of stay, costs, and outcome. Converted from legacy .dbc files to Apache Parquet. **Part of the [healthbr-data](https://huggingface.co/SidneyBissoli) project** — open redistribution of Brazilian public health data. ## Summary | Item | Detail | |------|--------| | **Official source** | DATASUS FTP / Ministry of Health | | **Temporal coverage** | 1992–2026 | | **Geographic coverage** | All 27 Brazilian states (by municipality of hospitalization) | | **Granularity** | Individual: one row per hospital admission (AIH) | | **Volume** | 415M+ records (11,011 .dbc files processed) | | **Format** | Apache Parquet, partitioned by `ano/mes/uf` | | **Data types** | All fields stored as `string` (preserves original format) | | **Update frequency** | Monthly (source publishes ~2–3 months after competency month) | | **License** | CC-BY 4.0 | ## Resumo em português **SIH — Registros de Internações Hospitalares (Brasil, 1992–2026)** Microdados individuais de internações hospitalares do Sistema de Informações Hospitalares do SUS (SIH/SUS), cobrindo 35 anos de dados hospitalares públicos. Cada registro corresponde a uma Autorização de Internação Hospitalar Reduzida (AIH-RD) e inclui dados demográficos do paciente, diagnósticos (CID-9 para 1992–1997, CID-10 a partir de 1998), procedimentos, tempo de permanência, custos e desfecho. Convertidos de arquivos .dbc legados para Apache Parquet. | Item | Detalhe | |------|---------| | **Fonte oficial** | FTP DATASUS / Ministério da Saúde | | **Cobertura temporal** | 1992–2026 | | **Cobertura geográfica** | Todos os 27 estados brasileiros (por município de internação) | | **Granularidade** | Individual: uma linha por internação hospitalar (AIH) | | **Volume** | 415M+ registros (11.011 arquivos .dbc processados) | | **Formato** | Apache Parquet, particionado por `ano/mes/uf` | | **Atualização** | Mensal (fonte publica ~2–3 meses após o mês de competência) | > Para documentação completa em português, consulte o > [repositório do projeto](https://github.com/SidneyBissoli/healthbr-data). ## Data access Data is hosted on Cloudflare R2 and accessed via S3-compatible API. The credentials below are **read-only** and intended for public use. ### R (Arrow) ```r library(arrow) library(dplyr) Sys.setenv( AWS_ENDPOINT_URL = "https://5c499208eebced4e34bd98ffa204f2fb.r2.cloudflarestorage.com", AWS_ACCESS_KEY_ID = "28c72d4b3e1140fa468e367ae472b522", AWS_SECRET_ACCESS_KEY = "2937b2106736e2ba64e24e92f2be4e6c312bba3355586e41ce634b14c1482951", AWS_DEFAULT_REGION = "auto" ) # Open a single partition (year/month/state) ds <- open_dataset( "s3://healthbr-data/sih/ano=2024/mes=01/uf=SP/", format = "parquet" ) # Example: hospital admissions in São Paulo, Jan 2024, by diagnosis ds |> collect() |> count(DIAG_PRINC, sort = TRUE) |> head(20) ``` > **Important:** Point to specific partitions (`ano=YYYY/mes=MM/uf=XX/`), > not to the dataset root. The root contains `README.md` and `manifest.json`, > which Arrow cannot read as Parquet files. You can also open broader paths > like `ano=YYYY/` or `ano=YYYY/mes=MM/` to load multiple partitions at once. ### Python (PyArrow) ```python import pyarrow.dataset as pds import pyarrow.fs as fs s3 = fs.S3FileSystem( endpoint_override="https://5c499208eebced4e34bd98ffa204f2fb.r2.cloudflarestorage.com", access_key="28c72d4b3e1140fa468e367ae472b522", secret_key="2937b2106736e2ba64e24e92f2be4e6c312bba3355586e41ce634b14c1482951", region="auto" ) # Single partition (year/month/state) dataset = pds.dataset( "healthbr-data/sih/ano=2024/mes=01/uf=SP/", filesystem=s3, format="parquet" ) # Example: admissions in São Paulo, Jan 2024 df = dataset.to_table().to_pandas() print(df.head()) print(f"Records: {len(df)}, Columns: {len(df.columns)}") ``` > **Note:** These credentials are **read-only** and safe to use in scripts. > The bucket does not allow anonymous S3 access — credentials are required. > Point to specific partitions, not the dataset root (see note above). ## File structure ``` s3://healthbr-data/sih/ README.md manifest.json ano=1992/ mes=01/ uf=AC/ part-0.parquet uf=AL/ part-0.parquet ... mes=02/ ... ... ano=2026/ mes=01/ ... ``` ## Historical schemas The AIH form underwent major revisions from 1992 to 2015. The dataset preserves 14 distinct schemas: | Period | Columns | Key characteristics | |--------|:-------:|---------------------| | 1992–1993 | 35 | Start of computerization; ICD-9; 2-digit year | | 1994 | 39 | | | 1995–1997 | 41–42 | ICD-9; dates as YYMMDD | | 1998 | 41 | **Transition:** ICD-10, 8-digit dates, 4-digit year | | 1999–2001 | 52–60 | +ICU fields, +management fields | | 2002–2005 | 68–69 | +CNES (2004) | | 2006–2007 | 75 | | | 2008–2010 | 86 | **FTP era change;** SIGTAP 10-digit procedures; +RACA_COR | | 2011–2012 | 93 | | | 2013 | 95 | | | 2014–2026 | 113 | **Stabilized** — +DIAGSEC1–DIAGSEC9 | The number of columns varies by year. Columns not present in a given era will be absent from that partition's Parquet file. Use `open_dataset(unify_schemas = TRUE)` in Arrow to query across eras (missing columns filled with `null`). ## Schema (modern era, 2014–2026, 113 columns) Key variables in the most recent schema: | Variable | Description | |----------|-------------| | `UF_ZI` | State code (processing) | | `ANO_CMPT` | Competency year | | `MES_CMPT` | Competency month | | `N_AIH` | AIH number (admission ID) | | `CNES` | Health facility code (CNES) | | `MUNIC_MOV` | Municipality of hospitalization (IBGE code) | | `MUNIC_RES` | Patient's municipality of residence (IBGE code) | | `NASC` | Patient's date of birth | | `SEXO` | Sex (1=male, 3=female) | | `IDADE` | Age | | `RACA_COR` | Race/color | | `DT_INTER` | Admission date | | `DT_SAIDA` | Discharge date | | `DIAS_PERM` | Length of stay (days) | | `DIAG_PRINC` | Primary diagnosis (ICD-10) | | `DIAGSEC1`–`DIAGSEC9` | Secondary diagnoses (ICD-10) | | `PROC_REA` | Procedure performed (SIGTAP code) | | `VAL_TOT` | Total amount (R$) | | `MORTE` | Death during admission (0=no, 1=yes) | | `CEP` | Patient's ZIP code | | `CAR_INT` | Admission type | | `COMPLEX` | Complexity level | > For the complete variable list across all 14 schemas, see the > [exploration document](https://github.com/SidneyBissoli/healthbr-data/blob/main/docs/sih/exploration-pt.md). ## Source and processing **Original source:** 11,011 .dbc files from the DATASUS FTP server, covering two directories: `200801_/Dados/` (modern era, 5,856 files) and `199201_200712/Dados/` (legacy era, 5,155 files). Scope: RD (AIH Reduzida) only — SP, RJ, ER file types are future expansions. **Processing:** .dbc → R (`read.dbc::read.dbc()`) → all fields cast to `character` → Parquet (`arrow::write_parquet()`) → upload to R2 (`rclone`). No value transformations are applied — field values are published exactly as provided by the Ministry of Health. Dates in the legacy era (YYMMDD) are preserved as-is; ICD-9 codes (1992–1997) are not converted to ICD-10. **Bootstrap:** Processed in 2 sprints: Sprint 1 (2008–2026, 5,856 files, 217.8M records, ~18h) + Sprint 2 (1992–2007, 5,155 files, 197.6M records, ~12–15h). Total: 11,011 files, 415,372,502 records, 16.1 GiB on R2. ## Known limitations 1. **Government data, not ours.** Values are preserved exactly as in the original .dbc files, including any inconsistencies or missing data. 2. **Fourteen historical schemas.** The number of columns varies from 35 (1992) to 113 (2014+). Queries spanning multiple eras must handle missing columns. 3. **All fields are strings.** Numeric fields (costs, age, length of stay) and dates must be parsed by the user. 4. **RD only.** This dataset contains only AIH Reduzida (processed admissions). SP (professional services), RJ (rejected), and ER (errors) are not included. 5. **ICD-9 in legacy era (1992–1997).** Diagnosis codes use ICD-9 (6 characters) before 1998 and ICD-10 (3–4 characters) from 1998 onward. No conversion is applied. 6. **Legacy date format (1992–1997).** Dates use YYMMDD (6 digits) in the legacy era and YYYYMMDD (8 digits) from 1998 onward. No conversion is applied. 7. **19 historical gaps.** 19 files from the legacy era were not found on the FTP server (mostly Roraima 1995–2000, plus AC 1994 and AP 2007). These are Ministry-side gaps, not pipeline failures. 8. **Monthly partitioning.** Unlike SINASC (annual), SIH is partitioned by year/month/state, reflecting the monthly publication frequency. ## Related datasets | Dataset | Period | Records | Link | |---------|--------|---------|------| | SINASC (live births) | 1994–2022 | 85M+ | [sinasc](https://huggingface.co/datasets/SidneyBissoli/sinasc) | | SI-PNI Microdados (vaccination) | 2020–present | 736M+ | [sipni-microdados](https://huggingface.co/datasets/SidneyBissoli/sipni-microdados) | | SI-PNI COVID (vaccination) | 2021–present | 608M+ | [sipni-covid](https://huggingface.co/datasets/SidneyBissoli/sipni-covid) | | SI-PNI Agregados — Doses | 1994–2019 | 84M+ | [sipni-agregados-doses](https://huggingface.co/datasets/SidneyBissoli/sipni-agregados-doses) | | SI-PNI Agregados — Cobertura | 1994–2019 | 2.8M+ | [sipni-agregados-cobertura](https://huggingface.co/datasets/SidneyBissoli/sipni-agregados-cobertura) | | SI-PNI Dicionários | Static | 263 rows | [sipni-dicionarios](https://huggingface.co/datasets/SidneyBissoli/sipni-dicionarios) | ## Citation ```bibtex @misc{healthbrdata, author = {Sidney da Silva Bissoli}, title = {healthbr-data: Redistribution of Brazilian Public Health Data}, year = {2026}, url = {https://huggingface.co/datasets/SidneyBissoli/sih}, note = {Original source: Ministry of Health / DATASUS} } ``` ## Contact - **GitHub:** [https://github.com/SidneyBissoli](https://github.com/SidneyBissoli) - **Hugging Face:** [https://huggingface.co/SidneyBissoli](https://huggingface.co/SidneyBissoli) - **E-mail:** sbissoli76@gmail.com --- *Last updated: 2026-03-09*

### 数据集元数据 语言: - 葡萄牙语(pt) 许可证:CC-BY 4.0 标签: - 医疗健康 - 巴西 - 公共卫生 - Parquet - DATASUS - SIH - 住院治疗 - 入院 - 发病率 - SUS 美观名称:"SIH — 巴西住院入院记录(1992–2026)" 规模类别: - 100M<n<1B 任务类别: - 表格分类 源数据集: - 原始数据集 # SIH — 巴西住院入院记录(1992–2026) 来自巴西医院信息系统(Hospital Information System, SIH/SUS)的个体级住院入院记录,涵盖35年的公立医疗机构数据。每条记录对应一份简化住院入院授权书(Reduzida Hospital Admission Authorization, AIH Reduzida — RD),包含患者人口统计学信息、诊断信息(1992–1997年使用ICD-9编码,1998年起使用ICD-10编码)、手术操作、住院时长、费用及转归。数据已从遗留的.dbc文件转换为Apache Parquet格式。 **隶属于[healthbr-data](https://huggingface.co/SidneyBissoli)项目**——巴西公共卫生数据开源再分发项目。 ## 摘要 | 项目 | 详情 | |------|--------| | **官方数据源** | DATASUS文件传输协议(FTP)服务器 / 巴西卫生部 | | **时间覆盖范围** | 1992–2026 | | **地理覆盖范围** | 巴西全部27个州(按住院所在市政划分) | | **数据粒度** | 个体级:每条记录对应一次住院入院(AIH) | | **数据体量** | 超4.15亿条记录(已处理11011个.dbc文件) | | **数据格式** | Apache Parquet,按`ano/mes/uf`(年/月/州)分区存储 | | **数据类型** | 所有字段均存储为字符串(保留原始格式) | | **更新频率** | 月度更新(数据源在统计月份结束后约2-3个月发布数据) | | **许可证** | CC-BY 4.0 | > 如需完整的葡萄牙语文档,请参阅[项目仓库](https://github.com/SidneyBissoli/healthbr-data)。 ## 数据获取 数据托管于Cloudflare R2存储服务,通过兼容S3的API进行访问。以下凭据**仅具备只读权限**,面向公众开放使用。 ### R语言(Arrow框架) r library(arrow) library(dplyr) Sys.setenv( AWS_ENDPOINT_URL = "https://5c499208eebced4e34bd98ffa204f2fb.r2.cloudflarestorage.com", AWS_ACCESS_KEY_ID = "28c72d4b3e1140fa468e367ae472b522", AWS_SECRET_ACCESS_KEY = "2937b2106736e2ba64e24e92f2be4e6c312bba3355586e41ce634b14c1482951", AWS_DEFAULT_REGION = "auto" ) # 打开单个分区(年/月/州) ds <- open_dataset( "s3://healthbr-data/sih/ano=2024/mes=01/uf=SP/", format = "parquet" ) # 示例:统计2024年1月圣保罗州的住院入院记录,按主要诊断分组 ds |> collect() |> count(DIAG_PRINC, sort = TRUE) |> head(20) > **重要提示:** 请指向具体的分区路径(`ano=YYYY/mes=MM/uf=XX/`),而非数据集根目录。根目录仅包含`README.md`和`manifest.json`,Arrow无法将其识别为Parquet文件。你也可以使用更宽泛的路径,如`ano=YYYY/`或`ano=YYYY/mes=MM/`,一次性加载多个分区。 ### Python(PyArrow) python import pyarrow.dataset as pds import pyarrow.fs as fs s3 = fs.S3FileSystem( endpoint_override="https://5c499208eebced4e34bd98ffa204f2fb.r2.cloudflarestorage.com", access_key="28c72d4b3e1140fa468e367ae472b522", secret_key="2937b2106736e2ba64e24e92f2be4e6c312bba3355586e41ce634b14c1482951", region="auto" ) # 加载单个分区(年/月/州) dataset = pds.dataset( "healthbr-data/sih/ano=2024/mes=01/uf=SP/", filesystem=s3, format="parquet" ) # 示例:加载圣保罗州2024年1月的住院入院记录 df = dataset.to_table().to_pandas() print(df.head()) print(f"记录数: {len(df)}, 字段数: {len(df.columns)}") > **注意:** 上述凭据**仅具备只读权限**,可安全用于脚本中。该存储桶不支持匿名S3访问,必须使用凭据。请指向具体的分区路径,而非数据集根目录(详见上述提示)。 ## 文件结构 s3://healthbr-data/sih/ README.md manifest.json ano=1992/ mes=01/ uf=AC/ part-0.parquet uf=AL/ part-0.parquet ... mes=02/ ... ... ano=2026/ mes=01/ ... ## 历史数据Schema AIH表单在1992年至2015年间经历了多次重大修订。本数据集共保留了14种不同的Schema: | 时间段 | 字段数 | 关键特征 | |--------|:-------:|---------------------| | 1992–1993 | 35 | 计算机化起步阶段;使用ICD-9编码;年份为2位数字 | | 1994 | 39 | | | 1995–1997 | 41–42 | 使用ICD-9编码;日期格式为YYMMDD | | 1998 | 41 | **转型阶段:** 采用ICD-10编码,日期为8位数字,年份为4位数字 | | 1999–2001 | 52–60 | 新增ICU相关字段、管理类字段 | | 2002–2005 | 68–69 | 新增CNES编码(2004年起) | | 2006–2007 | 75 | | | 2008–2010 | 86 | **FTP服务器格式变更;** 采用SIGTAP 10位操作编码;新增`RACA_COR`(种族/肤色)字段 | | 2011–2012 | 93 | | | 2013 | 95 | | | 2014–2026 | 113 | **格式稳定阶段:** 新增`DIAGSEC1`–`DIAGSEC9`(次要诊断)字段 | 不同年份的字段数量存在差异。特定时期不存在的字段将不会出现在对应分区的Parquet文件中。在Arrow中使用`open_dataset(unify_schemas = TRUE)`可实现跨时期查询(缺失字段将以`null`填充)。 ## 最新Schema(2014–2026年,共113个字段) 最新Schema中的关键变量如下: | 字段名 | 说明 | |----------|-------------| | `UF_ZI` | 州代码(处理用) | | `ANO_CMPT` | 统计年度 | | `MES_CMPT` | 统计月份 | | `N_AIH` | AIH编号(入院ID) | | `CNES` | 医疗机构代码(CNES) | | `MUNIC_MOV` | 住院所在市政(IBGE代码) | | `MUNIC_RES` | 患者常住市政(IBGE代码) | | `NASC` | 患者出生日期 | | `SEXO` | 性别(1=男性,3=女性) | | `IDADE` | 年龄 | | `RACA_COR` | 种族/肤色 | | `DT_INTER` | 入院日期 | | `DT_SAIDA` | 出院日期 | | `DIAS_PERM` | 住院时长(天) | | `DIAG_PRINC` | 主要诊断(ICD-10编码) | | `DIAGSEC1`–`DIAGSEC9` | 次要诊断(ICD-10编码) | | `PROC_REA` | 执行的手术操作(SIGTAP编码) | | `VAL_TOT` | 总费用(巴西雷亚尔,R$) | | `MORTE` | 住院期间死亡(0=否,1=是) | | `CEP` | 患者邮政编码 | | `CAR_INT` | 入院类型 | | `COMPLEX` | 医疗复杂度等级 | > 如需获取全部14种Schema的完整字段列表,请参阅[探索文档](https://github.com/SidneyBissoli/healthbr-data/blob/main/docs/sih/exploration-pt.md)。 ## 数据源与处理流程 **原始数据源:** 来自DATASUS FTP服务器的11011个.dbc文件,涵盖两个目录:`200801_/Dados/`(现代时期,共5856个文件)和`199201_200712/Dados/`(遗留时期,共5155个文件)。本数据集仅包含RD(AIH Reduzida)类型数据——SP、RJ、ER文件类型将在后续版本中补充。 **处理流程:** .dbc文件 → 使用R语言的`read.dbc::read.dbc()`读取 → 所有字段转换为字符型 → 写入Apache Parquet格式(`arrow::write_parquet()`) → 通过`rclone`上传至R2存储。未对字段值进行任何转换——所有字段值均严格保留巴西卫生部提供的原始格式。遗留时期(1992–1997年)的日期格式保留为YYMMDD;1992–1997年的ICD-9编码未转换为ICD-10。 **处理进度:** 分两阶段完成:第一阶段(2008–2026年,5856个文件,2.178亿条记录,耗时约18小时)+ 第二阶段(1992–2007年,5155个文件,1.976亿条记录,耗时约12–15小时)。总计处理11011个文件,共415,372,502条记录,在R2存储中占用16.1 GiB空间。 ## 已知局限性 1. **政府原始数据,未经修改:** 所有字段值均严格保留原始.dbc文件中的内容,包括任何不一致或缺失数据。 2. **14种历史Schema:** 字段数量从1992年的35个到2014年及以后的113个不等。跨时期查询需处理缺失字段的情况。 3. **所有字段均为字符串类型:** 数值字段(费用、年龄、住院时长)和日期格式需由使用者自行解析。 4. **仅包含RD类型数据:** 本数据集仅包含AIH Reduzida(已处理的入院记录)。SP(专业服务)、RJ(被驳回记录)和ER(错误记录)类型数据未包含在内。 5. **遗留时期使用ICD-9编码(1992–1997年):** 1998年之前的诊断编码使用ICD-9(6位字符),1998年起使用ICD-10(3–4位字符),未进行编码转换。 6. **遗留时期日期格式(1992–1997年):** 遗留时期的日期格式为YYMMDD(6位数字),1998年起为YYYYMMDD(8位数字),未进行格式转换。 7. **19处历史数据缺失:** FTP服务器上缺失19个遗留时期的文件(主要为1995–2000年的罗赖马州数据,以及1994年的阿克里州和2007年的阿马帕州数据)。此类缺失为卫生部侧的数据缺口,非数据处理流程故障。 8. **按月分区:** 与SINASC数据集(按年分区)不同,本数据集按年/月/州分区,以匹配数据源的月度发布频率。 ## 相关数据集 | 数据集 | 覆盖时段 | 记录数 | 链接 | |---------|--------|---------|------| | SINASC(活产记录) | 1994–2022 | 超8500万条 | [sinasc](https://huggingface.co/datasets/SidneyBissoli/sinasc) | | SI-PNI Microdados(疫苗接种) | 2020年至今 | 超7.36亿条 | [sipni-microdados](https://huggingface.co/datasets/SidneyBissoli/sipni-microdados) | | SI-PNI COVID(新冠疫苗接种) | 2021年至今 | 超6.08亿条 | [sipni-covid](https://huggingface.co/datasets/SidneyBissoli/sipni-covid) | | SI-PNI 聚合数据 — 接种剂次 | 1994–2019 | 超8400万条 | [sipni-agregados-doses](https://huggingface.co/datasets/SidneyBissoli/sipni-agregados-doses) | | SI-PNI 聚合数据 — 接种覆盖率 | 1994–2019 | 超280万条 | [sipni-agregados-cobertura](https://huggingface.co/datasets/SidneyBissoli/sipni-agregados-cobertura) | | SI-PNI 词典文件 | 静态 | 263行 | [sipni-dicionarios](https://huggingface.co/datasets/SidneyBissoli/sipni-dicionarios) | ## 引用格式 bibtex @misc{healthbrdata, author = {Sidney da Silva Bissoli}, title = {healthbr-data: 巴西公共卫生数据再分发项目}, year = {2026}, url = {https://huggingface.co/datasets/SidneyBissoli/sih}, note = {原始数据源:巴西卫生部 / DATASUS} } ## 联系方式 - **GitHub:** [https://github.com/SidneyBissoli](https://github.com/SidneyBissoli) - **Hugging Face:** [https://huggingface.co/SidneyBissoli](https://huggingface.co/SidneyBissoli) - **电子邮箱:** sbissoli76@gmail.com **最后更新时间:** 2026年3月9日
提供机构:
SidneyBissoli
二维码
社区交流群
二维码
科研交流群
商业服务