AUMCdb MEDS Extraction ETL
An ETL pipeline that converts the Amsterdam University Medical Centers Database (AmsterdamUMCdb) into the Medical Event Data Standard (MEDS) using MEDS-Extract.
AmsterdamUMCdb is a de-identified intensive care database from Amsterdam UMC. It covers about 23,000 ICU admissions of about 20,000 patients between 2003 and 2016, with vital signs, lab results, medication, procedures and fluid balance. The data is freely available for research, but you need to sign a data use agreement first. Request access through the DANS DataVerse.
- More information about AmsterdamUMCdb: https://github.com/AmsterdamUMC/AmsterdamUMCdb
- More information about MEDS: https://medical-event-data-standard.github.io/
This ETL targets AmsterdamUMCdb v1.0.2.
Setup
Requires Python >=3.11.4,<3.14. The package installs MEDS-Extract 0.9.2 and
suMEDS 0.6.2, which provide the commands below.
pip install AUMCdb_MEDS
Downloading the data needs a DANS DataVerse API key. You can create one on your DataVerse account page once your access request has been approved:
export AUMCDB_API_KEY=your_api_key
Usage
meds-extract-run spec=AUMCdb output_dir=$MEDS_DIR
That single command downloads the DataVerse archives, unpacks them, and runs the full
eight-stage MEDS-Extract pipeline. As its last step, suMEDS
(installed with this package) enriches metadata/codes.parquet: it tags the gender codes with
OMOP Gender concepts, and identifies and names the LOINC codes that the item dictionary maps items
to (see Enriching code metadata with suMEDS). For the plain
ETL, without the enrichment, add skip_stages=[sumeds_enrich].
To stage the raw data separately, or to use a copy you already have:
meds-extract-download spec=AUMCdb output_dir=$RAW_DATA_DIR
meds-extract-run spec=AUMCdb output_dir=$MEDS_DIR do_download=false input_dir=$RAW_DATA_DIR
$RAW_DATA_DIR should contain the seven AUMCdb CSVs (admissions.csv, numericitems.csv,
listitems.csv, freetextitems.csv, procedureorderitems.csv, processitems.csv and
drugitems.csv) as distributed, without converting their encoding, plus the public item
dictionary dictionary.csv that the code descriptions are built from and AmsterdamUMC's public OMOP
concept dictionary omop_dictionary.csv that documents the unit of items recorded without one (see
Code metadata). The download fetches both with the data; to add them to a copy you
already have (no API key needed):
meds-extract-download spec=AUMCdb output_dir=$RAW_DATA_DIR key=common
The seven tables can also be Parquet files with the same base names (numericitems.parquet, …),
next to dictionary.csv and omop_dictionary.csv, which stay CSV. MEDS-Extract reads a Parquet source as it is, without
decoding or type inference, so its columns must carry the types the CSV path infers (ids and
offsets Int64, value Float64, text String): convert each CSV with MEDS-Extract's own
convert_csv_to_parquet and the encodings the config declares.
Intermediate stage outputs are deleted after a successful run, by default: the spec sets
MEDS-Extract's etl.cleanup_intermediates: true, so a finished $MEDS_DIR holds only data/,
metadata/, .logs/ and .meds_extract_run/. A failed run keeps them, so the same command resumes
where it stopped, and the same command on a finished output still does nothing. To keep them (to look
at a stage's output; $MEDS_DIR/.logs/pipeline.log keeps the stage logs either way), add
"overrides=['cleanup_intermediates=false']". Cleanup never deletes raw data: a download into the
default $MEDS_DIR/.meds_extract_run/raw_input stays, and download_dest_dir= elsewhere lets other
output directories reuse it.
Resources and parallelism
numericitems.csv alone is about 80 GB (977.6 million rows), so a full run needs a fair amount of
memory and disk. With the tables already converted to Parquet, a serial run (one worker,
POLARS_MAX_THREADS=4) of 0.3.0 took about 17 minutes and peaked at about 10 GB of resident memory
on a laptop. You can trade memory for parallelism with the optional extras:
pip install AUMCdb_MEDS[local_parallelism] # local parallelism with hydra-joblib-launcher
pip install AUMCdb_MEDS[slurm_parallelism] # parallelism on SLURM with hydra-submitit-launcher
The number of subjects per shard is set by n_subjects_per_shard under etl: in the config
(default 1000).
Configuration
This package contains no ETL code. The entire pipeline is one file,
src/AUMCdb_MEDS/configs/messy.yaml, registered under the
MEDS_extract.pipelines entry-point group. It carries three sections:
sources:— where the raw data lives. The DANS DataVerse API key is passed as anX-Dataverse-keyheader read from${oc.env:AUMCDB_API_KEY}, so the credential never lands in the config, the logs, or the output tree. Both entries are zips, unpacked by the download layer. Thecommonentry is the public item dictionary, pinned to a commit and checked by SHA-256.etl:— the dataset name and curated stage options, including theencoding:of each source: six of the seven data CSVs are Windows-1252, not UTF-8 (see Source encoding). It also gives the dataset's DataVerse page formetadata/dataset.json, and declares the suMEDS enrichment that runs after the pipeline.- the event tables — what to extract, in dftly expressions.
Pseudo-timestamps
AUMCdb stores only offsets (in milliseconds) relative to the patient's first ICU admission;
absolute times are not meaningful, only relative differences. Reconstructing real timestamps used to be a Python
pre-MEDS step; it is now _table.cols:
_origin: (((extract /2003|2010/ from $admissionyeargroup)::int)::year)::datetime
admittedattime: $_origin + ($admittedat / 1000)::seconds
Tables other than admissions key on admissionid, so each joins admissions for the subject id
and year group before rebuilding _origin.
The anchor uses each admission's own admissionyeargroup. In v1.0.2 no patient's later admissions
fall in a different year group from their first, so this matches anchoring on the first admission.
Source encoding
AmsterdamUMCdb ships its CSVs in Windows-1252 (only admissions.csv is plain ASCII), while the
public item dictionary is UTF-8 with a byte-order mark. The config declares the codec of each source
under etl.encoding (cp1252 for the seven data tables, utf8 for dictionary), so MEDS-Extract
decodes them correctly and non-ASCII characters in item names, units and values (°C, µg,
Patiëntgewicht) survive intact, and the item names still match the dictionary's. Decoding is
strict: an invalid byte stops the run instead of silently becoming �.
Two MEDS-Extract 0.8 changes made the per-source form necessary:
etl.encodingnow also decodes the_metadatasources. The singleencoding: cp1252that 0.7 applied only to the data tables would now decode the UTF-8 dictionary as Windows-1252, which turns its byte-order mark into part of the first column name (the run stops becauseitemidis missing) and garbles its non-ASCII names.- A source the config does not list is detected (
etl.encoding: auto): valid UTF-8 is read as UTF-8, anything else as Windows-1252, and a file that mixes the two stops the run. On the v1.0.2 files, detection picks UTF-8 foradmissions.csv(plain ASCII, so the same text) and Windows-1252 for the other six, which is what the config declares. It would cost a full extra read of every file (numericitems.csvalone is about 80 GB) and a warning per file, so the config declares the codecs instead.
Output
Each subject is one AUMCdb patient (patientid). Codes are built from the source columns, joined
with //, and a missing component becomes UNK:
| Code prefix | Source table | Value |
|---|---|---|
MEDS_BIRTH, MEDS_DEATH, GENDER//… |
admissions |
|
ICU_ADMISSION//…, ICU_DISCHARGE//… |
admissions |
|
WEIGHT_AT_ADMISSION//…, HEIGHT_AT_ADMISSION//… |
admissions |
|
MEASURE//{item}//{unit} |
numericitems |
numeric_value |
MEASURE//{item}//{islabresult}//{value} |
listitems |
|
MEASURE//{item}//{islabresult} |
freetextitems |
text_value |
PROCEDURE//{ordercategoryname}//{item} |
procedureorderitems |
|
PROCESS//START//…, PROCESS//END//… |
processitems |
|
DRUG//START//…, DRUG//END//… |
drugitems |
|
DRUG//RATE//…, DRUG//DOSE//… |
drugitems |
numeric_value |
Birth, death and gender are only emitted from a patient's first admission, and gender is static
(no timestamp). AUMCdb only reports age in bands (40-49, 80+), so the birth date is imputed
from the middle of the band. Death is placed at its recorded offset. See the comments in the
config for the exact rules.
ICU stays
Every event except birth, death and gender carries its ICU admission in an icustay_id column,
listed under raw_source_id_columns in metadata/dataset.json. It is AmsterdamUMCdb's admissionid,
"unique value to identify the admission to the ICU", which every table but admissions is keyed
on (AmsterdamUMCdb wiki, admissions).
An admission is to the intensive care (IC) or medium care (MC) unit, or both (admissions.location).
A patient "may have multiple admissionid's during the same or another hospitalization", and the
release has no id of the hospital stay, so there is no hadm_id. The column takes the name the
MIMIC-IV ETL and the other MEDS ETLs give the ICU stay
(alignEHR#55).
Code metadata
metadata/codes.parquet lists every code with a description, parent_codes where
AmsterdamUMC's item dictionary maps the item to a standard vocabulary, and the code_template it
was built from. Releases up to 0.1.0 wrote only the
code column. Codes are built from Dutch item names and admission categories, which a reader can
decode with the AmsterdamUMCdb documentation but which cross-dataset mapping and vocabulary
tooling (OHDSI Athena) cannot resolve, so the config now attaches the documented meaning:
| Code family | Route | Source |
|---|---|---|
MEASURE//…, PROCEDURE//…, PROCESS//…, DRUG//… |
_metadata: dictionary: blocks, joined on the item name and restricted to the dictionary rows of the event's own table; one entry covers every unit, value or action variant |
the item dictionary AmsterdamUMC publishes for v1.0.2 and earlier (amsterdamumcdb/dictionary/legacy/dictionary.csv, MIT, commit 5422b94), downloaded at ETL time: English item name where translated, Dutch item name, itemid, category; its LOINC, ATC or SNOMED CT code as parent code |
MEDS_BIRTH, MEDS_DEATH, GENDER//…, ICU_ADMISSION//…, ICU_DISCHARGE//…, WEIGHT_…, HEIGHT_… |
_metadata: _self: templates, evaluated per admission |
the code's own components, named after their admissions column and explained as in the AmsterdamUMCdb table documentation |
Nothing from the dictionary is copied into this repository. It holds 4,985 items: 472 with an
English name and 387 mapped to a vocabulary (169 LOINC, 210 ATC, 8 SNOMED CT), so most item codes
are described by their Dutch name, itemid and category. On v1.0.2, every item name in each of the
six item tables has a dictionary row for that table (checked against the raw tables), so every
code gets a description.
The parent codes are AmsterdamUMC's own item-level mappings (made for the Dutch ICU data
warehouse); the vocabulary's own text is left to vocabulary tooling such as suMEDS (below). MEDS
0.4 makes description optional, so consumers must still not rely on it for datasets built with
older releases.
Units. Codes with a numeric value also carry a unit column: a string, the unit of the code's
numeric values, one per code, written in UCUM by suMEDS's
sumeds_normalize_units post-stage (°C becomes Cel, µg becomes ug, ml/uur becomes
mL/h). The spelling as recorded stays in unit_source_value, and a spelling suMEDS does not know
is kept as it is. MEASURE//{item}//{unit} gets the numericitems.unit of its rows, DRUG//RATE//…
the rateunit and DRUG//DOSE//… the doseunit (_metadata: _self: blocks). As recorded it is the
same value as the code's last component, so tools can read the unit without parsing the code;
the codes are unchanged (…//°C keeps its name), and a code ending in UNK has no unit. The unit in
a code is stripped of surrounding whitespace; missing or blank is UNK. MEDS-Extract compares units
the same way when it writes unit (stripped, blanks dropped), so °C and °C give one code. The dictionary's own unit column agrees with
the data for every numeric item and adds none (drug items have no dictionary unit).
Placeholder units and documented units. AmsterdamUMCdb records the placeholders Geen ("none")
and None as the unit of 436 numeric items, among them the monitor's SpO2, respiratory rate and
FiO2 (146 M of the 984 M numeric values of v1.0.2). Neither is a unit, so no code ends in one. For
57 of these items AmsterdamUMC documents the unit in the concept dictionary of its OMOP CDM
conversion
(amsterdamumcdb/dictionary/dictionary.csv,
MIT, same commit as the item dictionary; rows with source_vocabulary_id AUMC Numeric Unit,
source_code the itemid and concept_code the UCUM unit, built from AmsterdamUMC's
Usagi mapping).
That file is downloaded with the item dictionary (omop_dictionary.csv) and joined to
numericitems on the itemid (_table.joins; the key includes the literal AUMC Numeric Unit, so
only those rows join, at most one per item, and no event is duplicated). The codes of those items
end in the documented unit: MEASURE//Saturatie (Monitor)//% (6709),
MEASURE//Ademfrequentie Monitor///min (8874), % for FiO2 (12279, 12282, 6699) and other
percentages, /min for the other respiratory rates (8873, 8850, 7726, 8853). On v1.0.2 that is
115.6 M values; the medians agree with the unit (SpO2 96.6 %, respiratory rate 18.8 /min, FiO2 40 to
41 %). The other 379 placeholder items end in UNK, as a value recorded without a unit does. Either
way unit is the code's last component (null for UNK). The dictionary's four other
AUMC Numeric Unit rows are for items with a recorded unit, which stays: creatinine (6836), MCHC
(11910, 18666) and TSH (7071).
MEDS-Extract (since 0.9.0) writes unit as one string per code and fails if any code has more
than one unit. The first post-stage, suMEDS's shared sumeds_link_unit_siblings
(docs), gives codes that
differ only in their unit (DRUG//DOSE//{category}//{item}//mg and …//µg) the code without the
unit (DRUG//DOSE//{category}//{item}) as an in-dataset parent in parent_codes, and adds a row
for that code: no unit, the description its siblings share (or, if they differ only by their own
unit, that description without it) and the vocabulary parents they all have. With
link_single_units: true, a code ending in its unit gets its stem also when its item has a single
unit (DRUG//DOSE//{category}//{item}//mg alone gets DRUG//DOSE//{category}//{item}). AUMCdb uses
the stage's default options otherwise, so a …//UNK code (no unit recorded) also joins its item's siblings once
the item has a real unit; a …//UNK code alone gets no stem. The post-stages run in this order: sumeds_link_unit_siblings,
sumeds_normalize_units, sumeds_enrich. On v1.0.2 the ETL's own copy of this step (before suMEDS
0.6.6) found 196 groups (530 codes: 186 dose, 10 rate groups) and added 196 rows.
Enriching code metadata with suMEDS
Vocabulary tagging that AmsterdamUMCdb does not carry itself lives in
suMEDS and its versioned ontology data (sumeds-ontologies,
pinned release), which maintain one copy for all MEDS ETLs, rather than in this ETL. The package
ships the rules for it, src/AUMCdb_MEDS/sumeds_rules.yaml
(package data, also AUMCdb_MEDS.SUMEDS_RULES, format sumeds-rules/0.1), registered in suMEDS's sumeds.rules entry-point group under the same
name as the MEDS-Extract spec, AUMCdb. The spec declares suMEDS's sumeds_enrich stage after the
canonical pipeline (etl.post_stages, after suMEDS's sumeds_link_unit_siblings and
sumeds_normalize_units), so meds-extract-run spec=AUMCdb enriches the finished
metadata/codes.parquet in place, and it stays valid MEDS code metadata. --rules AUMCdb works for
any suMEDS command. By default the LOINC data comes from suMEDS's ontology packs, fetched from GitHub
on first use and cached; no Athena download is needed.
Whether a build was enriched is recorded in metadata/dataset.json, under
sumeds_enrichment.enriched, with the rules, the suMEDS version and the coverage. Enrichment is on
by default, and a failed enrichment (for example, on a server without internet access) does not fail
the ETL: metadata/codes.parquet is left as the ETL wrote it, dataset.json records
"enriched": false with the error, and the exit code is still 0. The warning, with the command that
finishes the enrichment, is in $MEDS_DIR/.logs/pipeline.log. Running meds-extract-run again does
not retry it (the stage is marked done); enrich the build afterwards, with the same rules and
options, with:
suMEDS-enrich $MEDS_DIR
# Without internet access, from a copy of the sumeds-ontologies packs directory:
suMEDS-enrich $MEDS_DIR --ontology-source /path/to/sumeds-ontologies/ontologies --offline
The stage's options are set at run time through overrides=, with ++ because the overrides reach
every stage of the pipeline:
# Without enrichment:
meds-extract-run spec=AUMCdb output_dir=$MEDS_DIR skip_stages=[sumeds_enrich]
# Make a failed enrichment fail the run (exit code 1):
meds-extract-run spec=AUMCdb output_dir=$MEDS_DIR "overrides=['++stage_cfg.strict=true']"
# Also look codes up in your own OHDSI Athena download:
meds-extract-run spec=AUMCdb output_dir=$MEDS_DIR "overrides=['++stage_cfg.athena_csv=/path/to/athena']"
# Add the LOINC Parts above each LOINC code as parents:
meds-extract-run spec=AUMCdb output_dir=$MEDS_DIR "overrides=['++stage_cfg.loinc_hierarchy=true']"
On a cluster whose compute nodes have no internet access, fill a cache on shared storage once from a login node, then run offline on the compute nodes with the same cache:
export XDG_CACHE_HOME=/shared/project/cache
# On a login node:
suMEDS-enrich --prefetch --rules AUMCdb
# On a compute node:
meds-extract-run spec=AUMCdb output_dir=$MEDS_DIR "overrides=['++stage_cfg.offline=true']"
For AmsterdamUMCdb, enrichment adds:
- Gender. One ontology rule,
aumcdb-gender, tagsGENDER//ManandGENDER//Vrouwwith the OMOP Gender conceptsGender//MandGender//Fas parent codes, as in AmsterdamUMC's own OMOP dictionary. suMEDS has no Gender pack, so the codes are only tagged, or validated (with the concept's name and OMOP fields) when your Athena download (--athena-csv) has the Gender vocabulary. The ETL alone does not emit these parents. - The dictionary's LOINC codes. The LOINC, ATC and SNOMED CT parents of item codes come from
AmsterdamUMC's dictionary and stay in the ETL. suMEDS looks the LOINC ones up in its LOINC pack:
the item code gets
vocabulary_idandconcept_code, and the parent gets its LOINC name inparent_names. Withloinc_hierarchy(above), the LOINC Parts above it are added as parents too. suMEDS hosts no ATC or SNOMED CT data, so those parents are named, and get their ancestors, only from your Athena download.
Descriptions and the ETL's parent codes are never changed; new parents are appended after them.
parent_names maps each named parent code to its name (a Parquet map<string, string>, read as a
pl.Map by Polars 2 and as a list of key/value structs by Polars 1). The file has no hierarchy
rules: no code is a coarser version of another code of the data (a list item,
MEASURE//{item}//{islabresult}//{value}, could only nest under a free-text item of the same name,
and none shares one). tests/test_sumeds_rules.py loads the file by its registered name and checks
that the rule matches exactly the gender codes the config builds, and
tests/test_run_with_enrichment.py runs meds-extract-run spec=AUMCdb on synthetic data, offline.
The same rules work with suMEDS … --rules AUMCdb to build a privacy-masked code catalog of the
output.
Testing with synthetic data
You can run the whole ETL without access to AmsterdamUMCdb. The test suite writes a tiny, entirely
synthetic dataset with the column layout and encodings of the v1.0.2 files and a small item
dictionary in the published format (tests/conftest.py), runs
meds-extract-run spec=AUMCdb skip_stages=[sumeds_enrich] over it and checks that every event's codes
are described, that the non-ASCII names survive both encodings, and that codes.parquet validates
against the MEDS code-metadata schema. It then runs meds-extract-run spec=AUMCdb, with the
enrichment, over the same data against a tiny synthetic LOINC pack, offline, and checks that the
enrichment adds the gender and LOINC information without changing anything the ETL wrote, that
metadata/dataset.json records it, that a failed enrichment keeps the plain output and can be
retried, and that skipping the stage gives the plain ETL. CI does this on every pull request (see
.github/workflows/synthetic-etl.yaml):
pip install -e .[dev]
pytest tests
Every value is visibly fake, so the output is only useful for checking that the pipeline runs end to end. The synthetic ETL workflow also generates raw files straight from the config with MESSY_synth 0.1.1, which reads MEDS-Extract 0.8 and 0.9 configs.
Summary statistics
tests/regression/full_summary_stats.json is a
meds_summary_stats fingerprint of
the MEDS dataset this ETL builds from the full AmsterdamUMCdb 1.0.2 release.
scripts/summary_stats.sh builds it with meds-extract-run spec=AUMCdb, so its code-metadata coverage
includes the suMEDS enrichment. It covers subject, event and measurement counts, digests of the code
vocabulary, per-subject, value and time distributions, code-metadata coverage, the splits and the
schema. It names no code and reports no cell of fewer than 20 subjects and
no minimum or maximum, which is what makes it safe to publish. Because it is committed next to the ETL,
its diff shows what an ETL change did to the output, and two ETL versions can be compared without
access to the data.
Regenerate it in every pull request that changes the output, from a build of that branch:
# Build the release with this checkout, then summarize it
scripts/summary_stats.sh full --input-dir $RAW_DATA_DIR
# Or summarize a build of this checkout you already have
scripts/summary_stats.sh full --meds-dir $MEDS_OUTPUT_DIR
Both print how the statistics changed against the committed baseline before overwriting it. Add
--compare to check a build without writing anything; it exits 1 when
tests/regression/policy.yaml flags an error. Rebuilding the same
commit reproduces the baseline exactly, so any finding is a change in the output. CI cannot rebuild the
credentialed release, so the Summary stats workflow only warns
when a pull request changes src/ (the config or the suMEDS rules) without regenerating the baseline.
A MEDS-Extract, suMEDS or polars upgrade can also move the output, so check it with --compare.
Contributing
Pull requests are welcome. Install the development extras and the pre-commit hooks first:
pip install -e .[dev]
pre-commit install
Breaking changes
0.4.0 (2026-11-27)
- Codes recorded with the placeholder unit
GeenorNoneend in the documented unit or inUNK. 436MEASUREcode strings change; events are otherwise unchanged (same rows, same count). The 57 items AmsterdamUMC documents in the concept dictionary of its OMOP conversion end in that unit (MEASURE//Saturatie (Monitor)//None→MEASURE//Saturatie (Monitor)//%,MEASURE//Ademfrequentie Monitor//None→MEASURE//Ademfrequentie Monitor///min,MEASURE//O2 concentratie//Geen→MEASURE//O2 concentratie//%), the other 379 inUNK. No new code coincides with an existing one (none of these items has another unit), so no codes merge. Incodes.parquet,unitandunit_source_valueare the code's last component: the documented unit, or null forUNK. On v1.0.2: 57 codes with 115.6 M values, 379 codes with 30.6 M values. The 57 keep their unit-free stemMEASURE//{item}(same row, same parent). The 379…//UNKcodes lose it, becausesumeds_link_unit_siblingslinks aUNKcode only to a real-unit sibling and none of these items has one: 379 stem rows (no events) leavecodes.parquetand those codes lose that lastparent_codesentry; their vocabulary parents stay. To migrate old codes, replace^(MEASURE//.+)//(?:Geen|None)$with\1//plus the item's documented unit, orUNKwhere it has none. The documented unit is theconcept_codeof the item'sAUMC Numeric Unitrow inomop_dictionary.csv(source_code_descriptionis the item name in the code for all 57). To find the stem of an…//UNKcode, drop//UNK. The ETL now downloads a second public file (omop_dictionary.csv); for a pre-stagedinput_dir, fetch it withmeds-extract-download spec=AUMCdb output_dir=$RAW_DATA_DIR key=common.
0.3.0 (2026-11-20)
-
Rebuilt on the complete AmsterdamUMCdb 1.0.2 release;
tests/regression/full_summary_stats.jsonregenerated (the previous baseline was built from an incomplete local copy). The baseline is built from the complete release for the first time, so its event and measurement counts rise for that reason, not because of an ETL change: the previous local copy held about 15% ofnumericitems(141,648,128 of 977,392,122numericitemsmeasurements in the new build), which accounts for 835,743,994 of the 835,777,757 added measurements. The other 33,763 come fromicustay_id(below). Subject counts are unchanged. -
New column
icustay_id. Every event exceptMEDS_BIRTH,MEDS_DEATHandGENDER//…now carries its ICU admission (admissionid) asicustay_id, listed underraw_source_id_columnsinmetadata/dataset.json(which listed none before). Codes are otherwise unchanged. Rows that are identical except for their admission, which the merge used to collapse into one, are now kept once per admission: on the full release that adds 33,763 rows outsidenumericitems(32,911 infreetextitems, 568 indrugitems, 154 inprocessitemsand 130 inlistitems). To migrate, code that selects columns by position, or expects only the MEDS core columns, should select by name or drop it, anddf.drop("icustay_id").unique()restores the old rows. -
Vocabulary parents are spelled
VOCABULARY//CODE. Theparent_codesthe ETL takes from the item dictionary (LOINC,ATC,SNOMED) used one slash,LOINC/2951-2; they now use two,LOINC//2951-2, the spelling suMEDS already writes for the parents it adds. Codes and events are unchanged. To migrate, respell old parents with the regex^([^/]+)/(?!/)→\1//. suMEDS and alignEHR already read both spellings as the same parent. -
The unit in a code is stripped of surrounding whitespace, and a blank one is
UNK:MEASURE//{item}//{unit},DRUG//RATE//…//{rateunit}andDRUG//DOSE//…//{doseunit}. Before, the unit was copied as recorded: a padded unit (°C) gave a code of its own, and a blank or empty one gave a code ending in whitespace or in//, with nounit. No output change on the synthetic data; codes change only where a unit was padded or blank. To migrate, strip the last component of an old code and writeUNKfor an empty one:^((?:MEASURE|DRUG//(?:RATE|DOSE))//.*//)\s*(\S(?:.*\S)?)?\s*$→\1\2, then a trailing//→//UNK. -
codes.parquetgains unit-free stem rows and stem parents for single-unit codes (#24). suMEDS'ssumeds_link_unit_siblingsnow runs withlink_single_units: true: every code that ends in its unit gets the code without the unit (its stem) as its lastparent_codesentry, and the stem gets a row of its own (no unit, no events), also when the item has a single unit (DRUG//DOSE//{category}//{item}//{unit}getsDRUG//DOSE//{category}//{item}, likewiseDRUG//RATEandMEASURE). Before, only items recorded in two or more units did. Events are unchanged. On a synthetic (MESSY-synth) build, 30 codes gain a stem parent and 30 stem rows are added (17DRUG//DOSE, 13DRUG//RATE). To migrate, nothing is needed unless a tool expects everycodes.parquetrow to have events: drop the stem rows (nocode_template, nounit), or ignore a parent that is the code without its last//component. -
Intermediate stage outputs are no longer kept. Up to 0.2.0, a run left each stage's output in
<output_dir>/<stage>/(convert_to_parquet/,convert_to_MEDS_events/,sumeds_enrich/, …). The spec now sets MEDS-Extract'setl.cleanup_intermediates: true, so a successful run deletes those directories and keeps onlydata/,metadata/,.logs/and.meds_extract_run/. The MEDS data and metadata are unchanged. To migrate, add"overrides=['cleanup_intermediates=false']"tomeds-extract-runwherever you read a stage directory after the run.
Citation
If you use this ETL in your research, please cite it with the Zenodo DOI (also available through GitHub's "Cite this repository" button):
@software{van_de_Water_AUMCdb_MEDS_ETL_2025,
author = {van de Water, Robin and Rockenschaub, Patrick and Renc, Pawel and McDermott, Matthew},
doi = {10.5281/zenodo.17531824},
license = {MIT},
title = {{The AUMCdb MEDS ETL}},
url = {https://github.com/prockenschaub/AUMCdb_MEDS},
year = {2025}
}
Please also cite the AmsterdamUMCdb dataset itself:
@article{thoralSharingICUPatient2021,
title = {Sharing {{ICU Patient Data Responsibly Under}} the {{Society}} of {{Critical Care Medicine}}/{{European Society}} of {{Intensive Care Medicine Joint Data Science Collaboration}}: {{The Amsterdam University Medical Centers Database}} ({{AmsterdamUMCdb}}) {{Example}}*},
shorttitle = {Sharing {{ICU Patient Data Responsibly Under}} the {{Society}} of {{Critical Care Medicine}}/{{European Society}} of {{Intensive Care Medicine Joint Data Science Collaboration}}},
author = {Thoral, Patrick J. and Peppink, Jan M. and Driessen, Ronald H. and Sijbrands, Eric J. G. and Kompanje, Erwin J. O. and Kaplan, Lewis and Bailey, Heatherlee and Kesecioglu, Jozef and Cecconi, Maurizio and Churpek, Matthew and Clermont, Gilles and {van der Schaar}, Mihaela and Ercole, Ari and Girbes, Armand R. J. and Elbers, Paul W. G.},
year = 2021,
month = jun,
journal = {Critical Care Medicine},
volume = {49},
number = {6},
pages = {e563-e577},
issn = {0090-3493},
doi = {10.1097/CCM.0000000000004916},
urldate = {2022-04-29},
langid = {english},
}
License
This ETL is released under the MIT License. AmsterdamUMCdb itself is covered by its own data use agreement.
Metadata
Release files for AUMCdb-MEDS 0.4.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| aumcdb_meds-0.4.0.tar.gz | 112.7 kB | With provenance | Details for aumcdb_meds-0.4.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| aumcdb_meds-0.4.0-py3-none-any.whl | Python 3 | none | any | Details for aumcdb_meds-0.4.0-py3-none-any.whl |
Total release size: 138.0 kB
Release files / aumcdb_meds-0.4.0.tar.gz
| Download URL | aumcdb_meds-0.4.0.tar.gz |
|---|---|
| Size | 112.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
46968a86ca5cd4fc9d87aebdd8ac2d48818716ada04c310b1a764b61dae8df59
|
|
BLAKE2b-256 checksum How to use checksums |
58738650af2549f2bb8b63d11ac2bf92a6b1d9035b4cfcb048ec2905139611e6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 27, 2026.
Transparency logRelease files / aumcdb_meds-0.4.0-py3-none-any.whl
| Download URL | aumcdb_meds-0.4.0-py3-none-any.whl |
|---|---|
| Size | 25.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
fd63e6775bfab5671a90190fb7ac180d9b3a7705b9059d09399aa96d36e455c6
|
|
BLAKE2b-256 checksum How to use checksums |
ed8392a104c72f578e2f2ef7dd7ae6cc269670498ca9adebddd1acc73f92cc5d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 27, 2026.
Transparency logSecurity for AUMCdb-MEDS 0.4.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for aumcdb_meds-0.4.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 27, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.