Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions datasets/eurostat-hospital-beds-nuts2/dataset.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
root: "../../out"
schema_version: 1

dataset:
name: "eurostat_hospital_beds_nuts2"
source_id: "eurostat"
years: [2026]
time_coverage:
start_year: 1993
end_year: 2024

raw:
output_policy: overwrite
sources:
- name: "eurostat_hlth_rs_bdsrg2"
type: "script"
args:
command: "../../connectors/tsv_normalize.py --flow HLTH_RS_BDSRG2 --output hlth_rs_bdsrg2_normalized.parquet"
output: "hlth_rs_bdsrg2_normalized.parquet"
filename: "hlth_rs_bdsrg2_normalized.parquet"
primary: true

clean:
sql: "sql/clean.sql"
read:
source: auto
mode: latest
delim: ","
encoding: utf-8
header: true
validate:
min_rows: 100

mart:
tables:
- name: "mart_eurostat_hospital_beds_nuts2"
sql: "sql/mart.sql"
required_tables:
- "mart_eurostat_hospital_beds_nuts2"

validation:
fail_on_error: true

registry:
dataflow: "HLTH_RS_BDSRG2"
theme: "Available beds in hospitals by NUTS 2 region"
nuts_level: 2
dimensions: ["freq", "unit", "geo"]
description: "Available beds in hospitals by NUTS 2 region"
21 changes: 21 additions & 0 deletions datasets/eurostat-hospital-beds-nuts2/sql/clean.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
-- clean.sql: HLTH_RS_BDSRG2 — posti letto ospedalieri per regione NUTS2
SELECT
r.freq,
r.unit,
r.geo,
r.year,
f.label_en AS freq_label_en,
u.label_en AS unit_label_en,
g.label_en AS geo_label_en,
g.nuts_level,
g.parent_code AS nuts_parent_code,
gp.label_en AS nuts_parent_label_en,
r.value,
r.flag,
fl.description_en AS flag_desc_en
FROM raw_input r
LEFT JOIN read_csv('codelists/freq.csv', auto_detect=true, delim=',', header=true) f ON r.freq = f.freq
LEFT JOIN read_csv('codelists/units.csv', auto_detect=true, delim=',', header=true) u ON r.unit = u.unit
LEFT JOIN read_csv('codelists/geo.csv', auto_detect=true, delim=',', header=true) g ON r.geo = g.code
LEFT JOIN read_csv('codelists/flags.csv', auto_detect=true, delim=',', header=true) fl ON r.flag = fl.flag
LEFT JOIN read_csv('codelists/geo.csv', auto_detect=true, delim=',', header=true) gp ON g.parent_code = gp.code
20 changes: 20 additions & 0 deletions datasets/eurostat-hospital-beds-nuts2/sql/mart.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
-- mart.sql: Posti letto ospedalieri NUTS2 — Italia
SELECT
year,
geo,
geo_label_en,
nuts_level,
nuts_parent_code,
nuts_parent_label_en,
freq,
freq_label_en,
unit,
unit_label_en,
value,
flag,
flag_desc_en
FROM clean_input
WHERE geo LIKE 'IT%'
AND nuts_level = 'NUTS2'
AND value IS NOT NULL
ORDER BY year DESC, geo
1 change: 1 addition & 0 deletions docs/dataset-registry.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
| `eurostat-soil-erosion-nuts3` | `AEI_PR_SOILER` | Environment / Estimated soil erosion by water | 5 (freq, levels, clc18, unit, geo) | 523,200 | ✅ |
| `eurostat-area-nuts3` | `REG_AREA3` | Geography / Area by land use category | 4 (freq, landuse, unit, geo) | 65,240 | ✅ |
| `eurostat-physicians-nuts2` | `HLTH_RS_PHYSREG` | Health / Physicians by NUTS2 region | 3 (freq, unit, geo) | 27,360 | ✅ |
| `eurostat-hospital-beds-nuts2` | `HLTH_RS_BDSRG2` | Health / Available beds in hospitals by NUTS2 region | 3 (freq, unit, geo) | 25,888 | ✅ |
| `eurostat-fertility-nuts3` | `DEMO_R_FIND3` | Demography / Fertility indicators | 4 (freq, indic_de, unit, geo) | 76,392 | ✅ |
| `eurostat-business-demography-nuts3` | `BD_SIZE_R3` | Business / Business demography by size class | 5 (freq, indic_sb, sizeclas, nace_r2, geo) | 120,955 | ✅ |

Expand Down